Transactional error when using JMS from stateless session bean

I get a transaction exception when committing a bean method responsible for sending to a JMS topic. This happens only occasionally when two separate threads invoke this method "at the same time".
The scenario:
Two separate threads running two different instances of a stateless session bean (slsb A). This ejb (slsb A) has an injected slsb B which is communicating with the the topic.
Both instances of slsb A are utilising the same instance of slsb B.
The CMT transactions for the two threads start in slsb A from methods with transaction attribute "RequiresNew". All nested methods are to other slsbs and have the transaction attribute "Required". The method in slsb B which sends the message is closing both the session and the connection to the topic.
I'm running Glassfish version 9.1_02 (build b04-fcs) and JMS implementation OpenMQ version 4.1.
Stacktrace (glassfish log):
[#|2008-09-09T13:00:40.515+0200|SEVERE|sun-appserver9.1|javax.resourceadapter.mqjmsra.outbound.connection|_ThreadID=18;_ThreadName=httpSSLWorkerThread-8080-1;_RequestID=108e8418-71a6-4d8b-a94d-9e1edc885891;|commitTransaction (XA) on JMSService:jmsdirect failed for connectionId:5754505514139844608 and onePhase:false due to unkown JMSService server error.|#]
[#|2008-09-09T13:00:40.515+0200|SEVERE|sun-appserver9.1|javax.enterprise.system.core.transaction|_ThreadID=18;_ThreadName=httpSSLWorkerThread-8080-1;org.omg.CORBA.INTERNAL:   vmcid: 0x0  minor code: 0 completed: Maybe;commit;_RequestID=108e8418-71a6-4d8b-a94d-9e1edc885891;|JTS5031: Exception [org.omg.CORBA.INTERNAL:   vmcid: 0x0  minor code: 0 completed: Maybe] on Resource [commit] operation.|#]
[#|2008-09-09T13:00:40.531+0200|INFO|sun-appserver9.1|javax.enterprise.system.container.ejb|_ThreadID=18;_ThreadName=httpSSLWorkerThread-8080-1;SubscriptionBean;|EJB5018: An exception was thrown during an ejb invocation on [SubscriptionBean]|#]
[#|2008-09-09T13:00:40.531+0200|INFO|sun-appserver9.1|javax.enterprise.system.container.ejb|_ThreadID=18;_ThreadName=httpSSLWorkerThread-8080-1;|
javax.ejb.EJBException: Unable to complete container-managed transaction.; nested exception is: javax.transaction.SystemException: org.omg.CORBA.INTERNAL: JTS5031: Exception [org.omg.CORBA.INTERNAL:   vmcid: 0x0  minor code: 0 completed: Maybe] on Resource [commit] operation. vmcid: 0x0 minor code: 0 completed: No
javax.transaction.SystemException: org.omg.CORBA.INTERNAL: JTS5031: Exception [org.omg.CORBA.INTERNAL:   vmcid: 0x0  minor code: 0 completed: Maybe] on Resource [commit] operation. vmcid: 0x0 minor code: 0 completed: No
     at com.sun.jts.jta.TransactionManagerImpl.commit(TransactionManagerImpl.java:321)
     at com.sun.enterprise.distributedtx.J2EETransactionManagerImpl.commit(J2EETransactionManagerImpl.java:1030)
     at com.sun.enterprise.distributedtx.J2EETransactionManagerOpt.commit(J2EETransactionManagerOpt.java:397)
     at com.sun.ejb.containers.BaseContainer.completeNewTx(BaseContainer.java:3792)
     at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:3585)
     at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1354)
     at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1316)
     at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:205)
     at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:127)
     at $Proxy130.requestNewSubscription(Unknown Source)
     at com.abeldrm.kms.core.services.subscription.SubscriptionWSBean.requestNewSubscription(SubscriptionWSBean.java:94)
     at sun.reflect.GeneratedMethodAccessor127.invoke(Unknown Source)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     at java.lang.reflect.Method.invoke(Method.java:597)
     at com.sun.enterprise.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1067)
     at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:176)
     at com.sun.ejb.containers.BaseContainer.invokeTargetBeanMethod(BaseContainer.java:2895)
     at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:3986)
     at com.sun.ejb.containers.WebServiceInvocationHandler.invoke(WebServiceInvocationHandler.java:189)
     at $Proxy129.requestNewSubscription(Unknown Source)
     at sun.reflect.GeneratedMethodAccessor126.invoke(Unknown Source)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     at java.lang.reflect.Method.invoke(Method.java:597)
     at com.sun.enterprise.webservice.InvokerImpl.invoke(InvokerImpl.java:81)
     at com.sun.enterprise.webservice.EjbInvokerImpl.invoke(EjbInvokerImpl.java:82)
     at com.sun.xml.ws.server.InvokerTube$2.invoke(InvokerTube.java:146)
     at com.sun.xml.ws.server.sei.EndpointMethodHandler.invoke(EndpointMethodHandler.java:257)
     at com.sun.xml.ws.server.sei.SEIInvokerTube.processRequest(SEIInvokerTube.java:93)
     at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:595)
     at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:554)
     at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:539)
     at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:436)
     at com.sun.xml.ws.api.pipe.helper.AbstractTubeImpl.process(AbstractTubeImpl.java:106)
     at com.sun.enterprise.webservice.MonitoringPipe.process(MonitoringPipe.java:147)
     at com.sun.xml.ws.api.pipe.helper.PipeAdapter.processRequest(PipeAdapter.java:115)
     at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:595)
     at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:554)
     at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:539)
     at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:436)
     at com.sun.xml.ws.api.pipe.helper.AbstractTubeImpl.process(AbstractTubeImpl.java:106)
     at com.sun.xml.ws.tx.service.TxServerPipe.process(TxServerPipe.java:329)
     at com.sun.enterprise.webservice.CommonServerSecurityPipe.processRequest(CommonServerSecurityPipe.java:218)
     at com.sun.enterprise.webservice.CommonServerSecurityPipe.process(CommonServerSecurityPipe.java:129)
     at com.sun.xml.ws.api.pipe.helper.PipeAdapter.processRequest(PipeAdapter.java:115)
     at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:595)
     at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:554)
     at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:539)
     at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:436)
     at com.sun.xml.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:243)
     at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:444)
     at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:244)
     at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:135)
     at com.sun.enterprise.webservice.Ejb3MessageDispatcher.handlePost(Ejb3MessageDispatcher.java:113)
     at com.sun.enterprise.webservice.Ejb3MessageDispatcher.invoke(Ejb3MessageDispatcher.java:87)
     at com.sun.enterprise.webservice.EjbWebServiceServlet.dispatchToEjbEndpoint(EjbWebServiceServlet.java:226)
     at com.sun.enterprise.webservice.EjbWebServiceServlet.service(EjbWebServiceServlet.java:155)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
     at com.sun.enterprise.web.AdHocContextValve.invoke(AdHocContextValve.java:114)
     at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
     at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
     at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:87)
     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
     at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
     at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
     at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
     at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
     at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
     at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
     at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:272)
     at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
     at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568)
     at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813)
     at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
     at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
     at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
     at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
     at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
