Many thanks, i will modifiy my sources to return Vectors
Thks again
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Lachezar Dobrev
Sent: lunes, 26 de noviembre de 2001 8:33
To: Orion-Interest
Subject: Re: OrionRemoteException: Error (de-)serializing object

   Exception says it all...
   This is a logn-time discussed problem/issue.
   Your Ejb methods should return the valid J2EE types: simple types, Serializable, EJBObject, Remote and Externalizable (I think).
   The ResultSet is none of the above.
   You should do something else. A Vector would be my solution. Just wrap the data, that is returned in the ResultSet with a Serializable bean and populate the vector with them.
 
   Of course it is not as easy as it sounds, if you want to change the data. But if it is the data itself... It will help.
 
   That's it.
 
 
   Lachezar
 
 
----- Original Message -----
Sent: Monday, November 26, 2001 8:41 PM
Subject: OrionRemoteException: Error (de-)serializing object

Hi, i am new in J2EE technology and i'm big troubles.

I have an intranet application (jsp & ejb) running fine with version 1.4.0,

i am trying to deploy the same EAR in 1.5.2 version, but i get this error.

com.evermind.server.rmi.OrionRemoteException: Error (de-)serializing object:

org.gjt.mm.mysql.jdbc2.ResultSet; nested exception is:

java.io.NotSerializableException: org.gjt.mm.mysql.jdbc2.ResultSet

This error occurs when i return a ResultSet from a method "executeQuery" of

an EJB that manages de mysql db.

I have written many jsp, that are in production, and i woud not want to

modify them.

Is there any solution for this error ?

Can i solve this problem if i return a Vector, instead of a ResultSet ?

Many thanks in advance and best regards

Andres Garcia Hourcade

====================================

EJB

====================================

import java.rmi.*;

import java.util.*;

import javax.ejb.*;

import javax.naming.*;

import java.sql.*;

import javax.sql.*;

import javax.sql.DataSource;

// ejb que maneja archivos de log

import Log.*;

public class DbManagerBean implements SessionBean

{

transient SessionContext context;

transient Connection conn = null;

transient DataSource ds = null;

transient Statement st = null;

transient ResultSet rs = null;

public void getConnection(String datasource) throws RemoteException,

DbManagerException

{

try

{

InitialContext ictx = new InitialContext();

this.ds = (DataSource) ictx.lookup(datasource);

this.conn = this.ds.getConnection();

}

catch (Exception e)

{

throw new DbManagerException(e);

}

}

 

public void closeConnection() throws RemoteException, DbManagerException

{

try

{

this.conn.close();

}

catch (Exception e)

{

throw new DbManagerException(e);

}

}

public ResultSet executeQuery(String strsql, String logonuser) throws

RemoteException, DbManagerException

{

st = null;

rs = null;

try

{

//ResultSet.TYPE_SCROLL_INSENSITIVE,

//ResultSet.CONCUR_READ_ONLY

this.st = this.conn.createStatement();

try{

// logeo la consulta

InitialContext context = new InitialContext();

LogHome logHome = (LogHome)

javax.rmi.PortableRemoteObject.narrow(context.lookup("Log"), LogHome.class);

Log log = logHome.create();

log.writeDebug(strsql, logonuser);

log.remove();

}

catch (Exception e)

{

throw new DbManagerException(e);

}

rs = this.st.executeQuery(strsql);

// the closing of a statement also closes all

// the resultsets asociated with the statement

st.close();

}

catch (SQLException e)

{

throw new DbManagerException(e, this.conn);

}

return (rs);

}

public void ejbPassivate(){

context = null;

conn = null;

ds = null;

st = null;

rs = null;

}

public void ejbActivate()

{

}

public void ejbRemove()

{

}

public void ejbCreate()

{

}

public void setSessionContext(SessionContext context)

{

this.context = context;

}

}

Reply via email to