[ https://issues.apache.org/jira/browse/KARAF-5795?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16527226#comment-16527226 ]
steven.tian commented on KARAF-5795: ------------------------------------ I have a work around to solve this issue . That is adding "javax.persistence.criteria" to the <Import-Package> tag as following : {code:java} <Import-Package> xxx,xxx,xxx, javax.persistence.criteria,xxx </Import-Package> {code} > ClassNotFoundException occurred even the required jar imported. > --------------------------------------------------------------- > > Key: KARAF-5795 > URL: https://issues.apache.org/jira/browse/KARAF-5795 > Project: Karaf > Issue Type: Bug > Affects Versions: 4.2.0 > Environment: JDK1.8 > Karaf 4.2.0 > Reporter: steven.tian > Assignee: Jean-Baptiste Onofré > Priority: Major > Attachments: installed_jpa.JPG > > > I tried to query table via JPA's CriteriaQuery feature, but I got following > exception in runtime: > *java.lang.ClassNotFoundException: javax.persistence.criteria.Selection not > found by database [409] at > org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1639* > below is my maven dependencies: > {code:java} > <dependency> > <groupId>org.apache.aries.jpa</groupId> > <artifactId>org.apache.aries.jpa.api</artifactId> > <version>2.7.0</version> > <scope>provided</scope> > </dependency> > > <dependency> > <groupId>org.hibernate</groupId> > <artifactId>hibernate-core</artifactId> > <version>5.2.9.Final</version> > <scope>provided</scope> > </dependency> > > <dependency> > <groupId>org.hibernate</groupId> > <artifactId>hibernate-osgi</artifactId> > <version>5.2.9.Final</version> > <scope>provided</scope> > </dependency> > > <dependency> > <groupId>org.hibernate.javax.persistence</groupId> > <artifactId>hibernate-jpa-2.1-api</artifactId> > <version>1.0.2.Final</version> > <scope>provided</scope> > </dependency> > > <dependency> > <groupId>javax.persistence</groupId> > <artifactId>javax.persistence-api</artifactId> > <version>2.2</version> > <scope>provided</scope> > </dependency> > {code} > I am quite sure that these jar files are existed either by feature:install > or directly put them into the deploy folder. > Please help me resolve this issue. > Thank you very much. -- This message was sent by Atlassian JIRA (v7.6.3#76005)