IMQ broker log:
[09/Sep/2008:13:00:40 CEST] ERROR CommitTransaction: commit failed. Connection ID: 5754505514139844608, Transaction ID: 0:
com.sun.messaging.jmq.jmsserver.util.BrokerException: Unknown Transaction 0
     at com.sun.messaging.jmq.jmsserver.data.protocol.ProtocolImpl.commitTransaction(ProtocolImpl.java:630)
     at com.sun.messaging.jmq.jmsserver.service.imq.IMQDirectService.commitTransaction(IMQDirectService.java:1735)
     at com.sun.messaging.jms.ra.DirectXAResource.commit(DirectXAResource.java:201)
     at com.sun.jts.jtsxa.OTSResourceImpl.commit(OTSResourceImpl.java:114)
     at com.sun.jts.CosTransactions.RegisteredResources.distributeCommit(RegisteredResources.java:795)
     at com.sun.jts.CosTransactions.TopCoordinator.commit(TopCoordinator.java:2111)
     at com.sun.jts.CosTransactions.CoordinatorTerm.commit(CoordinatorTerm.java:403)
     at com.sun.jts.CosTransactions.TerminatorImpl.commit(TerminatorImpl.java:249)
     at com.sun.jts.CosTransactions.CurrentImpl.commit(CurrentImpl.java:623)
     at com.sun.jts.jta.TransactionManagerImpl.commit(TransactionManagerImpl.java:309)
     at com.sun.enterprise.distributedtx.J2EETransactionManagerImpl.commit(J2EETransactionManagerImpl.java:1030)
     at com.sun.enterprise.distributedtx.J2EETransactionManagerOpt.commit(J2EETransactionManagerOpt.java:397)
     at com.sun.ejb.containers.BaseContainer.completeNewTx(BaseContainer.java:3792)
     at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:3585)
     at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1354)
     at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1316)
     at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:205)
     at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:127)
     at $Proxy130.requestNewSubscription(Unknown Source)
     at com.abeldrm.kms.core.services.subscription.SubscriptionWSBean.requestNewSubscription(SubscriptionWSBean.java:94)
     at sun.reflect.GeneratedMethodAccessor127.invoke(Unknown Source)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     at java.lang.reflect.Method.invoke(Method.java:597)
     at com.sun.enterprise.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1067)
     at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:176)
     at com.sun.ejb.containers.BaseContainer.invokeTargetBeanMethod(BaseContainer.java:2895)
     at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:3986)
     at com.sun.ejb.containers.WebServiceInvocationHandler.invoke(WebServiceInvocationHandler.java:189)
     at $Proxy129.requestNewSubscription(Unknown Source)
     at sun.reflect.GeneratedMethodAccessor126.invoke(Unknown Source)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     at java.lang.reflect.Method.invoke(Method.java:597)
     at com.sun.enterprise.webservice.InvokerImpl.invoke(InvokerImpl.java:81)
     at com.sun.enterprise.webservice.EjbInvokerImpl.invoke(EjbInvokerImpl.java:82)
     at com.sun.xml.ws.server.InvokerTube$2.invoke(InvokerTube.java:146)
     at com.sun.xml.ws.server.sei.EndpointMethodHandler.invoke(EndpointMethodHandler.java:257)
     at com.sun.xml.ws.server.sei.SEIInvokerTube.processRequest(SEIInvokerTube.java:93)
     at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:595)
     at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:554)
     at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:539)
     at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:436)
     at com.sun.xml.ws.api.pipe.helper.AbstractTubeImpl.process(AbstractTubeImpl.java:106)
     at com.sun.enterprise.webservice.MonitoringPipe.process(MonitoringPipe.java:147)
     at com.sun.xml.ws.api.pipe.helper.PipeAdapter.processRequest(PipeAdapter.java:115)
     at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:595)
     at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:554)
     at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:539)
     at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:436)
     at com.sun.xml.ws.api.pipe.helper.AbstractTubeImpl.process(AbstractTubeImpl.java:106)
     at com.sun.xml.ws.tx.service.TxServerPipe.process(TxServerPipe.java:329)
     at com.sun.enterprise.webservice.CommonServerSecurityPipe.processRequest(CommonServerSecurityPipe.java:218)
     at com.sun.enterprise.webservice.CommonServerSecurityPipe.process(CommonServerSecurityPipe.java:129)
     at com.sun.xml.ws.api.pipe.helper.PipeAdapter.processRequest(PipeAdapter.java:115)
     at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:595)
     at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:554)
     at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:539)
     at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:436)
     at com.sun.xml.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:243)
     at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:444)
     at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:244)
     at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:135)
     at com.sun.enterprise.webservice.Ejb3MessageDispatcher.handlePost(Ejb3MessageDispatcher.java:113)
     at com.sun.enterprise.webservice.Ejb3MessageDispatcher.invoke(Ejb3MessageDispatcher.java:87)
     at com.sun.enterprise.webservice.EjbWebServiceServlet.dispatchToEjbEndpoint(EjbWebServiceServlet.java:226)
     at com.sun.enterprise.webservice.EjbWebServiceServlet.service(EjbWebServiceServlet.java:155)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
     at com.sun.enterprise.web.AdHocContextValve.invoke(AdHocContextValve.java:114)
     at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
     at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
     at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:87)
     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
     at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
     at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
     at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
     at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
     at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
     at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
     at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:272)
     at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
     at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568)
     at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813)
     at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
     at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
     at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
     at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
     at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
Have anyone any idea why this should fail?
Regards,
Jon

I would suggest opening a case with [email protected] FWIW, I recall seeing
          something like this in WLS 6.0. I believe it is fixed in WLS 6.1
          -- Rob
          Chris Dupuy wrote:
          > Btw, this occurs when I create an stateful session bean that ends up
          > throwing an exception and setRollbackOnly() is called. From that point
          > forward, my logs fill with this message.
          >
          > Chris
          >
          > "Chris Dupuy" <[email protected]> wrote in message
          > news:[email protected]..
          > > anyone know what this means, and what you can do about it?
          > >
          > >
          > > <Error> <ConnectionManager> <atossd03> <cbeyondServer> <ExecuteThread:
          > '14'
          > > for queue: 'd
          > > efault'> <> <> <000000> <Closing:
          > 'weblogic.rjvm.t3.T3JVMConnection@488831'
          > > because of: 'Server received a message over an uniniti
          > > alized connection: 'JVMMessage from: 'null' to:
          > >
          > '5825313123619479267S:10.6.6.40:[8000,8000,8001,8001,8000,8001,-1]:cbeyond:c
          > > beyond
          > > Server' cmd: 'CMD_REQUEST', QOS: '101', responseId: '2', invokableId: '1',
          > > flags: 'JVMIDs Not Sent, TX Context Not Sent', abbrev o
          > > ffset: '204'''>
          > >
          > >
          > >
          

