This discussion is archived
7 Replies Latest reply: Dec 18, 2012 2:06 AM by user13047709 RSS

EJB Failed to generate class

user13047709 Newbie
Currently Being Moderated
Hi,

I am moving an legacy application which consist of EJB 2.0 from Weblogic 9 to weblogic 10.3.4 and I am facing following problem:

Caused by: java.lang.AssertionError: Failed to generate class for com.sky.jak.portfolio.beans.PortfolioRetriever_dqv50s_EOImpl_1034_WLStub
     at weblogic.rmi.internal.StubGenerator.generateStub(StubGenerator.java:797)
     at weblogic.rmi.internal.StubGenerator.generateStub(StubGenerator.java:786)
     at weblogic.rmi.extensions.StubFactory.getStub(StubFactory.java:74)
     at weblogic.rmi.internal.StubInfo.resolveObject(StubInfo.java:267)
     at weblogic.rmi.internal.StubInfo.readResolve(StubInfo.java:199)
     at sun.reflect.GeneratedMethodAccessor51.invoke(Unknown Source)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     at java.lang.reflect.Method.invoke(Method.java:597)
     at java.io.ObjectStreamClass.invokeReadResolve(ObjectStreamClass.java:1061)
     at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1762)
     at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
     at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
     at weblogic.rmi.extensions.server.CBVInputStream.readObject(CBVInputStream.java:64)
     at weblogic.rmi.internal.ServerRequest.unmarshalReturn(ServerRequest.java:100)
     at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:348)
     at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:259)
     at com.sky.jak.portfolio.beans.PortfolioRetriever_dqv50s_HomeImpl_1034_WLStub.create(Unknown Source)
     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 com.sky.jak.common.servicelocator.ServiceLocatorImp.callCreateMethod(ServiceLocatorImp.java:246)
     at com.sky.jak.common.servicelocator.ServiceLocatorImp.getBean(ServiceLocatorImp.java:211)
     at com.sky.jak.common.servicelocator.RemoteInvocationHandler.doReinitializeDelegate(RemoteInvocationHandler.java:155)
     at com.sky.jak.common.proxy.RecoverableInvocationHandler.reinitializeDelegate(RecoverableInvocationHandler.java:357)
     ... 13 more
Caused by: java.lang.reflect.InvocationTargetException
     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
     at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
     at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
     at weblogic.rmi.internal.StubGenerator.generateStub(StubGenerator.java:795)
     ... 37 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: 6
     at com.sky.jak.portfolio.beans.PortfolioRetriever_dqv50s_EOImpl_1034_WLStub.ensureInitialized(Unknown Source)
     at com.sky.jak.portfolio.beans.PortfolioRetriever_dqv50s_EOImpl_1034_WLStub.<init>(Unknown Source)
     ... 42 more

When I run appc at compile time I am getting the reported error. What strang is that if I disable appc at compile time, weblogic performs appc on the fly and all works fine. The same error I get even when I do run appc externaly to final ear.

Can someone please assist to troubleshoot that?

Thanks

