Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
1483 connectés 

  FORUM HardWare.fr
  Programmation
  Java

  Exception: java.lang.RuntimeException: java.lang.NoClassDefFoundError

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

Exception: java.lang.RuntimeException: java.lang.NoClassDefFoundError

n°1844571
FrenchFrog​ger
http://antony-ibanez.eg2.fr/
Posté le 29-01-2009 à 11:20:01  profilanswer
 

Bonjour j'ai cette erreur quand je lance les tests (Junit):
 

Code :
  1. java.lang.RuntimeException: java.lang.NoClassDefFoundError: Could not initialize class com.atosorigin.ceps.impl.engine.MultithreadedEngine
  2. at org.jboss.ejb3.EJBContainer.invokeCallback(EJBContainer.java:1113)
  3. at org.jboss.ejb3.EJBContainer.invokePostConstruct(EJBContainer.java:1123)
  4. at org.jboss.ejb3.EJBContainer.invokePostConstruct(EJBContainer.java:1134)
  5. at org.jboss.ejb3.pool.AbstractPool.create(AbstractPool.java:93)
  6. at org.jboss.ejb3.InfinitePool.get(InfinitePool.java:56)
  7. at org.jboss.ejb3.InfinitePool.get(InfinitePool.java:51)
  8. at org.jboss.ejb3.pool.ThreadlocalPool.create(ThreadlocalPool.java:53)
  9. at org.jboss.ejb3.pool.ThreadlocalPool.get(ThreadlocalPool.java:93)
  10. at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:58)
  11. at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
  12. at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
  13. at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
  14. at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
  15. at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
  16. at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
  17. at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
  18. at org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:159)
  19. at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
  20. at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:41)
  21. at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
  22. at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
  23. at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
  24. at org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:65)
  25. at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
  26. at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67)
  27. at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
  28. at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:486)
  29. at org.jboss.ejb3.session.InvokableContextClassProxyHack._dynamicInvoke(InvokableContextClassProxyHack.java:56)
  30. at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:91)
  31. at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
  32. at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:908)
  33. at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:742)
  34. at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:695)
  35. at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:522)
  36. at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:230)
  37. Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.atosorigin.ceps.impl.engine.MultithreadedEngine
  38. at com.atosorigin.ceps.impl.sessionbean.ConfigurationBean.init(ConfigurationBean.java:63)
  39. at sun.reflect.GeneratedMethodAccessor270.invoke(Unknown Source)
  40. at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  41. at java.lang.reflect.Method.invoke(Method.java:597)
  42. at org.jboss.ejb3.interceptors.aop.LifecycleCallbackBeanMethodInterceptor.invoke(LifecycleCallbackBeanMethodInterceptor.java:69)
  43. at org.jboss.aop.joinpoint.ConstructionInvocation.invokeNext(ConstructionInvocation.java:79)
  44. at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.setup(InvocationContextInterceptor.java:88)
  45. at org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_setup_2678600.invoke(InvocationContextInterceptor_z_setup_2678600.java)
  46. at org.jboss.aop.joinpoint.ConstructionInvocation.invokeNext(ConstructionInvocation.java:79)
  47. at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67)
  48. at org.jboss.aop.joinpoint.ConstructionInvocation.invokeNext(ConstructionInvocation.java:79)
  49. at org.jboss.ejb3.EJBContainer.invokeCallback(EJBContainer.java:1109)
  50. at org.jboss.ejb3.EJBContainer.invokePostConstruct(EJBContainer.java:1123)
  51. at org.jboss.ejb3.EJBContainer.invokePostConstruct(EJBContainer.java:1134)
  52. at org.jboss.ejb3.pool.AbstractPool.create(AbstractPool.java:93)
  53. at org.jboss.ejb3.InfinitePool.get(InfinitePool.java:56)
  54. at org.jboss.ejb3.InfinitePool.get(InfinitePool.java:51)
  55. at org.jboss.ejb3.pool.ThreadlocalPool.create(ThreadlocalPool.java:53)
  56. at org.jboss.ejb3.pool.ThreadlocalPool.get(ThreadlocalPool.java:93)
  57. at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:58)
  58. at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
  59. at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
  60. at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
  61. at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
  62. at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
  63. at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
  64. at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
  65. at org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:159)
  66. at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
  67. at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:41)
  68. at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
  69. at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
  70. at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
  71. at org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:65)
  72. at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
  73. at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67)
  74. at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
  75. at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:486)
  76. at org.jboss.ejb3.session.InvokableContextClassProxyHack._dynamicInvoke(InvokableContextClassProxyHack.java:56)
  77. at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:91)
  78. at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
  79. at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:908)
  80. at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:742)
  81. at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:695)
  82. at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:522)
  83. at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:230)
  84. at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:206)
  85. at org.jboss.remoting.Client.invoke(Client.java:1708)
  86. at org.jboss.remoting.Client.invoke(Client.java:612)
  87. at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:60)
  88. at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
  89. at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:61)
  90. at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
  91. at org.jboss.ejb3.security.client.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:65)
  92. at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
  93. at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:74)
  94. at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
  95. at org.jboss.aspects.remoting.PojiProxy.invoke(PojiProxy.java:62)
  96. at $Proxy14.invoke(Unknown Source)
  97. at org.jboss.ejb3.proxy.handler.ProxyInvocationHandlerBase.invoke(ProxyInvocationHandlerBase.java:261)
  98. at org.jboss.ejb3.proxy.handler.session.SessionSpecProxyInvocationHandlerBase.invoke(SessionSpecProxyInvocationHandlerBase.java:101)
  99. at $Proxy11.deleteLoadableGraph(Unknown Source)
  100. at com.atosorigin.ceps.test.configuration.TestConfigurationProcessingModule.cleanDatabase(TestConfigurationProcessingModule.java:74)
  101. at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  102. at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  103. at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  104. at java.lang.reflect.Method.invoke(Method.java:597)
  105. at org.junit.internal.runners.MethodRoadie.runBefores(MethodRoadie.java:122)
  106. at org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:86)
  107. at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77)
  108. at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42)
  109. at org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88)
  110. at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)
  111. at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)
  112. at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
  113. at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
  114. at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
  115. at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45)
  116. at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
  117. at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
  118. at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
  119. at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
  120. at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
  121. at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:72)
  122. at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
  123. at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:61)
  124. at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
  125. at org.jboss.ejb3.security.client.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:65)
  126. at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
  127. at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:74)
  128. at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
  129. at org.jboss.aspects.remoting.PojiProxy.invoke(PojiProxy.java:62)
  130. at $Proxy14.invoke(Unknown Source)
  131. at org.jboss.ejb3.proxy.handler.ProxyInvocationHandlerBase.invoke(ProxyInvocationHandlerBase.java:261)
  132. at org.jboss.ejb3.proxy.handler.session.SessionSpecProxyInvocationHandlerBase.invoke(SessionSpecProxyInvocationHandlerBase.java:101)
  133. at $Proxy11.deleteLoadableGraph(Unknown Source)
  134. at com.atosorigin.ceps.test.configuration.TestConfigurationProcessingModule.cleanDatabase(TestConfigurationProcessingModule.java:74)
  135. at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  136. at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  137. at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  138. at java.lang.reflect.Method.invoke(Method.java:597)
  139. at org.junit.internal.runners.MethodRoadie.runBefores(MethodRoadie.java:122)
  140. at org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:86)
  141. at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77)
  142. at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42)
  143. at org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88)
  144. at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)
  145. at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)
  146. at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
  147. at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
  148. at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
  149. at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45)
  150. at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
  151. at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
  152. at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
  153. at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
  154. at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)


 