Similar Messages

  • Error when returning Vector from EJB Session Bean

    I am testing the EJB functionality within JDeveloper(9.0.3). I simply expanded on the tutorial that is in the documentation (departments and employees). I created a method in the stateless session bean that retrieves a Collection of employees for a department, then converts it to a Vector. When I try to return the Vector from the session bean to a sample client, I get an error indicating that the Object is NOT serializable. I know that Vector IS serializable. Why do I get this error? (The error displays on the client message log, NOT the OC4J message log). I tried dumping the Vector to System.out.println - this works fine, so I l know I'm getting data.
    Here is the stack trace and errors that display:
    com.evermind.server.rmi.OrionRemoteException: Error (de-)serializing object: EmployeeLocal_EntityBeanWrapper4
         java.lang.Object com.evermind.server.ejb.EJBUtils.cloneSerialize(java.lang.Object, com.evermind.server.ejb.AbstractEJBHome)
              EJBUtils.java:404
         java.lang.Object com.evermind.server.ejb.EJBUtils.cloneObject(java.lang.Object, com.evermind.server.ejb.AbstractEJBHome)
              EJBUtils.java:377
         java.lang.Object com.evermind.server.ejb.EJBUtils.cloneOneObjectInstance(java.lang.Object, com.evermind.server.ejb.AbstractEJBHome)
              EJBUtils.java:419
         java.lang.Object com.evermind.server.ejb.EJBUtils.cloneArrayList(java.util.ArrayList, com.evermind.server.ejb.AbstractEJBHome)
              EJBUtils.java:599
         java.lang.Object com.evermind.server.ejb.EJBUtils.cloneObject(java.lang.Object, com.evermind.server.ejb.AbstractEJBHome)
              EJBUtils.java:357
         java.util.Collection hrApp_StatelessSessionBeanWrapper2.getEmployeesByDepartment(java.lang.Long)
              hrApp_StatelessSessionBeanWrapper2.java:323
         java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[])
              native code
         void com.evermind.server.rmi.RMICallHandler.run(java.lang.Thread)
              RMICallHandler.java:119
         void com.evermind.server.rmi.RMICallHandler.run()
              RMICallHandler.java:48
         void EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run()
              PooledExecutor.java:803
         void java.lang.Thread.run()
              Thread.java:484
    at connection to localhost/127.0.0.1 as admin
         void com.evermind.server.rmi.RMIConnection.EXCEPTION_ORIGINATES_FROM_THE_REMOTE_SERVER(java.lang.Throwable)
              RMIConnection.java:1558
         java.lang.Object com.evermind.server.rmi.RMIConnection.invokeMethod(com.evermind.server.rmi.RMIContext, long, long, java.lang.reflect.Method, java.lang.Object[])
              RMIConnection.java:1511
         java.lang.Object com.evermind.server.rmi.RemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
              RemoteInvocationHandler.java:53
         java.lang.Object com.evermind.server.rmi.RecoverableRemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
              RecoverableRemoteInvocationHandler.java:22
         java.lang.Object com.evermind.server.ejb.StatelessSessionRemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
              StatelessSessionRemoteInvocationHandler.java:50
         java.util.Collection __Proxy1.getEmployeesByDepartment(java.lang.Long)
         javax.swing.table.DefaultTableModel hr.hrAppClientFrame.getTableModel()
              hrAppClientFrame.java:150
         void hr.hrAppClientFrame.jbInit()
              hrAppClientFrame.java:122
         void hr.hrAppClientFrame.<init>()
              hrAppClientFrame.java:58
         void hr.hrAppClientFrame.main(java.lang.String[])
              hrAppClientFrame.java:141
         Nested exception is:
    java.io.NotSerializableException: EmployeeLocal_EntityBeanWrapper4
         void java.io.ObjectOutputStream.outputObject(java.lang.Object)
              ObjectOutputStream.java:1148
         void java.io.ObjectOutputStream.writeObject(java.lang.Object)
              ObjectOutputStream.java:366
         java.lang.Object com.evermind.server.ejb.EJBUtils.cloneSerialize(java.lang.Object, com.evermind.server.ejb.AbstractEJBHome)
              EJBUtils.java:390
         java.lang.Object com.evermind.server.ejb.EJBUtils.cloneObject(java.lang.Object, com.evermind.server.ejb.AbstractEJBHome)
              EJBUtils.java:377
         java.lang.Object com.evermind.server.ejb.EJBUtils.cloneOneObjectInstance(java.lang.Object, com.evermind.server.ejb.AbstractEJBHome)
              EJBUtils.java:419
         java.lang.Object com.evermind.server.ejb.EJBUtils.cloneArrayList(java.util.ArrayList, com.evermind.server.ejb.AbstractEJBHome)
              EJBUtils.java:599
         java.lang.Object com.evermind.server.ejb.EJBUtils.cloneObject(java.lang.Object, com.evermind.server.ejb.AbstractEJBHome)
              EJBUtils.java:357
         java.util.Collection hrApp_StatelessSessionBeanWrapper2.getEmployeesByDepartment(java.lang.Long)
              hrApp_StatelessSessionBeanWrapper2.java:323
         java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[])
              native code
         void com.evermind.server.rmi.RMICallHandler.run(java.lang.Thread)
              RMICallHandler.java:119
         void com.evermind.server.rmi.RMICallHandler.run()
              RMICallHandler.java:48
         void EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run()
              PooledExecutor.java:803
         void java.lang.Thread.run()
              Thread.java:484
    at connection to localhost/127.0.0.1
         void com.evermind.server.rmi.OrionRemoteException.receive(java.net.InetAddress, java.lang.String)
              OrionRemoteException.java:130
         void com.evermind.server.rmi.RMIConnection.handleMethodInvocationResponse()
              RMIConnection.java:1673
         void com.evermind.server.rmi.RMIConnection.run(java.lang.Thread)
              RMIConnection.java:532
         void com.evermind.server.rmi.RMIConnection.run()
              RMIConnection.java:275
         void EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run()
              PooledExecutor.java:797
         void java.lang.Thread.run()
              Thread.java:484
    Any ideas?
    Thanks

    I would suggest opening a case with [email protected] FWIW, I recall seeing
              something like this in WLS 6.0. I believe it is fixed in WLS 6.1
              -- Rob
              Chris Dupuy wrote:
              > Btw, this occurs when I create an stateful session bean that ends up
              > throwing an exception and setRollbackOnly() is called. From that point
              > forward, my logs fill with this message.
              >
              > Chris
              >
              > "Chris Dupuy" <[email protected]> wrote in message
              > news:[email protected]..
              > > anyone know what this means, and what you can do about it?
              > >
              > >
              > > <Error> <ConnectionManager> <atossd03> <cbeyondServer> <ExecuteThread:
              > '14'
              > > for queue: 'd
              > > efault'> <> <> <000000> <Closing:
              > 'weblogic.rjvm.t3.T3JVMConnection@488831'
              > > because of: 'Server received a message over an uniniti
              > > alized connection: 'JVMMessage from: 'null' to:
              > >
              > '5825313123619479267S:10.6.6.40:[8000,8000,8001,8001,8000,8001,-1]:cbeyond:c
              > > beyond
              > > Server' cmd: 'CMD_REQUEST', QOS: '101', responseId: '2', invokableId: '1',
              > > flags: 'JVMIDs Not Sent, TX Context Not Sent', abbrev o
              > > ffset: '204'''>
              > >
              > >
              > >
              

  • Transaction is not Rolling Back in Stateless Session Bean

              Hi,
              I am using UserTransaction in Stateless Session bean .
              Transaction is not rolling back.
              The following code is writen in stateless session bean. In UserTransaction i am
              calling Two methods of another stateless session bean.
              The problem is if doJob2() method fails, doJob1() method is rolling back. These
              two methods consist of SQL statement with different Connection Object from TXDataSource.And
              session bean(TestSession) is set to CMT, attribute as "Required".
              try{
              Context ictx=new InitialContext();
              TestHome home=(TestHome)ictx.lookup("TestSession");
                   utx = sessionCtx.getUserTransaction();
                   utx.begin();
              TestRemote remote=home.create();
                   remote.doJob1();
                   remote.doJob2();
                   utx.commit();
              }catch(Exception e)
                   try{
                   utx.rollback();
              }catch(Exception ex)
                   System.out.println("unable to rollback"+ex);
              if any SQL Exception as occured in doJob2(), its calling method utx.rollback()
              in catch block. but SQL statements executed thru. doJob1() are not rolling back.
              what might be the reason?
              thanks
              Ranganath
              

              Thanx Priscilla ,
              Transaction is working.
              ranganath
              "Priscilla Fung" <[email protected]> wrote:
              >
              >In your ejb-jar.xml, you should specify <transaction-type> element to
              >be "Container"
              >for container-managed transaction. If you specified it to be "Bean" for
              >bean-managed
              >transaction, EJB ontainer will suspend the caller's transaction before
              >starting
              >a new transaction for your doJobX() methods. Thus, doJob1()nd doJob2()
              >will be
              >executing in different transactions, and thus rolling back doJob2()'s
              >transaction
              >will have no effect on work done and committed in doJob1()'s transaction.
              >
              >Regards,
              >
              >Priscilla
              >
              >
              >"Ranganath" <[email protected]> wrote:
              >>
              >>
              >>
              >>I am sending config.xml,deployment descriptors, code snippet for TestSession.
              >>i
              >>am using weblogic6.0sp2.
              >>if you need any aditional info. please let me know.
              >>
              >>thanks
              >>ranganath
              >>
              >>EJB-JAR.xml
              >>
              >><?xml version="1.0"?>
              >>
              >><!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise
              >JavaBeans
              >>1.1//EN' 'http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd'>
              >>
              >><ejb-jar>
              >>     <enterprise-beans>
              >>     <session>
              >>          <ejb-name>TestSession</ejb-name>
              >>          <home>com.apar.sslbridge.test.TestHome</home>
              >>          <remote>com.apar.sslbridge.test.TestRemote</remote>
              >>          <ejb-class>com.apar.sslbridge.test.TestBean</ejb-class>
              >>          <session-type>Stateless</session-type>
              >>          <transaction-type>Bean</transaction-type>
              >>          <resource-ref>
              >>     <res-ref-name>jdbc/oraclePool</res-ref-name>
              >>     <res-type>javax.sql.DataSource</res-type>
              >>     <res-auth>Container</res-auth>
              >>          </resource-ref>
              >>     </session>
              >>     </enterprise-beans>
              >>     <assembly-descriptor>
              >>     <container-transaction>
              >>          <method>
              >>          <ejb-name>TestSession</ejb-name>
              >>          <method-intf>Remote</method-intf>
              >>          <method-name>*</method-name>
              >>          </method>
              >>          <trans-attribute>Required</trans-attribute>
              >>     </container-transaction>
              >> </assembly-descriptor>
              >></ejb-jar>
              >>
              >>
              >>TestSession CODE:
              >>
              >>
              >>     public void doJob1() throws RemoteException
              >>     {
              >>     Statement st = null;
              >>     String query=null;
              >>     try{
              >>     con=getConnection();
              >>     st=con.createStatement();
              >>     query="insert into x values("+x+++")";
              >>     System.out.println(query);
              >>     int rec=st.executeUpdate(query);
              >>     }catch(SQLException sqle)
              >>     {
              >>     System.out.println("SQL Exception "+sqle);
              >> throw new RemoteException("RemoteException*****SQLError");
              >>     } catch (Exception e) {
              >>     System.out.println("Exception "+e);
              >> throw new RemoteException("RemoteException*****GenralError");
              >> }
              >>}
              >>
              >>
              >> public void doJob2()throws RemoteException
              >> {
              >> Connection con=null;
              >> Statement st = null;
              >> String query=null;
              >> try{
              >> con=getConnection();
              >> st=con.createStatement();
              >> query="insert into y values("+x+++")";
              >> System.out.println(query);
              >> int rec=st.executeUpdate(query);
              >> }catch(SQLException sqle)
              >> {
              >> System.out.println("SQL Exception "+sqle);
              >> throw new RemoteException("RemoteException*****SQLError");
              >> } catch (Exception e) {
              >> System.out.println("Exception "+e);
              >> throw new RemoteException("RemoteException*****GenralError");
              >>}
              >>}
              >>private Connection getConnection(){
              >>try {
              >>Connection con = StaticParams.POOL_DATASOURCE.getConnection();
              >>return con;
              >>     } catch(Exception e) {
              >>     System.out.println("TestBean.getConnection() Unable to get get pool
              >>connection
              >>" + e);
              >>     }
              >>}
              >>
              >>
              >>
              >>
              >>"Priscilla Fung" <[email protected]> wrote:
              >>>
              >>>It should work if you are using TxDataSource. Could you post your
              >config.xml,
              >>>deployment descriptors, code snippet for TestSession?
              >>>
              >>>Regards,
              >>>
              >>>Priscilla
              >>>
              >>>"Ranganath" <[email protected]> wrote:
              >>>>
              >>>>Hi,
              >>>>
              >>>> I am using UserTransaction in Stateless Session bean .
              >>>> Transaction is not rolling back.
              >>>>
              >>>>The following code is writen in stateless session bean. In UserTransaction
              >>>>i am
              >>>>calling Two methods of another stateless session bean.
              >>>> The problem is if doJob2() method fails, doJob1() method is rolling
              >>>> back. These
              >>>>two methods consist of SQL statement with different Connection Object
              >>>>from TXDataSource.And
              >>>>session bean(TestSession) is set to CMT, attribute as "Required".
              >>>>
              >>>> try{
              >>>> Context ictx=new InitialContext();
              >>>> TestHome home=(TestHome)ictx.lookup("TestSession");
              >>>>     utx = sessionCtx.getUserTransaction();
              >>>>     utx.begin();
              >>>> TestRemote remote=home.create();
              >>>>     remote.doJob1();
              >>>>     remote.doJob2();
              >>>>     utx.commit();
              >>>> }catch(Exception e)
              >>>> {
              >>>>     try{
              >>>>      utx.rollback();
              >>>> }catch(Exception ex)
              >>>> {
              >>>>     System.out.println("unable to rollback"+ex);
              >>>>     }
              >>>> }
              >>>>if any SQL Exception as occured in doJob2(), its calling method utx.rollback()
              >>>>in catch block. but SQL statements executed thru. doJob1() are not
              >>rolling
              >>>>back.
              >>>>what might be the reason?
              >>>>
              >>>>thanks
              >>>>Ranganath
              >>>
              >>
              >
              

  • StreamCorruptedException from Stateless Session bean to java class

    Hi all,
    We have 2 servers, a ColdFusion App server which contains suns jdk 1.4.2 and websphere appserver using Ibm jdk, 1.4.2. On Server 1, we have a standalone java class which does a stateless session bean lookup and requests a service from it. On server 2(websphere), we have a stateless session bean deployed which connects to a database using a jndi lookup, executes a query and returns back a CachedRowSet object (which populates the ResultSet from the above query.) In some cases, session bean returns back an array of objects or String objects or just plain int values.
    When the java class on server 1 invokes the methods returning CachedRowSet, we are getting a StreamCorruptedException, whereas on the server side, there is no exception. everything gets executed fine on websphere. This is the case only for CachedRowSet and not for other return types(as mentioned earlier the session bean returns an array of object in some cases which the java class on server 1 is successfully able to use).
    This is what the piece of code look like on server 1:
    // First gets a StatelessSessionBean using suns InitialContextFactory
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.cosnaming.CNCtxFactory");
    env.put(Context.PROVIDER_URL,"iiop://localhost:2809");
    System.out.println("Creating initial context");
    Context ctx = new InitialContext(env);
    System.out.println("Initial context created.");
    Object homeObj = ctx.lookup("cell/nodes/localhost/servers/server1/ejb/SSBHome");
    SSBHome eHome = (SSBHome)PortableRemoteObject.narrow(homeObj,SSBHome.class);
    System.out.println("Got Home");
    SSB eBean = eHome.create();
    CachedRowSet crs = eBean.getAccts(param1, param2);
    //This is the line of code which throws the exception.
    The stacktrace shoows as follows:
    Got Home
    java.io.StreamCorruptedException
         at com.sun.corba.se.internal.io.IIOPInputStream.inputRemoteMembersForReadFields(IIOPInputStream.java:1675)
         at com.sun.corba.se.internal.io.IIOPInputStream.readFields(IIOPInputStream.java:1595)
         at com.sun.corba.se.internal.io.InputStreamHook.readFields(InputStreamHook.java:177)
         at java.math.BigInteger.readObject(BigInteger.java:3034)
         at com.sun.corba.se.internal.io.IIOPInputStream.readObject(Native Method)
         at com.sun.corba.se.internal.io.IIOPInputStream.invokeObjectReader(IIOPInputStream.java:1298)
         at com.sun.corba.se.internal.io.IIOPInputStream.inputObject(IIOPInputStream.java:908)
         at com.sun.corba.se.internal.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:261)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:247)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:209)
         at com.sun.corba.se.internal.iiop.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1084)
         at com.sun.corba.se.internal.iiop.CDRInputStream.read_value(CDRInputStream.java:293)
         at com.sun.corba.se.internal.io.IIOPInputStream.inputObjectField(IIOPInputStream.java:1484)
         at com.sun.corba.se.internal.io.IIOPInputStream.inputClassFields(IIOPInputStream.java:1893)
         at com.sun.corba.se.internal.io.IIOPInputStream.defaultReadObjectDelegate(IIOPInputStream.java:424)
         at com.sun.corba.se.internal.io.InputStreamHook.defaultReadObject(InputStreamHook.java:163)
         at java.math.BigDecimal.readObject(BigDecimal.java:1084)
         at com.sun.corba.se.internal.io.IIOPInputStream.readObject(Native Method)
         at com.sun.corba.se.internal.io.IIOPInputStream.invokeObjectReader(IIOPInputStream.java:1298)
         at com.sun.corba.se.internal.io.IIOPInputStream.inputObjectUsingFVD(IIOPInputStream.java:1182)
         at com.sun.corba.se.internal.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:259)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:247)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:209)
         at com.sun.corba.se.internal.iiop.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:948)
         at com.sun.corba.se.internal.iiop.CDRInputStream.read_value(CDRInputStream.java:289)
         at com.sun.corba.se.internal.corba.TCUtility.unmarshalIn(TCUtility.java:266)
         at com.sun.corba.se.internal.corba.AnyImpl.read_value(AnyImpl.java:561)
         at com.sun.corba.se.internal.iiop.CDRInputStream_1_0.read_any(CDRInputStream_1_0.java:635)
         at com.sun.corba.se.internal.iiop.CDRInputStream.read_any(CDRInputStream.java:260)
         at com.sun.corba.se.internal.javax.rmi.CORBA.Util.readAny(Util.java:100)
         at javax.rmi.CORBA.Util.readAny(Util.java:90)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.read_Array(ValueHandlerImpl.java:586)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:244)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:209)
         at com.sun.corba.se.internal.iiop.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1084)
         at com.sun.corba.se.internal.iiop.CDRInputStream.read_value(CDRInputStream.java:293)
         at com.sun.corba.se.internal.io.IIOPInputStream.inputObjectField(IIOPInputStream.java:1577)
         at com.sun.corba.se.internal.io.IIOPInputStream.inputClassFields(IIOPInputStream.java:1796)
         at com.sun.corba.se.internal.io.IIOPInputStream.inputObject(IIOPInputStream.java:913)
         at com.sun.corba.se.internal.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:261)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:247)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:209)
         at com.sun.corba.se.internal.iiop.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:948)
         at com.sun.corba.se.internal.iiop.CDRInputStream.read_value(CDRInputStream.java:289)
         at com.sun.corba.se.internal.corba.TCUtility.unmarshalIn(TCUtility.java:266)
         at com.sun.corba.se.internal.corba.AnyImpl.read_value(AnyImpl.java:561)
         at com.sun.corba.se.internal.iiop.CDRInputStream_1_0.read_any(CDRInputStream_1_0.java:635)
         at com.sun.corba.se.internal.iiop.CDRInputStream.read_any(CDRInputStream.java:260)
         at com.sun.corba.se.internal.javax.rmi.CORBA.Util.readAny(Util.java:100)
         at javax.rmi.CORBA.Util.readAny(Util.java:90)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.read_Array(ValueHandlerImpl.java:586)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:244)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:209)
         at com.sun.corba.se.internal.iiop.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1084)
         at com.sun.corba.se.internal.iiop.CDRInputStream.read_value(CDRInputStream.java:293)
         at com.sun.corba.se.internal.io.IIOPInputStream.inputObjectField(IIOPInputStream.java:1577)
         at com.sun.corba.se.internal.io.IIOPInputStream.inputClassFields(IIOPInputStream.java:1796)
         at com.sun.corba.se.internal.io.IIOPInputStream.inputObject(IIOPInputStream.java:913)
         at com.sun.corba.se.internal.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:261)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:247)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:209)
         at com.sun.corba.se.internal.iiop.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1084)
         at com.sun.corba.se.internal.iiop.CDRInputStream.read_value(CDRInputStream.java:293)
         at com.sun.corba.se.internal.io.IIOPInputStream.inputObjectField(IIOPInputStream.java:1577)
         at com.sun.corba.se.internal.io.IIOPInputStream.inputClassFields(IIOPInputStream.java:1796)
         at com.sun.corba.se.internal.io.IIOPInputStream.inputObject(IIOPInputStream.java:913)
         at com.sun.corba.se.internal.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:261)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:247)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:209)
         at com.sun.corba.se.internal.iiop.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1084)
         at com.sun.corba.se.internal.iiop.CDRInputStream.read_value(CDRInputStream.java:293)
         at com.EJBProj._SSB_Stub.getAccts(_SSB_Stub.java:240)
         at com.test.Test1.getAccts(Test1.java:101)
         at com.test.Test1.<init>(Test1.java:65)
         at com.test.Test1.main(Test1.java:81)
    java.io.IOException: Unable to read value from underlying bridge : Serializable readObject method failed internally
         at com.sun.corba.se.internal.io.IIOPInputStream.throwExceptionType(Native Method)
         at com.sun.corba.se.internal.io.IIOPInputStream.defaultReadObjectDelegate(IIOPInputStream.java:446)
         at com.sun.corba.se.internal.io.InputStreamHook.defaultReadObject(InputStreamHook.java:163)
         at java.math.BigDecimal.readObject(BigDecimal.java:1084)
         at com.sun.corba.se.internal.io.IIOPInputStream.readObject(Native Method)
         at com.sun.corba.se.internal.io.IIOPInputStream.invokeObjectReader(IIOPInputStream.java:1298)
         at com.sun.corba.se.internal.io.IIOPInputStream.inputObjectUsingFVD(IIOPInputStream.java:1182)
         at com.sun.corba.se.internal.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:259)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:247)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:209)
         at com.sun.corba.se.internal.iiop.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:948)
         at com.sun.corba.se.internal.iiop.CDRInputStream.read_value(CDRInputStream.java:289)
         at com.sun.corba.se.internal.corba.TCUtility.unmarshalIn(TCUtility.java:266)
         at com.sun.corba.se.internal.corba.AnyImpl.read_value(AnyImpl.java:561)
         at com.sun.corba.se.internal.iiop.CDRInputStream_1_0.read_any(CDRInputStream_1_0.java:635)
         at com.sun.corba.se.internal.iiop.CDRInputStream.read_any(CDRInputStream.java:260)
         at com.sun.corba.se.internal.javax.rmi.CORBA.Util.readAny(Util.java:100)
         at javax.rmi.CORBA.Util.readAny(Util.java:90)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.read_Array(ValueHandlerImpl.java:586)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:244)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:209)
         at com.sun.corba.se.internal.iiop.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1084)
         at com.sun.corba.se.internal.iiop.CDRInputStream.read_value(CDRInputStream.java:293)
         at com.sun.corba.se.internal.io.IIOPInputStream.inputObjectField(IIOPInputStream.java:1577)
         at com.sun.corba.se.internal.io.IIOPInputStream.inputClassFields(IIOPInputStream.java:1796)
         at com.sun.corba.se.internal.io.IIOPInputStream.inputObject(IIOPInputStream.java:913)
         at com.sun.corba.se.internal.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:261)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:247)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:209)
         at com.sun.corba.se.internal.iiop.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:948)
         at com.sun.corba.se.internal.iiop.CDRInputStream.read_value(CDRInputStream.java:289)
         at com.sun.corba.se.internal.corba.TCUtility.unmarshalIn(TCUtility.java:266)
         at com.sun.corba.se.internal.corba.AnyImpl.read_value(AnyImpl.java:561)
         at com.sun.corba.se.internal.iiop.CDRInputStream_1_0.read_any(CDRInputStream_1_0.java:635)
         at com.sun.corba.se.internal.iiop.CDRInputStream.read_any(CDRInputStream.java:260)
         at com.sun.corba.se.internal.javax.rmi.CORBA.Util.readAny(Util.java:100)
         at javax.rmi.CORBA.Util.readAny(Util.java:90)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.read_Array(ValueHandlerImpl.java:586)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:244)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:209)
         at com.sun.corba.se.internal.iiop.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1084)
         at com.sun.corba.se.internal.iiop.CDRInputStream.read_value(CDRInputStream.java:293)
         at com.sun.corba.se.internal.io.IIOPInputStream.inputObjectField(IIOPInputStream.java:1577)
         at com.sun.corba.se.internal.io.IIOPInputStream.inputClassFields(IIOPInputStream.java:1796)
         at com.sun.corba.se.internal.io.IIOPInputStream.inputObject(IIOPInputStream.java:913)
         at com.sun.corba.se.internal.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:261)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:247)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:209)
         at com.sun.corba.se.internal.iiop.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1084)
         at com.sun.corba.se.internal.iiop.CDRInputStream.read_value(CDRInputStream.java:293)
         at com.sun.corba.se.internal.io.IIOPInputStream.inputObjectField(IIOPInputStream.java:1577)
         at com.sun.corba.se.internal.io.IIOPInputStream.inputClassFields(IIOPInputStream.java:1796)
         at com.sun.corba.se.internal.io.IIOPInputStream.inputObject(IIOPInputStream.java:913)
         at com.sun.corba.se.internal.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:261)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:247)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:209)
         at com.sun.corba.se.internal.iiop.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1084)
         at com.sun.corba.se.internal.iiop.CDRInputStream.read_value(CDRInputStream.java:293)
         at com.EJBProj._SSB_Stub.getAccts(_SSB_Stub.java:240)
         at com.test.Test1.getAccts(Test1.java:101)
         at com.test.Test1.<init>(Test1.java:65)
         at com.test.Test1.main(Test1.java:81)
    Again, everything seems to work fine on websphere server.
    Any Clue of why this is happening?
    All suggestions are greatly appreciated.
    Thanks
    Neorav
    Message was edited by:
    NeoravB

    Sorry for the confusion!
    The solution mentioned above is not the right solution.
    The above given code works fine irrespective of having corbaloc in the url, if you are working in the IBMs jvm.
    It fails if you are working in suns jvm.
    Anyone with any idea whats missing here.
    Thanks a lot for any suggestion/ideas
    Neorav

  • Trying to return a Vector from stateless session bean.

    I have a simple Java client which needs to retrieve instances from an Entity Bean, to load into a JTable. I used a CMP entity bean, and wrote a getter method in a stateless session bean, to retrieve the instances and load them into a vector (via a Collection). When I try to return the Vector to the client, the client thread throws an exception, indicating that the object (Vector) is NOT serializable. I thought Vector WAS serializable? What am I doing wrong?
    I did run System.out.println on the Vector in the session bean, and it does display the expected data, so I know the Vector is being populated within the session bean.
    Thanks

    Are you sure that the objects (and all dependent objects) contained by the Vector are serializable?

  • What's s the best automated route from stateless session bean class to EJB?

    Hi,
    I have an application that generates stateless session bean classes.
    For any given stateless session bean class, I would like to build an EJB, moreover, I would like to automate the process as much as possible.
    I'd rather not rely on a full blown third party IDE.
    I reckon could write a set of java classes that could analyse the session bean class and generate the home and remote interface and a basic deployment descriptor.
    That said, I have no doubt that I would be renventing the wheel.
    But I am struggling to find a utility/class of the appropriate granularity in the public domain.
    I am wide open to any feedback on approaches people may have taken and the pros and pitfalls.
    I fully realise my question is quite unspecific, but I really wanted to get some feedback and start a discussion. Since, I am sure there is no 'correct' answer.
    Most kind regards,
    Simon.

    My best advice: surrender to use an IDE.
    You wonder sometimes at how much productivity (read as 'time') could be wasted by doing something that could be done automatically. For a learning experience or a once only exercise is fine but as a routine thing, not worth it.
    Cheers

  • Authentication error when using JMS service

    I'm currently trying to send String messages from LiveCycle to Websphere MQ (Both running on the same server), but I'm having some problems...
    I''m quite sure that my WAS setup is correct (or at least close to correct) because I've build some test Java classes that are able to put and get messages from MQ using JMS. However, when I'm usng the LiveCycle JMS service I get the following exception thrown:
    [5/26/10 17:46:44:705 CAT] 00000027 QueueMessageS A com.adobe.livecycle.jms.QueueMessageSender sendMessageToQueueWithProperties Error occurred when creating queue connection. Reason: MQJMS2013: invalid security authentication supplied for MQQueueManager.
    Since I'm not a Websphere fundi I trawled through Google and was able to figure out that the problem probably lies with the configuration of my queue connection factory. Changing the transport type from "Bindings" to "Client" didn't resolve the problem and I'm rapidly running out of good ideas. Hopefully somebody here would be able to help.
    The following info might be useful:
    OS = Windows Server 2003
    I'm using WAS 6.1.0.29
    Websphere MQ is running on the same machine (v6.0)
    I've used the Websphere MQ JMS Provider that comes with WAS
    I've configured a Queue Connection Factory and a Queue in the server scope
    No SSL or anything like that is set up yet
    I did notice that when configuring the Queue there is a section titled "WebSphere MQ Queue Connection Properties" where I am able to specify a user Id and password. However, nothing seemed to work. I tried my WAS administration user name, as well as a windows user who is indeed a member of the mqm group. Also tried it without any value, but no luck
    On the MQ side I couldn't really find any settings under either the Queue Manager or the Channel that would make much of a difference. Since I was able to access the queues using a servlet deployed on the same WAS instance I'm thinking it has something to do with the way that LC call the JMS provider. But to be honest, I don't really have a clue.
    Any help would be much appreciated.
    Greg

    Haven't solved the problem yet, but here's an update:
    I created an "ExecureScript" operation that contains simple Java code to write a message to MQ using the same JMS connection factory and JMS queue. It does work correctly, so clearly my setup it correct enough to send messages from LiveCycle to MQ via JMS.
    Here's the code for the ExecuteScript:
    //import the classes that the script references
    import java.util.List;
    import java.lang.String;
    import java.util.Map;
    import java.util.HashMap;
    import javax.jms.*;
    import javax.naming.*;
    //get a list of file names that are stored in the process variable named files
    String strMessage = patExecContext.getProcessDataStringValue("/process_data/@strMessage");
    //get connection factory
    String strQcf = patExecContext.getProcessDataStringValue("/process_data/@strQcf");
    //get queue
    String strQ = patExecContext.getProcessDataStringValue("/process_data/@strQ");
    try
        // Look up administered objects
        System.out.println("Looking up administered objects...");
        InitialContext initContext;
        initContext = new InitialContext();
        QueueConnectionFactory factory = (QueueConnectionFactory) initContext.lookup(strQcf);
        Queue queue = (Queue) initContext.lookup(strQ);           
        initContext.close();
          // Create JMS objects
          System.out.println("Creating JMS objects...");
          QueueConnection connection = factory.createQueueConnection();
          QueueSession session =    connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
        QueueSender sender = session.createSender(queue);
          //Send messages
          TextMessage message = session.createTextMessage(strMessage);
          sender.send(message);
           //Exit
           System.out.println("Exiting...");
           connection.close();
           System.out.println("Goodbye!");   
    } catch (Exception e)
            e.printStackTrace();
    Interestingly I don't provide any authentication information and yet LC is able to connect to MQ
    Cheers

  • InvocationException when use JMS from RA

    Hi everybody,
    I encountered an interesting thing (I guess a bug).
    The JMS Reference Implementation on the J2EE 1.4 RI works if you use JMS API in your servlets or even in you standalone (not deployed) application.
    But when you use the same coding inside of your Resource Adapter, like
    try{
    Context jndiContext= new InitialContext();
    javax.jms.ConnectionFactory jmsConnectionFactory =
    (javax.jms.ConnectionFactory)jndiContext.lookup
    ("QueueConnectionFactory");
    javax.jms.Connection jmsConnection =
    jmsConnectionFactory.createConnection();
    javax.jms.Session jmsSession =
    jmsConnection.createSession(false,
    Session.AUTO_ACKNOWLEDGE);
    jmsConnection.close();
    }//try
    catch (java.lang.Exception ex){
    ex.printStackTrace();
    }//catch
    the Session cannot be created and following Exception is thrown
    com.sun.enterprise.InvocationException
         at com.sun.enterprise.util.InvocationManagerImpl.getCurrentInvocation(InvocationManagerImpl.java:188)
         at com.sun.enterprise.resource.PoolManagerImpl.getResource(PoolManagerImpl.java:96)
         at com.sun.enterprise.resource.ConnectionManagerImpl.internalGetConnection(ConnectionManagerImpl.java:149)
         at com.sun.enterprise.resource.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:58)
         at com.sun.jms.connector.ra.JMSConnectionAdapter.createSession(JMSConnectionAdapter.java:363)
    The only cause for this Exception I see, is that J2EE RI doesn't handles yet the case, when the JMS API calls are comming from the threads, which are issued specially for resource adapters. And since even the standalone application using default environment properties to creat an InitialContext can create a Session to a JMS queue, I don't see the reason, why the Resource Adapter shouldn't be able to do this. So I guess, that is a bug.
    But anyway, does somebody know a workaround for this case? Or just any ideas?
    Thanks,
    Eugen

    Any luck figuring this out? i'm getting the same exception when appserver 8 does an auto reload of my webapp. For some reason the jdbc connection pools are messed up at that point.

  • "Not in a transaction" errors when using Oracle Thin Driver 9.0.1 with Weblogic 6.1

    Within a Tx data source by administered by Weblogic, I receive these
    errors when trying to access a Stored Procedure (that returns a
    resultset) through JDBC.
    The code fails at line ***, with the call to getObject;
    Any ideas?
    -H
    Here's an example of some code:
    try {
    stmt = getConnection().prepareCall(getTarget());
    stmt.registerOutParameter(1, OracleTypes.CURSOR);
    // set the input param
    stmt = JDBCHelper.paramSetter(stmt, getParameters());
    // execute and retrieve the result set
    stmt.execute();
    *** rs = (ResultSet)stmt.getObject(1);
    crs = new CachedRowSet();
    crs.populate(rs);
    a.add(crs);
    setResult(a);
    catch (Exception e) {

    Humphrey,
    Support of a feature means that it's gone though the full QA and
    PM approval cycle and it has been officially declared as supported.
    Feature may work well even if it's not supported. It just means you use
    it at your own risk.
    Regards,
    Slava Imeshev
    "Humphrey" <[email protected]> wrote in message
    news:[email protected]..
    According to the BEA documentation, this version of the driver is not
    supported due to "Known Issues" - does anyone know of what these
    issues are, perhaps there's a list somewhere?
    This is particularly strange since another document from BEA at
    http://e-docs.bea.com/wls/docs61/jdbc/thirdparty.html does mention how
    to upgrade the driver to 9.0.1, with no mention of any problems.

  • Error when using 'service in0/0 session' command.

    Good morning everyone,
    I'm having difficulties with one of my companies UC500 systems. It has been sitting for a number of months with no use, and we're putting it back in to production. When I attempt to take it offline to backup it's old config, I get a kernel panic (the full error is attached below). I can stop the panic and get it back to a working state. But in the course of doing that, the system won't save any config changes I have made. Are the hda1 errors on the bottom of the message anything to do with the CF cards? Can anyone tell me what I am doing wrong?
    Thanks,
    Stephen.
    Here is the error dump:
    Trying to shutdown Service Module Integrated-Service-Engine0/0
    Cisco BootMon Version: 1.0.2
    (Feb 27 2007 - 10:38:53) MPC83XX
    Bootmon starts
    Bootmon: cold reset.
    System now booting.
    Bootmon: reading primary bootloader image
    Bootmon: calling bootloader
    Cisco ServiceEngine Bootloader Version: 1.0.3
    (Jul  6 2007 - 10:15:37) MPC83XX
    Resetting devices ....Done.
    mac address for internal ethernet 00:1b:7a:42:55:de
    Please enter '***' to change boot configuration:
    ServicesEngine Bootloader Version : 1.0.3
    kern_sz: 1208148
    bl_boot_cf_cmd root=/dev/hda1 install_root=ide ro plat=freddo
    ## Booting image at 04000000 ...
       Image Name:   Linux-2.6.11.11-ppc
       Image Type:   PowerPC Linux Kernel Image (gzip compressed)
       Data Size:    1208084 Bytes =  1.2 MB
       Load Address: 00000000
       Entry Point:  00000000
       Verifying Checksum ... OK
       Uncompressing Kernel Image ... OK
    Linux version 2.6.11.11 (drodrig@fndn-bld-system1) (gcc version 3.4.3) #1 Fri Jan 25 19:10:11 PST 2008
    Built 1 zonelists
    Kernel command line: root=/dev/hda1 install_root=ide ro plat=freddo
    IPIC (128 IRQ sources, 8 External IRQs) at fe000700
    PID hash table entries: 4096 (order: 12, 65536 bytes)
    Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
    Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
    Memory: 514944k available (2036k kernel code, 552k data, 124k init, 0k highmem)
    Kernel Log Buffers loaded at 0xdfe80000, size: 524288 bytes
    Trace Buffers loaded at 0xdff00000, size: 1048576 bytes
    in atrace_init
    log_head: h: 0, t: 0, l: 0, w: 0, s: 1047488
    Using existing trace log
    log_head: h: 0, t: 0, l: 0, w: 0, s: 1047488
    Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
    NET: Registered protocol family 16
    PCI: Probing PCI hardware
    PCI: Cannot allocate resource region 0 of device 0000:00:00.0
    PCI: Cannot allocate resource region 2 of device 0000:00:00.0
    PCI: Failed to allocate mem resource #2:80000000@80000000 for 0000:00:00.0
    SCSI subsystem initialized
    usbcore: registered new driver usbfs
    usbcore: registered new driver hub
    devfs: 2004-01-31 Richard Gooch ([email protected])
    devfs: devfs_debug: 0x0
    devfs: boot_options: 0x1
    Cisco ContentEngine Flash Driver Version 0.02
    Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing disabled
    ttyS0 at MMIO 0xe0004500 (irq = 9) is a 16550A
    ttyS1 at MMIO 0xe0004600 (irq = 10) is a 16550A
    io scheduler noop registered
    io scheduler anticipatory registered
    io scheduler deadline registered
    io scheduler cfq registered
    RAMDISK driver initialized: 16 RAM disks of 32768K size 1024 blocksize
    loop: loaded (max 8 devices)
    GFAR: MTU = 1500 (frame size=1518,rx_buffer_size=1536,truesize=1784,sk_buff=152)
    eth0: Gianfar Ethernet Controller Version 1.1, 00:1b:7a:42:55:de
    eth0: Running with NAPI enabled
    Weight = 32
    eth0: 32/32 RX/TX BD ring size
    eth0: PHY is PHY-less
    GFAR: MTU = 1500 (frame size=1518,rx_buffer_size=1536,truesize=1784,sk_buff=152)
    eth1: Gianfar Ethernet Controller Version 1.1, 00:1b:7a:42:55:df
    eth1: Running with NAPI enabled
    Weight = 32
    eth1: 32/32 RX/TX BD ring size
    eth1: PHY is PHY-less
    Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
    ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
    hda: probing with STATUS(0x50) instead of ALTSTATUS(0x0a)
    hda: STI Flash 7.4.2, CFA DISK drive
    hdb: probing with STATUS(0x50) instead of ALTSTATUS(0x0a)
    hdb: probing with STATUS(0x51) instead of ALTSTATUS(0x0a)
    ide0 at 0xe1000000-0xe1000007,0xe100280d on irq 17
    hda: max request size: 128KiB
    hda: 2001888 sectors (1024 MB), CHS=1986/16/63
    /dev/ide/host0/bus0/target0/lun0: p1 p2
    ehci_hcd 0000:00:12.2: EHCI Host Controller
    ehci_hcd 0000:00:12.2: irq 18, pci mem 0x7fffef00
    ehci_hcd 0000:00:12.2: new USB bus registered, assigned bus number 1
    ehci_hcd 0000:00:12.2: USB 2.0 initialized, EHCI 0.95, driver 10 Dec 2004
    hub 1-0:1.0: USB hub found
    hub 1-0:1.0: 2 ports detected
    Initializing USB Mass Storage driver...
    usbcore: registered new driver usb-storage
    USB Mass Storage support registered.
    i2c /dev entries driver
    NET: Registered protocol family 2
    IP: routing cache hash table of 4096 buckets, 32Kbytes
    TCP established hash table entries: 131072 (order: 8, 1048576 bytes)
    TCP bind hash table entries: 65536 (order: 6, 262144 bytes)
    TCP: Hash tables configured (established 131072 bind 65536)
    NET: Registered protocol family 1
    NET: Registered protocol family 17
    Exporting platform capabilities
    /dev/ide/host0/bus0/target0/lun0: p1 p2
    ReiserFS: hda1: found reiserfs format "3.6" with standard journal
    ReiserFS: hda1: using ordered data mode
    ReiserFS: hda1: journal params: device hda1, size 8192, journal first block 18, max trans len 1024, max batch 900, max commit age 30, max trans age 30
    ReiserFS: hda1: checking transaction log (hda1)
    ReiserFS: hda1: Using r5 hash to sort names
    VFS: Mounted root (reiserfs filesystem) readonly.
    Mounted devfs on /dev
    hda: task_in_intr: status=0x51 { DriveReady SeekComplete Error }
    hda: task_in_intr: error=0x40 { UncorrectableError }, LBAsect=1321204, sector=1321204
    ide: failed opcode was: unknown
    end_request: I/O error, dev hda, sector 1321204
    ReiserFS: hda1: warning: vs-13070: reiserfs_read_locked_inode: i/o failure occurred trying to find stat data of [5962 5985 0x0 SD]
    hda: task_in_intr: status=0x51 { DriveReady SeekComplete Error }
    hda: task_in_intr: error=0x40 { UncorrectableError }, LBAsect=1321204, sector=1321204
    ide: failed opcode was: unknown
    end_request: I/O error, dev hda, sector 1321204
    ReiserFS: hda1: warning: vs-13070: reiserfs_read_locked_inode: i/o failure occurred trying to find stat data of [5962 5985 0x0 SD]
    hda: task_in_intr: status=0x51 { DriveReady SeekComplete Error }
    hda: task_in_intr: error=0x40 { UncorrectableError }, LBAsect=1321204, sector=1321204
    ide: failed opcode was: unknown
    end_request: I/O error, dev hda, sector 1321204
    ReiserFS: hda1: warning: vs-13070: reiserfs_read_locked_inode: i/o failure occurred trying to find stat data of [5962 5992 0x0 SD]
    Kernel panic - not syncing: No init found.  Try passing init= option to kernel.
    <0>Rebooting in 180 seconds..

    Stephen,
    The errors look to indicate that the information stored on the CFcard is corrupt. You'll need to re-install CUE through the boot loader. If that fails, then an RMA of the CF card may be necessary.
    http://www.cisco.com/en/US/docs/voice_ip_comm/unity_exp/rel3_1/installation/guide/boothelp31.html
    -Felipe

  • Web ADI Error when using column from table which can be NULL as parameter

    Hi
    We have a custom integrator which queries the records and downloads into excel sheet. There is parameter list attached to it. One of the parameter is on a field which can have NULL. When we try running the ADI , we are getting the error :
    Fatal error: Please have your system administrator view the bne.log file.
    java.lang.NullPointerException
    Please contact your support representative
    Please help.
    Regards,
    Pradeep.

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by Stefan Misch ([email protected]):
    Yep - if you try:
    create unique index XAK2_A_ARTIKEL
    on A_ARTIKEL(CUST_ID, EXTERNAL_ID);
    I get error ORA-01452, because of duplicate keys. I verified, that within a each CUST_ID, there is no duplicate non-null EXTERNAL_ID, but there are lots of rows for each CUST_ID where EXTERNAL_ID is NULL.
    Thanks for your help.
    Stefan<HR></BLOCKQUOTE>
    Create a view on your table, that you will use for inserts.
    Then, create a trigger INSTEAD OF INSERT on your view. You can perform the checks for uniqueness in it...
    Hope this will help...
    Thomas.
    null

  • Not be able to obtain a transacted session within stateless session bean

    I need some assistance on creating a transacted session. For some reason while within a stateless session bean, I am unable to create a transacted session even though I'm specifying to create the transacted queue session. Can anyone provide any assistance to me on this? It would be much appreciated.
    Here is the code snippets involved with the problem:
    Code snipet from ejb-jar.xml:
    <session>
    <display-name>Initial Request</display-name>
    <ejb-name>InitialRequestBean</ejb-name>
    <ejb-class>com.raytheon.rds.jms.InitialRequestBean</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Container</transaction-type>
    </session>
    Code from stateless session bean:
    static Logger logger;
    private QueueConnectionFactory connectionFactory;
    private SessionContext sc;
    private Queue requestQueue;
    public String processRequest(String msgBody)
    logger.log(Level.INFO, "In processRequest(String).", msgBody);
    QueueConnection con = null;
    QueueSession session = null;
    QueueSender sender = null;
    TextMessage message = null;
    String messageID = null;
    QueueReceiver receiver = null;
    TemporaryQueue replyQueue = null;
    boolean transacted = false;
    try
    //Create the infrastructure (ie. The connection & the session)
    logger.log(Level.FINE, "Creating connection");
    con = connectionFactory.createQueueConnection();
    logger.log(Level.FINE, "Creating session");
    session = con.createQueueSession(true, Session.AUTO_ACKNOWLEDGE);
    //Note: This line above was changed in all possible permutation and still didn't work such as using Session.SESSION_TRANSACTED
    transacted = session.getTransacted();
    logger.log(Level.FINE, "Is session transacted? : " + transacted);
    //Note: This line above is constantly saying false
    //Now first, setup the temporary reply queue and its listener
    replyQueue = session.createTemporaryQueue();
    logger.log(Level.FINE, "Creating receiver/consumer");
    receiver = session.createReceiver(replyQueue);
    con.start();
    //Now create the requestor that will make the request message and put it on the request queue
    logger.log(Level.FINE, "Creating Requestor/Producer");
    sender = session.createSender(requestQueue);
    //Now create the message and make sure that you put the "JMSReplyTo" property to the temporary response queue we just created
    message = session.createTextMessage();
    message.setJMSReplyTo(replyQueue);
    logger.log(Level.FINE, "Created message: " + message.getJMSMessageID());
    //Now add the actual info you want to send
    message.setText(msgBody);
    //Now send the message
    logger.log(Level.INFO, "Sending message: " + message.getText());
    sender.send(message);
    //Now wait until we get a response
    logger.log(Level.FINE, "Waiting for the response message");
    Message responseMsg = receiver.receive(20000); //Toggle the "0" to specify timeout in millisectionds
    //Process the message
    logger.log(Level.FINE, "Processing the response message");
    if(null != responseMsg)
    logger.log(Level.FINE, "responseMsg is : " + responseMsg.toString());
    messageID = processMessage(responseMsg);
    logger.log(Level.FINE, "Response is : " + messageID);
    //close the connection
    logger.log(Level.FINE, "Stopping the connection");
    con.stop();
    catch (Throwable t)
    // JMSException could be thrown
    logger.log(Level.SEVERE, "Exception Thrown in sendRequest: ", t);
    sc.setRollbackOnly();
    finally
    //Close the sender
    if (sender != null)
    try
    logger.log(Level.FINE, "Closing the sender");
    sender.close();
    catch (JMSException e)
    logger.log(Level.WARNING, "JMSException Thrown when trying to close the sender to the request queue: ", e);
    else
    logger.log(Level.FINE, "Sender is already closed.");
    //Close the receiver
    if (receiver != null)
    try
    logger.log(Level.FINE, "Closing the receiver");
    receiver.close();
    catch (JMSException e)
    logger.log(Level.WARNING, "JMSException Thrown when trying to close the receiver to the request queue: ", e);
    else
    logger.log(Level.FINE, "Receiver is already closed.");
    //Close the session
    if (session != null)
    try
    logger.log(Level.FINE, "Closing the session");
    session.close();
    catch (JMSException e)
    logger.log(Level.WARNING, "JMSException Thrown when trying to close the session to the request queue: ", e);
    else
    logger.log(Level.FINE, "Session is already closed.");
    //Close the connection
    if (con != null)
    try
    logger.log(Level.FINE, "Closing the connection");
    con.close();
    catch (JMSException e)
    logger.log(Level.WARNING, "JMSException Thrown when trying to close the connection to the reply queue: ", e);
    else
    logger.log(Level.FINE, "Connection is already closed.");
    return messageID;
    }

    I found the answer through lots of painful searching.
    http://blogs.sun.com/fkieviet/entry/request_reply_from_an_ejb
    This weblog from Frank Kieviet from a sun blog explains what's happening behind the scenes.
    Then I proceeded to create a Bean-Managed Transaction out of my EJB, which is using EJB 3.0. This requires the tag:
    @TransactionManagement(value= TransactionManagementType.BEAN)
    Note: I got this information from http://download.oracle.com/docs/cd/B31017_01/web.1013/b28221/servtran001.htm#BAJIBAFF
    Then I just added the code specified in Frank's blog and everything is working now. The main portion of the code looks like this now:
    //begin the user transaction
    ctx.getUserTransaction().begin();
    //Create the infrastructure (ie. The connection & the session)
    logger.log(Level.FINE, "Creating connection");
    con = connectionFactory.createQueueConnection();
    //Create the session
    logger.log(Level.FINE, "Creating session");
    session = con.createQueueSession(false, Session.SESSION_TRANSACTED);
    transacted = session.getTransacted();
    logger.log(Level.FINE, "Is session transacted? : " + transacted);
    //Now create the sender that will make the request message and put it on the request queue
    logger.log(Level.FINE, "Creating Sender");
    sender = session.createSender(requestQueue);
    //Now create the message
    message = session.createTextMessage();
    //Now add the actual info you want to send
    message.setText(msgBody);
    logger.log(Level.FINE, "Created message: " + message.getJMSMessageID());
    //Now first, setup the temporary reply queue and its listener
    replyQueue = session.createTemporaryQueue();
    if(null != replyQueue)
    logger.log(Level.FINE, "Created temporary queue: " + replyQueue.getQueueName());
    else
    logger.log(Level.FINE, "Temporary Queue could not be created.");
    //make sure that you put the "JMSReplyTo" property to the temporary response queue we just created
    message.setJMSReplyTo(replyQueue);
    //Now send the message
    logger.log(Level.INFO, "Sending message: " + message.getText());
    sender.send(message);
    //Now start the connection
    logger.log(Level.FINE, "Starting the connection");
    con.start();
    //commit the changes
    ctx.getUserTransaction().commit();
    ctx.getUserTransaction().begin();
    //Create the receiver
    logger.log(Level.FINE, "Creating Receiver");
    receiver = session.createReceiver(replyQueue);
    //Now wait until we get a response
    logger.log(Level.FINE, "Waiting for the response message");
    Message responseMsg = receiver.receive(20000); //Toggle the "0" to specify timeout in millisectionds
    //Process the message
    logger.log(Level.FINE, "Processing the response message");
    if(null != responseMsg)
    logger.log(Level.FINE, "responseMsg is : " + responseMsg.toString());
    else
    logger.log(Level.FINE, "No response came back.");
    messageID = processMessage(responseMsg);
    logger.log(Level.FINE, "Response is : " + messageID);
    logger.log(Level.FINE, "Transaction is complete");
    //commit the changes
    ctx.getUserTransaction().commit();

  • A tough one for EJB experts - Stateless session bean spec question

    I am busy learning more about EJBs and came across something confusing regarding the legal operations in the various container callback methods for stateless session beans.
    Specifically, the EJB spec states that in the ejbCreate() method, the SessionContext can be used to obtain a reference to the EJB Object. Now this makes perfect sense with stateful session beans, since the ejbCreate() method isn't called until a client is creating a bean and the container has linked that bean to the client's EJB Object. However, it is my understanding that when it comes to stateless session beans, the container creates the beans and adds them to the bean pool at its leisure. It is not until a business method is called by a client that a stateless bean is actually linked to an EJB object. So, how is it that a stateless bean could ever obtain a reference to an EJB Object from within ejbCreate(). Which EJB Object would it be linked to? This operation just doesn't appear to make sense in that context.
    Can anyone clarify this for me?

    Interesting question. I have such questions all the time! Here's a link to a similar discussion
    http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=70&t=000905
    Also, I tried this using Weblogic 8.1. Tried to access the EJBObject in ejbCreate before any business method was invoked. I did this by specifying a value for initial-beans-in-free-pool and found that the hash code for the EJBObject was the same for all the bean instances that were created on startup.
    I then invoked a business method and accessed the EJBObject in that method. Again the hash code for the object was the same as the one created on startup.
    Seemed to be that there is a 1:n relation between the EJBObject and bean instances.
    This may be container specific. The spec says the user should be able to invoke the getEJBObject() method in ejbCreate(), its upto the container to comply with it.

  • A simple class vs. Stateless Session Bean

    If I want a stateless bean to do some simple work such as give it a number A
              and get A+10 in return, does the Stateless session bean really perform
              better than a simple class? In my project, there are lots of simple job like
              this, which one should I use? A Stateless session bean or a simple class?
              Besides, when is the right time to use a stateful session bean? I use the
              servlet to keep user information in the session, and than have the stateless
              session bean working with it...This pattern meets most requirement....So I'm
              wondering in what situation should I need to use stateful session bean?
              Thanks!
              

    - It is far better to use a stateless session bean when implementing the session-facade pattern.
    - Keeping a home interface on the object won't make him stateful.
    - with the stateless beans, you do not decide when they're created. The container does.
    - The number of entity beans is not so important. The only thing important is to have a remote methode in your stateless(es) for each atomic transaction ("atomic" meaning here "you cannot cut").
    /Stephane

  • NameNotFoundException EJB 3.0 Stateless Session Bean

    Hi i am new to ejb 3.0 as well as ejb actually. I encountered an error trying out a small stateless session bean application.
    23:15:02,312 ERROR [STDERR] javax.naming.NameNotFoundException: com.afis.ct.ri.session.ejb.ReportIncidentSession not bound
    23:15:02,312 ERROR [STDERR]      at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
    23:15:02,312 ERROR [STDERR]      at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
    23:15:02,312 ERROR [STDERR]      at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
    23:15:02,312 ERROR [STDERR]      at org.jnp.server.NamingServer.lookup(NamingServer.java:296)
    23:15:02,312 ERROR [STDERR]      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:625)
    23:15:02,312 ERROR [STDERR]      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
    23:15:02,312 ERROR [STDERR]      at javax.naming.InitialContext.lookup(InitialContext.java:351)
    23:15:02,312 ERROR [STDERR]      at com.afis.ct.servlets.ri.ValidateIdentityServlet.validateIdentity(ValidateIdentityServlet.java:64)
    23:15:02,312 ERROR [STDERR]      at com.afis.ct.servlets.ri.ValidateIdentityServlet.processRequest(ValidateIdentityServlet.java:35)
    23:15:02,312 ERROR [STDERR]      at com.afis.ct.servlets.ri.ValidateIdentityServlet.doGet(ValidateIdentityServlet.java:19)
    23:15:02,312 ERROR [STDERR]      at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
    23:15:02,312 ERROR [STDERR]      at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    23:15:02,328 ERROR [STDERR]      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
    23:15:02,328 ERROR [STDERR]      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    23:15:02,328 ERROR [STDERR]      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
    23:15:02,328 ERROR [STDERR]      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
    23:15:02,328 ERROR [STDERR]      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    23:15:02,328 ERROR [STDERR]      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    23:15:02,328 ERROR [STDERR]      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
    23:15:02,328 ERROR [STDERR]      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
    23:15:02,328 ERROR [STDERR]      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
    23:15:02,328 ERROR [STDERR]      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
    23:15:02,328 ERROR [STDERR]      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
    23:15:02,328 ERROR [STDERR]      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
    23:15:02,328 ERROR [STDERR]      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
    23:15:02,328 ERROR [STDERR]      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
    23:15:02,328 ERROR [STDERR]      at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
    23:15:02,328 ERROR [STDERR]      at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
    23:15:02,328 ERROR [STDERR]      at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
    23:15:02,328 ERROR [STDERR]      at java.lang.Thread.run(Thread.java:595)My remote interface looks like
    package com.afis.ct.ri.session.ejb;
    import javax.ejb.Remote;
    @Remote
    public interface ReportIncidentSession {
         public boolean isIdentityValid(String identity);
    }My bean looks like
    package com.afis.ct.ri.session.ejb;
    import javax.ejb.Stateless;
    @Stateless
    public class ReportIncidentSessionBean implements ReportIncidentSession {
         public ReportIncidentSessionBean() {
              super();
         public boolean isIdentityValid(String identity) {
              return true;
    }Finally i am calling from a servlet which is part of a web application under the same hood(ear) as the ejb jar file.
    InitialContext ctx=new InitialContext();
                   ReportIncidentSession session=(ReportIncidentSession)ctx.lookup(ReportIncidentSession.class.getName());
                                  return session.isIdentityValid(identity);I have done nothing more than making sure there is no compilation error, and i feel some mandatory steps are missing.. So thanks for any help!
    Marvelous.

    Hi DRS, i tried your recommendation and injected the following on top of my servlet class:
    EJB(name="ReportIncidentSessionBean", businessInterface=ReportIncidentSession.class)
    public class ValidateIdentityServlet extends HttpServlet implements
              ValidateIdentity {The original beanInterface you mentioned had an error.
    And upon deployment, JBoss wasn't able to generate a deployment descriptor hinting at the annotations.
    23:50:08,765 ERROR [MainDeployer] Could not create deployment: file:/C:/Program Files/jboss-4.0.4.GA/server/Marvelous/deploy/Avian Flu Information System.ear/Avian Flu Information System Web.war/
    java.lang.UnsupportedOperationException: FIXME: should ignore annotations for missing classes
         at org.jboss.lang.AnnotationHelper.getAnnotations(AnnotationHelper.java:98)
         at org.jboss.lang.AnnotationHelper.getAnnotation(AnnotationHelper.java:75)
         at org.jboss.lang.AnnotationHelper.isAnnotationPresent(AnnotationHelper.java:60)
         at org.jboss.ws.server.WebServiceDeployerJSE.isWebserviceDeployment(WebServiceDeployerJSE.java:152)
         at org.jboss.ws.server.WebServiceDeployer.create(WebServiceDeployer.java:101)
         at org.jboss.ws.server.WebServiceDeployerJSE.create(WebServiceDeployerJSE.java:66)
         at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.create(SubDeployerInterceptorSupport.java:180)
         at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:91)
         at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
         at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
         at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
         at $Proxy49.create(Unknown Source)
         at org.jboss.deployment.MainDeployer.create(MainDeployer.java:953)
         at org.jboss.deployment.MainDeployer.create(MainDeployer.java:943)
         at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:807)
         at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:771)
         at sun.reflect.GeneratedMethodAccessor11.invoke(Unknown Source)
         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:155)
         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
         at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
         at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
         at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
         at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
         at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
         at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
         at $Proxy6.deploy(Unknown Source)
         at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
         at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:610)
         at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
         at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274)
         at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)Your input is greatly appreciated!

