9 Replies Latest reply on Apr 25, 2015 6:57 AM by vatsanm

    Is it possible to make an EJB 2.x call from AS 7.1.1 to 4.2.2?

    vatsanm

      Is it possible to make EJB calls from an EJB client on AS 7.1.1 into a EJB provider running on AS 4.2.2?

      If so how?  I looked at some examples but they seem to be goign the other direction.

        • 1. Re: Is it possible to make an EJB 2.x call from AS 7.1.1 to 4.2.2?
          wdfink

          As AS7 is different from the classes you might add the jbossall-client.jar to your application.

          Or you can add the jar as module an set a dependency in the MANIFEST of your deployment.

          • 2. Re: Is it possible to make an EJB 2.x call from AS 7.1.1 to 4.2.2?
            vatsanm

            Thx for the response, but I still for the same connection error as before.

             

            I added jbossall-client.jar  to the application WEB-INF/lib directory but did nto change the manifest or the deployment structure file. when I resarted the AS srer, I got the exception below. My jndi name is "wfm/ETMImpl/http". I did nor prefix "ejb:" or "java:".

             

            17:35:21,665 ERROR [org.jboss.remoting.remote.connection] (Remoting "etmregular1" read-1) JBREM000200: Remote connection failed: java.io.IOException: Received an invalid message length of -1393754107
            17:35:21,669 ERROR [stderr] (ajp-localhost-127.0.0.1-12001-1) java.lang.IllegalStateException: No EJB receiver available for handling [appName:wfm,modulename:wfm,distinctname:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@7c824e
            17:35:21,671 ERROR [stderr] (ajp-localhost-127.0.0.1-12001-1)   at org.jboss.ejb.client.EJBClientContext.requireEJBReceiver(EJBClientContext.java:584)
            17:35:21,673 ERROR [stderr] (ajp-localhost-127.0.0.1-12001-1)   at org.jboss.ejb.client.ReceiverInterceptor.handleInvocation(ReceiverInterceptor.java:119)
            17:35:21,674 ERROR [stderr] (ajp-localhost-127.0.0.1-12001-1)   at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:181)
            17:35:21,675 ERROR [stderr] (ajp-localhost-127.0.0.1-12001-1)   at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:136)
            17:35:21,676 ERROR [stderr] (ajp-localhost-127.0.0.1-12001-1)   at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:121)
            17:35:21,677 ERROR [stderr] (ajp-localhost-127.0.0.1-12001-1)   at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:104)
            17:35:21,678 ERROR [stderr] (ajp-localhost-127.0.0.1-12001-1)   at $Proxy50.getMdnsForPendingOrders(Unknown Source)
            17:35:21,679 ERROR [stderr] (ajp-localhost-127.0.0.1-12001-1)   at client.EJBClient.getWfmUpgradePendingLines(Unknown Source)
            17:35:21,681 ERROR [stderr] (ajp-localhost-127.0.0.1-12001-1)   at coei.webstore.PendingLinesServlet.getUpgradePendingLines(PendingLinesServlet.java:371)
            17:35:21,682 ERROR [stderr] (ajp-localhost-127.0.0.1-12001-1)   at coei.webstore.PendingLinesServlet.coreOrderProcessing(PendingLinesServlet.java:222)
            17:35:21,683 ERROR [stderr] (ajp-localhost-127.0.0.1-12001-1)   at coei.webstore.BaseServlet.doPost(BaseServlet.java:443)
            17:35:21,684 ERROR [stderr] (ajp-localhost-127.0.0.1-12001-1)   at javax.servlet.http.HttpServlet.service(HttpServlet.java:754)
            17:35:21,685 ERROR [stderr] (ajp-localhost-127.0.0.1-12001-1)   at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
            17:35:21,686 ERROR [stderr] (ajp-localhost-127.0.0.1-12001-1)   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329)
            17:35:21,688 ERROR [stderr] (ajp-localhost-127.0.0.1-12001-1)   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
            17:35:21,689 ERROR [stderr] (ajp-localhost-127.0.0.1-12001-1)   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)
            17:35:21,690 ERROR [stderr] (ajp-localhost-127.0.0.1-12001-1)   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
            17:35:21,691 ERROR [stderr] (ajp-localhost-127.0.0.1-12001-1)   at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153)
            17:35:21,693 ERROR [stderr] (ajp-localhost-127.0.0.1-12001-1)   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)
            17:35:21,694 ERROR [stderr] (ajp-localhost-127.0.0.1-12001-1)   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
            17:35:21,695 ERROR [stderr] (ajp-localhost-127.0.0.1-12001-1)   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

            17:35:21,696 ERROR [stderr] (ajp-localhost-127.0.0.1-12001-1)   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368)
            17:35:21,697 ERROR [stderr] (ajp-localhost-127.0.0.1-12001-1)   at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:505)
            17:35:21,698 ERROR [stderr] (ajp-localhost-127.0.0.1-12001-1)   at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:445)
            17:35:21,700 ERROR [stderr] (ajp-localhost-127.0.0.1-12001-1)   at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930)
            17:35:21,701 ERROR [stderr] (ajp-localhost-127.0.0.1-12001-1)   at java.lang.Thread.run(Thread.java:662)
            17:35:21,702 INFO  [stdout] (ajp-localhost-127.0.0.1-12001-1) EJBClient|getUpgradePendingLines|INFO|15|DEFAULT|Thu May 17 17:35:20 EDT 2012|ajp-localhost-127.0.0.1-12001-1|Error in calling WFM upgrade pending line API::java.lang.IllegalStateException: No EJB receiver available for handling [appName:wfm,modulename:wfm,distinctname:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@7c824e|

             

             

            • 3. Re: Is it possible to make an EJB 2.x call from AS 7.1.1 to 4.2.2?
              wdfink

              That looks like that the EJB client of AS7 is used, but you need to use the client code of AS4, so how does your code looks like?

              Do you use a mix of AS7 EJBs and AS4 EJBs in your webapp?

              • 4. Re: Is it possible to make an EJB 2.x call from AS 7.1.1 to 4.2.2?
                vatsanm

                No, I do not want to mix AS7 EJBs and AS4 EJBs in your webapp.  I run as an EJB client so its one or the other.  Sorry , I couldnt do a better job in formatting code.  My plan is to deploy my app on JB 71.1.1 adn the provider run on JB 4.2.2 and when the provider is ready to convert both to be in JB7.1.1.

                 

                Here is my setup.

                 

                jbossall-client.jar - <myapp>/WEB-INF/lib <-- sum link pointing to JB 4.2.2/client

                 

                jboss-deployment-structure.xml - <myapp>/WEB-INF/lib

                <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0">
                    <!-- Make sub deployments isolated by default, so they cannot see each others classes without a Class-Path entry -->
                    <deployment>
                        <exclusions>
                            <module name="org.hibernate"/>
                            <module name="org.jboss.ejb-client"/>  <!-- I added this line -->
                        </exclusions>

                        <dependencies>
                            <module name="org.apache.log4j" export="true"/></dependencies>

                        <resources></resources>

                    </deployment>
                </jboss-deployment-structure>

                 

                EJBClient.java

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                public

                 

                 

                 

                 

                class EJBClient

                {

                 

                     static ETMInterface myInterface = null;

                 

                 

                static String resourceBundleName = "wiab";

                 

                public static String PROVIDER_URL;

                 

                public static String JNDI_NAME;

                 

                private static boolean USE_JB7 = false;

                 

                static String host = null;

                 

                static boolean ejbObjFound = false;

                 

                static boolean exceptionFound = false;

                 

                static ErrorLog er = new ErrorLog("EJBClient");

                 

                 

                static

                {

                 

                 

                     try

                      {

                     ResourceBundle bundle = ResourceBundleFactory.getBundle(resourceBundleName);

                 

                 

                     PROVIDER_URL = bundle.getString("ejb.providerUrl");

                 

                     JNDI_NAME = bundle.getString("ejb.JndiName"

                );

                     String tempStr = bundle.getString("ejb.UseJB7"

                );

                 

                 

                     if(tempStr != null && tempStr.equalsIgnoreCase("TRUE") == true)

                 

                          USE_JB7 = true;

                 

                     else

                 

                 

                          USE_JB7 = false;

                 

                     er.Logit("EJBClient", "Provider urls=>" + PROVIDER_URL);

                 

                     er.Logit("EJBClient", "JNDI name=>" + JNDI_NAME);

                 

                     er.Logit("EJBClient", "Use JB7 Enabled: [" + tempStr + "]");

                }

                catch (Exception e)

                {

                     e.printStackTrace();

                 

                     er.Info("EJBClient", "Problem getting data from Resource bundle" + e);

                 

                     er.Critical("EJBClient", "Problem getting data from Resource bundle");

                }

                 

                init();

                }

                 

                 

                 

                synchronized static void init()

                {

                 

                 

                     if (ejbObjFound == false)

                     {

                          try

                 

                          {

                 

                               // Initialize EJB object

                 

                 

                               myInterface = (ETMInterface) EJBClient.lookup(PROVIDER_URL, JNDI_NAME);//"wfm/ETMImpl/socket");

                 

                 

                               er.Logit("init", "EJB object(myInterface) : " + myInterface

                );

                          }

                 

                     catch (javax.naming.NamingException e)

                     {

                          e.printStackTrace();

                 

                          exceptionFound = true;

                 

                          er.Info("init", "Problem finding ETMImpl object/connecting to wfm server"+ e);

                 

                          er.Critical("init", "Problem finding ETMImpl object/connecting to wfm server"

                );

                     }

                 

                     catch (Exception e)

                     {

                          e.printStackTrace();

                 

                          exceptionFound = true;

                 

                          er.Info("init", "Problem intializing JNDI object" + e);

                 

                          er.Critical("init", "Problem intializing JNDI object");

                     }

                 

                     finally

                      {

                 

                          if (myInterface != null || !exceptionFound)

                           {

                               ebObjFound = true   ;

                 

                     erLogit("init", "exceptionFound flag/ejbObjFound flag : "+ exceptionFound + "/" + ejbObjFound);

                     er.Logit("init", "EJB object - myInterface : " + myInterface);

                          }

                     }

                }

                 

                public

                 

                static InitialContext createInitialContext(String providerUrl) throws NamingException

                {

                     Hashtable<String, String> icProperties =

                new Hashtable<String, String>();

                 

                 

                public

                static Long getWfmPendingLinesCount(String accountNo) {

                 

                er.Logit("getWfmPendingLinesCount", "In getWfmPendingLinesCount...");

                 

                Long numberOfLines =

                new Long(0);// 0L

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                try

                {

                 

                if (ejbObjFound == false

                ) {

                 

                er.Logit("getWfmPendingLinesCount", "getWfmPendingLinesCount::EJB object not found, intializing again"

                );

                init();

                }

                 

                // else{

                 

                if (myInterface != null

                ) {

                numberOfLines =

                myInterface

                .getPendingLines(accountNo.trim());

                 

                er.Logit("getWfmPendingLinesCount", "No of pending lines::"

                + numberOfLines);

                }

                else

                {

                 

                er.Logit("getWfmPendingLinesCount", "myInterface object not intialized::::" + myInterface

                );

                numberOfLines =

                new

                Long(0);

                 

                er.Logit("getWfmPendingLinesCount", "# of pending lines::"

                + numberOfLines);

                }

                 

                // }

                }

                catch

                (Exception e) {

                 

                if (e.toString().indexOf("java.lang.RuntimeException"

                ) >= 0) {

                 

                ejbObjFound = false

                ;

                init();

                //10070

                }

                numberOfLines =

                new

                Long(0);

                e.printStackTrace();

                 

                er.Info("getWfmPendingLinesCount", "Error in calling WFM pending line API::"

                + e);

                 

                er.Critical("getWfmPendingLinesCount", "Error in calling WFM pending line API"

                );

                }

                 

                return

                numberOfLines;

                }

                 

                 

                 

                     if(USE_JB7 == true)

                     {

                       icProperties.put(javax.naming.Context.

                URL_PKG_PREFIXES, "org.jboss.ejb.client.naming"); //JB7 specific

                 

                 

                 

                 

                //icProperties.put("jboss.naming.client.ejb.context", "true");

                 

                //icProperties.put(Context.SECURITY_PRINCIPAL, "user");

                 

                //icProperties.put(Context.SECURITY_CREDENTIALS, "userPassword");

                     }

                 

                    else

                   {

                        icProperties.put(

                "java.naming.provider.url", providerUrl);

                        icProperties.put(

                "java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");

                   }

                 

                   return new InitialContext(icProperties);

                }

                 

                 

                 

                public static Object lookup(String providerUrl, String name) throws NamingException

                {

                  InitialContext ic =

                null;

                 

                 

                  try

                  {

                       ic = createInitialContext(providerUrl);

                 

                       final String appName = "wfm";

                 

                      final String moduleName = "wfm"; //JB7 specific

                 

                     final String distinctName = ""; //JB7 specific

                 

                 

                // The EJB name which by default is the simple class name of the bean implementation class

                 

                //final String beanName = EJBClient.class.getSimpleName(); //JB7 specific

                 

                    final String beanName = "ETMImpl"; //JB7 specific

                 

                 

                //final String viewClassName = "com.vzw.wfm.server.etm.ETMInterface";

                 

                    final String viewClassName = com.vzw.wfm.server.etm.ETMInterface.class.getName();

                 

                   er.Logit("lookup", "Initial context created:::>" + ic);

                 

                    er.Logit("lookup", "JNDI created:::> ejb:" + appName + "/" + moduleName + "/" + distinctName + "/" + beanName + "!"
                + viewClassName);

                   String jndiName =

                "ejb:" + appName + "/" + moduleName + "/" + distinctName + "/" + beanName + "!" + viewClassName;

                 

                        er.Logit("lookup", "JNDI2 created:::> " + jndiName);

                 

                   if(USE_JB7 != true)

                {

                 

                er.Logit("lookup", "EJBClient Using JB4");

                 

                return ic.lookup(name); //JB4.2.2

                }

                 

                else

                {

                 

                //return(ic.lookup("ejb:" + appName + "/" + moduleName + "/" + distinctName + "/" + beanName + "!"

                 

                //+ viewClassName)); //JB7 specific

                 

                er.Logit("lookup", "Using JB7");

                 

                if(name.contains("ejb:") == true)

                {

                 

                er.Logit("lookup", "EJBClient Using JB7 - JNDI Properties-" + name);

                 

                return(ic.lookup(name));

                }

                 

                else

                {

                 

                er.Logit("lookup", "EJBClient Using JB7 - JNDI Name-" + jndiName);

                 

                er.Logit("lookup", "EJBClient Using JB7 - Also JNDI Properties-" + name);

                 

                //return(ic.lookup(jndiName)); - testing fix - do not check in

                 

                return(ic.lookup(name));

                }

                }

                }

                 

                finally

                {

                 

                if (ic != null)

                {

                ic.close();

                }

                }

                }

                 

                 

                          }

                 

                 

                • 5. Re: Is it possible to make an EJB 2.x call from AS 7.1.1 to 4.2.2?
                  vatsanm

                  here is the stacktrace when I did the above change.

                   

                  09:19:52,740 INFO  [stdout] (MSC service thread 1-13) EJBClient|lookup|INFO|15|DEFAULT|Fri May 18 09:19:52 EDT 2012|MSC service thread 1-13|EJBClient Using JB7 - JNDI Name-ejb:wfm/wfm//ETMImpl!com.vzw.wfm.server.etm.ETMInterface|
                  09:19:52,743 INFO  [stdout] (MSC service thread 1-13) EJBClient|lookup|INFO|15|DEFAULT|Fri May 18 09:19:52 EDT 2012|MSC service thread 1-13|EJBClient Using JB7 - Also JNDI Properties-java:wfm/ETMImpl/http|
                  09:19:52,964 ERROR [stderr] (MSC service thread 1-13) java.lang.IllegalStateException: Failed to find method for hash:-790108502850547550 available={-8107796390111393345=public abstract void org.jnp.interfaces.Naming.unbind(javax.naming.Name) throws javax.naming.NamingException,java.rmi.RemoteException, 7733619496521189953=public abstract java.io.Serializable org.jboss.ha.framework.interfaces.HAPartition$HAPartitionStateTransfer.getCurrentState(), -5642140585403320990=public abstract java.util.Collection org.jnp.interfaces.Naming.listBindings(javax.naming.Name) throws javax.naming.NamingException,java.rmi.RemoteException, -4221607359560216057=public abstract java.util.Collection org.jnp.interfaces.Naming.list(javax.naming.Name) throws javax.naming.NamingException,java.rmi.RemoteException, -6149798079139202860=public abstract void org.jnp.interfaces.Naming.bind(javax.naming.Name,java.lang.Object,java.lang.String) throws javax.naming.NamingException,java.rmi.RemoteException, 6991977298034536864=public abstract void org.jboss.ha.framework.interfaces.HAPartition$HAPartitionStateTransfer.setCurrentState(java.io.Serializable), -5717908715153450081=public abstract void org.jnp.interfaces.Naming.rebind(javax.naming.Name,java.lang.Object,java.lang.String) throws javax.naming.NamingException,java.rmi.RemoteException, -7286638714004764603=public abstract javax.naming.Context org.jnp.interfaces.Naming.createSubcontext(javax.naming.Name) throws javax.naming.NamingException,java.rmi.RemoteException, -884175917852741154=public abstract java.lang.Object org.jnp.interfaces.Naming.lookup(javax.naming.Name) throws javax.naming.NamingException,java.rmi.RemoteException}
                  09:19:52,976 ERROR [stderr] (MSC service thread 1-13)   at org.jboss.invocation.MarshalledInvocation.getMethod(MarshalledInvocation.java:407)
                  09:19:52,977 ERROR [stderr] (MSC service thread 1-13)   at org.jboss.ha.framework.server.HARMIServerImpl.invoke(HARMIServerImpl.java:198)
                  09:19:52,978 ERROR [stderr] (MSC service thread 1-13)   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                  09:19:52,979 ERROR [stderr] (MSC service thread 1-13)   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                  09:19:52,980 ERROR [stderr] (MSC service thread 1-13)   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                  09:19:52,981 ERROR [stderr] (MSC service thread 1-13)   at java.lang.reflect.Method.invoke(Method.java:597)
                  09:19:52,982 ERROR [stderr] (MSC service thread 1-13)   at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:303)
                  09:19:52,983 ERROR [stderr] (MSC service thread 1-13)   at sun.rmi.transport.Transport$1.run(Transport.java:159)
                  09:19:52,984 ERROR [stderr] (MSC service thread 1-13)   at java.security.AccessController.doPrivileged(Native Method)
                  09:19:52,985 ERROR [stderr] (MSC service thread 1-13)   at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
                  09:19:52,986 ERROR [stderr] (MSC service thread 1-13)   at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
                  09:19:52,987 ERROR [stderr] (MSC service thread 1-13)   at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
                  09:19:52,988 ERROR [stderr] (MSC service thread 1-13)   at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
                  09:19:52,989 ERROR [stderr] (MSC service thread 1-13)   at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
                  09:19:52,990 ERROR [stderr] (MSC service thread 1-13)   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
                  09:19:53,002 ERROR [stderr] (MSC service thread 1-13)   at java.lang.Thread.run(Thread.java:662)
                  09:19:53,003 ERROR [stderr] (MSC service thread 1-13)   at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:255)
                  09:19:53,004 ERROR [stderr] (MSC service thread 1-13)   at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233)
                  09:19:53,005 ERROR [stderr] (MSC service thread 1-13)   at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:142)
                  09:19:53,006 ERROR [stderr] (MSC service thread 1-13)   at org.jboss.ha.framework.server.HARMIServerImpl_Stub.invoke(Unknown Source)
                  09:19:53,007 ERROR [stderr] (MSC service thread 1-13)   at org.jboss.ha.framework.interfaces.HARMIClient.invokeRemote(HARMIClient.java:219)
                  09:19:53,008 ERROR [stderr] (MSC service thread 1-13)   at org.jboss.ha.framework.interfaces.HARMIClient.invoke(HARMIClient.java:321)
                  09:19:53,009 ERROR [stderr] (MSC service thread 1-13)   at $Proxy50.lookup(Unknown Source)
                  09:19:53,010 ERROR [stderr] (MSC service thread 1-13)   at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:528)
                  09:19:53,011 ERROR [stderr] (MSC service thread 1-13)   at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:507)
                  09:19:53,022 ERROR [stderr] (MSC service thread 1-13)   at javax.naming.InitialContext.lookup(InitialContext.java:392)
                  09:19:53,023 ERROR [stderr] (MSC service thread 1-13)   at client.EJBClient.lookup(Unknown Source)
                  09:19:53,024 ERROR [stderr] (MSC service thread 1-13)   at client.EJBClient.init(Unknown Source)
                  09:19:53,025 ERROR [stderr] (MSC service thread 1-13)   at client.EJBClient.<clinit>(Unknown Source)
                  09:19:53,026 ERROR [stderr] (MSC service thread 1-13)   at coei.webstore.PendingLinesServlet.<init>(PendingLinesServlet.java:59)
                  09:19:53,027 ERROR [stderr] (MSC service thread 1-13)   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
                  09:19:53,028 ERROR [stderr] (MSC service thread 1-13)   at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
                  09:19:53,029 ERROR [stderr] (MSC service thread 1-13)   at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
                  09:19:53,030 ERROR [stderr] (MSC service thread 1-13)   at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
                  09:19:53,031 ERROR [stderr] (MSC service thread 1-13)   at org.jboss.msc.value.ConstructedValue.getValue(ConstructedValue.java:61)
                  09:19:53,032 ERROR [stderr] (MSC service thread 1-13)   at org.jboss.as.naming.ValueManagedReferenceFactory.getReference(ValueManagedReferenceFactory.java:49)
                  09:19:53,033 ERROR [stderr] (MSC service thread 1-13)   at org.jboss.as.ee.component.ManagedReferenceInterceptorFactory$ManagedReferenceInterceptor.processInvocation(ManagedReferenceInterceptorFactory.java:90)
                  09:19:53,035 ERROR [stderr] (MSC service thread 1-13)   at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
                  09:19:53,036 ERROR [stderr] (MSC service thread 1-13)   at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)
                  09:19:53,037 ERROR [stderr] (MSC service thread 1-13)   at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
                  09:19:53,038 ERROR [stderr] (MSC service thread 1-13)   at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45)
                  09:19:53,039 ERROR [stderr] (MSC service thread 1-13)   at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
                  09:19:53,040 ERROR [stderr] (MSC service thread 1-13)   at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
                  09:19:53,041 ERROR [stderr] (MSC service thread 1-13)   at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:161)
                  09:19:53,042 ERROR [stderr] (MSC service thread 1-13)   at org.jboss.as.ee.component.BasicComponent.createInstance(BasicComponent.java:85)
                  09:19:53,043 ERROR [stderr] (MSC service thread 1-13)   at org.jboss.as.web.deployment.component.WebComponentInstantiator$1.<init>(WebComponentInstantiator.java:57)
                  09:19:53,045 ERROR [stderr] (MSC service thread 1-13)   at org.jboss.as.web.deployment.component.WebComponentInstantiator.getReference(WebComponentInstantiator.java:55)
                  09:19:53,046 ERROR [stderr] (MSC service thread 1-13)   at org.jboss.as.web.deployment.WebInjectionContainer.instantiate(WebInjectionContainer.java:99)
                  09:19:53,047 ERROR [stderr] (MSC service thread 1-13)   at org.jboss.as.web.deployment.WebInjectionContainer.newInstance(WebInjectionContainer.java:78)
                  09:19:53,048 ERROR [stderr] (MSC service thread 1-13)   at org.jboss.as.web.deployment.WebInjectionContainer.newInstance(WebInjectionContainer.java:72)
                  09:19:53,049 ERROR [stderr] (MSC service thread 1-13)   at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1156)
                  09:19:53,050 ERROR [stderr] (MSC service thread 1-13)   at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1102)
                  09:19:53,051 ERROR [stderr] (MSC service thread 1-13)   at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3655)
                  09:19:53,052 ERROR [stderr] (MSC service thread 1-13)   at org.apache.catalina.core.StandardContext.start(StandardContext.java:3873)
                  09:19:53,053 ERROR [stderr] (MSC service thread 1-13)   at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90)
                  09:19:53,054 ERROR [stderr] (MSC service thread 1-13)   at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
                  09:19:53,056 ERROR [stderr] (MSC service thread 1-13)   at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
                  09:19:53,057 ERROR [stderr] (MSC service thread 1-13)   at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
                  09:19:53,058 ERROR [stderr] (MSC service thread 1-13)   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
                  09:19:53,059 ERROR [stderr] (MSC service thread 1-13)   at java.lang.Thread.run(Thread.java:662)

                  09:19:53,060 INFO  [stdout] (MSC service thread 1-13) EJBClient|init|INFO|15|DEFAULT|Fri May 18 09:19:52 EDT 2012|MSC service thread 1-13|Problem intializing JNDI objectjava.lang.IllegalStateException: Failed to find method for hash:-790108502850547550 available={-8107796390111393345=public abstract void org.jnp.interfaces.Naming.unbind(javax.naming.Name) throws javax.naming.NamingException,java.rmi.RemoteException, 7733619496521189953=public abstract java.io.Serializable org.jboss.ha.framework.interfaces.HAPartition$HAPartitionStateTransfer.getCurrentState(), -5642140585403320990=public abstract java.util.Collection org.jnp.interfaces.Naming.listBindings(javax.naming.Name) throws javax.naming.NamingException,java.rmi.RemoteException, -4221607359560216057=public abstract java.util.Collection org.jnp.interfaces.Naming.list(javax.naming.Name) throws javax.naming.NamingException,java.rmi.RemoteException, -6149798079139202860=public abstract void org.jnp.interfaces.Naming.bind(javax.naming.Name,java.lang.Object,java.lang.String) throws javax.naming.NamingException,java.rmi.RemoteException, 6991977298034536864=public abstract void org.jboss.ha.framework.interfaces.HAPartition$HAPartitionStateTransfer.setCurrentState(java.io.Serializable), -5717908715153450081=public abstract void org.jnp.interfaces.Naming.rebind(javax.naming.Name,java.lang.Object,java.lang.String) throws javax.naming.NamingException,java.rmi.RemoteException, -7286638714004764603=public abstract javax.naming.Context org.jnp.interfaces.Naming.createSubcontext(javax.naming.Name) throws javax.naming.NamingException,java.rmi.RemoteException, -884175917852741154=public abstract java.lang.Object org.jnp.interfaces.Naming.lookup(javax.naming.Name) throws javax.naming.NamingException,java.rmi.RemoteException}|
                  09:19:53,072 INFO  [stdout] (MSC service thread 1-13) EJBClient|init|CRITICAL|15|DEFAULT|Fri May 18 09:19:52 EDT 2012|MSC service thread 1-13|Problem intializing JNDI object|

                  • 6. Re: Is it possible to make an EJB 2.x call from AS 7.1.1 to 4.2.2?
                    wdfink

                    For me it is not clear what JNDI properties you use to create the InitialContext and what kind of lookup do you do.

                    You should add appropriate log statements.

                     

                    the error (objectjava.lang.IllegalStateException: Failed to find method for hash:-790108502850547550) sounds to me as an inconsitence of your Bean and interface or

                    the JBoss ejb-client classes (which should be a class loading issue).

                     

                    Maybe you might test the code outside AS7 to ensure that all the libs are correct and the code is working.

                    • 7. Re: Is it possible to make an EJB 2.x call from AS 7.1.1 to 4.2.2?
                      vatsanm

                      Wolf-Dieter,

                        Sorry for the confusion, but Icouldnt format the code.  My JNDI name is 'wfm/ETMImpl/http' (off a properties file)  or ejb:wfm/wfm//ETMImpl!com.vzw.wfm.server.etm.ETMInterface (based on Jb7 documentaion).  The EJB provider (running on JB4.2.2) is publishing the EJB service as 'wfm/ETMImpl/http'. If you are talking about the EJB provider on JB7, then the JNDI name is 'ejb:wfm/wfm//ETMImpl!com.vzw.wfm.server.etm.ETMInterface '.

                      • 8. Re: Is it possible to make an EJB 2.x call from AS 7.1.1 to 4.2.2?
                        spatwary04

                        Hi Vatsan,

                        were you able to resolve tthe issue??  I have similar problem i have my client on wildfly (which is similar to jboss 7 ) and ejb is deployed on 4.2. getting the below error same as you

                         

                        Remote connection failed: java.io.IOException: Received an invalid message length of -1393754107

                         

                        I have a tight deadline Any help would be really appreciated.

                        shiva

                        • 9. Re: Is it possible to make an EJB 2.x call from AS 7.1.1 to 4.2.2?
                          vatsanm

                          No, we couldnt.  We worked around the issue by upgrading both client and server to same release JB 6 since the provider system couldnt go to JB 7.1.1