11 Replies Latest reply on Jun 30, 2007 7:28 AM by fhh

    Can a Stateless bean make a call to an entity bean to persis

    ashusri000

      Hi All ,
      I am facing a problem in trying to put a call from a Stateless bean to an entity bean to persist an object . The beans are packed in an ear file and have been deployed on JBOss Server 4.xx . When I make a call to persist the entity bean object then it throws up an error as this :

      javax.persistence.PersistenceException: Exception [TOPLINK-7060] (Oracle TopLink Essentials - 2.0 (Build b41-beta2 (03/30/2007))): oracle.toplink.essentials.exceptions.ValidationException
      Exception Description: Cannot acquire data source [java:/system].
      Internal Exception: javax.naming.InvalidNameException: Not a compound name: system
      12:57:44,968 ERROR [STDERR] at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:220)
      12:57:44,968 ERROR [STDERR] at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.getServerSession(EntityManagerFactoryImpl.java:78)
      12:57:44,968 ERROR [STDERR] at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:111)
      12:57:44,968 ERROR [STDERR] at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:105)
      12:57:44,968 ERROR [STDERR] at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:76)
      12:57:44,968 ERROR [STDERR] at src.FirstSessionBean.sayHello(FirstSessionBean.java:23)
      12:57:44,968 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      12:57:44,968 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      12:57:44,968 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      12:57:44,968 ERROR [STDERR] at java.lang.reflect.Method.invoke(Unknown Source)
      12:57:44,968 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
      12:57:44,968 ERROR [STDERR] at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
      12:57:44,968 ERROR [STDERR] at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
      12:57:44,968 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      12:57:44,968 ERROR [STDERR] at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
      12:57:44,968 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      12:57:44,968 ERROR [STDERR] at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
      12:57:44,968 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      12:57:44,968 ERROR [STDERR] at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
      12:57:44,968 ERROR [STDERR] at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:197)
      12:57:44,968 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      12:57:44,968 ERROR [STDERR] at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
      12:57:44,968 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      12:57:44,968 ERROR [STDERR] at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
      12:57:44,968 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      12:57:44,968 ERROR [STDERR] at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:78)
      12:57:44,968 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      12:57:44,984 ERROR [STDERR] at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
      12:57:44,984 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      12:57:44,984 ERROR [STDERR] at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
      12:57:44,984 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      12:57:44,984 ERROR [STDERR] at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:227)
      12:57:44,984 ERROR [STDERR] at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:59)
      12:57:44,984 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      12:57:44,984 ERROR [STDERR] at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:102)
      12:57:44,984 ERROR [STDERR] at $Proxy67.sayHello(Unknown Source)
      12:57:44,984 ERROR [STDERR] at TestServlet.doPost(TestServlet.java:79)
      12:57:44,984 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      12:57:44,984 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      12:57:44,984 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
      12:57:44,984 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      12:57:44,984 ERROR [STDERR] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      12:57:44,984 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      12:57:44,984 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      12:57:44,984 ERROR [STDERR] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      12:57:44,984 ERROR [STDERR] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
      12:57:44,984 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
      12:57:44,984 ERROR [STDERR] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
      12:57:44,984 ERROR [STDERR] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
      12:57:44,984 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
      12:57:44,984 ERROR [STDERR] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
      12:57:44,984 ERROR [STDERR] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
      12:57:44,984 ERROR [STDERR] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
      12:57:44,984 ERROR [STDERR] at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
      12:57:44,984 ERROR [STDERR] at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
      12:57:44,984 ERROR [STDERR] at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
      12:57:44,984 ERROR [STDERR] at java.lang.Thread.run(Unknown Source)
      12:57:44,984 ERROR [STDERR] Caused by: Exception [TOPLINK-7060] (Oracle TopLink Essentials - 2.0 (Build b41-beta2 (03/30/2007))): oracle.toplink.essentials.exceptions.ValidationException
      Exception Description: Cannot acquire data source [java:/system].
      Internal Exception: javax.naming.InvalidNameException: Not a compound name: system
      12:57:44,984 ERROR [STDERR] at oracle.toplink.essentials.exceptions.ValidationException.cannotAcquireDataSource(ValidationException.java:358)
      12:57:44,984 ERROR [STDERR] at oracle.toplink.essentials.jndi.JNDIConnector.connect(JNDIConnector.java:120)
      12:57:44,984 ERROR [STDERR] at oracle.toplink.essentials.sessions.DatasourceLogin.connectToDatasource(DatasourceLogin.java:170)
      12:57:44,984 ERROR [STDERR] at oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:537)
      12:57:44,984 ERROR [STDERR] at oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:206)
      12:57:44,984 ERROR [STDERR] at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:212)
      12:57:44,984 ERROR [STDERR] ... 56 more
      12:57:44,984 ERROR [STDERR] Caused by: javax.naming.InvalidNameException: Not a compound name: system
      12:57:44,984 ERROR [STDERR] at javax.naming.CompoundName.addAll(Unknown Source)
      12:57:44,984 ERROR [STDERR] at org.jnp.interfaces.NamingContext.composeName(NamingContext.java:905)
      12:57:44,984 ERROR [STDERR] at org.jnp.interfaces.NamingContext.getAbsoluteName(NamingContext.java:1464)
      12:57:44,984 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:618)
      12:57:44,984 ERROR [STDERR] at javax.naming.InitialContext.lookup(Unknown Source)
      12:57:44,984 ERROR [STDERR] at oracle.toplink.essentials.jndi.JNDIConnector.connect(JNDIConnector.java:114)
      12:57:44,984 ERROR [STDERR] ... 60 more
      12:57:45,000 INFO [STDOUT] Finished Transaction
      ---------------------------------------------------------------------------------




      ** Please can u tell where the problem is . I am calling this stateless bean from a servlet .

        • 1. Re: Can a Stateless bean make a call to an entity bean to pe
          oskar.carlstedt

          Hi!

          It seems like JBoss can't find your datasource. It also looks like you are using toplink, are you? The example bellow is for the normal JBoss EJB3 (on top of Hibernate). Anyway, the configuration shall still be the same (please correct me if I'm wrong) except some of the properties in persistence.xml.

          So, you shall have a persistence.xml file packed with your ejb-jar-file. The file looks something like (the example is using MySQL-dialect. You shall probably use the Oracle dialect):

          <persistence xmlns="http://java.sun.com/xml/ns/persistence"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
           http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
           version="1.0">
           <persistence-unit name="my-ejbs">
           <jta-data-source>
           <!--
           THIS NAME SHALL MAP AGAINST THE JNDI-NAME OF YOUR DATA SOURCE FILE
           -->
           java:/service-fundorder-DS
           </jta-data-source>
           <properties>
           <property name="show_sql" value="true" />
           <property name="dialect"
           value="org.hibernate.dialect.MySQLDialect" />
           </properties>
           </persistence-unit>
          </persistence>
          


          Then you must deploy a data-source-file that defines the connection to the database. The filename must end with -ds.xml, e.g. my-service.ds.xml This file looks something like (also MySQL). THere are plenty of such example files in the JBoss distro under docs/examples/jta:
          <?xml version="1.0" encoding="UTF-8"?>
          <datasources>
           <local-tx-datasource>
          
           <!--
           JNDI NAME OF DATA SOURCE - THIS NAME IS MAPPED IN PERSISTENCE.XML IN YOUR EAR FILE
           -->
           <jndi-name>my-service-DS</jndi-name>
          
           <!--
           Connect parameters
           -->
           <connection-url>
           jdbc:${jdbc.vendor}://${db.host}:${db.port}/${db.name}
           </connection-url>
           <user-name>${db.username}</user-name>
           <password>${db.password}</password>
           <driver-class>${jdbc.driverclass}</driver-class>
          
           <!--
           Minimum and maximum poolsize
           -->
           <min-pool-size>0</min-pool-size>
           <max-pool-size>5</max-pool-size>
          
           <!--
           No of minutes in idle state until connection is destroyed
           -->
           <idle-timeout-minutes>1</idle-timeout-minutes>
          
           <!--
           Class used to detect if connection is valid or not. Using MySQL, this
           class shall only be used on drivers after 3.22.1 with "ping" support
           -->
           <valid-connection-checker-class-name>
           org.jboss.resource.adapter.jdbc.vendor.MySQLValidConnectionChecker
           </valid-connection-checker-class-name>
          
           <!--
           Class used when sorting exceptions
           -->
           <exception-sorter-class-name>
           org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter
           </exception-sorter-class-name>
          
          
           <!--
           corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional)
           -->
           <metadata>
           <type-mapping>mySQL</type-mapping>
           </metadata>
           </local-tx-datasource>
          </datasources>
          


          Kind regards
          //Oskar

          • 2. Re: Can a Stateless bean make a call to an entity bean to pe
            oskar.carlstedt

            Sorry, now thing got messed up here. We take the examples once again. Look at the JNDI-names. These got messed in the previous post.

            //Oskar

            persistence.xml

            <persistence xmlns="http://java.sun.com/xml/ns/persistence"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
             http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
             version="1.0">
             <persistence-unit name="my-ejbs">
             <jta-data-source>
             <!--
             THIS NAME SHALL MAP AGAINST THE JNDI-NAME OF
             YOUR DATA SOURCE FILE
             -->
             java:/my-service-DS
             </jta-data-source>
             <properties>
             <property name="show_sql" value="true" />
             <property name="dialect"
             value="org.hibernate.dialect.MySQLDialect" />
             </properties>
             </persistence-unit>
            </persistence>
            


            my-service-ds.xml
            <?xml version="1.0" encoding="UTF-8"?>
            <datasources>
             <local-tx-datasource>
            
             <!--
             JNDI NAME OF DATA SOURCE -
             THIS NAME IS MAPPED IN PERSISTENCE.XML IN YOUR EAR FILE
             -->
             <jndi-name>my-service-DS</jndi-name>
            
             <!--
             Connect parameters
             -->
             <connection-url>
             jdbc:${jdbc.vendor}://${db.host}:${db.port}/${db.name}
             </connection-url>
             <user-name>${db.username}</user-name>
             <password>${db.password}</password>
             <driver-class>${jdbc.driverclass}</driver-class>
            
             <!--
             Minimum and maximum poolsize
             -->
             <min-pool-size>0</min-pool-size>
             <max-pool-size>5</max-pool-size>
            
             <!--
             No of minutes in idle state until connection is destroyed
             -->
             <idle-timeout-minutes>1</idle-timeout-minutes>
            
             <!--
             Class used to detect if connection is valid or not. Using MySQL, this
             class shall only be used on drivers after 3.22.1 with "ping" support
             -->
             <valid-connection-checker-class-name>
             org.jboss.resource.adapter.jdbc.vendor.MySQLValidConnectionChecker
             </valid-connection-checker-class-name>
            
             <!--
             Class used when sorting exceptions
             -->
             <exception-sorter-class-name>
             org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter
             </exception-sorter-class-name>
            
            
             <!--
             corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional)
             -->
             <metadata>
             <type-mapping>mySQL</type-mapping>
             </metadata>
             </local-tx-datasource>
            </datasources>
            
            



            • 3. Re: Can a Stateless bean make a call to an entity bean to pe
              ashusri000

              Hi oskar.carlstedt,

              First of all thanks a lot for your reply .
              Yes , I am using toplink here and I have already got the clue for ds.xml file but I want to where I should be putting this ds.xml file :
              1.Should I pack it in the ear file along with the persistence.xml file

              OR
              2. I should put it in the deploy directory directly , i.e. outside the ear file .


              Expecting a relief soon from you .


              Regards

              • 4. Re: Can a Stateless bean make a call to an entity bean to pe
                ashusri000

                TO further add to the things I had already put the ds.xml file in the deploy directory but it when I go to access the entity it throws up this error :

                Internal Exception: javax.naming.InvalidNameException: Not a compound name: my-ejb-test
                16:05:48,312 ERROR [STDERR] at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:220)
                16:05:48,312 ERROR [STDERR] at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.getServerSession(EntityManagerFactoryImpl.


                Moreover in deploying this ear it throws this warning :

                16:10:13,921 INFO [STDOUT] [TopLink Warning]: 2007.06.27 04:10:13.906--java.lang.NullPointerException: null was thrown on attempt of PersistenceLoadProcessor to load class src.FirstSessionBean. The class is ignored.
                16:10:13,921 INFO [STDOUT] [TopLink Warning]: 2007.06.27 04:10:13.921--java.lang.NullPointerException: null was thrown on attempt of PersistenceLoadProcessor to load class com.hughes.testEjb.TestClient. The class is ignored.
                16:10:13,921 INFO [STDOUT] [TopLink Warning]: 2007.06.27 04:10:13.921--java.lang.NullPointerException: null was thrown on attempt of PersistenceLoadProcessor to load class src.Employee. The class is ignored.
                16:10:13,921 INFO [STDOUT] [TopLink Warning]: 2007.06.27 04:10:13.921--java.lang.NullPointerException: null was thrown on attempt of PersistenceLoadProcessor to load class src.FirstSession. The class is ignored.



                My ds.xml is :

                <?xml version="1.0" encoding="UTF-8"?>

                <!-- ===================================================================== -->
                <!-- -->
                <!-- JBoss Server Configuration -->
                <!-- -->
                <!-- ===================================================================== -->

                <!-- $Id: oracle-xa-ds.xml,v 1.13 2004/09/15 14:37:40 loubyansky Exp $ -->

                <!-- ===================================================================== -->
                <!-- ATTENTION: DO NOT FORGET TO SET Pad=true IN transaction-service.xml -->
                <!-- ===================================================================== -->


                <local-tx-datasource>
                <jndi-name>my-ejb-test</jndi-name>
                <connection-url>jdbc:oracle:thin:@127.0.0.1:1521:XE</connection-url>
                <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
                <user-name>system</user-name>
                ashu
                <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter
                </exception-sorter-class-name>

                <type-mapping>Oracle9i</type-mapping>

                </local-tx-datasource>


                My persistent.xml is :

                <?xml version="1.0" encoding="UTF-8"?>
                <persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
                <persistence-unit name="testApp" transaction-type="JTA">
                oracle.toplink.essentials.PersistenceProvider
                <jta-data-source>java:/my-ejb-test</jta-data-source>


                </persistence-unit>




                • 5. Re: Can a Stateless bean make a call to an entity bean to pe
                  oskar.carlstedt

                  Hi!

                  The datasource file has its own deployment, so this file shall be put directly in the deploy folder. When doing this you'll see JBoss deploying the ds file. After the deloyment (takes a second or two) you can find the deployed datasource in the jmx-console (http://localhost:8080/jmx-console).

                  In the jmx-console you shall be able to find a local transaction source, a connection pool etc. All these are are named from jndi-name in your ds.xml-file.

                  The persitence.xml file shall be bundled in the classpath of the jar file containing your ejbs.

                  The error you get must, as far as I can see, be due to an incorrect deployment of the ds-file. What if you only deploy the ds-file? Do get any errors? Can you see the deployed datasource in the jmx console?

                  Best
                  //Oskar


                  • 6. Re: Can a Stateless bean make a call to an entity bean to pe

                    Why are you using TopLink?

                    Regards

                    Felix

                    • 7. Re: Can a Stateless bean make a call to an entity bean to pe
                      ashusri000

                      Hi !
                      I am able to get the datasource being properly deployed and able to see it at the server console also. There is no error so far with this part . But when I go for deployment of the entity bean then it shows an error that this jndi name is not a compound name and then the call to the entity also fails .

                      I had already put the ds.xml file in the deploy directory but it when I go to access the entity it throws up this error :

                      Internal Exception: javax.naming.InvalidNameException: Not a compound name: my-ejb-test
                      16:05:48,312 ERROR [STDERR] at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:220)
                      16:05:48,312 ERROR [STDERR] at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.getServerSession(EntityManagerFactoryImpl.



                      And the question about using Toplink , I mean since I am not using hibernate that's why I am making use of toplink jars for persisietnce .

                      • 8. Re: Can a Stateless bean make a call to an entity bean to pe
                        oskar.carlstedt

                        Hello again!

                        If your datasource is correctly deployed, then I don't know. It might be a TopLink issue. This is the way to deploy a EJB3 jar file and connect it to a datasource.

                        When using EJB3 and JPA you are not using Hibernate directly. You are using JPA, which JBoss in turn maps to Hibernate. You don't have to care about the implementation of JPA. JBoss choose Hibernate, Glassfish choose TopLink, but they are all doing the same thing. The whole idéa is that you don't have to care about the underlying mechanism/implementation.

                        So, if you are using pure JPA, then you should go for the standard behaviour of the apllication server's implementation. On the other hand, if you are using special features of for example TopLink, or if you aren't satisfied with the standard implementation (in this case Hibernate), then of course you should go for TopLink if you find TopLink solve your problems.


                        Kind regards
                        Oskar

                        • 9. Re: Can a Stateless bean make a call to an entity bean to pe
                          oskar.carlstedt

                          Hi again!

                          Good news! Take a look at this post on another forum http://forums.oracle.com/forums/thread.jspa?threadID=244914

                          //Oskar

                          • 10. Re: Can a Stateless bean make a call to an entity bean to pe
                            ashusri000

                            Hi ,
                            thanks for the response but I had already been to this page with this exception and if you take a look at the code that is given there then you will notice that they have used a variable by the name mySession which they have provided no reference for as how did they implemented or referenced it.
                            I mean they didn't instantiate it and have made a direct use of it in the code .

                            This again hangs me back .

                            Regards

                            • 11. Re: Can a Stateless bean make a call to an entity bean to pe

                              Is it possible that Toplink requires resource references as per EJB spec?

                              Regards

                              Felix