1 Reply Latest reply on Apr 12, 2007 4:16 AM by abhayajha

    Getting ClassCastException during remote EJB call

    abhayajha Newbie

      Hi,

      I am migrating jboss-3.2.3 to Jboss-4.0.5.GA.

      I have two say first.ear and second.ear files deployed in the same JBoss-4.0.5.GA server. When ejb deployed in first.ear is invoked from second.ear, ClassCastException is thrown. But for local bean call, it works fine.

      Can some body help what is the actual reason for class cast exception?

      I tried to debug it out and I found problem is at
      ejbHome = (EJBHome) PortableRemoteObject.narrow(ref, clazz);

      I also inspected ref object it contains the correct home name as we are passing as second argument.

      StackTrace is as below:
      17:23:13,306 DEBUG [ServiceLocatorConfigurator] Looking up for<ejb/PermDAO>
      17:57:56,560 ERROR [STDERR] java.lang.ClassCastException
      17:57:56,576 ERROR [STDERR] at com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:293)
      17:57:56,576 ERROR [STDERR] at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:134)
      17:57:56,576 ERROR [STDERR] at com.db.dcs.model.settlements.ejb.services.locator.impl.ServiceLocatorConfigurator.getEJBHome(ServiceLocatorConfigurator.java:671)
      17:57:56,576 ERROR [STDERR] at com.db.dcs.model.settlements.ejb.services.locator.impl.ServiceLocatorConfigurator.getEjbProvider(ServiceLocatorConfigurator.java:494)
      17:57:56,576 ERROR [STDERR] at com.db.dcs.model.settlements.ejb.services.locator.impl.ServiceLocatorConfigurator.createProviderInstance(ServiceLocatorConfigurator.java:374)
      17:57:56,591 ERROR [STDERR] at com.db.dcs.model.settlements.ejb.services.locator.impl.ServiceLocatorConfigurator.getServiceInstance(ServiceLocatorConfigurator.java:182)
      17:57:56,591 ERROR [STDERR] at com.db.dcs.model.settlements.ejb.services.locator.impl.SimpleServiceFactoryImpl.getInstance(SimpleServiceFactoryImpl.java:80)
      17:57:56,591 ERROR [STDERR] at com.db.dcs.model.settlements.ejb.services.locator.impl.SimpleServiceLocatorImpl.getService(SimpleServiceLocatorImpl.java:60)
      17:57:56,591 ERROR [STDERR] at com.db.dcs.model.settlements.ejb.services.locator.ServiceLocator.getService(ServiceLocator.java:63)
      17:57:56,607 ERROR [STDERR] at com.db.dcs.model.settlements.jboss.security.LdapDBLoginModule.validatePassword(LdapDBLoginModule.java:217)
      17:57:56,607 ERROR [STDERR] at org.jboss.security.auth.spi.UsernamePasswordLoginModule.login(UsernamePasswordLoginModule.java:210)
      17:57:56,607 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      17:57:56,607 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      17:57:56,607 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      17:57:56,623 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:324)
      17:57:56,623 ERROR [STDERR] at javax.security.auth.login.LoginContext.invoke(LoginContext.java:675)
      17:57:56,623 ERROR [STDERR] at javax.security.auth.login.LoginContext.access$000(LoginContext.java:129)
      17:57:56,623 ERROR [STDERR] at javax.security.auth.login.LoginContext$4.run(LoginContext.java:610)
      17:57:56,623 ERROR [STDERR] at java.security.AccessController.doPrivileged(Native Method)
      17:57:56,623 ERROR [STDERR] at javax.security.auth.login.LoginContext.invokeModule(LoginContext.java:607)
      17:57:56,638 ERROR [STDERR] at javax.security.auth.login.LoginContext.login(LoginContext.java:534)
      17:57:56,638 ERROR [STDERR] at org.jboss.security.plugins.JaasSecurityManager.defaultLogin(JaasSecurityManager.java:601)
      17:57:56,638 ERROR [STDERR] at org.jboss.security.plugins.JaasSecurityManager.authenticate(JaasSecurityManager.java:535)
      17:57:56,638 ERROR [STDERR] at org.jboss.security.plugins.JaasSecurityManager.isValid(JaasSecurityManager.java:344)
      17:57:56,638 ERROR [STDERR] at org.jboss.web.tomcat.security.JBossSecurityMgrRealm.authenticate(JBossSecurityMgrRealm.java:491)
      17:57:56,654 ERROR [STDERR] at org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAuthenticator.java:257)
      17:57:56,654 ERROR [STDERR] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:416)
      17:57:56,654 ERROR [STDERR] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
      17:57:56,654 ERROR [STDERR] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
      17:57:56,654 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
      17:57:56,670 ERROR [STDERR] at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
      17:57:56,670 ERROR [STDERR] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
      17:57:56,670 ERROR [STDERR] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
      17:57:56,670 ERROR [STDERR] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
      17:57:56,685 ERROR [STDERR] at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
      17:57:56,685 ERROR [STDERR] at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
      17:57:56,685 ERROR [STDERR] at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
      17:57:56,685 ERROR [STDERR] at java.lang.Thread.run(Thread.java:534)