Exception... java.io.NotSerializableException (RMI)
hi,
I use a remote object <remoteObjOne> (already registered on the server) to create and register, there, (on the server) a second remote object <remoteObjTwo> .
To do this I call a method of <remoteObjOne> (already registered on the server):
public void buildRemoteDbConnectionOnTheServer(String objName){
MyClass myClass = new MyClass();
// MyClass is coded on the server
try {
Naming.rebind(objName, myClass); // put in the registry the object.
} catch (Exception e) {
System.out.println("buildRemoteDbConnectionOnTheServer erro registering remote obj " + e.getMessage());
}When the statement :
Naming.rebind(objName, myClass);is executed I get this error:
error marshalling arguments; nested exception is:
java.io.NotSerializableException: MyClass.I would understand what appen and to know how I can manage this error.
Any help shall be appreciated
thank you
regards
tonyMrsangelo
There are several errors here.
1. MyClass is not exported. Does it extend UnicastRemoteObject?
2. You can't bind to a remote registry, only to a registry in the local host. Callbacks have to be registered at the server via a specific remote method that takes the callback interface as a parameter. The server has to store that somewhere and use that to callback the client. In any case the design of using the Registry assumes that there is only one client, which is a broken design in the first place.
3. Callbacks don't work over the Internet without a lot of additional mucking around, usually involving 3rd-party products such as mine. Are you aware of that?
Similar Messages
-
Java.io.NotSerializableException
I am running iplanet ias 6.0 sp3 with web server 6.0 sp1. I
successfully deployed an ear file that contains the war and the jar to
the APPS dir. The session ejbs and the entity ejbs are packed into the
jar file which are deployed with the ear.
I have two piece of testing code. One is a standalone java program.
The other one is a jsp page together with the jsp bean which are packed
into the war file in the ear. The jsp bean code and the standalone
program are doing the same thing. They call a session ejb which calls an
entity bean.
I have made 2 experiments
1> Start server, run the standalone test, got the correct result.
Then run the jsp from the browser, got the correct result.
2> Start server, run the jsp from the browser, fail to get the
result. run the standalone test, fail to get the result
The paten is very consistent. The code and the error msg for test 2 are
attached. Could any one tell me what might cause the problem in the
second test and how to resolve the it ?
Thank in advance
Xiao
When the test fails, I got the following error msg from the console.
[10/Nov/2001 12:08:08:3] info: --------------------------------------
[10/Nov/2001 12:08:11:0] error: EBFP-serialize: error during
serialization of me
thod, exception = java.io.NotSerializableException: java.util.Vector$1
java.io.NotSerializableException: java.util.Vector$1
at
java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:845)
at
java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:342)
at
java.io.ObjectOutputStream.outputArray(ObjectOutputStream.java:811)
at
java.io.ObjectOutputStream.checkSubstitutableSpecialClasses(ObjectOut
putStream.java:432)
at
java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:337)
at
java.io.ObjectOutputStream.outputClassFields(ObjectOutputStream.java:
1567)
at
java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java
:453)
at
java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:911)
at
java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:342)
at com.kivasoft.ebfp.FPSerializable.serialize(Unknown Source)
at com.kivasoft.thread.ThreadBasic.run(Native Method)
at java.lang.Thread.run(Thread.java:479)
[10/Nov/2001 12:08:11:0] warning: EB-invalidate_delegate: instance
com.plateausy
[email protected] threw
an unche
cked or system exception, ex = ElmsUncheckedException:
getHolidayProfileHolidays()
Nested stack traces:
java.rmi.ServerException: RemoteException occurred in server thread;
nested exce
ption is:
java.rmi.ConnectIOException: <mapped>
java.rmi.ConnectIOException: <mapped>
<<no stack trace available>>
[10/Nov/2001 12:08:11:0] error: Exception Stack Trace:
ElmsUncheckedException:
getHolidayProfileHolidays()
Nested stack traces:
java.rmi.ServerException: RemoteException occurred in server thread;
nested exce
ption is:
java.rmi.ConnectIOException: <mapped>
java.rmi.ConnectIOException: <mapped>
<<no stack trace available>>
at
com.plateausystems.elms.bo.holidayprofile.ejb.HolidayProfileManagerBe
an.getHolidayProfileHolidays(Unknown Source)
at java.lang.reflect.Method.invoke(Native Method)
at
com.plateausystems.elms.bo.holidayprofile.ejb.ejb_skel_com_plateausys
tems_elms_bo_holidayprofile_ejb_HolidayProfileManagerBean.getHolidayProfileHolid
ays(ejb_skel_com_plateausystems_elms_bo_holidayprofile_ejb_HolidayProfileManager
Bean.java:207)
at
com.plateausystems.elms.bo.holidayprofile.ejb.ejb_kcp_skel_HolidayPro
fileManager.getHolidayProfileHolidays__seq_com_plateausystems_elms_bo_holidaypro
__13918743(ejb_kcp_skel_HolidayProfileManager.java:326)
at com.kivasoft.thread.ThreadBasic.run(Native Method)
at java.lang.Thread.run(Thread.java:479)
ERROR [Thread-37] (?:?) - <HolidayProfileManagerJB:getHolidayVOs>Can't
get Holid
ayVOs by holiday profile id.java.rmi.ServerException: RemoteException
occurred i
n server thread; nested exception is:
javax.transaction.TransactionRolledbackException
*************************************************************end of
error msg
The attached is session and entity bean code segment.
In the entity bean:
public Enumeration ejbFindByHolidayProfileID(String id) {
Vector list = new Vector();
try {
Connection connection = DBUtil.getConnection();
try {
PreparedStatement s =
connection.prepareStatement(sqlFindByHolidayProfileID);
try {
s.setString(1, id);
ResultSet rs = s.executeQuery();
try {
while (rs.next()) {
HolidayProfileHolidayPK pk = new
HolidayProfileHolidayPK();
pk.holidayProfileID = rs.getString("hol_prfl_id");
pk.holidayID = rs.getString("hol_id");
list.add(pk);
} finally {
rs.close();
} finally {
s.close();
} finally {
connection.close();
} catch (Exception e) {
throw new EJBException(e);
return list.elements();
In the session bean:
public HolidayProfileHolidayVO[] getHolidayProfileHolidays(String
holidayProfileID) throws ElmsFinderException
HolidayProfileHolidayVO[] vos = null;
ArrayList alst = new ArrayList();
HolidayProfileHolidayHome hphHome =
this.getHolidayProfileHolidayHome();
try {
java.util.Enumeration enum =
hphHome.findByHolidayProfileID(holidayProfileID);
while (enum.hasMoreElements()) {
Object obj = enum.nextElement();
HolidayProfileHoliday bean =
(HolidayProfileHoliday)javax.rmi.PortableRemoteObject.narrow(obj,
HolidayProfileHoliday.class);
alst.add(bean.getVO());
} catch (FinderException e) {
// throw as new ElmsCheckedException subclass
throw new ElmsFinderException("getHolidayProfileHolidays(id):
Could not find HolidayProfileHolidays.", e);
} catch (RemoteException e) {
// throw as new ElmsUncheckedException
throw new ElmsUncheckedException(
"getHolidayProfileHolidays()", e);
} catch (RuntimeException e) {
throw new ElmsUncheckedException(e);
if (alst.size()>0) vos =
(HolidayProfileHolidayVO[])alst.toArray(new HolidayProfileHolidayVO[1]);
return vos;
}Xiao,
We have the same problem.
The reason why your stand alone works, but your browser based doesn't,
is because the iPlanet Application server requires that all EJBs, all
objects held in any EJB, all objects held in attributes in an
HttpSession, and all objects held in those objects MUST implement
java.io.Serializable.
The unfortunate reason why iPlanet does this is because iPlanet does not
preserve the state of objects in memory across hits to the server.
iPlanet serializes each and every object mentioned above when the HTML
is returned to the client, and then un-serializes all the objects again
when it receives another hit from the client. This is true even in the
case of no-dsync sticky load balancing.
This is ridiculous. We use sticky load balancing and we have many
objects stored in HttpSession attributes which we do not want to be
serialized every hit to the server, in the interest of speed. It takes
too long to serialize all the objects, and it would take way too long to
save them in a database every hit.
David Shade
xluo888 wrote:
>
I am running iplanet ias 6.0 sp3 with web server 6.0 sp1. I
successfully deployed an ear file that contains the war and the jar to
the APPS dir. The session ejbs and the entity ejbs are packed into the
jar file which are deployed with the ear.
I have two piece of testing code. One is a standalone java program.
The other one is a jsp page together with the jsp bean which are packed
into the war file in the ear. The jsp bean code and the standalone
program are doing the same thing. They call a session ejb which calls an
entity bean.
I have made 2 experiments
1> Start server, run the standalone test, got the correct result.
Then run the jsp from the browser, got the correct result.
2> Start server, run the jsp from the browser, fail to get the
result. run the standalone test, fail to get the result
The paten is very consistent. The code and the error msg for test 2 are
attached. Could any one tell me what might cause the problem in the
second test and how to resolve the it ?
Thank in advance
Xiao
When the test fails, I got the following error msg from the console.
[10/Nov/2001 12:08:08:3] info: --------------------------------------
[10/Nov/2001 12:08:11:0] error: EBFP-serialize: error during
serialization of me
thod, exception = java.io.NotSerializableException: java.util.Vector$1
java.io.NotSerializableException: java.util.Vector$1
at
java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:845)
at
java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:342)
at
java.io.ObjectOutputStream.outputArray(ObjectOutputStream.java:811)
at
java.io.ObjectOutputStream.checkSubstitutableSpecialClasses(ObjectOut
putStream.java:432)
at
java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:337)
at
java.io.ObjectOutputStream.outputClassFields(ObjectOutputStream.java:
1567)
at
java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java
:453)
at
java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:911)
at
java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:342)
at com.kivasoft.ebfp.FPSerializable.serialize(Unknown Source)
at com.kivasoft.thread.ThreadBasic.run(Native Method)
at java.lang.Thread.run(Thread.java:479)
[10/Nov/2001 12:08:11:0] warning: EB-invalidate_delegate: instance
com.plateausy
[email protected] threw
an unche
cked or system exception, ex = ElmsUncheckedException:
getHolidayProfileHolidays()
Nested stack traces:
java.rmi.ServerException: RemoteException occurred in server thread;
nested exce
ption is:
java.rmi.ConnectIOException: <mapped>
java.rmi.ConnectIOException: <mapped>
<<no stack trace available>>
[10/Nov/2001 12:08:11:0] error: Exception Stack Trace:
ElmsUncheckedException:
getHolidayProfileHolidays()
Nested stack traces:
java.rmi.ServerException: RemoteException occurred in server thread;
nested exce
ption is:
java.rmi.ConnectIOException: <mapped>
java.rmi.ConnectIOException: <mapped>
<<no stack trace available>>
at
com.plateausystems.elms.bo.holidayprofile.ejb.HolidayProfileManagerBe
an.getHolidayProfileHolidays(Unknown Source)
at java.lang.reflect.Method.invoke(Native Method)
at
com.plateausystems.elms.bo.holidayprofile.ejb.ejb_skel_com_plateausys
tems_elms_bo_holidayprofile_ejb_HolidayProfileManagerBean.getHolidayProfileHolid
ays(ejb_skel_com_plateausystems_elms_bo_holidayprofile_ejb_HolidayProfileManager
Bean.java:207)
at
com.plateausystems.elms.bo.holidayprofile.ejb.ejb_kcp_skel_HolidayPro
fileManager.getHolidayProfileHolidays__seq_com_plateausystems_elms_bo_holidaypro
__13918743(ejb_kcp_skel_HolidayProfileManager.java:326)
at com.kivasoft.thread.ThreadBasic.run(Native Method)
at java.lang.Thread.run(Thread.java:479)
ERROR [Thread-37] (?:?) - <HolidayProfileManagerJB:getHolidayVOs>Can't
get Holid
ayVOs by holiday profile id.java.rmi.ServerException: RemoteException
occurred i
n server thread; nested exception is:
javax.transaction.TransactionRolledbackException
*************************************************************end of
error msg
The attached is session and entity bean code segment.
In the entity bean:
public Enumeration ejbFindByHolidayProfileID(String id) {
Vector list = new Vector();
try {
Connection connection = DBUtil.getConnection();
try {
PreparedStatement s =
connection.prepareStatement(sqlFindByHolidayProfileID);
try {
s.setString(1, id);
ResultSet rs = s.executeQuery();
try {
while (rs.next()) {
HolidayProfileHolidayPK pk = new
HolidayProfileHolidayPK();
pk.holidayProfileID = rs.getString("hol_prfl_id");
pk.holidayID = rs.getString("hol_id");
list.add(pk);
} finally {
rs.close();
} finally {
s.close();
} finally {
connection.close();
} catch (Exception e) {
throw new EJBException(e);
return list.elements();
In the session bean:
public HolidayProfileHolidayVO[] getHolidayProfileHolidays(String
holidayProfileID) throws ElmsFinderException
HolidayProfileHolidayVO[] vos = null;
ArrayList alst = new ArrayList();
HolidayProfileHolidayHome hphHome =
this.getHolidayProfileHolidayHome();
try {
java.util.Enumeration enum =
hphHome.findByHolidayProfileID(holidayProfileID);
while (enum.hasMoreElements()) {
Object obj = enum.nextElement();
HolidayProfileHoliday bean =
(HolidayProfileHoliday)javax.rmi.PortableRemoteObject.narrow(obj,
HolidayProfileHoliday.class);
alst.add(bean.getVO());
} catch (FinderException e) {
// throw as new ElmsCheckedException subclass
throw new ElmsFinderException("getHolidayProfileHolidays(id):
Could not find HolidayProfileHolidays.", e);
} catch (RemoteException e) {
// throw as new ElmsUncheckedException
throw new ElmsUncheckedException(
"getHolidayProfileHolidays()", e);
} catch (RuntimeException e) {
throw new ElmsUncheckedException(e);
if (alst.size()>0) vos =
(HolidayProfileHolidayVO[])alst.toArray(new HolidayProfileHolidayVO[1]);
return vos; -
Java.io.NotSerializableException: engine.MyMetaData
the exception....
java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
java.io.WriteAbortedException: Writing aborted by exception; java.io.NotSerializableException: engine.MyMetaData
java.io.WriteAbortedException: Writing aborted by exception; java.io.NotSerializableException: engine.MyMetaData
at java.io.ObjectInputStream.readObject(Unknown Source)
at java.io.ObjectInputStream.inputClassFields(Unknown Source)
at java.io.ObjectInputStream.defaultReadObject(Unknown Source)
at java.io.ObjectInputStream.inputObject(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at sun.rmi.server.UnicastRef.unmarshalValue(Unknown Source)
at sun.rmi.server.UnicastRef.invoke(Unknown Source)
at engine.ComputeEngine1_Stub.executeTask(ComputeEngine1_Stub.java:38)
at client.ComputeClientVisual.init(ComputeClientVisual.java:410)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
the class..
I send this class via RMI
public class MyTableModel extends AbstractTableModel {
public String[] columnNames = {};
public Vector rows = new Vector();
public MyMetaData metaData;//here is the class
that is my class that returns the exception
public class MyMetaData {
private Integer [] typeOfColumn;
private Boolean [] isWritable;
private Integer numberOfColumns;
private String tableName[];
I dont know why this exception
does anybody cant help me whit this?
I'll apreciate your helpDon't you see "java.io.NotSerializableException" in the output !!. RMI uses serialization protcol to transfer objects from one address space to another, so all parameters/return values of a remote method must be serializable.
Just make sure all prameters/return values of a remote method implements "Serializable" marker interface. MyMetaData class must implement "Serializable" interface in order to be transported as a return value of a RMI method.
-- Srinath Mandalapu -
Hi,
We are currently in the process of moving from Weblogic 6.1 SP5 and
Toplink 3.6.3 to Weblogic 8.1 SP2 and Toplink 9.0.4 and during some test
I have seen a "scaring" stack trace. It seems that, for some reason, a
thing that "uses to work" failed with a very strange error. I tried to
reproduce it but without any success. Besides asking if anybody knows
what could have caused this error I would like to know what the "not
serializable" object is. Is it the EntityEJBContext?
<12-09-2004 4:40' GMT> <Error> <app> <000000> <[thread 5
weblogic.kernel.Default]:Exception:
javax.transaction.TransactionRolledbackException at getXML
javax.transaction.TransactionRolledbackException: EJB Exception: :
java.io.NotSerializableException:
weblogic.ejb20.internal.EntityEJBContextImpl
at
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1054)
at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1332)
at
java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1304)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1247)
at
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
at
java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
at
weblogic.rmi.internal.CBVOutputStream.writeObject(CBVOutputStream.java:78)
at weblogic.rmi.internal.ServerRequest.copy(ServerRequest.java:218)
at
weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:158)
at
weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:138)
at
app.data.production.ProductionBean_3toa0w_EOImpl_811_WLStub.EJB2DOM(Unknown
Source)
In case it could share some light in the case I will explain a bit what
does the process intended to do:
The general idea is that, given some data (managed with Toplink's 9.0.4
CMP) we take a XML "snapshot" of them (via a custom OBJ2XML class that
has been working for ages without any problem) and "publish" it via JMS
in order to perform asyncronous actions with it. I'm sure this is a,
more than usual, scenario for a lot of folks.
As it seems looking at the stack at some point during some internal
object serialization it fails and rollbacks all the process. The object
being serialized by our side only contains four attributes: a
java.math.BigDecimal for it's primary key, a java.util.Date for
timestamp locking and two simple java.lang.String's
Although I'm pretty sure the problem should not be with the entity bean
itself but with an internal Weblogic op (is it trying to serialize the
EntityBeanContext as stated after the java.io.NotSerializableException
message?
Any help with this would be greatly appreciated as I have no clue how
this happened and I'm also unable to reproduce it (I'm also sure if I
managed to trigger it testing the application alone it will rise many
more times that could be admited if we move to production).
I would like to point also that currently until we have some more time
to fix it we are using "remote" entity bean, I mean even if we are alway
s calling them within the container they are not deployed with "local"
interfaces yet (although AFAIK Weblogic should avoid RMI calls on them
being co-located with the session beans).
Regards.
Ignacio.
P.S. here is the full stack dump
<12-09-2004 4:40' GMT> <Error> <app> <000000> <[thread 5
weblogic.kernel.Default]:Exception:
javax.transaction.TransactionRolledbackException at getXML
javax.transaction.TransactionRolledbackException: EJB Exception: :
java.io.NotSerializableException:
weblogic.ejb20.internal.EntityEJBContextImpl
at
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1054)
at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1332)
at
java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1304)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1247)
at
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
at
java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
at
weblogic.rmi.internal.CBVOutputStream.writeObject(CBVOutputStream.java:78)
at weblogic.rmi.internal.ServerRequest.copy(ServerRequest.java:218)
at
weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:158)
at
weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:138)
at
app.data.production.ProductionBean_3toa0w_EOImpl_811_WLStub.EJB2DOM(Unknown
Source)
at app.data.general.GeneralBean.EJB2DOM(GeneralBean.java:1180)
at
app.data.module.ModuleBean_1v2h9c_EOImpl.EJB2DOM(ModuleBean_1v2h9c_EOImpl.java:3954)
at app.data.general.GeneralBean.EJB2DOM(GeneralBean.java:1180)
at app.data.general.GeneralBean.getXML(GeneralBean.java:1024)
at app.data.general.GeneralBean.getXML(GeneralBean.java:1002)
at
app.data.module.ModuleBean_nw294k_EOImpl.getXML(ModuleBean_nw294k_EOImpl.java:3138)
at app.biz.common.Publisher.performPublication(Publisher.java:1644)
at app.biz.common.Publisher.launchPublisher(Publisher.java:1580)
at app.biz.module.ModuleDAO.update(ModuleDAO.java)
at
app.biz.module.ModuleDAO_jcgreo_EOImpl.update(ModuleDAO_jcgreo_EOImpl.java:100)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at app.core.util.Proxy.execute(Proxy.java:583)
at app.core.servlet.BaseServlet.execute(BaseServlet.java:440)
at
app.user.servlet.common.BaseServlet.accessSessionBean(BaseServlet.java:279)
at
app.user.servlet.common.BaseServlet.buildResponse(BaseServlet.java:132)
at app.core.servlet.BaseServlet.doGet(BaseServlet.java:116)
at app.core.servlet.BaseServlet.doPost(BaseServlet.java:154)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1053)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:387)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
at
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6310)
at
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
at
weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3622)
at
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2569)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
>Ignacio,
6.1 used pass-by-reference by default, so parameters to beans were
passed by reference.
It's very likely that you are getting this error because in 8.1 this default
was turned off. This causes serialization of parameters by default and
that's why your code that worked started failing - you just did not know
that you were passing non-serializable objects around.
To fix this you could either turn on the pass-by-reference explicitly and/or
find out where your code is passing non-serializable objects. This is a useful
exercise anyways.
Hope this helps.
Regards,
Slava Imeshev
"Ignacio G. Dupont" <[email protected]> wrote in message news:41b8c93f@mail...
Hi,
We are currently in the process of moving from Weblogic 6.1 SP5 and
Toplink 3.6.3 to Weblogic 8.1 SP2 and Toplink 9.0.4 and during some test
I have seen a "scaring" stack trace. It seems that, for some reason, a
thing that "uses to work" failed with a very strange error. I tried to
reproduce it but without any success. Besides asking if anybody knows
what could have caused this error I would like to know what the "not
serializable" object is. Is it the EntityEJBContext?
<12-09-2004 4:40' GMT> <Error> <app> <000000> <[thread 5
weblogic.kernel.Default]:Exception:
javax.transaction.TransactionRolledbackException at getXML
javax.transaction.TransactionRolledbackException: EJB Exception: :
java.io.NotSerializableException:
weblogic.ejb20.internal.EntityEJBContextImpl
at
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1054)
at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1332)
at
java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1304)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1247)
at
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
at
java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
at
weblogic.rmi.internal.CBVOutputStream.writeObject(CBVOutputStream.java:78)
at weblogic.rmi.internal.ServerRequest.copy(ServerRequest.java:218)
at
weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:158)
at
weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:138)
at
app.data.production.ProductionBean_3toa0w_EOImpl_811_WLStub.EJB2DOM(Unknown
Source)
In case it could share some light in the case I will explain a bit what
does the process intended to do:
The general idea is that, given some data (managed with Toplink's 9.0.4
CMP) we take a XML "snapshot" of them (via a custom OBJ2XML class that
has been working for ages without any problem) and "publish" it via JMS
in order to perform asyncronous actions with it. I'm sure this is a,
more than usual, scenario for a lot of folks.
As it seems looking at the stack at some point during some internal
object serialization it fails and rollbacks all the process. The object
being serialized by our side only contains four attributes: a
java.math.BigDecimal for it's primary key, a java.util.Date for
timestamp locking and two simple java.lang.String's
Although I'm pretty sure the problem should not be with the entity bean
itself but with an internal Weblogic op (is it trying to serialize the
EntityBeanContext as stated after the java.io.NotSerializableException
message?
Any help with this would be greatly appreciated as I have no clue how
this happened and I'm also unable to reproduce it (I'm also sure if I
managed to trigger it testing the application alone it will rise many
more times that could be admited if we move to production).
I would like to point also that currently until we have some more time
to fix it we are using "remote" entity bean, I mean even if we are alway
s calling them within the container they are not deployed with "local"
interfaces yet (although AFAIK Weblogic should avoid RMI calls on them
being co-located with the session beans).
Regards.
Ignacio.
P.S. here is the full stack dump
<12-09-2004 4:40' GMT> <Error> <app> <000000> <[thread 5
weblogic.kernel.Default]:Exception:
javax.transaction.TransactionRolledbackException at getXML
javax.transaction.TransactionRolledbackException: EJB Exception: :
java.io.NotSerializableException:
weblogic.ejb20.internal.EntityEJBContextImpl
at
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1054)
at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1332)
at
java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1304)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1247)
at
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
at
java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
at
weblogic.rmi.internal.CBVOutputStream.writeObject(CBVOutputStream.java:78)
at weblogic.rmi.internal.ServerRequest.copy(ServerRequest.java:218)
at
weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:158)
at
weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:138)
at
app.data.production.ProductionBean_3toa0w_EOImpl_811_WLStub.EJB2DOM(Unknown
Source)
at app.data.general.GeneralBean.EJB2DOM(GeneralBean.java:1180)
at
app.data.module.ModuleBean_1v2h9c_EOImpl.EJB2DOM(ModuleBean_1v2h9c_EOImpl.java:3954)
at app.data.general.GeneralBean.EJB2DOM(GeneralBean.java:1180)
at app.data.general.GeneralBean.getXML(GeneralBean.java:1024)
at app.data.general.GeneralBean.getXML(GeneralBean.java:1002)
at
app.data.module.ModuleBean_nw294k_EOImpl.getXML(ModuleBean_nw294k_EOImpl.java:3138)
at app.biz.common.Publisher.performPublication(Publisher.java:1644)
at app.biz.common.Publisher.launchPublisher(Publisher.java:1580)
at app.biz.module.ModuleDAO.update(ModuleDAO.java)
at
app.biz.module.ModuleDAO_jcgreo_EOImpl.update(ModuleDAO_jcgreo_EOImpl.java:100)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at app.core.util.Proxy.execute(Proxy.java:583)
at app.core.servlet.BaseServlet.execute(BaseServlet.java:440)
at
app.user.servlet.common.BaseServlet.accessSessionBean(BaseServlet.java:279)
at
app.user.servlet.common.BaseServlet.buildResponse(BaseServlet.java:132)
at app.core.servlet.BaseServlet.doGet(BaseServlet.java:116)
at app.core.servlet.BaseServlet.doPost(BaseServlet.java:154)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1053)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:387)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
at
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6310)
at
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
at
weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3622)
at
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2569)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
> -
Hi,
While trying to get JVM Memory pool information of a remote computer ,am getting java.io.NotSerializableException. I used following method
ManagementFactory.getMemoryPollMXBean().
Please help me to solve these exception.
java.io.NotSerializableException: sun.management.MemoryPoolImpl
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1156)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
at java.util.ArrayList.writeObject(ArrayList.java:570)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1461)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
at com.path.systemmanager.tunnelGate.TunnelServlet.doPost(TunnelServlet.java:38)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:738)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:290)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
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)
Thanks,
SreejithI agree, it looks frustrating. Obviously the serialization process has found the non-serializable object during the traversal of the object graph, but its difficult to know where this is.
Your class looks a bit "serialization-heavy", if you don't mind me saying. I avoid serializing anything to do with swing components and stick to collections and my own classes. Do you need to serialize these? If not, mark them transient. You can do this for all of them and then reintroduce into the serialized form one at a time to see which one causes the problem (just for curiosity).
When the object is deserialized you will have to make the necessary arrangements to set up any members that you marked transient, as these will be null. You can do this is readObject, but on this subject, why are you writing out the points member explicitly? It will be written out anyway since there is nothing special about it.
I don't know how familiar you are with the serialization package but its a sharp instrument that needs respect. I would advise reading the specification, if you haven't already done so. -
Java.io.NotSerializableException: java.awt.AWTEventMulticaster
I have an Applet. When I try to use the "print" feature on IE to print out the applet. I'm getting this Exception. java.io.NotSerializableException: java.awt.AWTEventMulticaster
What should I do?
Andyplease help!!
-
Hi,
I got this error when my servlet is trying to parse a xml document:
RuntimeRemoteException( java.io.WriteAbortedException: Writing aborted by exception; java.io.NotSerializableException: com.sun.xml.tree.XmlDocument )
And my application runs ok when Tomcat is used as servlet container, but it runs into problem when iPlanet is used.
Any idea?
Thanks in advance!Thanks for your reply.
The EJBs in the application are all stateless beans. The error happens at the servlet side, not the EJB side. When the servlet tries to parse the returned XML document using xalan 1.0, the error happened. However, I can not reproduce the error when I use Tomcat as servlet container.
here is how I coded:
XSLTProcessor processor = XSLTProcessorFactory.getProcessor(new org.apache.xalan.xpath.xdom.XercesLiaison());
XSLTInputSource xmlSource = new XSLTInputSource(doc);
XSLTInputSource xslSheet = new XSLTInputSource("file:"+xslFile);
Writer out = new StringWriter();
XSLTResultTarget xmlResult= new XSLTResultTarget(out);
processor.process(xmlSource,xslSheet,xmlResult); -
Java.io.NotSerializableException: java.util.Vector$1
I am using Java 2 in the API it says that the Vector implements Serializable but I am getting an exception java.io.NotSerializableException: java.util.Vector$1 I don't know why please help.
Thank you
palanisrAlthough Vectors are Serializable that doesn't mean that the contents of a Vector are necessarily Serializable. What are the contents of your Vector? Are they objects of a Serializable class? If not that is your problem. The attached sample code demonstrates the problem of serializing a Vector that contains non-serializable data. If you make the Employee class Serializable the code works.
import java.util.*;
import java.io.*;
public class Serialize
public static void main(String args[])
ObjectOutputStream oos = null;
FileOutputStream fos = null;
Vector v = new Vector();
v.add(new Employee("Smith","John"));
v.add(new Employee("Jones","Albert"));
try
fos = new FileOutputStream("vector.ser");
oos = new ObjectOutputStream(fos);
oos.writeObject(v);
catch(FileNotFoundException fnfe)
fnfe.printStackTrace();
catch(IOException ioe)
ioe.printStackTrace();
finally
try
if (oos != null)
oos.close();
catch(IOException ioe)
try
if (fos != null)
fos.close();
catch(IOException ioe)
class Employee //implements Serializable
private String lastName;
private String firstName;
public Employee(String lastName, String firstName)
this.lastName = lastName;
this.firstName = firstName;
} -
According to WLI docs, the Java Class Business Operations doesn't need to be Serializeable.
But somehow everytime I try to invoke the Busines Operations in studio, It always
throws me exception : java.io.NotSerializableException. Is it something wrong
with my Java Class ? The operation seems to be executed successfully but after
that It looks like WLI is trying to serialize the object into database which can
not be done because the Java Class is not serializeable. Changing the Java Class
to serializeable is not an option since I don't have any control on this class.
Please advise...
regards,
MartinAccording to WLI docs, the Java Class Business Operations doesn't need to be Serializeable.
But somehow everytime I try to invoke the Busines Operations in studio, It always
throws me exception : java.io.NotSerializableException. Is it something wrong
with my Java Class ? The operation seems to be executed successfully but after
that It looks like WLI is trying to serialize the object into database which can
not be done because the Java Class is not serializeable. Changing the Java Class
to serializeable is not an option since I don't have any control on this class.
Please advise...
regards,
Martin -
Java.io.NotSerializableException exception in session beans
Hey experts,
I have written the following code to call a session bean method from a portal application.
Object obj1 = context.lookup("applications/knet");
UserInfoHome userInfoHome =
(UserInfoHome) javax.rmi.PortableRemoteObject.narrow(
obj1,
UserInfoHome.class);
UserInfo userInfo = userInfoHome.create();
Collection col =
userInfo.getAllrooms();
out.println("The size is " + col.size() + "<br>");
The following is the implementation of the getAllrooms() method in the session bean
public Collection getAllrooms() {
Collection col = null;
try {
InitialContext ctx = new InitialContext();
roomsHome = (RoomsLocalHome) ctx.lookup("java:comp/env/ejb/RoomsBean");
col = roomsHome.findAllRooms();
} catch (NamingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (FinderException e) {
// TODO Auto-generated catch block
e.printStackTrace();
return col;
In the entity bean the following EJB QL has been used
<EJB QL>
select object(r) from Rooms r
</<EJB QL>>
I get the following error
com.sap.engine.services.rmi_p4.exception.P4BaseRuntimeException: I/O operation failed : java.io.NotSerializableException: com.sap.engine.services.ejb.entity.finder.EJBLocalCollection :
at com.sap.engine.services.rmi_p4.server.P4ObjectBrokerServerImpl.getException(P4ObjectBrokerServerImpl.java:926)
at com.sap.engine.services.rmi_p4.reflect.LocalInvocationHandler.replicateReturnValue(LocalInvocationHandler.java:115)
at com.sap.engine.services.rmi_p4.reflect.LocalInvocationHandler.invokeInternal(LocalInvocationHandler.java:90)
at com.sap.engine.services.rmi_p4.reflect.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:50)
at $Proxy180.getAllrooms(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.sap.engine.services.ejb.session.stateless_sp5.ObjectStubProxyImpl.invoke(ObjectStubProxyImpl.java:187)
at $Proxy181.getAllrooms(Unknown Source)
at com.watercorp.BMS.test.EJBTest.doContent(EJBTest.java:120)
at com.sapportals.portal.prt.component.AbstractPortalComponent.serviceDeprecated(AbstractPortalComponent.java:209)
at com.sapportals.portal.prt.component.AbstractPortalComponent.service(AbstractPortalComponent.java:114)
at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328)
... 29 more
Caused by: java.io.NotSerializableException: com.sap.engine.services.ejb.entity.finder.EJBLocalCollection
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1054)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
at com.sap.engine.services.rmi_p4.reflect.LocalInvocationHandler.replicateReturnValue(LocalInvocationHandler.java:110)
... 42 more
Please helpHi Sabbir,
You are trying to expose a Collection of Entity local interfaces (RoomsLocal) that is the result of RoomsLocalHome.findAllRooms(), through the Session bean's remote interface method getAllrooms(). This is forbidden by the EJB specification and of course cannot work. You have to use remote interfaces of Entity beans when you want to expose them to remote clients - although this is not a good practice either since Entity beans are fine-grained components. Data transfer objects (<a href="http://en.wikipedia.org/wiki/Data_Transfer_Object">DTO</a>) with Session facades should be used for this purpose (you already have a Session facade - the UserInfo bean).
Hope this clarifies it!
-Vladimir
Message was edited by:
Vladimir Pavlov -
Java.lang.Exception... RMI error
Hello...
I'm have a problem when the program RemoteServer.java is compiled:
The reference is in:
http://developer.java.sun.com/developer/onlineTraining/Programming/BasicJava1/rmi.html
I have a link from /usr/lib/ to /usr/local/lib and libgcj.so.3 is in the last
The error messages is:
java.lang.Exception: compiler exited with status: 1
at 0x4026515f: java.lang.Throwable.Throwable(java.lang.String) (/usr/lib/libgcj.so.3)
at 0x402580d2: java.lang.Exception.Exception(java.lang.String) (/usr/lib/libgcj.so.3)
at 0x403189e6: gnu.java.rmi.rmic.CompilerProcess.compile(java.lang.String) (/usr/lib/libgcj.so.3)
at 0x4031d8c2: gnu.java.rmi.rmic.RMIC.compile(java.lang.String) (/usr/lib/libgcj.so.3)
at 0x40318ecd: gnu.java.rmi.rmic.RMIC.processClass(java.lang.String) (/usr/lib/libgcj.so.3)
at 0x40318c7c: gnu.java.rmi.rmic.RMIC.run() (/usr/lib/libgcj.so.3)
at 0x40318b3b: gnu.java.rmi.rmic.RMIC.main(java.lang.String[]) (/usr/lib/libgcj.so.3)
at 0x4023f308: gnu.gcj.runtime.FirstThread.call_main() (/usr/lib/libgcj.so.3)
at 0x402aa0b1: gnu.gcj.runtime.FirstThread.run() (/usr/lib/libgcj.so.3)
at 0x4024bfdc: JvThreadRun(java.lang.Thread) (/usr/lib/libgcj.so.3)
at 0x4021878c: JvRunMain(java.lang.Class, byte const, int, byte const, boolean) (/usr/lib/libgcj.so.3)
Any idea???
Thanks..!!the problem is Red Hat has a rmic and rmiregistry already installed in /usr/bin/ folder
-
Java.lang.Exception,java.rmi.RemoteException
Hi ,
Whem I'm deploying my appliucation on WLS 10.3 I'm getting the following exception.
####<Nov 13, 2008 1:32:21 PM IST> <Warning> <EJB> <swetha> <AdminServer> <[STANDBY] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1226563341175> <BEA-012035> <The Remote interface method: 'public abstract java.util.Collection com.bt.resmgt.aam.model.absence.book.AttendanceManager.findAbsences(com.bt.fieldpeople.security.models.Subject,com.bt.resmgt.aam.model.employee.Employee,java.util.List,java.lang.String,java.lang.String,java.util.List,java.util.Date,java.util.Date,java.util.Date,boolean,boolean,boolean,boolean,boolean,boolean,boolean,java.lang.String[]) throws java.lang.Exception,java.rmi.RemoteException' in EJB 'AttendanceManager' contains a parameter of type: 'java.util.List' which is not Serializable. Though the EJB 'AttendanceManager' has call-by-reference set to false, this parameter is not Serializable and hence will be passed by reference. A parameter can be passed using call-by-value only if the parameter type is Serializable.>
could anybody please help me out?
any type of jelp will be greatly appreciated.
Thanks,
NeerajYour problem is here:
«'java.util.List' which is not Serializable»
You're trying to deploy a remote bean. Local beans can work with a parameter that isn't serializable, because their access is made by reference (pointers). But for remote beans, the whole object must be serialized and send over the network to be received by the client. Thus, the java.util.List can't be serialised, so WL complains.
You must choose a container that can be serialized like java.util.ArrayList, a LinkedList or a vector in case of lists, or use local beans. Anyway, I think serialised objects should always be used with bean functions parameters. -
Unreported exception java.rmi.RemoteException; must be caught or declared t
I am receiving an:
unreported exception java.rmi.RemoteException; must be caught or declared to be thrown
error when I attempt to compile the Client.java file.
The Client.java file implements the ATMListener.java interface.
As you will see below, I've stripped them down by taking out all of the code, yet I still receive this error.
Any ideas...
ATMListener.java
import java.rmi.*;
import java.rmi.server.UnicastRemoteObject;
* @author Eddie Brodie
* @version %I%, %G%
public interface ATMListener extends java.rmi.Remote
Client.java
import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.NotBoundException;
import java.rmi.RemoteException;
import java.rmi.UnknownHostException;
public class Client extends java.rmi.server.UnicastRemoteObject implements ATMListenerWell first off unless I am missing something in the API java.rmi.Remote is an interface not a class so implements not inherits, but I do not really know these classes so I cannot be sure I am not missing something.
As for the unreported exception. What could be causing something like this would be an exception thrown by the constructor of the parent class. Even if you have no constructor written for your class it still has a default constructor which will by default call the super constrcutpor meaning an exception could be thrown from the super constrcutor down to your default constructor where you would not know what to do with it. -
Getting java.io.NotSerializableException exception
Hi All,
I am getting the java.io.NotSerializableException when using FacesContext.getCurrentInstance().getExternalContext().getSessionMap().put("DATA_LIST",dataList); in the bean. Can any one tell me the solution.
WARNING: Cannot serialize session attribute DATA_LIST for session B4270E3F0D63D10FF5E83D057AF4EE88
java.io.NotSerializableException: com.ColorBO
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1054)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
at java.util.ArrayList.writeObject(ArrayList.java:529)
at sun.reflect.GeneratedMethodAccessor164.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:809)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1296)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1247)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
at org.apache.catalina.session.StandardSession.writeObject(StandardSession.java:1445)
at org.apache.catalina.session.StandardSession.writeObjectData(StandardSession.java:920)
at org.apache.catalina.session.StandardManager.doUnload(StandardManager.java:516)
at org.apache.catalina.session.StandardManager.unload(StandardManager.java:462)
at org.apache.catalina.session.StandardManager.stop(StandardManager.java:664)
at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4255)
at org.apache.catalina.manager.ManagerServlet.undeploy(ManagerServlet.java:1283)
at org.apache.catalina.manager.ManagerServlet.doGet(ManagerServlet.java:372)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:168)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:482)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:534)
Oct 25, 2006 11:28:38 PM org.apache.catalina.session.StandardSession writeObject
WARNING: Cannot serialize session attribute DATA_LIST for session 46A81579BFE42E28F2AE5BBA7D091710
java.io.NotSerializableException: com.ColorBO
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1054)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
at java.util.ArrayList.writeObject(ArrayList.java:529)
at sun.reflect.GeneratedMethodAccessor164.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:809)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1296)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1247)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
at org.apache.catalina.session.StandardSession.writeObject(StandardSession.java:1445)
at org.apache.catalina.session.StandardSession.writeObjectData(StandardSession.java:920)
at org.apache.catalina.session.StandardManager.doUnload(StandardManager.java:516)
at org.apache.catalina.session.StandardManager.unload(StandardManager.java:462)
at org.apache.catalina.session.StandardManager.stop(StandardManager.java:664)
at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4255)
at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:892)
at org.apache.catalina.startup.HostConfig.undeployApps(HostConfig.java:1143)
at org.apache.catalina.startup.HostConfig.stop(HostConfig.java:1115)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:313)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1053)
at org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1065)
at org.apache.catalina.core.StandardEngine.stop(StandardEngine.java:447)
at org.apache.catalina.core.StandardService.stop(StandardService.java:512)
at org.apache.catalina.core.StandardServer.stop(StandardServer.java:717)
at org.apache.catalina.startup.Catalina.stop(Catalina.java:586)
at org.apache.catalina.startup.Catalina.start(Catalina.java:561)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271)The object in the list should implement serializable
-
hi to all,
i am using a session less bean A to querry a Entity Bean B , which inturns calls another EntityBean C ,
finally a ' find' method is invoked on the EntityBean C, In this a vector is created which holds 3 different vectors at different indexes, now the problem i am facing is that when Enity Bean B is returning the final vector to the A , it's firing out a errors that :-
TRANSACTION COULD NOT BE COMPLETED: RemoteException occurred in server thread;
ested exception is:
java.rmi.RemoteException: null; nested exception is:
java.rmi.ServerException: RemoteException occurred in server thread; ne
ted exception is:
java.rmi.RemoteException: null; nested exception is:
java.io.NotSerializableException: java.util.Vector$1
java.rmi.ServerException: RemoteException occurred in server thread; nested exc
ption is:
java.rmi.RemoteException: null; nested exception is:
java.rmi.ServerException: RemoteException occurred in server thread; ne
ted exception is:
java.rmi.RemoteException: null; nested exception is:
java.io.NotSerializableException: java.util.Vector$1
java.rmi.RemoteException: null; nested exception is:
java.rmi.ServerException: RemoteException occurred in server thread; ne
ted exception is:
java.rmi.RemoteException: null; nested exception is:
java.io.NotSerializableException: java.util.Vector$1
java.rmi.ServerException: RemoteException occurred in server thread; nested exc
ption is:
java.rmi.RemoteException: null; nested exception is:
java.io.NotSerializableException: java.util.Vector$1
java.rmi.RemoteException: null; nested exception is:
java.io.NotSerializableException: java.util.Vector$1
java.io.NotSerializableException: java.util.Vector$1
<<no stack trace available>>
ur any help would be highly appricated to solve out this prob.
If i try to iterate through this vector it's gives IOR:0232003x343242344asdsd................................................blabla....................
thanxs in adavance
DeepakHi I think you are using the method elements() in a remote method.
This method can't be Serializable!! Because it returns an Interface. Interfaces are never Serializable.
Regards,
Peter
Maybe you are looking for
-
Send/Don't Send Error Report
Everytime I open Safari it comes up with an error. It says "Safari Web Browser has encountered a problem and needs to close. We are sorry for the inconvenience." and asks "Send error report" or "Don't Send". If I click either it closes out. How do I
-
Deleting Bookmarks in Safari 5
Does someone know how to delete a bookmark that has been added to the Bookmark drop down tab of the Safari Menu? Thank you!!!
-
My wife's iPhone is not operational, so I thought I would give her my retired one. I assumed that if I synced her phone info into iTunes, I could just sync the same info into the retired iPhone for her use. Apparently, when I previously synced her
-
Orabpel-11017 - Error during WriteFileAdapter INVOKE
Im seeing this error on the invoke for my file adapter. <bindingFault xmlns="http://schemas.oracle.com/bpel/extension"><part name="code"><code>null</code> </part><part name="summary"><summary>file:/appl/BPLDVLP2/BPLDVLP2/10.1.3/bpel/domains/default/t
-
Hi, Let's say that I have an open path, drawn as a line in an illustration. Now, that path has been outlined (outline stroke) to a closed path, styled by it's fill. I am currently in the process of restyling such an illustration, and I would like to