Announcement Announcement Module
Collapse
No announcement yet.
Return Value from Remote Bean Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Return Value from Remote Bean

    I am invoking a Stateless Session Remote EJB to retrieve an arrayList .

    The program is successfully invoking the EJB and the ejb logs display the result returned, but the return parameter is never retrieved.


    Am I missing something ?
    Is there any other configuration that I need to do besides this...

    applicationContext.xml
    <bean id="imgInterface"
    class="org.springframework.ejb.access.SimpleRemote StatelessSessionProxyFactoryBean"
    lazy-init="true" autowire="default" dependency-check="default">
    <property name="jndiName"
    value="cell/clusters/TestCluster/ejb/ImgInterface" />
    <property name="jndiTemplate">
    <ref bean="jndiEnviroment" />
    </property>
    <property name="businessInterface"
    value="com.test.ejb.img.ImgInterface" />
    <property name="resourceRef">
    <value>false</value>
    </property>
    </bean>


    This is the code
    ArrayList imgList = new ArrayList();
    ImgInterface imgInterfaceBean = (ImgInterface)context.getBean("imgInterface");
    imgList = imgInterfaceBean.getImgList() ;

    I can't invoke any lines after calling the getImgList().


    Thanks.

  • #2
    This is the ejb-jar.xml that I have included in Spring Project.
    Do I need to load it in code using ClassPathXmlApplicationContext ?

    Really not sure, what else can I do to get the return value.. from the EJB..

    Please Help......
    Very urgent.



    <ejb-jar id="ejb-jar_ID">
    <display-name>ImgInterface</display-name>

    <enterprise-beans> <session id="ImgInterface">
    <ejb-name>ImgInterface</ejb-name>
    <home>com.test.ejb.img.ImgInterfaceHome</home>
    <remote>com.test.ejb.img.ImgInterface</remote>
    <ejb-class>ccom.test.ejb.img.ImgInterfaceBean</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Container</transaction-type>
    </session>
    </enterprise-beans>

    <assembly-descriptor>
    <container-transaction>
    <method>
    <ejb-name>ImgInterface</ejb-name>
    <method-name>*</method-name>
    </method>
    <trans-attribute>NotSupported</trans-attribute>
    </container-transaction>
    </assembly-descriptor>
    </ejb-jar>

    Comment


    • #3
      What you posted so far seems ok. It seems that the execution of your method is the problem. How does the implementation of getImgList() look like?

      Comment


      • #4
        The imgList() retrieves images from backened.

        There are no errors thrown during the execution of this method and the logs show that its returning an image in the arraylist.

        The ejb is deployed on remote machine and is already in prod.

        I have included ejb-jar.xml in WEB-INF directory, but havent provided any reference to load it.

        Do I need to do that?

        Comment


        • #5
          Originally posted by springframework View Post
          The imgList() retrieves images from backened.

          There are no errors thrown during the execution of this method and the logs show that its returning an image in the arraylist.
          Serverside logs? Are they produced inside the EJB?

          Originally posted by springframework View Post
          The ejb is deployed on remote machine and is already in prod.
          And it works when accessing it from a non-spring client under same circumstances?

          If yes: Could you try to debug the invocation from the spring-based client to find out at which point the execution hangs?

          Originally posted by springframework View Post
          I have included ejb-jar.xml in WEB-INF directory, but havent provided any reference to load it.

          Do I need to do that?
          No. ejb-jar.xml does not belong there and you do not need to handle it yourself. This is done by the application server upon deployment.

          Regards,
          Andreas

          Comment


          • #6
            Yes, serverside logs are produced inside the EJB.

            Works perfect from a non spring client

            Comment


            • #7
              I tried invoking the EJB using traditional JNDI lookup.

              I am able to get pass through the getImgList() method, no errors on server or local.

              However it always returns null, although the EJB returns an ArrayList of size 1.

              Comment


              • #8
                So the value to return is an ArrayList, but the client receives null? There seems to be some remoting issue here. Double check the serverside logs. Sometimes there is more than one log file which might reveal helpful informations.

                Comment

                Working...
                X