Maybe you are looking for

  • Burned DVD freezes.. any ideas?

    Here's my problem, I hope someone might have a thought: I've burned about 10 DVDs now, each of which are resulting in pretty much the same errors.. a) won't play the 3rd of 4 chapters, and b) freezes to a still frame in random areas (and occasionally

  • What does that  "calid : calparser" mean?

    While trying and failing with new event creation in my calendar in calendaring server http.log I could see thes lines: [08/Nov/2005:17:03:49 +0200] myhost cshttpd[4205]: General Warning: No email address found for organizer with calid : calparser [08

  • TCP/IP Sockets

    TCP/IP Sockets I need to write a server/client program which will implement a weather server. A text file in the same directory as the server will be updated daily(manually) and the server will send this information to clients on request. The client

  • Installing Python Idle

    I'm an aerospace engineer and I just want to use Python to crunch numbers as a cool freebie Matlab alternative. I don't want to learn Java so I do not need or want any of the Mac OS cocoa hooks. I do need numpy and matplotlib. Xcode 3.0 has no simple

  • Trouble merging exposures from Lightroom 5 into Photoshop CC HDR Pro

    I'm a new member to Photoshop CC and I'm trying to merge 3 exposures into Photoshop CC HDR Pro. When the exposures move over to the initial adjustments window, there is a large white line running vertically through the image. I'm missing about 40% of