使用jbuilder 2006 在weblogic下创建一个web service,通过jdbc读oracle的表,然后将表的数据传给客户端,resultset不能被序列化,所以使用List,编译部署都成功了,但是去访问就出错了,求教,请大家指点,谢谢了
程序如下:
public List getTable()
{
DataSource ds ;
List ReturnDate = null;
Connection conn = null ;
ResultSet rs = null;
try
{
Bean1 ub = new Bean1();
ds=getOracleDS();
conn = ds.getConnection();
Statement sta = conn.createStatement();
rs = sta.executeQuery("Select * from testTable");
ReturnDate = new ArrayList();
while(rs.next() )
{
ub.setFirst_Name(rs.getString("First_Name") ) ;
ub.setLast_Name(rs.getString("Last_Name") ) ;
ub.setAddress(rs.getString("Address") );
ub.setCity(rs.getString("City") );
ub.setCountry(rs.getString("Country") );
ReturnDate.add(ub);
}
conn.close();
}
catch (Exception e)
{
//异常处理
}
return ReturnDate;
}
private DataSource getOracleDS() throws NamingException
{
Context ctx = new InitialContext();
return (DataSource) ctx.lookup("jdbc/testmdb");
}
错误提示如下:
Invocation failed!
Parameter Name Parameter Value
Request sent to the server
<!--REQUEST.................-->
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<env:Header>
</env:Header>
<env:Body env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<m:getTable xmlns:m="http://beanexport">
</m:getTable>
</env:Body>
</env:Envelope>
Response from the server
<!--RESPONSE.................-->
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<env:Header>
</env:Header>
<env:Body>
<env:Fault>
<faultcode>env:Server </faultcode>
<faultstring>Exception during processing: weblogic.xml.schema.binding.SerializationException: type mapping lookup failure on class=class beanexport.Bean1 TypeMapping=TYPEMAPPING SIZE=2
ENTRY 1:
class: java.util.List
xsd_type: ['java:language_builtins.util']:p1:List
ser: weblogic.xml.schema.binding.internal.builtin.JavaUtilListCodec@532d15
deser: weblogic.xml.schema.binding.internal.builtin.JavaUtilListCodec@b4e7ec
ENTRY 2:
class: beanexport.Tuple
xsd_type: ['java:beanexport']:p2:Tuple
ser: beanexport.TupleCodec@e6615f