Java. Io. notserializableexception error.

Source: Internet
Author: User

Recently, I participated in the Java development project. The development environment is myeclipse + weblogic.

I also posted several posts to introduce some of the technologies used.

How to use struct in a Java program to input multiple data records to Oracle at a time.

How to Use collection variables as data sources to insert data into a data table or update data.

How to modify collection type variables in Oracle.

How to insert data to collection-type variables one by one in Oracle.

However, the following code cannot pass during ut.

Structdescriptor ST = new structdescriptor ("department_type", dbconn );

The error is:

Caused by: Java. RMI. marshalexception: Error marshalling return; Nested exception is:
Java. Io. notserializableexception: Oracle. JDBC. Driver. t4cconnection
At weblogic. rjvm. responseimpl. unmarshalreturn (responseimpl. Java: 195)

This problem occurs because objects are not serialized. We have this problem: the program cannot run during ut, but there is no problem in calling from the JSP page. Therefore, the analysis result is that the UT part in the project architecture we write does not inherit serialization or the struct itself does not inherit serialization.

Refer:

Http://forums.bea.com/thread.jspa? Messageid = 600034901 & tstart = 0
Http://forums.bea.com/thread.jspa? Messageid = 400006195
Http://e-docs.bea.com/wls/docs81/jdbc/thirdparty.html#1043705
Http://e-docs.bea.com/wls/docs81/jdbc/programming.html#1054307
//************************************** **************************************** ************
To obtain a connection for a JDBC client, use a Java Naming and Directory Interface (jdni) lookup to locate the datasource object, as shown in the following code fragment.
Note: When using a JDBC connection in a client-side application, the exact same JDBC driver classes must be in the classpath on both the server and the client. if the driver classes do not match, you may see Java. RMI. unmarshalexception exceptions.
//************************************** **************************************** ************

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.