0 Replies Latest reply on Oct 17, 2012 4:48 PM by Phillip Rhodes

    [SOLVED] org.jboss.remoting.InvocationResponse cannot be cast to org.jboss.invocation.MarshalledValue error, making EJB3 call over HTTP w/ JBossAS 4.2.3 and Unified Invoker

    Phillip Rhodes Newbie

      OK, I got the server to a point that it starts with no errors, but when I create an EJB3 client and try to invoke my SSB using HTTP, I get this error:

       

      Exception in thread "main" javax.naming.NamingException: Failed to retrieve Naming interface for provider http://localhost:8080/unified-invoker/Ejb3ServerInvokerServlet/?return-exception=true [Root exception is java.lang.ClassCastException: org.jboss.remoting.InvocationResponse cannot be cast to org.jboss.invocation.MarshalledValue]

          at org.jboss.naming.HttpNamingContextFactory.getInitialContext(HttpNamingContextFactory.java:84)

          at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:684)

          at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:305)

          at javax.naming.InitialContext.init(InitialContext.java:240)

          at javax.naming.InitialContext.<init>(InitialContext.java:214)

          at stateless.client.Client.main(Client.java:39)

      Caused by: java.lang.ClassCastException: org.jboss.remoting.InvocationResponse cannot be cast to org.jboss.invocation.MarshalledValue

          at org.jboss.naming.HttpNamingContextFactory.getNamingServer(HttpNamingContextFactory.java:135)

          at org.jboss.naming.HttpNamingContextFactory.getInitialContext(HttpNamingContextFactory.java:80)

          ... 5 more

       

      Any thoughts or suggestions on this?   This is JBoss AS 4.2.3 with the unified invoker SAR from

      https://community.jboss.org/wiki/EJBJMSAndJNDIOverHTTPWithUnifiedInvoker

       

      and JBoss Remoting 2.2.3_SP3.

       

       

      My client code looks like this:

       

         public static void main(String[] args) throws Exception

         {

             Properties p = new Properties();

             p.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.HttpNamingContextFactory");

             p.put(Context.PROVIDER_URL, "http://localhost:8080/unified-invoker/Ejb3ServerInvokerServlet/?return-exception=true");

             p.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");     

             InitialContext ctx = new InitialContext(p);

             Calculator calculator = (Calculator) ctx.lookup("CalculatorBean/http");

       

             System.out.println("1 + 1 = " + calculator.add(1, 1));

             System.out.println("1 - 1 = " + calculator.subtract(1, 1));

       

         }

       

      the jars I have linked to the client program are:

       

      concurrent.jar

      log4j.jar

      jboss-common.jar

      jboss-jmx.jar

      jbosssx-client.jar

      jboss-client.jar

      jboss-remoting.jar

       

       

      Thanks!

       

      EDIT: looks like I had the wrong URL in my client.  At any rate, got past this error.  Now on to the *next* problem.   This damn unified invoker is going to turn my hair grey prematurely!