Edited by: user13047709 on Dec 12, 2012 2:26 AM
  • 1. Re: EJB Failed to generate class
    651477 Explorer
    Currently Being Moderated
    hi,
    would you mind pasting your EJB code here? or a simple reproducer?
    Then we can look into it to see what is the root cause

    Thanks,
    Amy
  • 2. Re: EJB Failed to generate class
    Jeets Journeyer
    Currently Being Moderated
    Hi

    1. Are you using appc on the same file, which you have already executed appc using 9.x environment? Or is it the fresh ejb file?

    2. I believe you have set the environment of 1034 only before running appc tool.

    3. If you are good at ant tools, can you try using wlappc and see if its working fine?

    Finally, just curious to know, how are you executing the command?

    Cheers,
    Jeets
  • 3. Re: EJB Failed to generate class
    user13047709 Newbie
    Currently Being Moderated
    Hi,

    I am using fresh ear file. Once I deploy that one directly to WLS10 it is working. Once I am running appc from command line (all wls environment set up, no errors during appc compilation, even the -verbose doesn't tell anything) - I am getting pasted error. When I run appc via ant (which esentially run weblogic.appc) I am getting the same error as well. The only way it works is when the clean ear (without appc artefacts) is deployed to wls10 and it is compiled by weblogic on deployment time.

    I wasn't able to reproduce that on simple EJB.

    Good to mention that WLS9 is running on JVM 5 whereas WLS10 is running on JVM 6 where the codebase were migrated to JVM 6 however compiling for 1.5 target. Don't ask me why - simply legacy project. But the comparison above descrived ways on WLS10 and JDK6

    I bet that there has to be something in project configuration or lay out or so. I suspected classpath etc but with no luck so far
  • 4. Re: EJB Failed to generate class
    Jeets Journeyer
    Currently Being Moderated
    Can you give us the starting stack of the issue aswell?

    You are giving it from caused by, please give the starting of the SR.

    Hope you would be setting the class path using ANT, can you cross check, which JDK or weblogic instance your are using to set it.

    Thanks,
  • 5. Re: EJB Failed to generate class
    Jeets Journeyer
    Currently Being Moderated
    Also, provide the way you used the appc tool using ant, and do you have any classes in ear/lib directory?
  • 6. Re: EJB Failed to generate class
    user13047709 Newbie
    Currently Being Moderated
    Hi,

    the full stack trace follows:

    2012-12-11 13:54:53,411 ERROR [MSR !f6251134-4a63-49f9-9366-ee1713fa9bbb,f6251134-4a63-49f9-9366-ee1713fa9bbb,2370dbe6-f974-426d-8191-459f9cbd233a,JSP,JSKY,SKY,1,3! ] msengine.MSEngineBean - JSKY SKY error
    com.sky.jak.marketstructure.universe.UniverseRetrieverException: [Market Structure Exception] Market Structure Wrapped Exception cause: Throwable thrown within Portfolio: 6
         at com.sky.jak.marketstructure.universe.UniverseRetriever.getPortfolioUniverse(UniverseRetriever.java:638)
         at com.sky.jak.marketstructure.report.StatsFieldCalculator.loadData(StatsFieldCalculator.java:162)
         at com.sky.jak.marketstructure.report.UniverseFieldCalculator$CalcThread.run(UniverseFieldCalculator.java:167)
         at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
         at com.sky.jak.common.concurrent.ExecutorFacade$1.call(ExecutorFacade.java:127)
         at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
         at java.util.concurrent.FutureTask.run(FutureTask.java:138)
         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
         at java.lang.Thread.run(Thread.java:619)
    Caused by: com.sky.jak.common.servicelocator.ServiceLocatorException: com.sky.jak.portfolio.exception.PortfolioThrowableWrapperException: 6
         at com.sky.jak.common.servicelocator.ServiceLocator.getPortfolioRetriever(ServiceLocator.java:769)
         at com.sky.jak.marketstructure.universe.UniverseRetriever.getPortfolioUniverse(UniverseRetriever.java:584)
         ... 9 more
    Caused by: com.sky.jak.portfolio.exception.PortfolioThrowableWrapperException: 6
         at com.sky.jak.common.proxy.PointExceptionFactory.getDefaultCheckedException(PointExceptionFactory.java:195)
         at com.sky.jak.common.proxy.PointExceptionFactory.getCheckedException(PointExceptionFactory.java:100)
         at com.sky.jak.common.proxy.RecoverableOperationState.throwThrowable(RecoverableOperationState.java:349)
         at com.sky.jak.common.proxy.RecoverableOperationState.throwThrowable(RecoverableOperationState.java:339)
         at com.sky.jak.common.proxy.RecoverableOperationState.getEntry(RecoverableOperationState.java:277)
         at com.sky.jak.common.proxy.RecoverableOperationState.processThrowable(RecoverableOperationState.java:175)
         at com.sky.jak.common.proxy.RecoverableOperationState.processThrowableAndThrowIfMaxReached(RecoverableOperationState.java:132)
         at com.sky.jak.common.proxy.RecoverableInvocationHandler.reinitializeDelegate(RecoverableInvocationHandler.java:380)
         at com.sky.jak.common.servicelocator.RemoteInvocationHandler.<init>(RemoteInvocationHandler.java:59)
         at com.sky.jak.common.servicelocator.ServiceLocatorImp.getLocatableService(ServiceLocatorImp.java:134)
         at com.sky.jak.common.servicelocator.ServiceLocator.getPortfolioRetriever(ServiceLocator.java:765)
         ... 10 more
    Caused by: java.lang.AssertionError: Failed to generate class for com.sky.jak.portfolio.beans.PortfolioRetriever_dqv50s_EOImpl_1034_WLStub
         at weblogic.rmi.internal.StubGenerator.generateStub(StubGenerator.java:797)
         at weblogic.rmi.internal.StubGenerator.generateStub(StubGenerator.java:786)
         at weblogic.rmi.extensions.StubFactory.getStub(StubFactory.java:74)
         at weblogic.rmi.internal.StubInfo.resolveObject(StubInfo.java:267)
         at weblogic.rmi.internal.StubInfo.readResolve(StubInfo.java:199)
         at sun.reflect.GeneratedMethodAccessor51.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at java.io.ObjectStreamClass.invokeReadResolve(ObjectStreamClass.java:1061)
         at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1762)
         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
         at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
         at weblogic.rmi.extensions.server.CBVInputStream.readObject(CBVInputStream.java:64)
         at weblogic.rmi.internal.ServerRequest.unmarshalReturn(ServerRequest.java:100)
         at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:348)
         at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:259)
         at com.sky.jak.portfolio.beans.PortfolioRetriever_dqv50s_HomeImpl_1034_WLStub.create(Unknown Source)
         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 com.sky.jak.common.servicelocator.ServiceLocatorImp.callCreateMethod(ServiceLocatorImp.java:246)
         at com.sky.jak.common.servicelocator.ServiceLocatorImp.getBean(ServiceLocatorImp.java:211)
         at com.sky.jak.common.servicelocator.RemoteInvocationHandler.doReinitializeDelegate(RemoteInvocationHandler.java:155)
         at com.sky.jak.common.proxy.RecoverableInvocationHandler.reinitializeDelegate(RecoverableInvocationHandler.java:357)
         ... 13 more
    Caused by: java.lang.reflect.InvocationTargetException
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
         at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
         at weblogic.rmi.internal.StubGenerator.generateStub(StubGenerator.java:795)
         ... 37 more
    Caused by: java.lang.ArrayIndexOutOfBoundsException: 6
         at com.sky.jak.portfolio.beans.PortfolioRetriever_dqv50s_EOImpl_1034_WLStub.ensureInitialized(Unknown Source)
         at com.sky.jak.portfolio.beans.PortfolioRetriever_dqv50s_EOImpl_1034_WLStub.<init>(Unknown Source)
         ... 42 more

    Ant appc targed follows:
    <target name="appc" unless="skip-appc">
    <property name="appc.target" value="${svc.jar.name}.ear"/>
    <echo message="${toString:wl.class.path}"/>
    <mkdir dir="${appc.dir}"/>
    <java classname="weblogic.appc" dir="${dist.dir}" fork="true" failonerror="true">
    <jvmarg value="-Djava.io.tmpdir=${appc.dir}"/>
    <arg line="-verbose"/>
    <classpath>
    <path refid="wl.class.path"/>
    </classpath>
    <arg value="${appc.target}"/>
    </java>
    <delete dir="${appc.dir}"/>
    </target>

    While running ant JAVA_HOME is set to JDK 1.6, wl.class.path is pointing to weblogic 10.3.4 libraries. Now I am just thinking of that ear is compiled by JDK 1.6 with target specified to 1.5. Do I somehow specify the same option for appc ?
  • 7. Re: EJB Failed to generate class
    user13047709 Newbie
    Currently Being Moderated
    Do you know where the WLStub classes are stored on weblogic when appc is running on deployment time. As under EJBCache are generated classes like PortfolioRetriever_dqv50s_HomeImpl.class but not Stubs. As I would like to find decompile them and see if there is some major difference. That might help me in resolving that

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points