Results 1 to 8 of 8

Thread: Return Value from Remote Bean

  1. #1

    Default 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. #2

    Default

    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>

  3. #3
    Join Date
    Aug 2004
    Posts
    2,715

    Default

    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?

  4. #4

    Default

    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?

  5. #5
    Join Date
    Aug 2004
    Posts
    2,715

    Default

    Quote 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?

    Quote 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?

    Quote 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

  6. #6

    Default

    Yes, serverside logs are produced inside the EJB.

    Works perfect from a non spring client

  7. #7

    Default

    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.

  8. #8
    Join Date
    Aug 2004
    Posts
    2,715

    Default

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •