1 Reply Latest reply on Dec 19, 2007 2:07 AM by jaikiran pai

    java.lang.ClassCastException: org.jboss.util.id.GUID cannot

    Bob Petry Newbie

      Hi,

      I am attempting to lookup and call methods on an ejb from a servlet where the two are deployed in separate ear files on the same JBoss server.

      I believe I have encountered a classloading issue, if so, I am not sure how to resolve it. Can anyone help me resolve this problem?


      Anyway, here is my latest progress, the exception is encountered at

      obj = PortableRemoteObject.narrow(ctx.lookup("ejb/UserAdmin/UserBean" , Class.forName(className));

      Is this a classloading issue or a configuration issue?

      Has anyone encountered this problem? And if so do you know what I may be doing wrong.

      Thanks in advance, hopefully someone has a clue as to what this problem may be.

      Bob

      Lookup code

      InitialContext ctx = new InitialContext();
      Object obj = null;
      try {
      obj = PortableRemoteObject.narrow(ctx.lookup("ejb/UserAdmin/UserBean"), Class.forName(className));
      } catch (Exception e) {
      logger.log(Level.ERROR, e.getMessage(), e);
      }
      UserBeanHome home = (UserBeanHome)obj;
      UserBean remote = (UserBean) home.create();


      Exception

      java.lang.ClassCastException: org.jboss.util.id.GUID cannot be cast to org.jboss
      .util.id.GUID
      at org.jboss.invocation.InvokerInterceptor.readExternal(InvokerInterceptor.java:358)
      at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1792)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1751)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
      at org.jboss.proxy.Interceptor.readExternal(Interceptor.java:80)
      at org.jboss.proxy.ejb.RetryInterceptor.readExternal(RetryInterceptor.java:291)
      at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1792)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1751)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
      at org.jboss.proxy.Interceptor.readExternal(Interceptor.java:80)
      at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1792)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1751)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
      at org.jboss.proxy.Interceptor.readExternal(Interceptor.java:80)
      at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1792)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1751)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
      at org.jboss.proxy.Interceptor.readExternal(Interceptor.java:80)
      at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1792)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1751)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
      at org.jboss.proxy.ClientContainer.readExternal(ClientContainer.java:156)
      at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1792)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1751)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
      at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1945)
      at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1869)at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
      at java.rmi.MarshalledObject.get(MarshalledObject.java:142)
      at org.jnp.interfaces.MarshalledValuePair.get(MarshalledValuePair.java:72)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:652)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
      at javax.naming.InitialContext.lookup(InitialContext.java:392)