在我的 pom.xml 中包含与 Cassandra 相关的新依赖项后,我开始收到此异常。我在我的应用程序中使用它来记录日志。
[EXCEPTION]:Task execution exception, Cause : java.lang.NoClassDefFoundError: org/apache/openjpa/conf/OpenJPAConfiguration
java.lang.NoClassDefFoundError: org/apache/openjpa/conf/OpenJPAConfiguration
at java.lang.Class.getDeclaredConstructors0(Native Method) ~[na:1.7.0_79]
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2585) ~[na:1.7.0_79]
at java.lang.Class.getConstructor0(Class.java:2885) ~[na:1.7.0_79]
at java.lang.Class.newInstance(Class.java:350) ~[na:1.7.0_79]
at org.apache.geronimo.osgi.locator.ProviderLocator.getServices(ProviderLocator.java:319) ~[geronimo-jpa_2.0_spec-1.1.jar:1.1]
at javax.persistence.spi.PersistenceProviderResolverHolder$DefaultPersistenceProviderResolver.getPersistenceProviders(PersistenceProviderResolverHolder.java:108) ~[geronimo-jpa_2.0_spec-1.1.jar:1.1]
at javax.persistence.Persistence$PersistenceUtilImpl.isLoaded(Persistence.java:278) ~[geronimo-jpa_2.0_spec-1.1.jar:1.1]
at org.hibernate.validator.engine.resolver.JPATraversableResolver.isReachable(JPATraversableResolver.java:62) ~[hibernate-validator-4.1.0.Final.jar:4.1.0.Final]
at org.hibernate.validator.engine.resolver.DefaultTraversableResolver.isReachable(DefaultTraversableResolver.java:94) ~[hibernate-validator-4.1.0.Final.jar:4.1.0.Final]
at org.hibernate.validator.engine.resolver.SingleThreadCachedTraversableResolver.isReachable(SingleThreadCachedTraversableResolver.java:47) ~[hibernate-validator-4.1.0.Final.jar:4.1.0.Final]org.hibernate.validator.engine.ValidatorImpl.validateConstraint(ValidatorImpl.java:324) ~[hibernate-validator-4.1.0.Final.jar:4.1.0.Final]
at org.hibernate.validator.engine.ValidatorImpl.isValidationRequired(ValidatorImpl.java:757) ~[hibernate-validator-4.1.0.Final.jar:4.1.0.Final]
at
这是我的 pom.xml :
<dependencies>
<dependency>
<groupId>com.app.cops</groupId>
<artifactId>logging</artifactId>
<version>0.0.5-SNAPSHOT</version>
</dependency>
</dependencies>
这是日志项目的 pom.xml :
<dependencies>
<dependency>
<groupId>com.datastax.cassandra</groupId>
<artifactId>cassandra-driver-core</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>com.datastax.cassandra</groupId>
<artifactId>cassandra-driver-mapping</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>19.0</version>
</dependency>
<dependency>
<artifactId>hector-object-mapper</artifactId>
<groupId>org.hectorclient</groupId>
<version>3.1-10</version>
</dependency>
<dependency>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa-all</artifactId>
<version>2.0.0</version>
</dependency>
</dependencies>
即使在具有 OpenJPAConfiguration 的 pom.xml 中包含 openjpa-all 依赖项后,我仍然看到此问题。对此的任何帮助将不胜感激。