1 2 3 Previous Next 63 Replies Latest reply on Feb 28, 2012 10:46 PM by smarlow

    Deploying Seam 2.2.2 WAR to JBoss AS 7 + bundled Hibernate 3 gives strange exceptions (CCE + NSME)

    kwutzke

      Hello,

       

      I'm trying to port my Seam 2 application to JBoss AS 7.1. I have been trying Hibernate 4 for a while, but it's not working. Now I'm reverting back to Hibernate 3 bundled with my webapp. I was following

       

      https://docs.jboss.org/author/display/AS7/JPA+Reference+Guide

       

      "Packaging the Hibernate 3.5 or greater 3.x JPA persistence provider with your application" along the path.

       

      However, when deploying the webapp I get the exception:

      {code}18:27:00,774 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/bbstats]] (MSC service thread 1-1) Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener: org.jboss.seam.InstantiationException: Could not instantiate Seam component: emf

          at org.jboss.seam.Component.newInstance(Component.java:2170) [jboss-seam-2.2.2.Final.jar:]

          at org.jboss.seam.contexts.Contexts.startup(Contexts.java:304) [jboss-seam-2.2.2.Final.jar:]

          at org.jboss.seam.contexts.Contexts.startup(Contexts.java:278) [jboss-seam-2.2.2.Final.jar:]

          at org.jboss.seam.contexts.ServletLifecycle.endInitialization(ServletLifecycle.java:143) [jboss-seam-2.2.2.Final.jar:]

          at org.jboss.seam.init.Initialization.init(Initialization.java:744) [jboss-seam-2.2.2.Final.jar:]

          at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:36) [jboss-seam-2.2.2.Final.jar:]

          at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3392) [jbossweb-7.0.7.Final.jar:]

          at org.apache.catalina.core.StandardContext.start(StandardContext.java:3850) [jbossweb-7.0.7.Final.jar:]

          at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:77) [jboss-as-web-7.1.0.CR1.jar:7.1.0.CR1]

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824)

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759)

          at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [:1.7.0_02]

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [:1.7.0_02]

          at java.lang.Thread.run(Unknown Source) [:1.7.0_02]

      Caused by: javax.persistence.PersistenceException: [PersistenceUnit: BBStatsPU] Unable to build EntityManagerFactory

          at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:914) [hibernate-entitymanager-3.6.9.Final.jar:]

          at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:890) [hibernate-entitymanager-3.6.9.Final.jar:]

          at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:56) [hibernate-entitymanager-3.6.9.Final.jar:]

          at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:63) [hibernate-jpa-2.0-api-1.0.1.Final.jar:1.0.1.Final]

          at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:47) [hibernate-jpa-2.0-api-1.0.1.Final.jar:1.0.1.Final]

          at org.jboss.seam.persistence.EntityManagerFactory.createEntityManagerFactory(EntityManagerFactory.java:81) [jboss-seam-2.2.2.Final.jar:]

          at org.jboss.seam.persistence.EntityManagerFactory.startup(EntityManagerFactory.java:50) [jboss-seam-2.2.2.Final.jar:]

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.7.0_02]

          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) [:1.7.0_02]

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) [:1.7.0_02]

          at java.lang.reflect.Method.invoke(Unknown Source) [:1.7.0_02]

          at org.jboss.seam.util.Reflections.invoke(Reflections.java:22) [jboss-seam-2.2.2.Final.jar:]

          at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144) [jboss-seam-2.2.2.Final.jar:]

          at org.jboss.seam.Component.callComponentMethod(Component.java:2283) [jboss-seam-2.2.2.Final.jar:]

          at org.jboss.seam.Component.callCreateMethod(Component.java:2198) [jboss-seam-2.2.2.Final.jar:]

          at org.jboss.seam.Component.newInstance(Component.java:2158) [jboss-seam-2.2.2.Final.jar:]

          ... 13 more

      Caused by: org.hibernate.HibernateException: Could not instantiate dialect class

          at org.hibernate.service.jdbc.dialect.internal.DialectFactoryImpl.constructDialect(DialectFactoryImpl.java:82)

          at org.hibernate.service.jdbc.dialect.internal.DialectFactoryImpl.buildDialect(DialectFactoryImpl.java:64)

          at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:142)

          at org.hibernate.service.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:75)

          at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:159)

          at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:131)

          at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:71) [hibernate-core-3.6.9.Final.jar:]

          at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2270) [hibernate-core-3.6.9.Final.jar:]

          at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2266) [hibernate-core-3.6.9.Final.jar:]

          at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1735) [hibernate-core-3.6.9.Final.jar:]

          at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:76) [hibernate-entitymanager-3.6.9.Final.jar:]

          at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:905) [hibernate-entitymanager-3.6.9.Final.jar:]

          ... 28 more

      Caused by: java.lang.ClassCastException: org.hibernate.dialect.MySQLDialect cannot be cast to org.hibernate.dialect.Dialect

          at org.hibernate.service.jdbc.dialect.internal.DialectFactoryImpl.constructDialect(DialectFactoryImpl.java:73)

          ... 39 more{code}

       

      Eeh?

       

      OK looking at the persistence.xml file:

       

      {code:xml}<?xml version="1.0" encoding="UTF-8"?>

      <persistence xmlns="http://java.sun.com/xml/ns/persistence"

                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                   xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"

                   version="2.0">

        <persistence-unit name="BBStatsPU" transaction-type="JTA">

          <provider>org.hibernate.ejb.HibernatePersistence</provider>

          <jta-data-source>java:jboss/datasources/BBStatsDS</jta-data-source>

       

          <class>com.kawoolutions.bbstats.model.Arena</class>

          <class>com.kawoolutions.bbstats.model.Assignment</class>

          ...

       

          <exclude-unlisted-classes>false</exclude-unlisted-classes>

       

          <properties>

            <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>

            <property name="jboss.as.jpa.providerModule" value="hibernate3-bundled" />

            <property name="transaction.manager_lookup_class" value="org.jboss.as.jpa.hibernate3.JBossAppServerJtaPlatform" />

          </properties>

        </persistence-unit>

      </persistence>{code}

      When outcommenting the hibernate.dialect property, the exception goes away, but it seems to get even worse:

      {code}

      18:04:09,863 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/bbstats]] (MSC service thread 1-3) Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener: org.jboss.seam.InstantiationException: Could not instantiate Seam component: emf

          at org.jboss.seam.Component.newInstance(Component.java:2170) [jboss-seam-2.2.2.Final.jar:]

          at org.jboss.seam.contexts.Contexts.startup(Contexts.java:304) [jboss-seam-2.2.2.Final.jar:]

          at org.jboss.seam.contexts.Contexts.startup(Contexts.java:278) [jboss-seam-2.2.2.Final.jar:]

          at org.jboss.seam.contexts.ServletLifecycle.endInitialization(ServletLifecycle.java:143) [jboss-seam-2.2.2.Final.jar:]

          at org.jboss.seam.init.Initialization.init(Initialization.java:744) [jboss-seam-2.2.2.Final.jar:]

          at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:36) [jboss-seam-2.2.2.Final.jar:]

          at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3392) [jbossweb-7.0.7.Final.jar:]

          at org.apache.catalina.core.StandardContext.start(StandardContext.java:3850) [jbossweb-7.0.7.Final.jar:]

          at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:77) [jboss-as-web-7.1.0.CR1.jar:7.1.0.CR1]

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824)

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759)

          at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [:1.7.0_02]

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [:1.7.0_02]

          at java.lang.Thread.run(Unknown Source) [:1.7.0_02]

      Caused by: javax.persistence.PersistenceException: [PersistenceUnit: BBStatsPU] Unable to build EntityManagerFactory

          at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:914) [hibernate-entitymanager-3.6.9.Final.jar:]

          at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:890) [hibernate-entitymanager-3.6.9.Final.jar:]

          at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:56) [hibernate-entitymanager-3.6.9.Final.jar:]

          at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:63) [hibernate-jpa-2.0-api-1.0.1.Final.jar:1.0.1.Final]

          at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:47) [hibernate-jpa-2.0-api-1.0.1.Final.jar:1.0.1.Final]

          at org.jboss.seam.persistence.EntityManagerFactory.createEntityManagerFactory(EntityManagerFactory.java:81) [jboss-seam-2.2.2.Final.jar:]

          at org.jboss.seam.persistence.EntityManagerFactory.startup(EntityManagerFactory.java:50) [jboss-seam-2.2.2.Final.jar:]

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.7.0_02]

          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) [:1.7.0_02]

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) [:1.7.0_02]

          at java.lang.reflect.Method.invoke(Unknown Source) [:1.7.0_02]

          at org.jboss.seam.util.Reflections.invoke(Reflections.java:22) [jboss-seam-2.2.2.Final.jar:]

          at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144) [jboss-seam-2.2.2.Final.jar:]

          at org.jboss.seam.Component.callComponentMethod(Component.java:2283) [jboss-seam-2.2.2.Final.jar:]

          at org.jboss.seam.Component.callCreateMethod(Component.java:2198) [jboss-seam-2.2.2.Final.jar:]

          at org.jboss.seam.Component.newInstance(Component.java:2158) [jboss-seam-2.2.2.Final.jar:]

          ... 13 more

      Caused by: org.hibernate.HibernateException: Unable to locate TypeSafeActivator#applyDDL method

          at org.hibernate.cfg.beanvalidation.BeanValidationIntegrator.applyRelationalConstraints(BeanValidationIntegrator.java:226)

          at org.hibernate.cfg.beanvalidation.BeanValidationIntegrator.integrate(BeanValidationIntegrator.java:126)

          at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:295)

          at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1737) [hibernate-core-3.6.9.Final.jar:]

          at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:76) [hibernate-entitymanager-3.6.9.Final.jar:]

          at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:905) [hibernate-entitymanager-3.6.9.Final.jar:]

          ... 28 more

      Caused by: java.lang.NoSuchMethodException: org.hibernate.cfg.beanvalidation.TypeSafeActivator.applyDDL(java.util.Collection, java.util.Properties, org.hibernate.dialect.Dialect)

          at java.lang.Class.getMethod(Unknown Source) [:1.7.0_02]

          at org.hibernate.cfg.beanvalidation.BeanValidationIntegrator.applyRelationalConstraints(BeanValidationIntegrator.java:206)

          ... 33 more{code}

      Does anybody know what's going on and more importantly how to fix this?

       

      Karsten

       

      PS: this is a double post from the Seam 2 forum, sorry (I'm too desperate/annoyed)

        • 1. Re: Deploying Seam 2.2.2 WAR to JBoss AS 7 + bundled Hibernate 3 gives strange exceptions (CCE + NSME)
          smarlow

          What is the Seam 2 forum post link?  You might want to add a link to this port there.

           

          Which version of Hibernate 3.x are you packaging?  Can you show the output from "jar tf YourWarName.war" and also attach your server.log so we can see the deployment messages prior to the error.

           

          Scott

          • 2. Re: Deploying Seam 2.2.2 WAR to JBoss AS 7 + bundled Hibernate 3 gives strange exceptions (CCE + NSME)
            kwutzke

            Hello Scott,

             

            thanks for helping!

             

            Seam 2 post: https://community.jboss.org/thread/195076

             

            As can be seen from the stack trace I'm using Hibernate 3.6.9: [hibernate-core-3.6.9.Final.jar:]

             

            I'm not using WAR deployment really, I just wanted to make clear I'm not using EAR. Actually I'm using JBoss Tools to deploy the webapp unzipped.

             

            I've attached the server log, the deployment XML and Maven POM.

             

            I have no problem zipping up the whole project if this aids solving the problem... PM me if interested.

             

            Thanks

            Karsten

            • 3. Re: Deploying Seam 2.2.2 WAR to JBoss AS 7 + bundled Hibernate 3 gives strange exceptions (CCE + NSME)
              smarlow

              Hello Karsten,

               

              It looks like the "method not found" in Hibernate org.hibernate.cfg.beanvalidation.TypeSafeActivator, is the cause.  Hibernate 3.6.9 org.hibernate.cfg.beanvalidation.TypeSafeActivator doesn't have that method (with that signature).  See latest 3.6 source here).

               

              I'll look a little closer to see if I can make more sense out of this.  Its looking like the Hibernate Validator 4.2.0.Final is not working with Hibernate 3.6.x.  If you set a breakpoint at org.hibernate.cfg.beanvalidation.BeanValidationIntegrator.integrate(BeanValidationIntegrator.java:126), you should be able to examine the BeanValidationIntegrator.class.getClassLoader to which AS7 module that is from (just for verification). 

               

              Your application's pom.xml, does mention Hibernate Validator version 3.1.0.GA, it would be good to verify that isn't being used (I see your exclude of it in the jboss-deployment-structure.xml but definitely worth verifying).  If its not using the 3.1.0.GA version of the validator, I would try two experiments.

               

              1.  Remove hibernate-validator from the app and see if that changes anything.

               

              2.  If #1 doesn't change anything, stop the AS7 server, backup the current as7/modules/org/hibernate/validator/main folder and then replace hibernate-validator-4.2.0.Final.jar with the Hibernate 3.1.0.GA validator jar (delete the current .index in that folder and update the module.xml to have the correct name).

               

              Alternatively, if you find that the 3.1.0.GA version of the validator, is being used.  We can drill in deeper to see why thats not working out.

               

              Depending on the results of the above two experiments, we can determine the next step forward.

               

              Also note that the latest JPA doc is at this link (link above was the 7.0 doc) https://docs.jboss.org/author/display/AS71/JPA+Reference+Guide.

               

              Scott

              • 4. Re: Deploying Seam 2.2.2 WAR to JBoss AS 7 + bundled Hibernate 3 gives strange exceptions (CCE + NSME)
                smarlow

                For the first ClassCastException: org.hibernate.dialect.MySQLDialect cannot be cast to org.hibernate.dialect.Dialect, that sounds like the Hibernate 4 classes are somehow getting used here.  Lets tackle the method not found problem first.

                 

                For debugging the as7 (which is the easiest way), JDB can also be used and is the easiest way to debug if your not setup at the moment with all the sources.  Let me know if you want some JDB tips. 

                 

                Scott

                • 5. Re: Deploying Seam 2.2.2 WAR to JBoss AS 7 + bundled Hibernate 3 gives strange exceptions (CCE + NSME)
                  ctomc

                  Seam 2 works with hibernate 3.3.x and validator 3.1 that is your main couse of the problems.

                  Bundle hibernate 3.3(jpa 1) instead 3.6(jpa 2) and it should work.

                   

                  --

                  tomaz

                  • 6. Re: Deploying Seam 2.2.2 WAR to JBoss AS 7 + bundled Hibernate 3 gives strange exceptions (CCE + NSME)
                    kwutzke

                    Hello Tomaz,

                     

                    sorry but I cannot go below any version of Hibernate 3.5 because JPA compatibility issues.

                     

                    When reading this http://stackoverflow.com/questions/3344389/java-lang-nosuchmethodexception-org-hibernate-validator-classvalidator-seam-web that doesn't necessarily solve the issue.

                     

                    Karsten

                    • 7. Re: Deploying Seam 2.2.2 WAR to JBoss AS 7 + bundled Hibernate 3 gives strange exceptions (CCE + NSME)
                      kwutzke

                      Hello Scott,

                       

                      I agree, let's first tackle the Seam - Hibernate issues.

                       

                      I honestly haven't found out how to set a breakpoint in Eclipse onto a class that lies on the server. My JBoss Tools "JBoss 7 Server Runtime" doesn't include the Hibernate 4 core JARs, just the JPA 2 API JAR and the 4.2.0 Validator JAR. I had to manually add the Hibernate 4 JAR to the project for compile errors to be resolved. See screenshot attached! (Luckily the JARs just fit right onto one screen, above the Hibernate core JAR there's "Referenced Libraries" and after the resteasy-multipart JARs there my "docs" dir from the project)

                       

                      In that image you can already see what happens when omitting the Hibernate Validator 3.1.0.GA JAR from the project. Seam has a hard dependency on the old validator, see here:

                       

                      https://community.jboss.org/thread/180671

                       

                      Note Pete Muir's comment there. This has been "resolved", see https://issues.jboss.org/browse/JBSEAM-3247, but it still is present in Seam 2.2.2.

                       

                      The stack trace (as in the screenshot) is:

                      {code}02:15:12,478 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/bbstats]] (MSC service thread 1-4) Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener: java.lang.RuntimeException: Could not create Component: arenaListQuery

                          at org.jboss.seam.init.Initialization.addComponent(Initialization.java:1202) [jboss-seam-2.2.2.Final.jar:]

                          at org.jboss.seam.init.Initialization.installComponents(Initialization.java:1118) [jboss-seam-2.2.2.Final.jar:]

                          at org.jboss.seam.init.Initialization.init(Initialization.java:737) [jboss-seam-2.2.2.Final.jar:]

                          at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:36) [jboss-seam-2.2.2.Final.jar:]

                          at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3392) [jbossweb-7.0.7.Final.jar:]

                          at org.apache.catalina.core.StandardContext.start(StandardContext.java:3850) [jbossweb-7.0.7.Final.jar:]

                          at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:77) [jboss-as-web-7.1.0.CR1.jar:7.1.0.CR1]

                          at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824)

                          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759)

                          at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [:1.7.0_02]

                          at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [:1.7.0_02]

                          at java.lang.Thread.run(Unknown Source) [:1.7.0_02]

                      Caused by: java.lang.NoClassDefFoundError: org/hibernate/validator/ClassValidator

                          at java.lang.Class.getDeclaredMethods0(Native Method) [:1.7.0_02]

                          at java.lang.Class.privateGetDeclaredMethods(Unknown Source) [:1.7.0_02]

                          at java.lang.Class.getDeclaredMethods(Unknown Source) [:1.7.0_02]

                          at org.jboss.seam.Component.initMembers(Component.java:553) [jboss-seam-2.2.2.Final.jar:]

                          at org.jboss.seam.Component.<init>(Component.java:247) [jboss-seam-2.2.2.Final.jar:]

                          at org.jboss.seam.Component.<init>(Component.java:208) [jboss-seam-2.2.2.Final.jar:]

                          at org.jboss.seam.init.Initialization.addComponent(Initialization.java:1186) [jboss-seam-2.2.2.Final.jar:]

                          ... 11 more

                      Caused by: java.lang.ClassNotFoundException: org.hibernate.validator.ClassValidator from [Module "deployment.bbstats.war:main" from Service Module Loader]

                          at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)

                          at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)

                          at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)

                          at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)

                          at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)

                          ... 18 more{code}

                      Still stuck and I hope I don't have to go into any of the workaround hacks described in the JBSEAM issue...

                       

                      Karsten

                      • 8. Re: Deploying Seam 2.2.2 WAR to JBoss AS 7 + bundled Hibernate 3 gives strange exceptions (CCE + NSME)
                        ctomc

                        sorry but I cannot go below any version of Hibernate 3.5 because JPA compatibility issues.

                        hmm, and your are positive that seam 2.2.x works with that version of hibernate without any problems? AFAIK seam2 does not even compile with hibernate 3.5+ Seam 2 is JPA1 based and hibernate 3.5 and up are all JPA2 implementations...

                        It might work but i would bet on it.

                         

                         

                        --

                        tomaz

                        • 9. Re: Deploying Seam 2.2.2 WAR to JBoss AS 7 + bundled Hibernate 3 gives strange exceptions (CCE + NSME)
                          kwutzke

                          I'm pretty sure yes, also because my demo website at http://www.bbstats.net is such a webapp. The entity mappings pre-Hibernate 3.5 didn't work at all, so had to put Hibernate 3.5 online. Just checked it, there is

                          {code}4000 -rw-r--r-- 1 root staff 4089101 2010-10-13 20:52 hibernate3.jar{code}

                          on ther server, which is the JAR naming scheme of Hibernate 3.5 and 3.6.

                           

                          Hibernate MANIFEST:

                          {code}Manifest-Version: 1.0

                          Archiver-Version: Plexus Archiver

                          Created-By: Apache Maven

                          Built-By: steve

                          Build-Jdk: 1.5.0_22

                          Specification-Title: Hibernate Distribution

                          Specification-Version: 3.6.0.Final

                          Specification-Vendor: Hibernate.org

                          Implementation-Title: Hibernate Distribution

                          Implementation-Version: 3.6.0.Final

                          Implementation-Vendor-Id: org.hibernate

                          Implementation-Vendor: Hibernate.org

                          Implementation-URL: http://hibernate.org{code}

                          The Seam MANIFEST says:

                          {code}Manifest-Version: 1.0

                          Archiver-Version: Plexus Archiver

                          Created-By: Apache Maven

                          Built-By: mnovotny

                          Build-Jdk: 1.6.0_24

                          Specification-Title: Seam JSF Controls

                          Specification-Version: 2.2.2.Final

                          Specification-Vendor: JBoss

                          Implementation-Title: Seam JSF Controls

                          Implementation-Version: 2.2.2.Final

                          Implementation-Vendor-Id: org.jboss.seam

                          Implementation-Vendor: JBoss

                          {code}

                           

                          Karsten

                          • 10. Re: Deploying Seam 2.2.2 WAR to JBoss AS 7 + bundled Hibernate 3 gives strange exceptions (CCE + NSME)
                            smarlow

                            Lets give jdb a try then (its ui is primitive but doesn't need source for debugging).

                             

                            1.  Update as7/bin/standalone.conf to enable jdb to attach

                            change from:

                            #JAVA_OPTS="$JAVA_OPTS -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"

                             

                            to:

                             

                            JAVA_OPTS="$JAVA_OPTS -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y"

                             

                            2.  Start the AS7 instance (./startup.sh)

                             

                            3.  Start jdb

                             

                            jdb -attach 8787

                             

                            stop at org.hibernate.cfg.beanvalidation.BeanValidationIntegrator:126

                            cont

                             

                            You should see the following response from jdb, indicating that the breakpoint as been set.

                            Deferring breakpoint org.hibernate.cfg.beanvalidation.BeanValidationIntegrator:126.

                            It will be set after the class is loaded.

                             

                            When your application deploys, jdb should stop at  BeanValidationIntegrator:126.  Then gather the classloader information:

                             

                            dump this.getClass()

                            dump this.getClass().getClassLoader()

                            dump this

                             

                            Paste the output here.

                             

                            You can entry command "quit" to end the jdb session.  Then stop the AS7 instance (command out the java_opts line in standalone.conf).

                             

                            That will be a start.  I'll be on IRC as well, we can discuss in a PM, if you like.

                             

                            Scott

                            • 11. Re: Deploying Seam 2.2.2 WAR to JBoss AS 7 + bundled Hibernate 3 gives strange exceptions (CCE + NSME)
                              kwutzke

                              Hello Scott,

                               

                              first of all I'm on Windows, however that shouldn't matter.

                               

                              I first got an exception:

                               

                              {code}C:\dev\jboss7\bin>jdb -attach 8787

                              java.io.IOException: shmemBase_attach failed: Das System kann die angegebene Datei nicht finden

                               

                                      at com.sun.tools.jdi.SharedMemoryTransportService.attach0(Native Method)

                                      at com.sun.tools.jdi.SharedMemoryTransportService.attach(SharedMemoryTransportService.java:108)

                                      at com.sun.tools.jdi.GenericAttachingConnector.attach(GenericAttachingConnector.java:116)

                                      at com.sun.tools.jdi.SharedMemoryAttachingConnector.attach(SharedMemoryAttachingConnector.java:63)

                                      at com.sun.tools.example.debug.tty.VMConnection.attachTarget(VMConnection.java:356)

                                      at com.sun.tools.example.debug.tty.VMConnection.open(VMConnection.java:165)

                                      at com.sun.tools.example.debug.tty.Env.init(Env.java:63)

                                      at com.sun.tools.example.debug.tty.TTY.main(TTY.java:1066)

                               

                              Fatal error:

                              Unable to attach to target VM.{code}

                              Note that "Das System kann die angegebene Datei nicht finden" means "File not found". I was able to clear it up by http://wiki.apache.org/cocoon/DebuggingCocoon.

                               

                              On Windows you need to exec:

                              {code}jdb -connect com.sun.jdi.SocketAttach:hostname=localhost,port=8787{code}

                               

                              Now the exception is (without localhost):

                              {code}

                              C:\dev\jboss7>jdb -connect com.sun.jdi.SocketAttach:port=8787

                              java.net.ConnectException: Connection refused: connect

                                      at java.net.DualStackPlainSocketImpl.connect0(Native Method)

                                      at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:69)

                                      at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)

                                      at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)

                                      at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)

                                      at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:157)

                                      at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:391)

                                      at java.net.Socket.connect(Socket.java:579)

                                      at com.sun.tools.jdi.SocketTransportService.attach(SocketTransportService.java:222)

                                      at com.sun.tools.jdi.GenericAttachingConnector.attach(GenericAttachingConnector.java:116)

                                      at com.sun.tools.jdi.SocketAttachingConnector.attach(SocketAttachingConnector.java:90)

                                      at com.sun.tools.example.debug.tty.VMConnection.attachTarget(VMConnection.java:356)

                                      at com.sun.tools.example.debug.tty.VMConnection.open(VMConnection.java:165)

                                      at com.sun.tools.example.debug.tty.Env.init(Env.java:63)

                                      at com.sun.tools.example.debug.tty.TTY.main(TTY.java:1066)

                               

                              Fatal error:

                              Unable to attach to target VM.

                              {code}

                              Cause could be the Windows Firwall blocking the port, however I was not yet able to add the port as an exception (if I just wasn't so darn tired and didn't have a German Windows, can't find the port thing right now). In any case I deactivated the whole Windows Firewall just to see the same exception (relaunched a new cmd line/shell).

                               

                              Karsten

                              • 12. Re: Deploying Seam 2.2.2 WAR to JBoss AS 7 + bundled Hibernate 3 gives strange exceptions (CCE + NSME)
                                smarlow

                                Ahh, sorry about that.  Rather than changing standalone.conf, update standalone.conf.bat.

                                 

                                Change the following line in standalone.conf.bat:

                                 

                                rem set "JAVA_OPTS=%JAVA_OPTS% -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"

                                 

                                To:

                                 

                                set "JAVA_OPTS=%JAVA_OPTS% -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y"

                                 

                                This will enable debugging of the AS7 process (it will be frozen/paused until the debugger attaches). 

                                 

                                Be sure to comment this line out after debugging (adding the "rem" back, so your AS7 runs without waiting for a debugger to attach next time. 

                                • 13. Re: Deploying Seam 2.2.2 WAR to JBoss AS 7 + bundled Hibernate 3 gives strange exceptions (CCE + NSME)
                                  kwutzke

                                  I changed standalone.conf back and then changed the bat file, however the ConnectException is still there. (I edited my previous reply in parallel to your answer).

                                   

                                  I'm restarting Windows without the Firewall now.

                                   

                                  Aahm side note: I'm starting the server from the JBoss Tools GUI, not via any scripts... Where's the difference? I didn't notice JBAS waiting for anything... it succeeds with the usual "Server started in 3406 msec" or similar note.

                                   

                                  Karsten

                                  • 14. Re: Deploying Seam 2.2.2 WAR to JBoss AS 7 + bundled Hibernate 3 gives strange exceptions (CCE + NSME)
                                    smarlow

                                    If it still doesn't work, we can try something else.  Don't worry too much about it.  I expected jdb to just work.

                                    1 2 3 Previous Next