java.lang.IllegalStateException: No reference found for "-1104443365".

Oracle Community | 3004 | 1 decade ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    JCA-deployment in Weblogic8.1

    Oracle Community | 1 decade ago | 3004
    java.lang.IllegalStateException: No reference found for "-1104443365".
  2. 0

    [GLASSFISH-9420] Exception attempting to inject Env-Prop error, testing TX SQE tx05 functional test using GFV3 - Java.net JIRA

    java.net | 1 year ago
    java.lang.IllegalStateException: Illegal invocation type for EJB Context : SERVLET_INVOCATION]] at com.sun.enterprise.naming.impl.SerialContext.lookup (SerialContext.java:434)
  3. 0

    TX SQE tx05 functional tests fails using metro 2.0 and Glassfish V3, seeing this error is server.log: Caused by: com.sun.enterprise.container.common.spi.util.InjectionException : Exception attempting to inject Env-Prop: sb.SimpleAsCMTEjb/ ejbCtx@Field-Injectable Resource. Class name = sb.SimpleAsCMTEjb Field name=ejbCtx@java.lang.String@sb.SimpleAsCMTEjb/ejbCtx@@ into class org.glassfish.webservices.JAXWSServlet at com.sun.enterprise.container.common.impl.util.InjectionManagerImpl ._inject(InjectionManagerImpl.java:466) at com.sun.enterprise.container.common.impl.util.InjectionManagerImpl.inject (InjectionManagerImpl.java:236) at com.sun.enterprise.container.common.impl.util.InjectionManagerImpl.injectInstance (InjectionManagerImpl.java:125) at com.sun.web.server.J2EEInstanceListener.handleBeforeEvent (J2EEInstanceListener.java:289) ... 32 more Caused by: javax.naming.NamingException: Lookup failed for 'java:comp/env/sb.SimpleAsCMTEjb/ejbCtx' in SerialContext [Root exception is javax.naming.NameNotFoundException: No object bound for java:comp/env/sb.SimpleAsCMTEjb/ejbCtx [Root exception is java.lang.IllegalStateException: Illegal invocation type for EJB Context : SERVLET_INVOCATION]] at com.sun.enterprise.naming.impl.SerialContext.lookup (SerialContext.java:434) at javax.naming.InitialContext.lookup(InitialContext.java:392) at com.sun.enterprise.container.common.impl.util.InjectionManagerImpl ._inject(InjectionManagerImpl.java:365) ... 35 more Caused by: javax.naming.NameNotFoundException: No object bound for java:comp/env/sb.SimpleAsCMTEjb/ejbCtx [Root exception is java.lang.IllegalStateException: Illegal invocation type for EJB Context : SERVLET_INVOCATION] at com.sun.enterprise.naming.impl.JavaURLContext.lookup (JavaURLContext.java:218) at com.sun.enterprise.naming.impl.SerialContext.lookup (SerialContext.java:420) ... 37 more Caused by: java.lang.IllegalStateException: Illegal invocation type for EJB Context : SERVLET_INVOCATION at com.sun.ejb.EjbNamingReferenceManagerImpl.getEJBContextObject (EjbNamingReferenceManagerImpl.java:203) at com.sun.enterprise.container.common.impl.ComponentEnvManagerImpl $EjbContextProxy.create(ComponentEnvManagerImpl.java:760) at com.sun.enterprise.naming.impl.GlassfishNamingManagerImpl.lookup (GlassfishNamingManagerImpl.java:684) at com.sun.enterprise.naming.impl.GlassfishNamingManagerImpl.lookup (GlassfishNamingManagerImpl.java:653) at com.sun.enterprise.naming.impl.JavaURLContext.lookup (JavaURLContext.java:148) ... 38 more TX SQE tx05 functional test worked for GF V2 but errors when trying to run against GF V3. If it's a portable app, then it should work when running against V2 and V3. I don't think access to EJB context would have worked outside of an ejb invocation in V2 but if it did it was a spec violation. A pointer to the application archive and the source is located here: %pwd /net/galapago.east/files/share/tx05/ken/ %ls -alrt -rwxr-xr-x 1 jbenoit staff 44332 Sep 2 13:28 SampleService.ear the corresponding source is checked out on host t24u-1.east under directory /space/test4u2/cvswork/sunsw/tango/qe-tests/wstx i.e. /space/test4u2/cvswork/sunsw/tango/qe-tests/wstx/functional/samples/ entity-manager/SampleService created /space/test4u2/cvswork/sunsw/tango/qe-tests/wstx/functional/ samples/entity-manager/SampleService/dist/SampleService.ear the test4u testrun logs/output/errors are located http://eas-v240-12.india.sun.com:8080/test4u-users/metro/results/20090902140416/t24u-1 is this expected behavior to break existing app when porting to V3 from V2? does the app have to change somehow to fix this error and get past it in order to work on V3? Ken wrote: "Looks like non-EJB code is attempting to lookup an EJB context. EJB context is only available to code running within the context of an EJB invocation." this error shown above is the most recent error, after seeing and fixing this error below: (TX SQE tx05 error using GF V3 & metro 2.0:) [exec] com.sun.enterprise.cli.framework.CommandException : remote failure: Exception while preparing the app : org.glassfish.deployment.common.DeploymentException : Could not resolve a persistence unit corresponding to the persistence-context- ref- name [sb.LibraryFacadeWebServiceBean/em] in the scope of the module called [SampleService#SampleService-war.war]. Please verify your application. Details/emails related to this previous error are shown below to provide context on current state of application errors whilest porting from GFV2 to GFV3: Mitesh stated: "As the error above suggests, you are having a reference to PersitenceUnit from a war. However, the persistence unit is not visible to war. This is because the PersistenceUnit exists inside the ejb.jar. The application might have worked in V2 because it was more lax in implementing separation between ear modules. " Is it an ear? Is PU packaged in a separate jar? If yes, check that such jar is in the lib/ directory of the ear (or that the Class-Path entry in the manifest file references that jar explicitly) - the new JEE 6 requirement for library jars. To which i responded: "what "Class-Path entry in manifest file references that jar explicitly" are you referring to here? what module needs to have this Class-Path entry? are you talking about SampleService#SampleService-war.war ? these modules are required to work against V3 and V2, so are you saying that i now need to have two different modules, one with some Class-Path entry for V3 and another different module without this Class-Path entry to work against V2?" Mitesh writes: "No. You do not need different application for V2 and V3. You need one "correct" JavaEE application. If you want to share the PersistenceUnit and corresponding entity classes between the war annd ejbjar, please package them under lib dir of ear. I wrote: "i put a copy of SampleService-ejb.jar in lib/ dir of ear as shown here /net/galapago.east/files/share/tx05/5/ and now i see these errors: [snip] Mitesh wrote: " Did you put a copy of ejb.jar in lib? That is not correct approach. You need to package the entities and persitence.xml in a jar (Remove them from ejb.jar) and put the jar in lib dir. Thus you .ear structure would be like .ear lib/entities.jar Entity1.class Entity2.class META-INF/persistence.xml ejb.jar Should not contain Entity*.class or persitsence.xml web.war I wrote: " i've done so and i see errors shown in [1] from testrun [1a], .ear is saved in [1b] below. here is the contents of newly created SampleService- entities.jar and modified SampleService-ejb.jar: (t24u-1:/space/test4u2/cvswork/sunsw/tango/qe-tests/wstx/functional/samples/entity-manager/SampleService/SampleService-ejb/dist) >> unzip -l SampleService- entities.jar Archive: SampleService-entities.jar Length Date Time Name ------ ---- ---- ---- 0 08-19-09 23:57 META-INF/ 102 08-19-09 23:57 META-INF/MANIFEST.MF 0 08-19-09 23:57 library/ 812 08-19-09 23:57 META-INF/persistence.xml 1019 08-19-09 23:57 library/Book$BorrowStatus.class 2573 08-19-09 23:57 library/Book.class 407 08-19-09 23:57 library/BookNotFoundException.class 410 08-19-09 23:57 library/BooksNotFoundException.class ------ ------- 5323 8 files (t24u-1:/space/test4u2/cvswork/sunsw/tango/qe-tests/wstx/functional/samples/entity-manager/SampleService/SampleService-ejb/dist) >> unzip -l SampleService-ejb.jar Archive: SampleService-ejb.jar Length Date Time Name ------ ---- ---- ---- 0 08-19-09 23:57 META-INF/ 102 08-19-09 23:57 META-INF/MANIFEST.MF 0 08-19-09 23:57 sb/ 255 08-19-09 23:57 META-INF/sun-ejb-jar.xml 3682 08-19-09 23:57 META-INF/wsit- sb.LibraryFacadeWebServiceBean.xml 2568 08-19-09 23:57 META-INF/wsit-sb.SimpleAsCMTEjb.xml 2301 08-19-09 23:57 sb/LibraryBean.class 4350 08-19-09 23:57 sb/LibraryFacadeWebServiceBean.class 520 08-19-09 23:57 sb/LibraryLocal.class 7206 08-19-09 23:57 sb/SimpleAsCMTEjb.class ------ ------- 20984 10 files (t24u-1:/space/test4u2/cvswork/sunsw/tango/qe-tests/wstx/functional/samples/entity-manager/SampleService/SampleService-ejb/dist) >> .ear looks like this: jbenoit/galapago 1476 >unzip -l SampleService.ear Archive: SampleService.ear Length Date Time Name ------ ---- ---- ---- 0 08-19-09 23:57 META-INF/ 102 08-19-09 23:57 META-INF/MANIFEST.MF 0 08-19-09 23:57 jar/ 0 08-19-09 23:57 lib/ 533 08-19-09 23:57 META-INF/application.xml 247 08-19-09 23:57 META-INF/sun-application.xml 22252 08-19-09 23:57 SampleService-ejb.jar 13839 08-19-09 23:57 SampleService-war.war 6323 08-19-09 23:57 lib/SampleService-entities.jar ------ ------- 43296 9 Mitesh wrote: "Above looks correct to me." all TX05 results should be accessible from http://eas-v240-12.india.sun.com:8080/test4u/testrunresults?testrunid=20090807214934 most recent runs are date stamped and appear at the top of link above. errors here: http://eas-v240-12.india.sun.com:8080/test4u-users/metro/results/20090820192613/t24u-1/testrun_090820-154354/logs/domain2-server-logs/logs/server.log testrun here: http://eas-v240-12.india.sun.com:8080/test4u-users/metro/results/20090820192613/t24u-1/ i've copied the .ear to /net/galapago.east/files/share/tx05/6/SampleService.ear if you want to run this job yourself you can launch it from http://eas-v240-12.india.sun.com:8080/test4u/viewtestrun?testrunid=20090807214934 [1a]http://eas-v240-12.india.sun.com:8080/test4u-users/metro/results/20090820033652/t24u-1/ [1b]/net/galapago.east/files/share/tx05/6/SampleService.ear http://eas-v240-12.india.sun.com:8080/test4u-users/metro/results/20090817181651/t24u-1/testrun_090817-143418/logs/domain2-server-logs/logs/server.log testrun results shown here: http://eas-v240-12.india.sun.com:8080/test4u-users/metro/results/20090817181651/t24u-1/ Marina Vatkina wrote: The answer is similar - in v3 because each module is loaded by its own classloader, by default the war doesn't see classes (and PUs) from an ejb jar. Is it an ear? Is PU packaged in a separate jar? If yes, check that such jar is in the lib/ directory of the ear (or that the Class-Path entry in the manifest file references that jar explicitly) - the new JEE 6 requirement for library jars.

    Java.net JIRA | 8 years ago | jbenoit
    java.lang.IllegalStateException: Illegal invocation type for EJB Context : SERVLET_INVOCATION]] at com.sun.enterprise.naming.impl.SerialContext.lookup (SerialContext.java:434)
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.IllegalStateException

      No reference found for "-1104443365".

      at kodo.ee.JDOObjectFactory.getObjectInstance()
    2. kodo.ee
      JDOObjectFactory.getObjectInstance
      1. kodo.ee.JDOObjectFactory.getObjectInstance(JDOObjectFactory.java:44)
      1 frame
    3. Java RT
      NamingManager.getObjectInstance
      1. javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:301)
      1 frame
    4. weblogic.jndi.internal
      WLContextImpl.lookup
      1. weblogic.jndi.internal.WLEventContextImpl.lookup(WLEventContextImpl.java:257)
      2. weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:357)
      2 frames
    5. weblogic.jndi.factories
      ReadOnlyContextWrapper.lookup
      1. weblogic.jndi.factories.java.ReadOnlyContextWrapper.lookup(ReadOnlyContextWrapper.java:45)
      1 frame
    6. weblogic.jndi.internal
      AbstractURLContext.lookup
      1. weblogic.jndi.internal.AbstractURLContext.lookup(AbstractURLContext.java:130)
      1 frame
    7. Java RT
      InitialContext.lookup
      1. javax.naming.InitialContext.lookup(InitialContext.java:347)
      1 frame