Exception while executing Session bean

Hi All,

I am working on a J2EE application which uses iPlanet as web server and Websphere as app server. The developments are done in Visual Age for Java 3.5.3 and the deployed code as well as the other related classes used to be exported to the above servers. The database used for the application is DB2UDB.

Here is my problem.

The application is working fine in the development environment but when I move the application to another set of servers with the same environment, I am getting the following exception when trying to invoke a method in one of the session bean.

com.safeway.util.exception.AppException [0] CRITICAL: CORBA MARSHAL 0 No; nested exception is: org.omg.CORBA.MARSHAL: Unable to read value from underlying

bridge : Unable to locate value class COM.ibm.db2.jdbc.DB2Exception minor code: 0 completed: No An unspecified application exception has occurred.

java.rmi.MarshalException: CORBA MARSHAL 0 No; nested exception is: org.omg.CORBA.MARSHAL: Unable to read value from underlying bridge : Unable to locate value

class COM.ibm.db2.jdbc.DB2Exception minor code: 0 completed: No org.omg.CORBA.MARSHAL: Unable to read value from underlying bridge : Unable to locate value class

COM.ibm.db2.jdbc.DB2Exception minor code: 0 completed: No

Message

CORBA MARSHAL 0 No; nested exception is: org.omg.CORBA.MARSHAL: Unable to read value from underlying bridge : Unable to locate value class

COM.ibm.db2.jdbc.DB2Exception minor code: 0 completed: No

Localized

Message

CORBA MARSHAL 0 No; nested exception is: org.omg.CORBA.MARSHAL: Unable to read value from underlying bridge : Unable to locate value class

COM.ibm.db2.jdbc.DB2Exception minor code: 0 completed: No

Stack

Trace

com.safeway.util.exception.AppException [0] CRITICAL: CORBA MARSHAL 0 No; nested exception is:

org.omg.CORBA.MARSHAL: Unable to read value from underlying bridge : Unable to locate value class COM.ibm.db2.jdbc.DB2Exception minor code: 0 completed: No

An unspecified application exception has occurred.

java.rmi.MarshalException: CORBA MARSHAL 0 No; nested exception is:

org.omg.CORBA.MARSHAL: Unable to read value from underlying bridge : Unable to locate value class COM.ibm.db2.jdbc.DB2Exception minor code: 0 completed: No

org.omg.CORBA.MARSHAL: Unable to read value from underlying bridge : Unable to locate value class COM.ibm.db2.jdbc.DB2Exception minor code: 0 completed: No

at java.lang.Throwable.fillInStackTrace(Native Method)

at java.lang.Throwable.fillInStackTrace(Compiled Code)

at java.lang.Throwable.(Compiled Code)

at java.lang.Exception.(Compiled Code)

at com.safeway.util.exception.AppException.(AppException.java:187)

at com.safeway.app.tm.command.UserDetailCommand.execute(Compiled Code)

at com.safeway.app.tm.servlet.TMMainServlet.doPost(TMMainServlet.java:74)

at com.safeway.app.tm.servlet.TMMainServlet.doGet(TMMainServlet.java:41)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:701)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:826)

at com.netscape.server.http.servlet.NSServletRunner.Service(NSServletRunner.java:504)

Please note that this is working fine in the development environment and is happening only when we move to QA area.

Here is the part of code which is throwing this exception. I am getting log messages till -- "log.debug("adding query results to resultXML");" but not-- "log.debug("added query results to resultXML");". The exception seems to be thrown from "processDb.executeQuery(queryList)" where processDb is a session bean. Please find the code of the session bean after this codelet.

iPlanet deployed code

ProcessDbHome home = TMEJBHomeFactory.getInstance().getProcessDbHome();

log.debug("Got the ProcessDbHome instance");

log.debug("Create the ProcessDbHome object");

//create session EJB

ProcessDb processDb = home.create();

log.debug("Created the ProcessDbHome object");

log.debug("Execute the query and create the resultXML string");

log.debug("adding userProfile to resultXML");

String resultXML =

"<db>"

+ getResult("resultXML")

+ userProfile.getXml();

log.debug("added userProfile to resultXML");

log.debug("adding userProfile grantor permission to resultXML");

resultXML = resultXML

+ "<subordinate>"

+ userProfile.isNotGrantor(userId.trim())

+ "</subordinate>";

log.debug("added userProfile grantor permission to resultXML");

log.debug("adding query results to resultXML");

resultXML = resultXML

+ processDb.executeQuery(queryList)

+ "</db>";

log.debug("added query results to resultXML");

log.debug("Executed the query");

addResult("resultXML", resultXML);

//log.debug(resultXML);

//set the result class to request object so jsp can take it out

req.setAttribute("result", result);

log.debug("Exiting UserDetailCommand.execute()");

websphere deployed session bean codelet

public String executeQuery(List queryList)

throws AppException, RemoteException {

Connection conn = null;

StringBuffer resultXML = new StringBuffer();

String sql = "";

String xml = "";

try {

conn = TMDatabase.getInstance().getConnection();

Statement stmt = conn.createStatement();

ResultSet rs = null;

Iterator iterator = queryList.iterator();

QueryBean queryBean;

while (iterator.hasNext()) {

queryBean = (QueryBean) iterator.next();

sql = queryBean.getQuery();

rs = stmt.executeQuery(sql);

xml = toXML(rs);

resultXML.append(

"<" + queryBean.getName() + ">" + xml + "</" + queryBean.getName() + ">");

}

//release memory

if (stmt != null) {

stmt.close();

stmt = null;

}

if (rs != null) {

rs.close();

rs = null;

}

return resultXML.toString();

}

catch (SQLException sqle) {

throw new AppException(sqle.getMessage(), sqle);

}

finally {

if (conn != null) {

TMDatabase.getInstance().closeConnection(conn);

}

}

}

The deployment is proper and the Session bean working fine in all the other cases.

Could someone help?

Thanks

Unni

[6496 byte] By [unnidnaira] at [2007-9-28 19:21:36]
# 1

try use serialver to manually generate UID for the failed classes. Usually those are the classes that implement java.io.Seriaizable

>serialver <class>

<class>:static final long serialVersionUID = -300084

053521881126L;

Then in <class>.java put the abolve line in your code. Recompile, and re-deploy.

javashuangya at 2007-7-12 17:53:04 > top of Java-index,Other Topics,Patterns & OO Design...