-
15. Re: Deploying Seam 2.2.2 WAR to JBoss AS 7 + bundled Hibernate 3 gives strange exceptions (CCE + NSME)
kwutzke Feb 14, 2012 8:05 PM (in response to smarlow)Never mind, I found it. Doh, needed to add the VM args to the launch configuration:
Servers tab -> Server Runtime (double click) -> Open launch configuration
Appended "... -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y" and received the message
{code}Listening for transport dt_socket at address: 8787{code}
Sorry I'm really tired! It's 2 A.M. in Germany but I need to get over this thing.
I'll report back ASAP now that I seem to have gotten JDB attached.
Karsten
-
16. Re: Deploying Seam 2.2.2 WAR to JBoss AS 7 + bundled Hibernate 3 gives strange exceptions (CCE + NSME)
kwutzke Feb 14, 2012 8:15 PM (in response to kwutzke)Here's the output of the 3 dumps:
{code}MSC service thread 1-4[1] dump this.getClass()
this.getClass() = {
ANNOTATION: 8192
ENUM: 16384
SYNTHETIC: 4096
cachedConstructor: null
newInstanceCallerCache: null
name: "org.hibernate.cfg.beanvalidation.BeanValidationIntegrator"
allPermDomain: null
useCaches: true
declaredFields: null
publicFields: null
declaredMethods: null
publicMethods: null
declaredConstructors: null
publicConstructors: null
declaredPublicFields: null
declaredPublicMethods: null
classRedefinedCount: 0
lastRedefinedCount: 0
genericInfo: null
serialVersionUID: 3206093459760846163
serialPersistentFields: instance of java.io.ObjectStreamField[0] (id=7858)
reflectionFactory: instance of sun.reflect.ReflectionFactory(id=7859)
initted: true
enumConstants: null
enumConstantDirectory: null
annotations: null
declaredAnnotations: null
annotationType: null
}
MSC service thread 1-4[1] dump this.getClass().getClassLoader()
this.getClass().getClassLoader() = {
NO_RESOURCE_LOADERS: instance of org.jboss.modules.ResourceLoaderSpec[0] (id=7874)
module: instance of org.jboss.modules.Module(id=7876)
transformer: null
paths: instance of org.jboss.modules.Paths(id=7877)
localLoader: instance of org.jboss.modules.ModuleClassLoader$1(id=7878)
pathsUpdater: instance of java.util.concurrent.atomic.AtomicReferenceFieldUpdater$AtomicReferenceFieldUpdaterImpl(id=7879)
org.jboss.modules.ConcurrentClassLoader.LOCKLESS: false
org.jboss.modules.ConcurrentClassLoader.SAFE_JDK: false
org.jboss.modules.ConcurrentClassLoader.definingLoader: instance of sun.misc.Launcher$AppClassLoader(id=7880)
org.jboss.modules.ConcurrentClassLoader.GET_PACKAGE_SUPPRESSOR: instance of java.lang.ThreadLocal(id=7881)
org.jboss.modules.ConcurrentClassLoader.EMPTY_ENUMERATION: instance of java.util.Collections$2(id=7882)
org.jboss.modules.ConcurrentClassLoader.packages: instance of org.jboss.modules.UnlockedReadHashMap(id=7883)
java.security.SecureClassLoader.initialized: true
java.security.SecureClassLoader.pdcache: instance of java.util.HashMap(id=7884)
java.security.SecureClassLoader.debug: null
java.lang.ClassLoader.parent: instance of sun.misc.Launcher$AppClassLoader(id=7880)
java.lang.ClassLoader.parallelLockMap: instance of java.util.concurrent.ConcurrentHashMap(id=7885)
java.lang.ClassLoader.package2certs: instance of java.util.concurrent.ConcurrentHashMap(id=7886)
java.lang.ClassLoader.nocerts: instance of java.security.cert.Certificate[0] (id=7887)
java.lang.ClassLoader.classes: instance of java.util.Vector(id=7888)
java.lang.ClassLoader.defaultDomain: instance of java.security.ProtectionDomain(id=7889)
java.lang.ClassLoader.domains: instance of java.util.Collections$SynchronizedSet(id=7890)
java.lang.ClassLoader.packages: instance of java.util.HashMap(id=7891)
java.lang.ClassLoader.scl: instance of sun.misc.Launcher$AppClassLoader(id=7880)
java.lang.ClassLoader.sclSet: true
java.lang.ClassLoader.loadedLibraryNames: instance of java.util.Vector(id=7892)
java.lang.ClassLoader.systemNativeLibraries: instance of java.util.Vector(id=7893)
java.lang.ClassLoader.nativeLibraries: instance of java.util.Vector(id=7894)
java.lang.ClassLoader.nativeLibraryContext: instance of java.util.Stack(id=7895)
java.lang.ClassLoader.usr_paths: instance of java.lang.String[16] (id=7896)
java.lang.ClassLoader.sys_paths: instance of java.lang.String[1] (id=7897)
java.lang.ClassLoader.assertionLock: instance of java.lang.Object(id=7898)
java.lang.ClassLoader.defaultAssertionStatus: false
java.lang.ClassLoader.packageAssertionStatus: null
java.lang.ClassLoader.classAssertionStatus: null
}
MSC service thread 1-4[1] dump this
this = {
LOG: instance of org.hibernate.internal.CoreMessageLogger_$logger(id=7899)
APPLY_CONSTRAINTS: "hibernate.validator.apply_to_ddl"
BV_CHECK_CLASS: "javax.validation.Validation"
MODE_PROPERTY: "javax.persistence.validation.mode"
ACTIVATOR_CLASS: "org.hibernate.cfg.beanvalidation.TypeSafeActivator"
DDL_METHOD: "applyDDL"
ACTIVATE_METHOD: "activateBeanValidation"
VALIDATE_METHOD: "validateFactory"
}{code}
Hmmm....... what's the above telling me?
Karsten
-
17. Re: Deploying Seam 2.2.2 WAR to JBoss AS 7 + bundled Hibernate 3 gives strange exceptions (CCE + NSME)
smarlow Feb 14, 2012 9:10 PM (in response to kwutzke)I think that will be enough to go on. I'll write back later.
-
18. Re: Deploying Seam 2.2.2 WAR to JBoss AS 7 + bundled Hibernate 3 gives strange exceptions (CCE + NSME)
smarlow Feb 14, 2012 11:38 PM (in response to smarlow)It seems like the Hibernate 4 module is also in your application for some reason. Could you try enabling JPA TRACE (see troubleshooting section here) logging and also check that the jboss-deployment-structure.xml is in the WEB-INF of your war.
-
19. Re: Deploying Seam 2.2.2 WAR to JBoss AS 7 + bundled Hibernate 3 gives strange exceptions (CCE + NSME)
smarlow Feb 14, 2012 11:40 PM (in response to smarlow)Paste the server.log from deploying with JPA trace enabled, so I can see it.
-
20. Re: Deploying Seam 2.2.2 WAR to JBoss AS 7 + bundled Hibernate 3 gives strange exceptions (CCE + NSME)
smarlow Feb 14, 2012 11:41 PM (in response to smarlow)Also show the output of "jar tf bbstats.war".
-
21. Re: Deploying Seam 2.2.2 WAR to JBoss AS 7 + bundled Hibernate 3 gives strange exceptions (CCE + NSME)
odavido Feb 15, 2012 2:42 AM (in response to kwutzke)could you extract a minimal seam 2.2.2 war from your app to be able to reproduce your behaviour?
I have also found this one (well you are packaging it as a war archive):
Seam 2 Booking EAR Migration of Binaries - Step by Step
David
-
22. Re: Deploying Seam 2.2.2 WAR to JBoss AS 7 + bundled Hibernate 3 gives strange exceptions (CCE + NSME)
odavido Feb 15, 2012 2:49 AM (in response to kwutzke)could you please start the JBoss with this JDK option:
-verbose:class
and post where the Hibernate classes are loaded from?
David
-
23. Re: Deploying Seam 2.2.2 WAR to JBoss AS 7 + bundled Hibernate 3 gives strange exceptions (CCE + NSME)
kwutzke Feb 15, 2012 5:15 AM (in response to smarlow)@Scott:
1. I need to restate: I'm not using WAR deployment really, just JBoss Tools deployment which seems to just copy the whole directory structure to the local instance. (Wrong subject, my bad!) I've manually zipped up the deployed files and issued the command for you to see the dir tree (attached!).
2. I added the two trace loggers to standalone.xml, see server.log attached.
3. I checked the deployment and yes jboss-deployment-structure.xml is present (also see files dump)
Well, if you ask me, the line
{code}11:07:24,541 INFO [org.hibernate.validator.util.Version] (MSC service thread 1-2) Hibernate Validator 4.2.0.Final{code}
shouldn't be there.
However it was already visible before the JPA tracers. Don't know if this should happen. I'd expect a Hibernate Validator 3.1.0 to be used. Again, I don't know if it should work with 4.2.0.Final though.
Karsten
-
server.log.zip 14.3 KB
-
bbstats-local.txt.zip 2.3 KB
-
-
24. Re: Deploying Seam 2.2.2 WAR to JBoss AS 7 + bundled Hibernate 3 gives strange exceptions (CCE + NSME)
kwutzke Feb 15, 2012 7:08 AM (in response to smarlow)Scott,
I just pulled the old webapp from my remote server, it deployed to JBAS 7.1 CR1 without any exceptions. The directory structure of my webapp has changed slightly and that's mostly because I have adapted to Maven and its recommended directory structure (or rather for JSF 2 using a deployed "resources" dir).
So there must be something with the dependencies and/or the dir tree structure. I've attached my old deployment's files dump below.
Edit #1: I restored the old DB locally and now my webapp works like a "charm" again.
Edit #2: I've attached the old app's server.log (local JBAS 7.1) and there you can see no traces of Hibernate Validator 4.2.0... I have no idea what triggers Hibernate 4 in my new webapp.
Edit #3: I just realized that my old app wasn't using JTA as can be seen from the persistence unit setup (RESOURCE_LOCAL). I cling to remember having had problems with JTA setup etc., so I omitted transactions entirely for that app (at first). It's something I need to have today however.
Karsten
-
bbstats-online.txt.zip 2.1 KB
-
oldapp.server.log.zip 8.0 KB
-
-
25. Re: Deploying Seam 2.2.2 WAR to JBoss AS 7 + bundled Hibernate 3 gives strange exceptions (CCE + NSME)
smarlow Feb 15, 2012 11:12 AM (in response to kwutzke)Karsten,
I see what is happening now.
11:07:27,688 INFO [org.hibernate.annotations.common.Version] (MSC service thread 1-3) HCANN000001: Hibernate Commons Annotations {4.0.1.Final}
11:07:27,688 INFO [org.hibernate.Version] (MSC service thread 1-3) HHH000412: Hibernate Core {4.0.0.Final}
11:07:27,688 INFO [org.hibernate.cfg.Environment] (MSC service thread 1-3) HHH000206: hibernate.properties not found
11:07:27,688 INFO [org.hibernate.cfg.Environment] (MSC service thread 1-3) HHH000021: Bytecode provider name : javassist
11:07:28,249 INFO [org.hibernate.dialect.Dialect] (MSC service thread 1-3) HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect
11:07:28,249 INFO [org.hibernate.engine.transaction.internal.TransactionFactoryInitiator] (MSC service thread 1-3) HHH000268: Transaction strategy: org.hibernate.engine.transaction.internal.jta.CMTTransactionFactory
11:07:28,265 INFO [org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory] (MSC service thread 1-3) HHH000397: Using ASTQueryTranslatorFactory
11:07:28,280 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
When Seam calls javax.persistence.Persistence.createEntityManagerFactory(), the Hibernate 4.0 persistence provider is used. The javax.persistence.Persistence.createEntityManagerFactory method doesn't know about the difference between Hibernate 4.0 (which is already registered) and the Hibernate 3.6.x jars packaged with the application.
Are there any Seam alternatives, that don't use javax.persistence.Persistence.createEntityManagerFactory()?
-
26. Re: Deploying Seam 2.2.2 WAR to JBoss AS 7 + bundled Hibernate 3 gives strange exceptions (CCE + NSME)
ctomc Feb 15, 2012 11:34 AM (in response to smarlow)When Seam calls javax.persistence.Persistence.createEntityManagerFactory(), the Hibernate 4.0 persistence provider is used. The javax.persistence.Persistence.createEntityManagerFactory method doesn't know about the difference between Hibernate 4.0 (which is already registered) and the Hibernate 3.6.x jars packaged with the application.
Are there any Seam alternatives, that don't use javax.persistence.Persistence.createEntityManagerFactory()?
I don't think this is the case, maybe it just needs hibernate-jpa-2.0-api-1.0.1.Final.jar inside application so it won't use one that is defined globaly.
This jar is the same for hibernate 3.6 and 4.x, additionaly maybe exclude of global shoud also be added.
For seam alternative of crateEntityManagerFactory you can create a component that overrides build-in one and you can do there anything you want. This might just help in this case.
-
27. Re: Deploying Seam 2.2.2 WAR to JBoss AS 7 + bundled Hibernate 3 gives strange exceptions (CCE + NSME)
kwutzke Feb 15, 2012 11:58 AM (in response to ctomc)Tomaz Cerar wrote:
I don't think this is the case, maybe it just needs hibernate-jpa-2.0-api-1.0.1.Final.jar inside application so it won't use one that is defined globaly.
This jar is the same for hibernate 3.6 and 4.x, additionaly maybe exclude of global shoud also be added.
My Maven dependencies already add this JAR to the project and it's also present in the server's deployment. How do I exclude the JBAS JAR then?
I wonder how this all makes sense since I didn't even change the Seam version for both apps.
For seam alternative of createEntityManagerFactory you can create a component that overrides build-in one and you can do there anything you want. This might just help in this case.
I've been using the persistence framework EntityHome/EntityQuery for that project ever since and (again) how should that make sense when nothing in my project concerning Seam has changed? I'm in doubt this is going anywhere.
Karsten
-
28. Re: Deploying Seam 2.2.2 WAR to JBoss AS 7 + bundled Hibernate 3 gives strange exceptions (CCE + NSME)
smarlow Feb 15, 2012 12:01 PM (in response to ctomc)Hi Tomaz,
AS7-3423 will try to deal with applications that have their own javax.persistence jars. Currently, the global ones are always used. This will be for the special case of applications that use the javax.persistence.Persistence.createEntityManagerFactory(). For applications that want the EE container managed JPA experience, they shouldn't packaged the javax.persistence jars. So, not yet on including the javax.persistence jars with the app. I'm not yet sure if this will work or not. We need a way to check if a deployment has the javax.persistence jars before injecting the global api jars (I'm not sure how to do that but maybe someone else does).
Do you have a link or more information regarding the seam way for creating a component that overrides the built-in one for getting the entity manager?
Scott
-
29. Re: Deploying Seam 2.2.2 WAR to JBoss AS 7 + bundled Hibernate 3 gives strange exceptions (CCE + NSME)
kwutzke Feb 15, 2012 12:13 PM (in response to smarlow)Hello Scott,
When Seam calls javax.persistence.Persistence.createEntityManagerFactory(), the Hibernate 4.0 persistence provider is used. The javax.persistence.Persistence.createEntityManagerFactory method doesn't know about the difference between Hibernate 4.0 (which is already registered) and the Hibernate 3.6.x jars packaged with the application.
Are there any Seam alternatives, that don't use javax.persistence.Persistence.createEntityManagerFactory()?
I wonder how this all makes sense with my situation. I have my old (online) webapp which works on JBoss AS 7.0.0.Final up to JBoss AS 7.1.0.CR1 using Seam 2.2.2 and it's not kicking in Hibernate 4. Then I changed the project to Maven, now resulting in a different set of deployed libs, a slightly different jboss-deployment-structure.xml, a slightly different dir structure plus the persistence now being JTA (not RESOURCE_LOCAL as the old app) and it's still using Seam 2.2.2 but this time the app is kicking in Hibernate 4.... it doesn't make sense to me!
I'm very unsure/doubtful to look into Seam as the cause.
Soooo stuck.
Karsten