1 Reply Latest reply on Oct 29, 2009 6:31 AM by Wolfgang Knauf

    java.rmi.ServerException: RemoteException

    Bijesh Menon Newbie


      Hi

      I am new to this community.I having a problem while accessing stateless session bean from client code.

      I am using JBOSS 4.0.2

      Following is the stack trace


      java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
      java.rmi.ServerException: EJBException:; nested exception is:
      javax.ejb.EJBException: Could not instantiate bean; CausedByException is:
      null
      at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:325)
      at sun.rmi.transport.Transport$1.run(Transport.java:153)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
      at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
      at java.lang.Thread.run(Thread.java:595)
      at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
      at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
      at sun.rmi.server.UnicastRef.invoke(Unknown Source)
      at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Source)
      at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:118)
      at org.jboss.invocation.InvokerInterceptor.invokeInvoker(InvokerInterceptor.java:227)
      at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:167)
      at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)
      at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:55)
      at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:169)
      at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:86)
      at $Proxy0.create(Unknown Source)
      at com.oneview.configure.delegate.ConfigureDelegate.getRemoteInstance(ConfigureDelegate.java:447)
      at com.oneview.configure.delegate.ConfigureDelegate.fetchAllCameraDetail(ConfigureDelegate.java:59)
      at com.oneview.configure.action.ConfigureCameraAction.processShowConfigureCameraView(ConfigureCameraAction.java:94)
      at com.oneview.configure.action.ConfigureCameraAction.showConfigureCameraView(ConfigureCameraAction.java:49)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:276)
      at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:196)
      at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)
      at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226)
      at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
      at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:397)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
      at java.lang.Thread.run(Unknown Source)
      Caused by: java.rmi.ServerException: EJBException:; nested exception is:
      javax.ejb.EJBException: Could not instantiate bean; CausedByException is:
      null
      at org.jboss.ejb.plugins.LogInterceptor.handleException(LogInterceptor.java:352)
      at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:125)
      at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryFinderInterceptor.java:93)
      at org.jboss.ejb.SessionContainer.internalInvokeHome(SessionContainer.java:613)
      at org.jboss.ejb.Container.invoke(Container.java:894)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      at org.jboss.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke(JRMPInvoker.java:805)
      at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:406)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
      at sun.rmi.transport.Transport$1.run(Transport.java:153)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
      at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
      at java.lang.Thread.run(Thread.java:595)
      Caused by: javax.ejb.EJBException: Could not instantiate bean; CausedByException is:
      null
      at org.jboss.ejb.plugins.AbstractInstancePool.get(AbstractInstancePool.java:180)
      at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invokeHome(StatelessSessionInstanceInterceptor.java:78)
      at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:90)
      at org.jboss.ejb.plugins.CallValidationInterceptor.invokeHome(CallValidationInterceptor.java:41)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:109)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:335)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:146)
      at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:116)
      at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:121)


      ****************************************************
      Following is my client code

      private ConfigureRemoteInterface getRemote() {



      ConfigureRemoteInterface configureRemoteInterface = null;
      Properties p = new Properties();
      p.put(Context.INITIAL_CONTEXT_FACTORY,
      "org.jnp.interfaces.NamingContextFactory");
      p.put(Context.PROVIDER_URL, "localhost:1099");
      p.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
      InitialContext ctx = null;
      try {
      ctx = new InitialContext(p);
      } catch (NamingException e) {
      e.printStackTrace();
      }
      Object obj = null;
      try {
      obj = ctx.lookup("ejb/ConfigureJndi");
      } catch (NamingException e) {
      e.printStackTrace();
      }
      if(obj instanceof ConfigureHomeInterface){
      }else if(obj instanceof ConfigureRemoteInterface){
      System.out.println(ConfigureCameraAction.class.getName()+">>>>>>>>>>>>OBJ IS OBJECT>>>>>>>>>");
      }
      ConfigureHomeInterface configureHomeInterface=null;
      configureHomeInterface = (ConfigureHomeInterface) PortableRemoteObject
      .narrow(obj, ConfigureHomeInterface.class);

      try {
      configureRemoteInterface = configureHomeInterface.create();
      } catch (RemoteException e) {
      e.printStackTrace();
      } catch (CreateException e) {
      e.printStackTrace();
      }

      return configureRemoteInterface;
      }

      *****************************************
      HOME class as follows

      import java.rmi.RemoteException;
      import javax.ejb.CreateException;
      import javax.ejb.EJBHome;


      public interface ConfigureHomeInterface extends EJBHome {
      public ConfigureRemoteInterface create() throws RemoteException, CreateException;
      }

      *******************************************
      Remote as folows

      import java.rmi.RemoteException;
      import javax.ejb.EJBObject;



      public interface ConfigureRemoteInterface extends EJBObject {


      public String sayHello() throws RemoteException,DataHandlerException ;

      public void ejbCreate(){}
      public void ejbRemove(){}
      public void ejbActivate(){}
      public void ejbPassivate(){}
      public void setSessionContext

      (SessionContext sc ) {}


      }


      Any help at the earliest is always welcome :)
      Thanks in advance !