[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

java.io.NotSerializableException WAS 6.0

Posted on 2006-05-24
6
Medium Priority
?
1,483 Views
Last Modified: 2013-11-24
Hi all

i am creating EAR Comp. from WASD 5.1.1 and deploying in WAS 6.0.
here one of my Stateless Session Bean calling another Stateless Session Bean. while calling , i am getting this exception.

java.rmi.MarshalException: Exception occurred in server thread; nested exception is:
      java.io.NotSerializableException
      at com.ibm.rmi.util.ProxyUtil.copyObjects(ProxyUtil.java:289)
      at com.ibm.CORBA.iiop.UtilDelegateImpl.copyObjects(UtilDelegateImpl.java:764)
      at javax.rmi.CORBA.Util.copyObjects(Util.java:315)
      at com.dcons.iss.ejb._ISS_Stub.handleRequest(_ISS_Stub.java:325)
      at com.dcons.iss.ejb.CountryBean.postRequest(CountryBean.java:142)
      at com.dcons.iss.ejb.EJSRemoteStatelessCountryBean_92aaebd3.postRequest(EJSRemoteStatelessCountryBean_92aaebd3.java:35)
      at com.dcons.iss.ejb._CountryRemote_Stub.postRequest(_CountryRemote_Stub.java:257)
      at com.dcons.iss.ejb.BeanHandlerFacadeBean.delegateRequest(BeanHandlerFacadeBean.java:74)
      at com.dcons.iss.ejb.EJSRemoteStatelessBeanHandlerFacade_7b05eacf.delegateRequest(EJSRemoteStatelessBeanHandlerFacade_7b05eacf.java:35)
      at com.dcons.iss.ejb._BeanHandlerFacadeRemote_Stub.delegateRequest(_BeanHandlerFacadeRemote_Stub.java:263)
      at com.dcons.iss.BeanHandler.doPost(BeanHandler.java:97)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
      at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1282)
      at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:673)
      at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:265)
      at com.dcons.iss.Controller.doPost(Controller.java:109)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
      at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1282)
      at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:673)
      at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:80)
      at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1802)
      at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:84)
      at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:469)
      at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:408)
      at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:286)
      at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminaters(NewConnectionInitialReadCallback.java:201)
      at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:103)
      at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java:566)
      at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java(Compiled Code))
      at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java:952)
      at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java:1039)
      at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code))
Caused by: java.io.NotSerializableException

0
Comment
Question by:datacons
4 Comments
 
LVL 92

Accepted Solution

by:
objects earned 336 total points
ID: 16758090
looks like one classes is not saerializable

whats the call at line 97 of BeanHandler
0
 
LVL 14

Assisted Solution

by:hoomanv
hoomanv earned 332 total points
ID: 16758131
Hi,
Any Object that needs to be sent across as an argument to the remote object (RMI) has to be "Serializable".Make sure your arguments are serializable.

Breaking an object and sending it to remote object and then reconstructing it at the remote site is called Marshalling and UnMarshalling respectively.
0
 

Author Comment

by:datacons
ID: 16758171
hi

thanx for reply. instead of using Serializable , we can define in Deployment Descriptor files. for Example in Weblogic-ejb-jar.xml , we can define like <call-by-reference>true </call-by-reference>. so all Ejbs are becoming serializable.

my question is how do we define in Websphere 6.0 server./ WASD 5.1.1 Deployment Descriptor Files.

0
 
LVL 30

Assisted Solution

by:Mayank S
Mayank S earned 332 total points
ID: 16761038
Not sure, I would prefer to always define it as Serializable (if you port the same code to a different app-server you could face problems). Make sure the data-members inside the objects you are passing to the EJB are also serializable.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Suggested Courses
Course of the Month20 days, 10 hours left to enroll

868 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question