1 Reply Latest reply on Oct 28, 2004 1:46 AM by raist_majere

    JBoss 4.0: can't get CMP and Oracle JDBC working

    aironyiu

      Hi:
      I am running the JBoss 4.0 (binary dist) on HP-UX 11i. I was able to run various examples in the 'Getting started JBoss 4.0' document until chapter 7 and 8.

      Here are the details:

      (1) Trying CMP (as in Chapter 7 of Getting Started document) is OK until running the client.

      There errors are:

      (jboss)/app_server/src/j2eetutorial14/examples/ejb/cmproster$ant -f jboss-build.xml run-cmp
      Buildfile: jboss-build.xml

      run-cmp:
      [java] Caught an exception:
      [java] java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
      [java] java.rmi.ServerException: EJBException:; nested exception is:
      [java] javax.ejb.EJBException: createBeanClassInstanceCommand == null; CausedByException is:
      [java] createBeanClassInstanceCommand == null
      [java] at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:292)
      [java] at sun.rmi.transport.Transport$1.run(Transport.java:148)
      [java] at java.security.AccessController.doPrivileged(Native Method)
      [java] at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
      [java] at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
      [java] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
      [java] at java.lang.Thread.run(Thread.java:534)
      [java] at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
      [java] at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
      [java] at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:133)
      [java] at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Source)
      [java] at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:118)
      [java] at org.jboss.invocation.MarshallingInvokerInterceptor.invoke(MarshallingInvokerInterceptor.java:73)
      [java] at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)
      [java] at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:55)
      [java] at org.jboss.proxy.ejb.StatefulSessionInterceptor.invoke(StatefulSessionInterceptor.java:106)
      [java] at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:86)
      [java] at $Proxy2.createLeague(Unknown Source)
      [java] at client.RosterClient.insertInfo(RosterClient.java:156)
      [java] at client.RosterClient.main(RosterClient.java:51)
      [java] Caused by: java.rmi.ServerException: EJBException:; nested exception is:
      [java] javax.ejb.EJBException: createBeanClassInstanceCommand == null; CausedByException is:
      [java] createBeanClassInstanceCommand == null
      [java] at org.jboss.ejb.plugins.LogInterceptor.handleException(LogInterceptor.java:347)
      [java] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:195)
      [java] at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
      [java] at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:624)
      [java] at org.jboss.ejb.Container.invoke(Container.java:854)
      [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      [java] at java.lang.reflect.Method.invoke(Method.java:324)
      [java] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
      [java] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      [java] at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      [java] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
      [java] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
      [java] at org.jboss.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke(JRMPInvoker.java:775)
      [java] at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:382)
      [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      [java] at java.lang.reflect.Method.invoke(Method.java:324)
      [java] at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
      [java] at sun.rmi.transport.Transport$1.run(Transport.java:148)
      [java] at java.security.AccessController.doPrivileged(Native Method)
      [java] at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
      [java] at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
      [java] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
      [java] at java.lang.Thread.run(Thread.java:534)
      [java] Caused by: javax.ejb.EJBException: createBeanClassInstanceCommand == null; CausedByException is:
      [java] createBeanClassInstanceCommand == null
      [java] at roster.RosterBean.createLeague(RosterBean.java:439)
      [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      [java] at java.lang.reflect.Method.invoke(Method.java:324)
      [java] at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
      [java] at org.jboss.ejb.StatefulSessionContainer$ContainerInterceptor.invoke(StatefulSessionContainer.java:521)
      [java] at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:128)
      [java] at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
      [java] at org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor.invoke(StatefulSessionInstanceInterceptor.java:294)
      [java] at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)
      [java] at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:105)
      [java] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:316)
      [java] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:149)
      [java] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
      [java] ... 25 more
      [java] Caught an exception:
      [java] java.rmi.NoSuchObjectException: Could not activate; failed to restore state; CausedByException is:
      [java] /app_server/jboss-4.0.0/server/default/tmp/sessions/RosterBean-e0sxwn0j-9/e0sxy3kf-a.ser (No such file or directory)
      [java] at org.jboss.ejb.plugins.AbstractInstanceCache.get(AbstractInstanceCache.java:118)
      [java] at org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor.invoke(StatefulSessionInstanceInterceptor.java:217)
      [java] at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)
      [java] at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:105)
      [java] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:316)
      [java] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:149)
      [java] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
      [java] at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
      [java] at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:624)
      [java] at org.jboss.ejb.Container.invoke(Container.java:854)
      [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      [java] at java.lang.reflect.Method.invoke(Method.java:324)
      [java] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
      [java] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      [java] at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      [java] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
      [java] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
      [java] at org.jboss.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke(JRMPInvoker.java:775)
      [java] at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:382)
      [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      [java] at java.lang.reflect.Method.invoke(Method.java:324)
      [java] at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
      [java] at sun.rmi.transport.Transport$1.run(Transport.java:148)
      [java] at java.security.AccessController.doPrivileged(Native Method)
      [java] at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
      [java] at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
      [java] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
      [java] at java.lang.Thread.run(Thread.java:534)

      BUILD SUCCESSFUL
      Total time: 8 seconds



      (2) Trying CMP with Oracle, after following the instructions as in Chapter 8, i.e.
      (a) modify the standardjbosscmp-jdbc.xml (restart JBoss afterwards)
      <jbosscmp-jdbc>

      java:/XAOracleDS
      <datasource-mapping>Oracle9i</datasource-mapping>

      (b) modify jboss-servie.xml

      true

      (c) modify oracle-xa-ds-xml,
      <xa-datasource-property name="URL">jdbc:oracle:thin:@hkzux05:1521:testdb01</xa-datasource-property>

      Then put in the deploy directory, with no errors
      # 11:56:30,961 INFO [WrapperDataSourceService] Bound connection factory for resource adapter for ConnectionManager 'jboss.jca:name=
      XAOracleDS,service=DataSourceBinding to JNDI name 'java:XAOracleDS'
      11:56:30,977 INFO [JCAResource] Registration is not done -> stop

      Now running CMP client again (as in Section 7.2.1), give me the following errors:

      (jboss)/app_server/src/j2eetutorial14/examples/ejb/cmproster$ant -f jboss-build.xml run-cmp
      Buildfile: jboss-build.xml

      run-cmp:
      [java] Caught an exception:
      [java] java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
      [java] java.rmi.ServerException: EJBException:; nested exception is:
      [java] javax.ejb.EJBException: Error checking if entity exists:org.jboss.util.NestedSQLException: You are trying to use a c
      onnection factory that has been shut down: ManagedConnectionFactory is null.; - nested throwable: (javax.resource.ResourceException:
      You are trying to use a connection factory that has been shut down: ManagedConnectionFactory is null.)
      [java] at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:292)
      [java] at sun.rmi.transport.Transport$1.run(Transport.java:148)
      [java] at java.security.AccessController.doPrivileged(Native Method)
      [java] at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
      [java] at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
      [java] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
      [java] at java.lang.Thread.run(Thread.java:534)
      [java] at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
      [java] at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
      [java] at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:133)
      [java] at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Source)
      [java] at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:118)
      [java] at org.jboss.invocation.MarshallingInvokerInterceptor.invoke(MarshallingInvokerInterceptor.java:73)
      [java] at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)
      [java] at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:55)
      [java] at org.jboss.proxy.ejb.StatefulSessionInterceptor.invoke(StatefulSessionInterceptor.java:106)
      [java] at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:86)
      [java] at $Proxy2.createLeague(Unknown Source)
      [java] at client.RosterClient.insertInfo(RosterClient.java:156)
      [java] at client.RosterClient.main(RosterClient.java:51)
      [java] Caused by: java.rmi.ServerException: EJBException:; nested exception is:
      [java] javax.ejb.EJBException: Error checking if entity exists:org.jboss.util.NestedSQLException: You are trying to use a c
      onnection factory that has been shut down: ManagedConnectionFactory is null.; - nested throwable: (javax.resource.ResourceException:
      You are trying to use a connection factory that has been shut down: ManagedConnectionFactory is null.)
      [java] at org.jboss.ejb.plugins.LogInterceptor.handleException(LogInterceptor.java:347)
      [java] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:195)
      [java] at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
      [java] at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:624)
      [java] at org.jboss.ejb.Container.invoke(Container.java:854)
      [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      [java] at java.lang.reflect.Method.invoke(Method.java:324)
      [java] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
      [java] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      [java] at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      [java] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
      [java] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
      [java] at org.jboss.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke(JRMPInvoker.java:775)
      [java] at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:382)
      [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      [java] at java.lang.reflect.Method.invoke(Method.java:324)
      [java] at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
      [java] at sun.rmi.transport.Transport$1.run(Transport.java:148)
      [java] at java.security.AccessController.doPrivileged(Native Method)
      [java] at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
      [java] at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
      [java] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
      [java] at java.lang.Thread.run(Thread.java:534)
      [java] Caused by: javax.ejb.EJBException: Error checking if entity exists:org.jboss.util.NestedSQLException: You are trying to
      use a connection factory that has been shut down: ManagedConnectionFactory is null.; - nested throwable: (javax.resource.ResourceExc
      eption: You are trying to use a connection factory that has been shut down: ManagedConnectionFactory is null.)
      [java] at roster.RosterBean.createLeague(RosterBean.java:439)
      [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      [java] at java.lang.reflect.Method.invoke(Method.java:324)
      [java] at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
      [java] at org.jboss.ejb.StatefulSessionContainer$ContainerInterceptor.invoke(StatefulSessionContainer.java:521)
      [java] at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:128)
      [java] at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
      [java] at org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor.invoke(StatefulSessionInstanceInterceptor.java:294)
      [java] at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)
      [java] at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:105)
      [java] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:316)
      [java] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:149)
      [java] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
      [java] ... 25 more
      [java] Caught an exception:
      [java] java.rmi.NoSuchObjectException: Could not activate; failed to restore state; CausedByException is:
      [java] /app_server/jboss-4.0.0/server/default/tmp/sessions/RosterBean-e0syihhf-6/e0synls5-7.ser (No such file or directory)
      [java] at org.jboss.ejb.plugins.AbstractInstanceCache.get(AbstractInstanceCache.java:118)
      [java] at org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor.invoke(StatefulSessionInstanceInterceptor.java:217)
      [java] at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)
      [java] at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:105)
      [java] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:316)
      [java] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:149)
      [java] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
      [java] at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
      [java] at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:624)
      [java] at org.jboss.ejb.Container.invoke(Container.java:854)
      [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      [java] at java.lang.reflect.Method.invoke(Method.java:324)
      [java] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
      [java] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      [java] at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      [java] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
      [java] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
      [java] at org.jboss.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke(JRMPInvoker.java:775)
      [java] at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:382)
      [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      [java] at java.lang.reflect.Method.invoke(Method.java:324)
      [java] at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
      [java] at sun.rmi.transport.Transport$1.run(Transport.java:148)
      [java] at java.security.AccessController.doPrivileged(Native Method)
      [java] at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
      [java] at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
      [java] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
      [java] at java.lang.Thread.run(Thread.java:534)

      BUILD SUCCESSFUL
      Total time: 8 seconds

      Thanks