0 Replies Latest reply on Jun 29, 2016 6:27 PM by Leonardo Oporto

    Jboss-ejb3.xml cannot setup

    Leonardo Oporto Newbie

      Hi community,

      I am kind a new using Jboss/wildfly

       

      I am trying to invoke a remote stateless ejb from another ejb developed in another JBOSS instance.

       

      I can make the lookup if I try to do something like Object ref = lookupObject(beanAddress)

      but when I try to cast to my remote class (called TestInterface) with  PortableRemoteObject.narrow(ref, TestInterface.class);

      there is an error message that cannot find the TestInterface class.

       

      I am trying to use jboss-ejb3.xml to specify the remote class info, but I cannot find the correct Info.

       

      When I deploy the server where is the EJB I am trying to connect with, this is the info I get

       

      java:global/server-side/TestBean!oporto.api.TestInterface

              java:app/server-side/TestBean!oporto.api.TestInterface

              java:module/TestBean!oporto.api.TestInterface

              java:jboss/exported/server-side/TestBean!oporto.api.TestInterface

              java:global/server-side/TestBean

              java:app/server-side/TestBean

              java:module/TestBean

       

       

      The content of the jboss-ejb3.xml is

       

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

      <jboss:ejb-jar xmlns:jboss="http://www.jboss.com/xml/ns/javaee"

                     xmlns="http://java.sun.com/xml/ns/javaee"

                     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                     xmlns:c="urn:clustering:1.0"

                     xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee http://www.jboss.org/j2ee/schema/jboss-ejb3-2_0.xsd http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd"

                     version="3.1"

                     impl-version="2.0">

          <jboss:enterprise-beans>

              <jboss:ejb>

                  <ejb-name>TestBean</ejb-name>

                  <resource-ref>

                      <res-ref-name>exported/server-side</res-ref-name>

                      <lookup-name>java:jboss/exported/server-side</lookup-name>

                  </resource-ref>

                  </jboss:ejb>

          </jboss:enterprise-beans>

      </jboss:ejb-jar>

       

      I am not sure What I am doing bad.

       

       

      From client side (from the EJB I am trying to invoke the TestBean), I use this string for the lookup:

            String beanAddress = "ejb:/TestBean!oporto.api.TestInterface";

      and seems to work, since when I do the

           Object ref = lookupObject(beanAddress)

      I am getting an instance of an object. As I said, the problem is at the moment of making the cast since there is an error message that cannot find the TestBean class and I cannot make the jboss-ejb3.xml that as I understand, should resolve this.

       

       

       

      Any help is welcome.

      Thanks!