J'utilise Eclipse 3.4.1, avec les plugins maven et junit, jdk 1.6, dans mon projet maven les sources "normales" (comme MultithreadedEngine.java) sont dans le répertoire src/main/java, les sources de tests sont dans le répertoire src/test/java, les classes compilées sont respectivement dans target/classes et target/test-classes
Lorsque je lance junit, j'ai un serveur mysql 5 démarré, un serveur jboss 5.0.0 GA démarré avec déployé au bon endroit un ear contenant les classes "normales" (cad pas les classes de test) dont la classe qui pose problème: MultithreadedEngine (le chemin dans le ear est bon)
J'ai cette erreur tout au long de mes tests...

mood
Publicité
Posté le 29-01-2009 à 11:20:01  profilanswer
 

n°1844872
FrenchFrog​ger
http://antony-ibanez.eg2.fr/
Posté le 29-01-2009 à 16:59:28  profilanswer
 

Voilà une partie du code de ma classe. J'ai lu que l'erreur pouvait venir de là (des champs statiques entres autres)
 

Code :
  1. public class MultithreadedEngine implements Engine
  2. {
  3.     private/* static is implicit */enum Status
  4.     {
  5.         STOPPED(1), IN_START(2), STARTED(3), IN_STOP(4);
  6.         private int id;
  7.         int getId()
  8.         {
  9.             return this.id;
  10.         }
  11.         Status(int id)
  12.         {
  13.             this.id = id;
  14.         }
  15.     }
  16.     Status                               engineCurrentStatus      = Status.STOPPED;
  17.     private static MultithreadedEngine   instance                 = new MultithreadedEngine();
  18.     private AcquisitionAndProcessingImpl acquisitionAndProcessing = null;
  19.     private ConfigurationImpl            configuration            = null;
  20.     private InternalDictionary           dictionary               = null;
  21.     private InternalScheduler            scheduler                = null;
  22.     private InternalLoader               loader                   = null;
  23.     private ImportExport                 importExport             = null;
  24.    
  25.     private MultithreadedEngine()
  26.     {
  27.         this.dictionary = new InternalDictionary();
  28.        
  29.         this.scheduler  = new InternalScheduler(dictionary);
  30.         this.acquisitionAndProcessing = new AcquisitionAndProcessingImpl(this.dictionary,this.scheduler);
  31.         this.configuration = new ConfigurationImpl(this.dictionary,this.scheduler);
  32.         this.loader = new InternalLoader(this.dictionary,this.scheduler);
  33.         //this.importExport = new ImportExportImpl(this.dictionary);         
  34.     }


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  Java

  Exception: java.lang.RuntimeException: java.lang.NoClassDefFoundError

 

Sujets relatifs
[JAVA/EE] Export de données MySQL5 vers formulaire WordJAVA Interface graphique
javax.naming.NameNotFoundException: B not bound (Java, JBoss, MySql)2 Redirections à partir d'un bouton Java
quel intérêt de relancer une exception dans un catch ?Débutant en JAVA
Environement java[Java] Problème de lecture dans un fichier
problème de HashMap résolu, mais besoin d'explications, bug JAVA ?Utiliser dll dans du java
Plus de sujets relatifs à : Exception: java.lang.RuntimeException: java.lang.NoClassDefFoundError


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR