This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes JDBC and the fly likes Strange SQLException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Strange SQLException" Watch "Strange SQLException" New topic
Author

Strange SQLException

John Eric Hamacher
Ranch Hand

Joined: Apr 25, 2007
Posts: 230
Hello:

I have the following code:



The class which contains this code has a main method so I can test it. When I execute the main method from within JDeveloper, everything works fine. However, when I include this class in a web application and deploy it to the embedded OC4J server, the same code throws an exception on the last line above:

09/03/20 14:31:11 java.sql.SQLException: Internal Error
09/03/20 14:31:11 at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:138)
09/03/20 14:31:11 at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:175)
09/03/20 14:31:11 at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:240)
09/03/20 14:31:11 at oracle.jdbc.oracore.OracleTypeCOLLECTION.initCollElemTypeName(OracleTypeCOLLECTION.java:985)
09/03/20 14:31:11 at oracle.jdbc.oracore.OracleTypeCOLLECTION.getAttributeType(OracleTypeCOLLECTION.java:1015)
09/03/20 14:31:11 at oracle.jdbc.oracore.OracleNamedType.getFullName(OracleNamedType.java:96)
09/03/20 14:31:11 at oracle.jdbc.oracore.OracleTypeADT.createStructDescriptor(OracleTypeADT.java:2108)
09/03/20 14:31:11 at oracle.jdbc.oracore.OracleTypeADT.unpickle81(OracleTypeADT.java:1432)
09/03/20 14:31:11 at oracle.jdbc.oracore.OracleTypeUPT.unpickle81UPT(OracleTypeUPT.java:426)
09/03/20 14:31:11 at oracle.jdbc.oracore.OracleTypeUPT.unpickle81rec(OracleTypeUPT.java:383)
09/03/20 14:31:11 at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle81_imgBody_elems(OracleTypeCOLLECTION.java:938)
09/03/20 14:31:11 at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle81_imgBody(OracleTypeCOLLECTION.java:882)
09/03/20 14:31:11 at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle81(OracleTypeCOLLECTION.java:702)
09/03/20 14:31:11 at oracle.jdbc.oracore.OracleTypeCOLLECTION._unlinearize(OracleTypeCOLLECTION.java:227)
09/03/20 14:31:11 at oracle.jdbc.oracore.OracleTypeCOLLECTION.unlinearize(OracleTypeCOLLECTION.java:199)
09/03/20 14:31:11 at oracle.sql.ArrayDescriptor.toJavaArray(ArrayDescriptor.java:663)
09/03/20 14:31:11 at oracle.sql.ARRAY.getArray(ARRAY.java:282)

I am using the same JDBC driver in both cases. I found that the exception contained the error code 17001 but that didn't help much. I have seen this problem reported many times but I have never seen a solution.

Anybody have ideas?

Thanks
Eric
Leandro Coutinho
Ranch Hand

Joined: Mar 04, 2009
Posts: 417
Do the version of the jdk the same in both projects?
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

Is it developer machine and server machine is same ?
OR, try changing the way you passed parameters to this code

May be fourth OUT parameter needs some thing other than OracleTypes.ARRAY, "ORG_FIRST_CHAR_OBJ_TAB"


[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
John Eric Hamacher
Ranch Hand

Joined: Apr 25, 2007
Posts: 230
Thanks for the responses. Both ways of running occur within JDeveloper s they use the same JDK. aqnd they are on the same machine. JDevloper contains a built-in server. So I ran the code both from its main method from Jdeveloper and as part of a web application running in the built-in server.

Eric
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
http://www.google.com/search?q=java.sql.SQLException:+Internal+Error+at+oracle.jdbc.oracore.OracleTypeCOLLECTION.initCollElemTypeName gives interesting results.

It makes me think of a driver bug or a driver <--> database version mismatch.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Strange SQLException