Seam 2.2.1.final, Hibernate-search, jboss AS 6, and Maven
ventmonkey Feb 3, 2011 3:25 PMHi all. Sorry if this is the wrong forum for this question. I posted this in the Seam discussion board, then realized it should probably be here.
I am trying to deploy a seam app to Jboss AS 6.0.0.Final, using the hibernate included in the Seam pom, and have the following in my pom.xml
<properties>
<version.seam>2.2.1.Final</version.seam>
</properties>
<dependency>
<groupId>org.jboss.seam</groupId>
<artifactId>jboss-seam</artifactId>
<version>${version.seam}</version>
</dependency>
<dependency>
<groupId>org.jboss.seam</groupId>
<artifactId>jboss-seam-ui</artifactId>
<version>${version.seam}</version>
</dependency>
<dependency>
<groupId>org.jboss.seam</groupId>
<artifactId>jboss-seam-remoting</artifactId>
<version>${version.seam}</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>antlr</groupId>
<artifactId>antlr</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-search</artifactId>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>antlr</groupId>
<artifactId>antlr</artifactId>
</exclusion>
<exclusion>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.hibernate</groupId>
<artifactId>ejb3-persistence</artifactId>
</exclusion>
<exclusion>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-commons-annotations</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
<exclusion>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-commons-annotations</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-tools</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.0-api</artifactId>
<version>1.0.0.Final</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-snowball</artifactId>
<version>2.4.1</version>
</dependency>
......
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<version>2.5</version>
<configuration>
<version>5</version>
<defaultLibBundleDir>lib</defaultLibBundleDir>
<modules>
<ejbModule>
<groupId>com.myproj</groupId>
<artifactId>myproj-ejb</artifactId>
</ejbModule>
</modules>
<jboss>
<loader-repository>
com.myproj:archive=unique-archive-name
</loader-repository>
<loader-repository-config>java2ParentDelegation=false</loader-repository-config>
</jboss>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
This adds the folowing libs to my project
find . -name \*hiber\*.jar
./myproj-ear/target/myproj-ear-1.0-SNAPSHOT/lib/hibernate-tools-3.2.4.GA.jar
./myproj-ear/target/myproj-ear-1.0-SNAPSHOT/lib/hibernate-jpa-2.0-api-1.0.0.Final.jar
./myproj-ear/target/myproj-ear-1.0-SNAPSHOT/lib/hibernate-commons-annotations-3.1.0.GA.jar
./myproj-ear/target/myproj-ear-1.0-SNAPSHOT/lib/hibernate-entitymanager-3.4.0.GA.jar
./myproj-ear/target/myproj-ear-1.0-SNAPSHOT/lib/hibernate-validator-3.1.0.GA.jar
./myproj-ear/target/myproj-ear-1.0-SNAPSHOT/lib/hibernate-annotations-3.4.0.GA.jar
./myproj-ear/target/myproj-ear-1.0-SNAPSHOT/lib/hibernate-search-3.1.1.GA.jar
./myproj-ear/target/myproj-ear-1.0-SNAPSHOT/lib/hibernate-core-3.3.1.GA.jar
mason@mason-desktop:/proj/myproj$ find . -name \*seam\*.jar
./myproj-ear/target/myproj-ear-1.0-SNAPSHOT/lib/jboss-seam-remoting-2.2.1.Final.jar
./myproj-ear/target/myproj-ear-1.0-SNAPSHOT/lib/jboss-seam-ui-2.2.1.Final.jar
./myproj-ear/target/myproj-ear-1.0-SNAPSHOT/lib/jboss-seam-2.2.1.Final.jar
./myproj-ear/target/myproj-ear-1.0-SNAPSHOT/jboss-seam-2.2.1.Final.jar
mason@mason-desktop:/proj/myproj$
my META-INF/jboss-app.xml looks like
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jboss-app PUBLIC
"-//JBoss//DTD J2EE Application 1.4//EN"
"http://www.jboss.org/j2ee/dtd/jboss-app_4_0.dtd">
<jboss-app>
<loader-repository>com.myproj:archive=unique-archive-name<loader-repository-config>java2ParentDelegation=false</loader-repository-config>
</loader-repository>
</jboss-app>
and when I deploy, I get this error...
19:17:36,321 ERROR [AbstractKernelController] Error installing to Start: name=jboss.j2ee:ear=myproj-ear-1.0-SNAPSHOT.ear,jar=myproj-ejb-1.0-SNAPSHOT.jar,name=GoogleAccountBean,service=EJB3 state=Create: java.lang.ClassCastException: org.hibernate.hql.ast.HqlToken cannot be cast to org.hibernate.hql.ast.HqlToken
at org.hibernate.hql.ast.HqlLexer.makeToken(HqlLexer.java:62) [:3.6.0.Final]
at org.hibernate.hql.antlr.HqlBaseLexer.mIDENT(HqlBaseLexer.java:599) [:3.6.0.Final]
at org.hibernate.hql.antlr.HqlBaseLexer.nextToken(HqlBaseLexer.java:270) [:3.6.0.Final]
at antlr.TokenBuffer.fill(Unknown Source) [:6.0.0.Final]
at antlr.TokenBuffer.LA(Unknown Source) [:6.0.0.Final]
at antlr.LLkParser.LA(Unknown Source) [:6.0.0.Final]
at org.hibernate.hql.antlr.HqlBaseParser.statement(HqlBaseParser.java:141) [:3.6.0.Final]
at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:274) [:3.6.0.Final]
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:182) [:3.6.0.Final]
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:136) [:3.6.0.Final]
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:101) [:3.6.0.Final]
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:80) [:3.6.0.Final]
at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:124) [:3.6.0.Final]
at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:156) [:3.6.0.Final]
at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:135) [:3.6.0.Final]
at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1770) [:3.6.0.Final]
at org.hibernate.ejb.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:272) [:3.6.0.Final]
at org.jboss.ejb3.timerservice.mk2.TimerServiceImpl.getActiveTimers(TimerServiceImpl.java:983) [:1.0.0-alpha-13]
at org.jboss.ejb3.timerservice.mk2.TimerServiceImpl.restoreTimers(TimerServiceImpl.java:738) [:1.0.0-alpha-13]
at org.jboss.ejb3.timerservice.mk2.TimerServiceFactoryImpl.restoreTimerService(TimerServiceFactoryImpl.java:123) [:1.0.0-alpha-13]
at org.jboss.ejb3.TimerServiceContainer.restoreTimerService(TimerServiceContainer.java:244) [:1.7.17]
at org.jboss.ejb3.TimerServiceContainer.afterStart(TimerServiceContainer.java:129) [:1.7.17]
at org.jboss.ejb3.EJBContainer.start(EJBContainer.java:1113) [:1.7.17]
I cannot figure out if I am missing a hibernate lib, or if this is a class loading order issue. Please help. Has anyone else gotten Seam 2.2.1, Hibernate-search, and Jboss AS 6 working in a maven project?
Thanks,Mason