1 Reply Latest reply on Apr 26, 2016 5:42 AM by Nilesh-Oracle

    weblogic.appc fails with ClassNotFoundException in defineClass()

    Artem Ananiev-Oracle

      Hi,

       

      I am trying to deploy an application to Oracle Java Cloud Service (JCS), and get a problem. Application is an ear file:

       

      application.ear

      -- ejb.jar

      -- rest.war

      -- web.war

       

      Deployment fails at "WLS App Compile" step with the following symptoms:

       

      weblogic.j2ee.dd.xml.AnnotationProcessException: [EJB:015002]Unable to load class com.company.ApplicationBean in Jar **** : java.lang.ClassNotFoundException: Class bytes found but defineClass()failed for: 'com.company.ApplicationBean'

        at weblogic.j2ee.dd.xml.BaseJ2eeAnnotationProcessor.addProcessingError(BaseJ2eeAnnotationProcessor.java:1323)

        at weblogic.j2ee.dd.xml.BaseJ2eeAnnotationProcessor.addFatalProcessingError(BaseJ2eeAnnotationProcessor.java:1328)

        at weblogic.ejb.container.dd.xml.EjbAnnotationProcessor.processAnnotations(EjbAnnotationProcessor.java:165)

        at weblogic.ejb.container.dd.xml.EjbDescriptorReaderImpl.processStandardAnnotations(EjbDescriptorReaderImpl.java:344)

        at weblogic.ejb.container.dd.xml.EjbDescriptorReaderImpl.createReadOnlyDescriptorFromJarFile(EjbDescriptorReaderImpl.java:204)

        at weblogic.ejb.spi.EjbDescriptorFactory.createReadOnlyDescriptorFromJarFile(EjbDescriptorFactory.java:93)

        at weblogic.ejb.container.ejbc.EJBCompiler.parseDescriptors(EJBCompiler.java:1203)

        at weblogic.ejb.container.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:392)

        at weblogic.application.compiler.AppcUtils.compileEJB(AppcUtils.java:316)

        at weblogic.application.compiler.EJBModule.compile(EJBModule.java:128)

        at weblogic.application.compiler.flow.CompileModuleFlow.compileModules(CompileModuleFlow.java:103)

        at weblogic.application.compiler.flow.CompileModuleFlow.compile(CompileModuleFlow.java:51)

        at weblogic.application.compiler.FlowDriver$FlowStateChange.next(FlowDriver.java:69)

        at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)

        at weblogic.application.compiler.FlowDriver.nextState(FlowDriver.java:36)

        at weblogic.application.compiler.FlowDriver.run(FlowDriver.java:26)

        at weblogic.application.compiler.EARCompiler.compile(EARCompiler.java:51)

        at weblogic.application.compiler.flow.AppCompilerFlow.compileInput(AppCompilerFlow.java:112)

        at weblogic.application.compiler.flow.AppCompilerFlow.compile(AppCompilerFlow.java:37)

        at weblogic.application.compiler.FlowDriver$FlowStateChange.next(FlowDriver.java:69)

        at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)

        at weblogic.application.compiler.FlowDriver.nextState(FlowDriver.java:36)

        at weblogic.application.compiler.FlowDriver.run(FlowDriver.java:26)

        at weblogic.application.compiler.Appc.runBody(Appc.java:203)

        at weblogic.utils.compiler.Tool.run(Tool.java:158)

        at weblogic.utils.compiler.Tool.run(Tool.java:115)

        at weblogic.application.compiler.Appc.main(Appc.java:262)

        at weblogic.appc.main(appc.java:14)

       

      ApplicationBean is a class annotated as @Stateless, in ejb.jar. If this annotation is removed, the compilation succeeds, but it's obviously unaccepted. Listing this bean in ejb-jar.xml, or adding beans.xml, do not help. The same ear file can be deployed to a local WebLogic 12.1.3 server, and running weblogic.apps by hand against this ear is fine as well. Java version mismatch (the application is compiled with 1.8) is not an issue either.

       

      Any ideas why it fails and how to fix it?