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

Similar Messages

  • 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

  • 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'''>
              > >
              > >
              > >
              

  • 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?

  • Running web service in session bean or Java class

    Hi All ,
    I have wsdl file published on server which i can access from WebService Navigator. I have created this file using create web service option by right clicking on session bean. I want to execute this webservice in other session bean which is in other Track. How can i achieve this?
    Thanks in advance
    Regards
    Ravi Shankar

    Hi Ravi,
    1ce the service is published ..you can execute the service by making the instance out of it or the other option is you can use jaxrpc or saajapi for dealing with SOAP api directly

  • 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();

  • Run  servlet through stateless session bean

    can any body help me about.........
    how to run(execute or call) servlet through state less session bean.
    i have developed servlet program, now i want to run that servlet from stateless session bean ,can any body help ,how to write the code for above one

    Hi
    it can be possible if your session bean  can call servlet through an protocol.
      means you can create an URL or URL connection class and call it through http protocol.
    i .e we can create URLConnetion ( HttpURLConnection ) object to that servlet  from a session bean.
    I hope this will help you some extent to solve your probs.
    Thanks
    Mrutyunjaya Tripathy

  • Web Service from stateful Session Bean deleted after server restart

    Hi,
    i created a stateful session bean and from this a web service.
    I am able to deploy it and it works really fine.
    My problem is: after a server restart the web service is gone and i
    have to deploy it again.
    I have some other web services (but these are web services from stateless session beans)
    but they "survive" the server restart.
    I don't want to deploy the web service after every server restart, did I forget something or
    is it a general problem of stateful session beans or web services?
    Thanks in advance
    Jens

    Hello Björn,
    I am not quite sure what your problem is but did you have a look at these articles:
    http://help.sap.com/saphelp_nw04/helpdata/en/4d/993441c73cef23e10000000a155106/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/be/2e2c4142aef623e10000000a155106/frameset.htm
    I hope they can give you some idea.
    Regads
    Vyara

  • Why do we obtain a java.rmi.MarshalException during a stateless session bean method invocation from a client java program?

    Hello,
    we're using iAS SP3.
    We deployed a stateless session bean that has a business methods with a Vector as argument (put (vector, String)).
    If we call it from a servlet, it works fine. But when we try to call it from a thread, started in a standalone java client program, we obtain a java.rmi.MarshalException.
    We tried to use Vector and HashSet objects as arguments, but we always obtain this kind of exception. It seems strange because a similar
    method that returns a Collection of objects (getAll) works fine. This is the our bean Remote Interface:
    public interface Receive extends EJBObject {
    public void putMessage(Message message, java.lang.String la) throws RemoteException; // it works fine!!!
    public void putMessages(java.util.Vector messages, java.lang.String la) throws RemoteException; // it doesn't work!!!
    Collection getAll (java.lang.String la) throws RemoteException, EJBException; // it works fine!!!!
    This is the java client stack trace:
    java.rmi.MarshalException: CORBA MARSHAL 0 No; nested exception is:
    org.omg.CORBA.MARSHAL: minor code: 0 completed: No
    org.omg.CORBA.MARSHAL: minor code: 0 completed: No
    at java.lang.Class.newInstance0(Native Method)
    at java.lang.Class.newInstance(Class.java:241)
    at com.sun.corba.ee.internal.iiop.ReplyMessage.getSystemException(ReplyMessage.java:93)
    at com.sun.corba.ee.internal.iiop.ClientResponseImpl.getSystemException(ClientResponseImpl.java:82)
    at com.sun.corba.ee.internal.corba.ClientDelegate.invoke(ClientDelegate.java:199)
    at org.omg.CORBA.portable.ObjectImpl._invoke(ObjectImpl.java:248)
    at ejb._Receive_Stub.putMessages(_Receive_Stub.java:731)
    at commlayer.Receiver.run(Receiver.java:67)
    Does anyone know how to solve this problem?
    Thank you in advance,
    Maurizio

    This is big bug!
    This seems to occur when you try to return complex objects (e.g. a vector of classes or even the Date class).
    As a workaround you can add this Ejb or module to the iPlanet Classpath (NT via kregedit, Sun via iasenv skript.).
    This helps but i really don't know why.
    It should be fixed in 6.5, maybe. We'll see.
    Regards

  • Call stateless session bean EJB 2.0 from Webdynpro Java UI

    Hello,
    Can someone please tell me asto how to call a stateless session bean EJB 2.0 from Webdynpro Java UI?
    The NWDS version is 7.0.
    Thanks and Regards,
    Arya

    Hi Aryadipta
    Please check this pdfs
    https://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/b00917dc-ead4-2910-3ebb-b0a63e49ef10&overridelayout=true
    Steps for calling stateless session bean in Webdynpro java
    Go to NWDS -> open perspective ->j2ee
    select EJB Module Project ->create a project with name
    Open the Project -->RC on ejb-jar.xml -> Select new --> EJB
    Give name to EJB Bean (First letter should be in capital letters)
    select the type of bean as Stateless session bean and give the package name to store that EJB bean.
    After that Expand ejb-jar.xml and then select the <projectEJB> 
    Double click on this on method  tab double click you will get business method where we will create the methods for business logic
    Double click on projectEJB and then RC on bean tab and write required business logic in bean window as follows(based on requirement we will design a business logic).
    After writing the business logic go to project -> rebuild
    Till now we have created one EJB jar file
    then go to File-->Enterprise Application Project -->create a project (projectEAR)
    After creating a project click on next-> here we will have ear projects and then we select specific project required for our application.(here select projectEJB)
    After that Calculate EAR project will be available on j2ee explorer.
    Right click on <Bean> here
    select New->Web Service->give a name to webservice and select Default configuration type as simple SOAP
    -->click next -> Finish.
    That webservice and related are created in ejb-jar.xml .
    Expand the ejb-jar.xml.and double click on < webservice>
    RC ProjectEJB -> Build EJB Archive RC on CalculateEAR ->Build applicationarchive.
    Expand the projectEAR->RC on CalculateEAR.ear->Deploy to J2EE Engine
    Double click on calculateEAR.ear ->Webservice navigator tab ->we eill servers expand the node
    select the specific WebService  
    Here we test the webservice by click on Test and test it.
    After that go to Web dynpro perspective ->create one webdynpro Project and one component
    RC on model> Select import Web Service model(last)>give model name and package
    and select radio button as local file system or URL
    Go to WSnavigator->copy the WSDL path and paste it in model WSDL path and click on finish.
    from here onwards steps are same as that adaptive RFC model
    Hope it helps
    Thanks
    Tulasi Palnati
    Edited by: Tulasi Palnati on Aug 26, 2009 12:15 PM
    Edited by: Tulasi Palnati on Aug 26, 2009 12:43 PM

  • Stateless Session Bean has no Context when called from WAR

    Hello,
    Here is the code for my stateless session bean (it will carry out certain actions based on the timer service)
    package DigestTest;
    import java.io.BufferedWriter;
    import java.io.FileWriter;
    import java.util.Date;
    import javax.ejb.*;
    import javax.ejb.TimedObject;
    import javax.ejb.Timer;
    * This is the bean class for the MasterTimerBean enterprise bean.
    * Created Sep 7, 2006 9:05:09 AM
    * @author ttaylor
    public class MasterTimerBean implements SessionBean, MasterTimerRemoteBusiness, MasterTimerLocalBusiness, TimedObject
    private SessionContext context;
    public void setSessionContext(SessionContext aContext)
    context = aContext;
    * @see javax.ejb.SessionBean#ejbActivate()
    public void ejbActivate()
    * @see javax.ejb.SessionBean#ejbPassivate()
    public void ejbPassivate()
    * @see javax.ejb.SessionBean#ejbRemove()
    public void ejbRemove()
    // </editor-fold>
    * See section 7.10.3 of the EJB 2.0 specification
    * See section 7.11.3 of the EJB 2.1 specification
    public void ejbCreate()
    // TODO implement ejbCreate if necessary, acquire resources
    // This method has access to the JNDI context so resource aquisition
    // spanning all methods can be performed here such as home interfaces
    // and data sources.
    public void ejbTimeout(Timer timer)
    try
    BufferedWriter writer = new BufferedWriter(new FileWriter("C:\\timerTest.txt"));
    writer.write("Timer has tripped");
    writer.newLine();
    writer.flush();
    writer.close();
    catch(Exception e)
    return;
    // Add business logic below. (Right-click in editor and choose
    // "EJB Methods > Add Business Method" or "Web Service > Add Operation")
    public String initializeTimer()
    String result = "\n\nInitializing Timer\n";
    try
    // Create Your Timer
    if(context!=null)
    TimerService ts = context.getTimerService();
    result = result+"Instantiating Timer Object\n";
    Timer timer = ts.createTimer(new Date(), 5000, "TestTimer");
    result = result+"About to grab TimerHandle";
    TimerHandle timerHandle = timer.getHandle();
    else
    result = result+"\nContext Object is null\n";
    catch (Exception e)
    result = result+"\nError:\n"+e.toString();
    return result;
    public String writerTest()
    String result = "about to write";
    try
    result = result+"\nOpening the file";
    BufferedWriter writer = new BufferedWriter(new FileWriter("C:\\timerTest.txt"));
    result = result+"\nWriter Test Passed";
    writer.write("Writer Works");
    writer.newLine();
    result = result+"\nFlushing writer";
    writer.flush();
    result = result+"\nClosing writer";
    writer.close();
    catch (Exception e)
    result = result+"\n"+e.toString();
    return result;
    I am calling initializeTimer() from a jsp page with a simple <jsp:useBean tag>.
    The program keeps returning that the context variable is not set(this is from the context!=null conditional in initializeTimer()). I am very confused, I thought that setContext(...) was called by the container upon instantiation (and thus should happen completely without any action from me).
    How am I able to call a session bean that has not had the context set?
    Any information is appreciated,
    Thanks,
    Scott

    thank you for your reply, rajeevm007.
    it seems that the question is really a problem now.
    i think i should update weblogic to the lastest version and confirm this question. if it still in there, it seems that we have to reset the global variables all manually. so, now, we are discussing that should we modify all the ejbs, or wait the next version of weblogic. :) of cause the second choice is a joke.
    no other good choice?
    maybe in the march of the next year....
    cheers
    thank you again.

  • Looking up of a stateless session bean from an MDB

    Hi,
    I have been trying to invoke a method on a stateless session bean from an MDB on receipt of a message from a queue. The bean receives the message. Then it gets the initial context, but after this the following message appears:
    javax.naming.NamingException: Error instantation environment context for Message DrivenBean MyMDB: No location specified and no suitable instance of the type 'MySessionRemote' found for the ejb-ref <mySessionBean> at com.evermind.server.ejb.MessageDrivenHome.getEnvironmentContext(MessageDrivenHome.java:559)
    The session bean is in a seperate ear file. These are the deployment descriptors of the MDB:
    ejb-jar:
    <ejb-jar>
         <description>A Message-Driven Beans</description>
         <enterprise-beans>
         <message-driven>
              <description></description>
              <ejb-name>MyMDB</ejb-name>
              <ejbclass>MyMDB</ejb-class>
              <message-driven-destination>
              <jms-destination-type>javax.jms.Queue</jms-destination-type>
              </message-driven-destination>
              <ejb-ref>
              <ejb-ref-name>MySessionEJB</ejb-ref-name>
              <ejb-ref-type>Session</ejb-ref-type>
              <home>MySessionEJBHome</home>
              <remote>MySessionRemote</remote>
              </ejb-ref>
         </message-driven>
         </enterprise-beans>
         <assembly-descriptor>
         </assembly-descriptor>
    </ejb-jar>
    orion-ejb-jar
    <orion-ejb-jar>
    <enterprise-beans>
              <message-driven-deployment name="QueueProcessor" destination-location="jms/theQueue" connection-factory-location="jms/theQueueConnectionFactory">
              </message-driven-deployment>
         </enterprise-beans>
         <assembly-descriptor>
         </assembly-descriptor>
    </orion-ejb-jar>
    The lookup name which I give in MDB is:
    java:comp/env/MySessionEJB

    Hi,
        Thanks for your replies.I did as you had suggested.I added ejb-local-ref to the ejb-jar.xml and i provided ejb-ref as MyBean.
    My lookup code uses the string
    ctxt.lookup("localejbs\MyBean");
    But still i get Naming Exception.
    I tried something different yesterday.
    I changed the code to use
    InitialContext ctxt = new InitialContext();
    ctxt.lookup("localejbs/"+ pathfromJNDIRegistry);
    and this time i did not get Naming exception but i got RemoteException saying there was error loading the class.
    Is there something i need to add somewhere for the classloader to be able to find and load this class in the second scenario.
    Please suggest me which method to go for amongst the two and what is the missing information i need to add.
    Thanks
    Priya

  • Trying to call stateless session bean from MDB

    Folks,
    Am working on RAD and WAS 8.
    I have an MDB. And a stateless session bean (AOBean under EJB project).
    While the listener listens to the messages from queue, it also tries to persist to db. I want to achieve this via a method of AOBean (through instantiating session bean or by injection).
    I have been sucessful by invoking a method from AOBean class -  that method just returns a string (without any objects being passed)
    Problem:
    I am getting IllegalStateException when I try to invoke a method of AOBean class, that has an object as a parameter
    For eg:
    MDB
    @EJB(name="ejb/TransactionMgrAOBean", mappedName="ejb/TransactionMgrAOBean")
    ITransactionMgrAO tranAO;
        public void onMessage(Message message) {
         TextMessage textMessage = (TextMessage) message;
         boolean status = false;
      try {
       TransactionVO tranVO =  getTransactionVO();//Here building the object to be passed to session bean
       String status1  = tranAO.getVersion(tranVO);
      }catch(Exception e){
    AOBean
    @Stateless
    @Remote({ ITransactionMgrAO.class })
    @WebService
    public class TransactionMgrAOBean {
    public String getVersion(TransactionVO tranVO) throws Exception{
      try{
    //business logic 
      } catch(Exception e){
      throw e;
      return true;
    TransactionVO implements Serializable has also inner static classes that are not Serializable.
    EXCEPTION: At runtime we are getting exception saying that the inner classes are not serialized.
    REASON why we are invoking session bean from MDB? We found that if we invoke any service from AOBean the transaction management was successful. We are using sessionContext.setRollBackonly when an exception occurs. Tranasactions are not rolled back when any db exception occurs if we invoke business logic methods from Model layer of another NON-EJB package.
    Hope I have provided enough information!

    My concret problem is that I want to call an ejb session contained in an ejb project from a session bean in a different web project. When I include the code in my web session bean I get the error adjunted:
    - Code:
    @EJB
    private UserRemote userSessionBean;
    - Error:
    Exception Details: javax.naming.NameNotFoundException
    pac.UserRemote#pac.UserRemote not found
    Possible Source of Error:
    Class Name: com.sun.enterprise.naming.TransientContext
    File Name: TransientContext.java
    Method Name: doLookup
    Line Number: 216
    Any suggestion?

  • Calling Stateless Session bean from Servlet

    Dear Friends,
    A help will be Appreciated...
    I created a EJB (Stateless Session Bean) using WebSphere Application Developer with its Business logic in Main bean. Its working perfectly fine using UTC (Standalone Test Client). But when i use a servlet to communicate with this EJB, its giving me error as follows:
    Error Stack:
    java.lang.NoClassDefFoundError: package name/DemoHome
    at java.lang.Class.newInstance0(Native Method)
    at java.lang.Class.newInstance(Class.java:254)
    at java.beans.Beans.instantiate(Beans.java:213)
    at java.beans.Beans.instantiate(Beans.java:57)
    at com.ibm.servlet.engine.webapp.WebAppServletManager.loadServlet(WebAppServletManager.java:148)
    at com.ibm.servlet.engine.webapp.WebAppServletManager.getServletReference(WebAppServletManager.java:287)
    at com.ibm.servlet.engine.webapp.WebApp.getServletReference(WebApp.java:354)
    at com.ibm.servlet.engine.webapp.WebAppRequestDispatcherInfo.calculateInfo(WebAppRequestDispatcherInfo.java:167)
    at com.ibm.servlet.engine.webapp.WebAppRequestDispatcherInfo.<init>(WebAppRequestDispatcherInfo.java:51)
    at com.ibm.servlet.engine.webapp.WebApp.getRequestDispatcher(WebApp.java:1145)
    at com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:179)
    at com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:67)
    at com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:122)
    at com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(OSEListener.java:315)
    at com.ibm.servlet.engine.http11.HttpConnection.handleRequest(HttpConnection.java:60)
    at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:323)
    at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:252)
    at com.ibm.ws.util.CachedThread.run(ThreadPool.java:122)
    For more Info let me provide the snipets of how i used the Sevlet:
    Client.java
    import java.io.IOException;
    import java.io.PrintWriter;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import packagename.*; //package name of imported ear file which is in
    //classpath
    public class Client extends HttpServlet {
    public void doGet(
    javax.servlet.http.HttpServletRequest request,
    javax.servlet.http.HttpServletResponse response)
    throws javax.servlet.ServletException, java.io.IOException {
    PrintWriter out=response.getWriter();
    Properties p = new Properties();
    p.put(javax.naming.Context.PROVIDER_URL, "iiop:///");
    p.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY,"com.ibm.websphere.naming.WsnInitialContextFactory");
    try {
    InitialContext initial = new InitialContext(p);
    Object objref = initial.lookup("JDemo");
    DemoHome home = (DemoHome)PortableRemoteObject.narrow(objref,DemoHome.class);
    Demo demo = home.create();
    int r=demo.testBean(4);
    out.println("EJB RESULT= "+r);
    } catch (Exception ex) {
    System.err.println("Caught an unexpected exception!");
    ex.printStackTrace();
    Kindly provide ur solution to this problem. Urgent solution will be helpful as its a part of our present project.
    Thanking you for ur esteemed help.
    regards,
    Arun.

    Perhaps you webserver can't see your package jar file.
    Try putting it in WEB-INF\lib directory of your app and restart your server.

  • JNDI lookup of a Stateless Session bean from another stateless session bean

    Hi,
       I am working on SAP Netweaver. We have created a stateless session bean which is finally deployed as a webservice. From this stateless session bean we need to call another stateless session bean as a local reference.
        I have done the following.
    1. Added JNDI-Name to the ejb-j2ee-engine.xml.
    2. My lookup code is as follows
    Context context = null;
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sap.engine.services.jndi.InitialContextFactoryImpl");
    context = new InitialContext(env);
    Object ejbObj =     context.lookup("MyBean");
    But i get the NamingException .Here MyBean is the jndi-name provided in the ejb-j2ee-engine.xml.
    Can somebody tell me what i am doing wrong.
    Thanks
    Priya

    Hi,
        Thanks for your replies.I did as you had suggested.I added ejb-local-ref to the ejb-jar.xml and i provided ejb-ref as MyBean.
    My lookup code uses the string
    ctxt.lookup("localejbs\MyBean");
    But still i get Naming Exception.
    I tried something different yesterday.
    I changed the code to use
    InitialContext ctxt = new InitialContext();
    ctxt.lookup("localejbs/"+ pathfromJNDIRegistry);
    and this time i did not get Naming exception but i got RemoteException saying there was error loading the class.
    Is there something i need to add somewhere for the classloader to be able to find and load this class in the second scenario.
    Please suggest me which method to go for amongst the two and what is the missing information i need to add.
    Thanks
    Priya

Maybe you are looking for

  • Order By in Sub Query

    Hi All, I am trying to following SQL select d.deptno, d.dname, e.empno, e.ename, e.sal from dept d, emp e where d.deptno = e.deptno and (e.empno, e.sal) in ( select e2.empno, e2.sal from emp e2 where e2.deptno = d.deptno and rownum < 3 order by e2.sa

  • Netra t1 error on booting

    Hi all, I have following errors when I boot netra t1 and it keeps rebooting and not able to reach login state. Any idea? Boot device: /pci@1f,0/pci@1,1/scsi@2/disk@0,0:a  File and args: SunOS Release 5.10 Version Generic_118822-25 64-bit Copyright 19

  • How to Personalize Your Dashboard

    Post Author: rnagahori CA Forum: Nsite Personalizing Your Dashboard The first time you select an application, an empty dashboard will appear with a "Dashboard Personalization" link of the application's main page.  Follow these steps to build your fir

  • Override abstract method ?

    hi all package jgraph; import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.util.*; public class JFrameMain extends javax.swing.JFrame {       public JFrameMain() {         initComponents();     // <editor-fold defaultstate="

  • I need to open multiple files in elements 12

    I want to put two images into an empty file. In earlier versions I could open both images and the new file in the workspace at one time. Wih #12 I can only open one file at a time. How do i get past this? I want to drag both images into the file and