-
1. Re: Bug?!! Caused by: java.lang.ClassNotFoundException: org.hibernate.LockOptions
shadowlaw Oct 11, 2011 9:08 AM (in response to shadowlaw)i'm using this simple code
HistoryEntity historyEntity = reader.getCurrentRevision(
HistoryEntity.class, false);
if (historyEntity != null) {
LOGGER.info("USERNAME " + historyEntity.getUsername());
}
****** the first one is working but the second, the one below throws the exception. Any one has an idea about the issue?
AuditQuery forRevisionsOfEntity = reader.createQuery()
.forRevisionsOfEntity(Brand.class, false, false);
List resultList = forRevisionsOfEntity.getResultList();
-
2. Re: Bug?!! Caused by: java.lang.ClassNotFoundException: org.hibernate.LockOptions
adamw Oct 12, 2011 5:17 AM (in response to shadowlaw)Maybe you are bundling whole hibernate-core with your app, and you don't have classloader isolation turned on? Which version of JBossAS are you using?
Adam
-
3. Re: Bug?!! Caused by: java.lang.ClassNotFoundException: org.hibernate.LockOptions
shadowlaw Oct 12, 2011 6:09 AM (in response to adamw)i'm not using any server, it's just a maven project and main class
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-envers</artifactId>
<version>3.5.0-Final</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>3.3.1.GA</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
<version>3.4.0.GA</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.17</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.1</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.5.8</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.5.8</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>JBOSS_NEXUS</id>
<url>http://repository.jboss.org/nexus/content/groups/public</url>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>
-
4. Re: Bug?!! Caused by: java.lang.ClassNotFoundException: org.hibernate.LockOptions
adamw Oct 12, 2011 6:13 AM (in response to shadowlaw)You are mixing hibernate-core and hibernate-envers versions. You have to use the same versions of both dependencies.
Adam
-
5. Re: Bug?!! Caused by: java.lang.ClassNotFoundException: org.hibernate.LockOptions
shadowlaw Oct 12, 2011 6:25 AM (in response to adamw)it's working correctly thank you