2009-06-05 6 views
2

J'ai le problème suivant. Lorsque je déploie mon fichier ear dans le dossier server \ default \ deploy de JBOSS la première fois, les choses semblent fonctionner correctement. Mais alors, avec JBOSS en cours d'exécution, si je supprime et recopie le fichier ear, mes tests unitaires échouent avec l'exception listée ci-dessous. C'est comme si elle perdait les mappages Hibernate pour les entités pendant le déploiement à chaud. Ensuite, si j'arrête et redémarre JBOSS sans effectuer un seul changement, les choses fonctionnent à nouveau. C'est comme si le déploiement à chaud ne fonctionnait pas correctement.jboss problèmes de déploiement à chaud avec hibernate

L'un d'entre vous a-t-il déjà rencontré ce problème ou est-il au courant d'une solution de contournement?

Merci pour toute aide.

Enviroment: Windows XP SP3 JBoss Hibernate 3.3.1 4.2.3GA Hibernate Entity Manager 3.4.0

javax.ejb.EJBException: java.lang.IllegalArgumentException: org.hibernate.hql.ast .QuerySyntaxException: TestEntity n'a pas été mappée [DE TestEntity] à org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx (Ejb3TxPolicy.java:63) à org.jboss.aspects.tx.TxPolicy.invokeInOurTx (TxPolicy.java:83) à org.jboss.aspects.tx.TxInterceptor $ Required.invoke (TxInterceptor.java:191) à org.jboss.aop.joinpoint.MethodInvoca tion.invokeNext (MethodInvocation.java:101) à org.jboss.aspects.tx.TxPropagationInterceptor.invoke (TxPropagationInterceptor.java:95) à org.jboss.aop.joinpoint.MethodInvocation.invokeNext (MethodInvocation.java:101) à org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke (StatelessInstanceInterceptor.java:62) à org.jboss.aop.joinpoint.MethodInvocation.invokeNext (MethodInvocation.java:101) à org.jboss.aspects.security. AuthenticationInterceptor.invoke (AuthenticationInterceptor.java:77) à org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke (Ejb3AuthenticationInterceptor.java:110) à org.jboss.aop.joinpoint.MethodInvocation.invokeNext (MethodInvocation.java:101) à org.jboss.ejb3.ENCPropagationInterceptor.invoke (FR CPropagationInterceptor.java:46) à org.jboss.aop.joinpoint.MethodInvocation.invokeNext (MethodInvocation.java:101) à org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke (AsynchronousInterceptor.java:106) à org. jboss.aop.joinpoint.MethodInvocation.invokeNext (MethodInvocation.java:101) à org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke (StatelessContainer.java:304) à org.jboss.aop.Dispatcher.invoke (Dispatcher. java: 106) à org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke (AOPRemotingInvocationHandler.java:82) à org.jboss.remoting.ServerInvoker.invoke (ServerInvoker.java:809) à org.jboss.remoting. transport.socket.ServerThread.processInvocation (ServerThread.java:608) à org.jboss.remoting.transport.socket.ServerThread.dorun (ServerThread.java:406) à org.jboss.remoting.transport.socket.ServerThread.run (ServerThread.java:173) Causé par: java.lang .IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException: TestEntity n'a pas été mappée [DE TestEntity] à org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException (AbstractEntityManagerImpl.java:617) à org.hibernate.ejb.AbstractEntityManagerImpl.createQuery (AbstractEntityManagerImpl.java:96) à org.jboss.ejb3.entity.TransactionScopedEntityManager.createQuery (TransactionScopedEntityManager.java:134) à com.topcoder.test.TestBean.retrieveAll (TestBean.java:62) à sun.reflect .NativeMethodAccessorImpl.invoke0 (méthode native) à sun.r eflect.NativeMethodAccessorImpl.invoquer (source inconnue) à sun.reflect.DelegatingMethodAccessorImpl.invoke (source inconnue) à java.lang.reflect.Method.invoke (source inconnue) à org.jboss.aop.joinpoint.MethodInvocation.invokeNext (MethodInvocation.java : 112) à org.jboss.ejb3.interceptor.InvocationContextImpl.proceed (InvocationContextImpl.java:166) à org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke (EJB3InterceptorsInterceptor.java:63) à org.jboss.aop .joinpoint.MethodInvocation.invokeNext (MethodInvocation.java:101) à org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke (TransactionScopedEntityManagerInterceptor.java:54) à org.jboss.aop.joinpoint.MethodInvocation.invokeNext (MethodInvocation.java : 101) à org.jboss.ejb3.AllowedOperationsInterceptor.invoke (AllowedOperationsInterceptor.java:47) à org.jboss.aop.joinpoint.MethodInvocation.invokeNext (MethodInvocation.java:101) à org.jboss.aspects.tx.TxPolicy. invokeInOurTx (TxPolicy.java:79) à org.jboss.aspects.tx.TxInterceptor $ Required.invoke (TxInterceptor.java:191) à org.jboss.aop.joinpoint.MethodInvocation.invokeNext (MethodInvocation.java:101) à org.jboss.aspects.tx.TxPropagationInterceptor.invoke (TxPropagationInterceptor.java:95) à org.jboss.aop.joinpoint.MethodInvocation.invokeNext (MethodInvocation.java:101) à org.jboss.ejb3.stateless. StatelessInstanceInterceptor.invoke (StatelessInstanceInterceptor.java:62) à org.jboss.aop.joinpoint.MethodInvocation.invokeNext (Metho dInvocation.java:101) à org.jboss.aspects.security.AuthenticationInterceptor.invoke (AuthenticationInterceptor.java:77) à org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke (Ejb3AuthenticationInterceptor.java:110) à org. jboss.aop.joinpoint.MethodInvocation.invokeNext (MethodInvocation.java:101) à org.jboss.ejb3.ENCPropagationInterceptor.invoke (ENCPropagationInterceptor.java:46) à org.jboss.aop.joinpoint.MethodInvocation.invokeNext (MethodInvocation. java: 101) à org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke (AsynchronousInterceptor.java:106) à org.jboss.aop.joinpoint.MethodInvocation.invokeNext (MethodInvocation.java:101) à org.jboss. ejb3.stateless.StatelessContainer.dynamicInvoke (StatelessContainer.java : 304) à org.jboss.aop.Dispatcher.invoke (Dispatcher.java:106) à org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke (AOPRemotingInvocationHandler.java:82) à org.jboss.remoting.ServerInvoker .invoke (ServerInvoker.java:809) à org.jboss.remoting.transport.socket.ServerThread.processInvocation (ServerThread.java:608) à org.jboss.remoting.transport.socket.ServerThread.dorun (ServerThread.java : 406) à org.jboss.remoting.transport.socket.ServerThread.run (ServerThread.java:173) à org.jboss.remoting.MicroRemoteClientInvoker.invoke (MicroRemoteClientInvoker.java:163) à org.jboss.remoting .Client.invoke (Client.java:1634) à org.jboss.remoting.Client.invoke (Client.java:548) à org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke (InvokeRemoteInterceptor.java:62) à org.jboss.aop.joinpoint.MethodInvocation.invokeNext (MethodInvocation.java:101) à org.jboss.aspects.tx. ClientTxPropagationInterceptor.invoke (ClientTxPropagationInterceptor.java:67) à org.jboss.aop.joinpoint.MethodInvocation.invokeNext (MethodInvocation.java:101) à org.jboss.aspects.security.SecurityClientInterceptor.invoke (SecurityClientInterceptor.java:53) à org.jboss.aop.joinpoint.MethodInvocation.invokeNext (MethodInvocation.java:101) à org.jboss.ejb3.remoting.IsLocalInterceptor.invoke (IsLocalInterceptor.java:74) à org.jboss.aop.joinpoint. MethodInvocation.invokeNext (MethodInvocation.java:101) à org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke (StatelessRemoteProxy.java:107) à $ Proxy0.retrieveAll (Source inconnue) à com.topcoder.test.TestEntityTestCase.testFake (TestEntityTestCase.java:101) à sun.reflect.NativeMethodAccessorImpl.invoke0 (Méthode native) à sun.reflect.NativeMethodAccessorImpl.invoke (Source inconnue) à sun.reflect.DelegatingMethodAccessorImpl.invoke (Source inconnue) à java.lang.reflect.Method.invoke (Source inconnue) à junit.framework. TestCase.runTest (TestCase.java:164) at junit.framework.TestCase.runBare (TestCase.java:130) at junit.framework.TestResult $ 1.protect (TestResult.java:106) at junit.framework.TestResult .runProtected (TestResult.java:124) à junit.framework.TestResult.run (TestResult.java:109) à junit.framework.TestCase.run (TestCase.java:120) à junit.framework.TestSuite.runTest (TestSuite.java:230) à junit.framework.TestSuite.run (TestSuite.java:225) à org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run (JUnit3TestReference.java:130) à org.eclipse.jdt.internal. junit.runner.TestExecution.run (TestExecution.java:38) à org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests (RemoteTestRunner.java:460) à org.eclipse.jdt.internal.junit. runner.RemoteTestRunner.runTests (RemoteTestRunner.java:673) à org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run (RemoteTestRunner.java:386) à org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main (RemoteTestRunner.java:196) à org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke (InvokeRemoteInterceptor.java:74) à org.jboss.aop .joinpoint.MethodInvocation.invokeNext (MethodInvocation.java:101) à org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke (ClientTxPropagationInterceptor.java:67) à org.jboss.aop.joinpoint.MethodInvocation.invokeNext (MethodInvocation.java : 101) à org.jboss.aspects.security.SecurityClientInterceptor.invoke (SecurityClientInterceptor.java:53) à org.jboss.aop.joinpoint.MethodInvocation.invokeNext (MethodInvocation.java:101) à org.jboss.ejb3 .remoting.IsLocalInterceptor.invoke (IsLocalInterceptor.java:74) sur org.jboss.aop.joinpo int.MethodInvocation.invokeNext (MethodInvocation.java:101) à org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke (StatelessRemoteProxy.java:107) à $ Proxy0.retrieveAll (Source inconnue) à com.topcoder.test. TestEntityTestCase.testFake (TestEntityTestCase.java:101) à sun.reflect.NativeMethodAccessorImpl.invoke0 (native Method) à sun.reflect.NativeMethodAccessorImpl.invoke (Source inconnue) à sun.reflect.DelegatingMethodAccessorImpl.invoke (Source inconnue) à java.lang.reflect.Method.invoke (source inconnue) à junit.framework.TestCase.runTest (TestCase.java:164) à junit.framework.TestCase.runBare (TestCase.java:130) à junit. framework.TestResult $ 1.protect (TestResult.ja va: 106) à junit.framework.TestResult.runProtected (TestResult.java:124) à junit.framework.TestResult.run (TestResult.java:109) à junit.framework.TestCase.run (TestCase.java: 120) à junit.framework.TestSuite.runTest (TestSuite.java:230) à junit.framework.TestSuite.run (TestSuite.java:225) à org.eclipse.jdt.internal.junit.runner.junit3. JUnit3TestReference.run (JUnit3TestReference.java:130) à org.eclipse.jdt.internal.junit.runner.TestExecution.run (TestExecution.java:38) à org.eclipse.jdt.internal.junit.runner.RemoteTestRunner. runTests (RemoteTestRunner.java:460) à org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests (RemoteTestRunner.java:673) à org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run (RemoteTestRunner.java:386) à org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main (RemoteTestRunner.java:196) Causé par: org. hibernate.hql.ast.QuerySyntaxException: TestEntity n'est pas mappé [FROM TestEntity] at org.hibernate.hql.ast.util.SessionFactoryHelper.requireClassPersister (SessionFactoryHelper.java:158) at org.hibernate.hql.ast.tree. FromElementFactory.addFromElement (FromElementFactory.java:87) à org.hibernate.hql.ast.tree.FromClause.addFromElement (FromClause.java:70) à org.hibernate.hql.ast.HqlSqlWalker.createFromElement (HqlSqlWalker.java: 255) à org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElement (HqlSqlBaseWalker.java:3056) à org.hibernate.hql.antlr.HqlSq lBaseWalker.fromElementList (HqlSqlBaseWalker.java:2945) à org.hibernate.hql.antlr.HqlSqlBaseWalker.fromClause (HqlSqlBaseWalker.java:688) à org.hibernate.hql.antlr.HqlSqlBaseWalker.query (HqlSqlBaseWalker.java:544) à org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement (HqlSqlBaseWalker.java:281) à org.hibernate.hql.antlr.HqlSqlBaseWalker.statement (HqlSqlBaseWalker.java:229) à org.hibernate.hql.ast. QueryTranslatorImpl.analyze (QueryTranslatorImpl.java:228) à org.hibernate.hql.ast.QueryTranslatorImpl.doCompile (QueryTranslatorImpl.java:160) à org.hibernate.hql.ast.QueryTranslatorImpl.compile (QueryTranslatorImpl.java:111) at org.hibernate.engine.query.HQLQueryPlan. (HQLQueryPlan.java:77) à org.hibernate.engine.query.HQLQueryPlan. (HQLQueryPlan.java:56) à org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan (QueryPlanCache.java:72) à org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan (AbstractSessionImpl .java: 133) à org.hibernate.impl.AbstractSessionImpl.createQuery (AbstractSessionImpl.java:112) à org.hibernate.impl.SessionImpl.createQuery (SessionImpl.java:1623) à org.hibernate.ejb.AbstractEntityManagerImpl .createQuery (AbstractEntityManagerImpl.java:93) à org.jboss.ejb3.entity.TransactionScopedEntityManager.createQuery (TransactionScopedEntityManager.java:134) à com.topcoder.test.TestBean.retrieveAll (TestBean.java:62) au soleil .reflect.NativeMethodAccessorImpl.invoke0 (Méthode native) à sun.reflect.NativeMethodAccessorImpl.invoke (Source inconnue) à sun.reflect.DelegatingMethodAccessorImpl.invoke (Source inconnue) à java.lang.reflect.Method.invoke (Source inconnue) à org.jboss.aop.joinpoint .MethodInvocation.invokeNext (MethodInvocation.java:112) à org.jboss.ejb3.interceptor.InvocationContextImpl.proceed (InvocationContextImpl.java:166) à org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke (EJB3InterceptorsInterceptor.java:63) à org.jboss.aop.joinpoint.MethodInvocation.invokeNext (MethodInvocation.java:101) à org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke (TransactionScopedEntityManagerInterceptor.java:54) à org.jboss.aop.joinpoint .MethodInvocation.invokeNext (Metho dInvocation.java:101) à org.jboss.ejb3.AllowedOperationsInterceptor.invoke (AllowedOperationsInterceptor.java:47) à org.jboss.aop.joinpoint.MethodInvocation.invokeNext (MethodInvocation.java:101) à org.jboss. aspects.tx.TxPolicy.invokeInOurTx (TxPolicy.java:79) à org.jboss.aspects.tx.TxInterceptor $ Requis.invoke (TxInterceptor.java:191) à org.jboss.aop.joinpoint.MethodInvocation.invokeNext (MethodInvocation.java:101) à org.jboss.aspects.tx.TxPropagationInterceptor.invoke (TxPropagationInterceptor.java:95) à org.jboss.aop.joinpoint.MethodInvocation.invokeNext (MethodInvocation.java:101) à org. jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke (StatelessInstanceInterceptor.java:62) à org.jboss.aop.joinpoint.MethodInvocation.invokeNext (MethodInvocation.java:101) à org.jboss.aspects.security.AuthenticationInterceptor.invoke (AuthenticationInterceptor.java:77) à org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke (Ejb3AuthenticationInterceptor.java:110) à org.jboss.aop.joinpoint.MethodInvocation.invokeNext (MethodInvocation.java:101) à org.jboss.ejb3.ENCPropagationInterceptor.invoke (ENCPropagationInterceptor.java:46) à org.jboss. aop.joinpoint.MethodInvocation.invokeNext (MethodInvocation.java:101) à org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke (AsynchronousInterceptor.java:106) à org.jboss.aop.joinpoint.MethodInvocation.invokeNext (MethodInvocation. java: 101) à org.jboss.ejb3.stateless.Sta telessContainer.dynamicInvoke (StatelessContainer.java:304) à org.jboss.aop.Dispatcher.invoke (Dispatcher.java:106) à org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke (AOPRemotingInvocationHandler.java:82) à org.jboss.remoting.ServerInvoker.invoke (ServerInvoker.java:809) à org.jboss.remoting.transport.socket.ServerThread.processInvocation (ServerThread.java:608) à org.jboss.remoting.transport.socket. ServerThread.dorun (ServerThread.java:406) à org.jboss.remoting.transport.socket.ServerThread.run (ServerThread.java:173)

Répondre

0

Qu'est-ce que vous avez à la classe?

com.topcoder.test.TestBean.retrieveAll (TestBean.java:62) à

+0

Liste résultat = em.createQuery ("DE TestEntity") getResultList(). – dcp

+0

Deux idées. Essayez de passer à l'API de critères ou utilisez le nom qualifié complet dans HQL au lieu de "TestEntity". – FoxyBOA

+0

Le nom qualifié complet semble aider le problème. Il n'échoue plus sur cette ligne. Que pensez-vous pourrait être la raison de ce comportement? Pourquoi le nom complet n'est-il pas requis lors d'un déploiement à froid, mais il est * requis * lors d'un déploiement à chaud? Mais, il y a toujours un problème sur le déploiement à chaud. Si je modifie tout le code dans ma classe TestBean, je vais une exception comme celui-ci en essayant de courir: java.lang.RuntimeException: java.lang.IllegalStateException: Impossible de remplacer provoquer \t à Désolé Je ne peux pas lister toute la trace, j'ai manqué de caractères autorisés sur le commentaire. – dcp

Questions connexes