xml - IllegalAccessError in Java SE app with Weld implementation -


i trying run standalone app has weld implementation of cdi, , in app need entitymanager work oracle database.

when run app (via weld main method), following shown in cmd line:

exception in thread "main" java.lang.illegalaccesserror: tried access class javax.xml.parsers.factoryfinder class javax.xml.parsers.factoryfinder$configurationerror     @ java.lang.class.getdeclaringclass0(native method)     @ java.lang.class.getdeclaringclass(unknown source)     @ java.lang.class.getenclosingclass(unknown source)     @ java.lang.class.getsimplebinaryname(unknown source)     @ java.lang.class.ismemberclass(unknown source)     @ org.jboss.weld.util.reflection.reflections.isnonstaticinnerclass(reflections.java:139)     @ org.jboss.weld.bootstrap.beandeployer.isbeancandidate(beandeployer.java:98)     @ org.jboss.weld.bootstrap.beandeployer.addclass(beandeployer.java:78)     @ org.jboss.weld.bootstrap.beandeployer.addclasses(beandeployer.java:135)     @ org.jboss.weld.bootstrap.beandeployment.createbeans(beandeployment.java:184)     @ org.jboss.weld.bootstrap.weldbootstrap.deploybeans(weldbootstrap.java:349)     @ org.jboss.weld.bootstrap.api.helpers.forwardingbootstrap.deploybeans(forwardingbootstrap.java:70)     @ org.jboss.weld.environment.se.weld.initialize(weld.java:133)     @ org.jboss.weld.environment.se.startmain.go(startmain.java:41)     @ org.jboss.weld.environment.se.startmain.main(startmain.java:52) 

what cause such error?

here persistence.xml:

<persistence-unit name="oracleunit"                   transaction-type="resource_local">     <provider>org.hibernate.ejb.hibernatepersistence</provider>      <class>entities.myentity</class>      <properties>         <property name="javax.persistence.jdbc.driver" value="oracle.jdbc.driver.oracledriver" />         <property name="javax.persistence.jdbc.platform"                   value="org.eclipse.persistence.platform.database.oracle.oracleplatform" />          <property name="javax.persistence.jdbc.url"                   value="jdbc:oracle:thin:@localhost:1521:orcl" />         <property name="javax.persistence.jdbc.user" value="test" />         <property name="javax.persistence.jdbc.password" value="test" />          <property name="hibernate.dialect" value="org.hibernate.dialect.oracle10gdialect"/>     </properties> </persistence-unit> 

here dependencies:

<dependencies>      <dependency>         <groupid>org.jboss.weld.se</groupid>         <artifactid>weld-se-core</artifactid>         <version>1.1.10.final</version>     </dependency>     <dependency>         <groupid>org.hibernate</groupid>         <artifactid>hibernate-core</artifactid>         <version>4.3.8.final</version>     </dependency>     <dependency>         <groupid>org.hibernate</groupid>         <artifactid>hibernate-entitymanager</artifactid>         <version>4.3.8.final</version>     </dependency>     <dependency>         <groupid>org.hibernate</groupid>         <artifactid>hibernate-validator</artifactid>         <version>5.1.3.final</version>     </dependency>     <dependency>         <groupid>com.oracle</groupid>         <artifactid>ojdbc6</artifactid>         <version>11.2.0.3</version>     </dependency> 

here how create entity manager, standard:

  entitymanagerfactory emf = persistence.createentitymanagerfactory("oracleunit");     entitymanager em = emf.createentitymanager(); 

updating weld dependency newest 1 solved issue.

dependencies following:

<dependency>         <groupid>org.jboss.weld.se</groupid>         <artifactid>weld-se-core</artifactid>         <version>3.0.0.alpha14</version>     </dependency>     <dependency>         <groupid>org.jboss</groupid>         <artifactid>jandex</artifactid>         <version>1.2.2.final</version>     </dependency>     <dependency>         <groupid>javax.servlet</groupid>         <artifactid>javax.servlet-api</artifactid>         <version>3.1.0</version>     </dependency>     <dependency>         <groupid>com.oracle</groupid>         <artifactid>ojdbc6</artifactid>         <version>11.2.0.3</version>     </dependency>     <dependency>         <groupid>org.hibernate</groupid>         <artifactid>hibernate-entitymanager</artifactid>         <version>4.3.8.final</version>     </dependency> 

Comments

Popular posts from this blog

c++ - llvm function pass ReplaceInstWithInst malloc -

Cross-Compiling Linux Kernel for Raspberry Pi - ${CCPREFIX}gcc -v does not work -

java.lang.NoClassDefFoundError When Creating New Android Project -