Application migration error, ANTLR and Wildfly incompatibility 8

0

I have a legacy application developed in Java web, and would like to put it in a new production environment. In this environment is installed Java 8 and the latest version of Wildfly. Today this application runs on a Java 7 server in Glassfish (I can not remember the version, but it's not so outdated).

The problem that is occurring is the following, when I try to deploy the application in Wildfly it gives the following error:

"{\"JBAS014671: Failed services\" => {
\"jboss.persistenceunit.\\"Projeto.war#ProjetoBasePU\\"\" => \"org.jboss.msc.service.StartException in service jboss.persistenceunit.\\"Projeto.war#ProjetoBasePU\\": javax.persistence.PersistenceException: [PersistenceUnit: ProjetoBasePU] Unable to build Hibernate SessionFactory
Caused by: javax.persistence.PersistenceException: [PersistenceUnit: ProjetoBasePU] Unable to build Hibernate SessionFactory
Caused by: org.hibernate.MappingException: Could not get constructor for org.hibernate.persister.collection.OneToManyPersister
Caused by: org.hibernate.HibernateException: Unable to parse order-by fragment
Caused by: java.lang.ClassCastException: antlr.CommonToken cannot be cast to antlr.Token\",
\"jboss.persistenceunit.\\"Projeto.war#ProjetoBaseTestPU\\"\" => \"org.jboss.msc.service.StartException in service jboss.persistenceunit.\\"Projeto.war#ProjetoBaseTestPU\\": javax.persistence.PersistenceException: [PersistenceUnit: ProjetoBaseTestPU] Unable to build Hibernate SessionFactory
Caused by: javax.persistence.PersistenceException: [PersistenceUnit: ProjetoBaseTestPU] Unable to build Hibernate SessionFactory
Caused by: org.hibernate.MappingException: Could not get constructor for org.hibernate.persister.collection.OneToManyPersister
Caused by: org.hibernate.HibernateException: Unable to parse order-by fragment
Caused by: java.lang.ClassCastException: antlr.CommonToken cannot be cast to antlr.Token\"

I'm trying to get the following error when I try to access the first screen of the system:

14:11:41,484 ERROR [stderr] (default task-6) javax.servlet.ServletException: java.lang.NoSuchMethodError: org.hibernate.SessionFactory.openSession()Lorg/hibernate/classic/Session;

14:11:41,484 ERROR [stderr] (default task-6)    at org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:848)

14:11:41,484 ERROR [stderr] (default task-6)    at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:777)

14:11:41,485 ERROR [stderr] (default task-6)    at org.apache.jsp.login_jsp._jspService(login_jsp.java:193)

14:11:41,485 ERROR [stderr] (default task-6)    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:69)

14:11:41,485 ERROR [stderr] (default task-6)    at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)

14:11:41,485 ERROR [stderr] (default task-6)    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:366)

14:11:41,485 ERROR [stderr] (default task-6)    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:326)

14:11:41,485 ERROR [stderr] (default task-6)    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:259)

14:11:41,485 ERROR [stderr] (default task-6)    at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)

14:11:41,486 ERROR [stderr] (default task-6)    at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)

14:11:41,486 ERROR [stderr] (default task-6)    at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:130)

14:11:41,486 ERROR [stderr] (default task-6)    at br.edu.unifeob.sguprofessor.filtros.FiltroHibernate.doFilter(FiltroHibernate.java:51)

14:11:41,486 ERROR [stderr] (default task-6)    at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60)

14:11:41,486 ERROR [stderr] (default task-6)    at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132)

14:11:41,486 ERROR [stderr] (default task-6)    at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:85)

14:11:41,486 ERROR [stderr] (default task-6)    at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:61)

14:11:41,486 ERROR [stderr] (default task-6)    at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)

14:11:41,487 ERROR [stderr] (default task-6)    at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)

14:11:41,487 ERROR [stderr] (default task-6)    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)

14:11:41,487 ERROR [stderr] (default task-6)    at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:113)

14:11:41,487 ERROR [stderr] (default task-6)    at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:56)

14:11:41,487 ERROR [stderr] (default task-6)    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)

14:11:41,487 ERROR [stderr] (default task-6)    at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:45)

14:11:41,488 ERROR [stderr] (default task-6)    at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:61)

14:11:41,488 ERROR [stderr] (default task-6)    at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:58)

14:11:41,488 ERROR [stderr] (default task-6)    at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:70)

14:11:41,488 ERROR [stderr] (default task-6)    at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76)

14:11:41,488 ERROR [stderr] (default task-6)    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)

14:11:41,524 ERROR [stderr] (default task-6)    at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)

14:11:41,524 ERROR [stderr] (default task-6)    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)

14:11:41,524 ERROR [stderr] (default task-6)    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)

14:11:41,524 ERROR [stderr] (default task-6)    at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:240)

14:11:41,524 ERROR [stderr] (default task-6)    at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:227)

14:11:41,525 ERROR [stderr] (default task-6)    at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:73)

14:11:41,525 ERROR [stderr] (default task-6)    at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:146)

14:11:41,525 ERROR [stderr] (default task-6)    at io.undertow.server.Connectors.executeRootHandler(Connectors.java:177)

14:11:41,525 ERROR [stderr] (default task-6)    at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:727)

14:11:41,525 ERROR [stderr] (default task-6)    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

14:11:41,525 ERROR [stderr] (default task-6)    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)

14:11:41,525 ERROR [stderr] (default task-6)    at java.lang.Thread.run(Thread.java:724)

14:11:41,526 ERROR [stderr] (default task-6) Caused by: java.lang.NoSuchMethodError: org.hibernate.SessionFactory.openSession()Lorg/hibernate/classic/Session;

14:11:41,526 ERROR [stderr] (default task-6)    at br.edu.unifeob.sgu.uteis.HibernateConnection.getSession(HibernateConnection.java:56)

14:11:41,526 ERROR [stderr] (default task-6)    at br.edu.unifeob.sgu.uteis.HibernateConnection.beginTransaction(HibernateConnection.java:107)

14:11:41,526 ERROR [stderr] (default task-6)    at br.edu.unifeob.sguprofessor.taglibs.hibernatetag.HibernateQuery.doEndTag(HibernateQuery.java:65)

14:11:41,526 ERROR [stderr] (default task-6)    at org.apache.jsp.login_jsp._jspx_meth_hibernate_005fquery_005f0(login_jsp.java:326)

14:11:41,526 ERROR [stderr] (default task-6)    at org.apache.jsp.login_jsp._jspService(login_jsp.java:141)

14:11:41,527 ERROR [stderr] (default task-6)    ... 37 more

Has anyone ever been through this?

    
asked by anonymous 04.09.2014 / 19:22

1 answer

1

I wanted to put it as a comment but I'm not getting it.

14: 11: 41,484 ERROR [stderr] (default task-6) javax.servlet.ServletException: # : org.hibernate.SessionFactory.openSession () Lorg / hibernate / classic / Session;

You're probably having a version mismatch in the meantime. This typically occurs when you compile on one version and the runtime environment is on another.

Ex: Compiled locale as Hiberante 3 and in your JBoss has Hibernate 4, and the openSession () method is not available in the Hibernate 4 SessionFactory object.

Javadoc : p>

  

Thrown if an application tries to call a specified method of a class (either static or instance), and that class no longer has a definition of that method.    Normally, this error is caught by the compiler; this error can only occur at run time if the definition of a class has incompatibly changed.


Additional suggestion

Within JBoss a version of Hibernate 4 is already available, be sure to remove any other version of Hibernate from your application.

    
05.09.2014 / 23:50