weblogic EJB分布式部署的问题,急~~~~~~~在线等,高分送,分多多
公司系统:认证模块的 Message-Dirven bean 和几个Session bean部署在远端机,Web application 和其他EJB部署在本机。本机的Bean 发送消息驱动远端的Message Bean,Message Bean调用 Session Bean做出相应的响应和操作。Session Bean中操作数据库插入一条有Blob数据时发生异常:NotSerializableException :oracle.sql.BLOB ;.............。但是我在本机写了一个client 程序调用远端的session bean的接口操作没问题。
报错代码如下:
public String createDataLog(DataLog data) throws Exception {
Connection c = null;
PreparedStatement ps = null;
ResultSet rs = null;
java.sql.Blob blob = null;
OutputStream out = null;
String returncode = "0";
try {
c = DB.getConnection();
ps = c.prepareStatement(this.INS_SQL);
ps.setString(1, data.getTime());
ps.setTimestamp(2, data.getTrans_date());
ps.setString(3, data.getEntitle_index());
ps.setString(4, data.getEntitlecode());
ps.setString(5, data.getFactory());
ps.setString(6, data.getPackage_id());
ps.setString(7, data.getPackage_data());
ps.setString(8, data.getState());
ps.execute();
ps.close();
String transdate = data.getTrans_date().toString();
transdate = transdate.substring(0, transdate.length() - 2);
String query =
"select v_package_buffer from ca_datacmd_log where c_entitle_index= '" +
data.getEntitle_index() + "' for update";
ps = c.prepareStatement(query);
rs = ps.executeQuery();
while (rs.next()) { //这里抛出异常~~~~~~~~~~~~~~~~~~~~~``
System.out.println(rs.getBlob(1).getClass());
blob = (java.sql.Blob)rs.getBlob("v_package_buffer");
}
ps = c.prepareStatement(
"update ca_datacmd_log set v_package_buffer=? where c_entitle_index= '" +
data.getEntitle_index() + "'");
out = ( (OracleThinBlob) blob).getBinaryOutputStream();
out.write(data.getPackage_buffer());
ps.setBlob(1, blob);
ps.executeUpdate();
rs.close();
returncode = "1";
}
catch (Exception e) {
e.printStackTrace();
this.sessionContext.setRollbackOnly();
throw e;
}
finally {
try {
if (out != null) {
out.close();
}
if (ps != null) {
ps.close();
}
if (c != null) {
c.close();
}
}
catch (Exception e) {
e.printStackTrace();
}
}
return returncode;
}
报错代码如下:
public String createDataLog(DataLog data) throws Exception {
Connection c = null;
PreparedStatement ps = null;
ResultSet rs = null;
java.sql.Blob blob = null;
OutputStream out = null;
String returncode = "0";
try {
c = DB.getConnection();
ps = c.prepareStatement(this.INS_SQL);
ps.setString(1, data.getTime());
ps.setTimestamp(2, data.getTrans_date());
ps.setString(3, data.getEntitle_index());
ps.setString(4, data.getEntitlecode());
ps.setString(5, data.getFactory());
ps.setString(6, data.getPackage_id());
ps.setString(7, data.getPackage_data());
ps.setString(8, data.getState());
ps.execute();
ps.close();
String transdate = data.getTrans_date().toString();
transdate = transdate.substring(0, transdate.length() - 2);
String query =
"select v_package_buffer from ca_datacmd_log where c_entitle_index= '" +
data.getEntitle_index() + "' for update";
ps = c.prepareStatement(query);
rs = ps.executeQuery();
while (rs.next()) { //这里抛出异常~~~~~~~~~~~~~~~~~~~~~``
System.out.println(rs.getBlob(1).getClass());
blob = (java.sql.Blob)rs.getBlob("v_package_buffer");
}
ps = c.prepareStatement(
"update ca_datacmd_log set v_package_buffer=? where c_entitle_index= '" +
data.getEntitle_index() + "'");
out = ( (OracleThinBlob) blob).getBinaryOutputStream();
out.write(data.getPackage_buffer());
ps.setBlob(1, blob);
ps.executeUpdate();
rs.close();
returncode = "1";
}
catch (Exception e) {
e.printStackTrace();
this.sessionContext.setRollbackOnly();
throw e;
}
finally {
try {
if (out != null) {
out.close();
}
if (ps != null) {
ps.close();
}
if (c != null) {
c.close();
}
}
catch (Exception e) {
e.printStackTrace();
}
}
return returncode;
}
...全文
相关推荐
Weblogic下ejb配置
五、常见问题与解决方案在配置和使用WebLogic EJB时,可能会遇到如部署失败、性能瓶颈、安全性问题等。这些问题通常可以通过查看日志、调整服务器配置、优化bean代码等方式解决。
在WebLogic中部署实现本地接口的EJB 2.0 SessionBean
WebLogic服务器是甲骨文公司推出的一款企业级应用服务器,支持Java EE规范,广泛应用于构建和部署大型分布式应用。本章将介绍WebLogic服务器的核心功能、架构组成及优势。WebLogic服务器提供了多种关键功能,包括但不限于应用部署、集群管理、服务集成、负载均衡和故障转移等。这些功能共同确保了应用的高可用性和可扩展性。
图解eclipse+myelcipse开发EJB,weblogic部署
图解Eclipse+MyEclipse开发EJB,Weblogic部署通过本文,我们将了解如何使用Eclipse+MyEclipse开发EJB项目,并将其部署到Weblogic服务器上。
使用eclipse通过weblogic开发简单的ejb应用(weblogic 10.x & ejb3.x)
com.example.MyBeanRemote");```"ilucky-ejb-3.0-weblogic"可能表示的是部署到WebLogic Server的EJB模块。
Weblogic 创建一个简单的EJB项目
WebLogic Server 是一款由 Oracle 公司提供的企业级 Java 应用服务器,它支持Java EE(Enterprise JavaBeans,EJB)技术,使得开发者能够构建、部署和管理分布式企业级应用程序


