IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Java Discussion :

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


Sujet :

Java

  1. #1
    Membre du Club
    Inscrit en
    Janvier 2008
    Messages
    74
    Détails du profil
    Informations forums :
    Inscription : Janvier 2008
    Messages : 74
    Points : 68
    Points
    68
    Par défaut Exception: java.lang.RuntimeException: java.lang.NoClassDefFoundError
    Bonjour j'ai cette erreur quand je lance les tests (Junit):

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

  2. #2
    Membre du Club
    Inscrit en
    Janvier 2008
    Messages
    74
    Détails du profil
    Informations forums :
    Inscription : Janvier 2008
    Messages : 74
    Points : 68
    Points
    68
    Par défaut
    Voilà une partie du code de ma classe. J'ai lu que l'erreur pouvait venir de là (des champs statiques entres autres)

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

Discussions similaires

  1. Réponses: 0
    Dernier message: 25/01/2011, 19h01
  2. Réponses: 6
    Dernier message: 25/01/2010, 01h58
  3. Réponses: 1
    Dernier message: 22/12/2008, 10h12
  4. Exception in thread "main" java.lang.NoClassDefFoundError
    Par laurentibus dans le forum Général Java
    Réponses: 8
    Dernier message: 10/07/2008, 17h03
  5. Exception in thread "main" java.lang.NoClassDefFoundError
    Par miketidy dans le forum Concurrence et multi-thread
    Réponses: 5
    Dernier message: 09/06/2008, 16h58

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo