Java.lang.AbstractMethodError: oracle.sql.BLOB.setBytes

Hi ,
When I deployed an application ( In Oracle 10g )that uses oracleresultset i am getting an error as follows java.lang.AbstractMethodError: oracle.sql.BLOB.setBytes
anybody has a clue ?
Vishnu

Hi Vishnu,
I got the same error, and also when trying blob.setBinaryStream(1L);
By me the DB is an 8.1.6 and the JDBC Driver I tried are both the new 10.1 and older ones.
Did you solve your problem ? In which case I would be interested in a solution. A work around seems to be the blob.getBinaryOutputStream() method, but this is a problem for me since it is not portable.
Regards
Michele

Similar Messages

  • Oracle.sql.BLOB.setBytes() Error

    Hi,
    I'm trying to use Java to put a large array of bytes into a BLOB table column. I'm first inserting the new row with an empty_blob() and then calling select <blob_column> ... for update and getting the oracle.sql.BLOB out of the resultset. I then try to call setBytes() on this BLOB and I get the following exception:
    java.sql.SQLException: Invalid argument(s) in call: putBytes()
    at oracle.jdbc.driver.T4CConnection.putBytes(T4CConnection.java:2440)
    at oracle.sql.BLOB.setBytes(BLOB.java:916)
    I'm using Oracle XE (oracle-xe-11.2.0-1.0.x86_64.rpm), the latest ojdbc6.jar, and jboss 4.2.2 on CentOS.
    A code snippet of what I'm doing:
    ... stmt = con.prepareStatement("select blob_column from blob_table where id=? for update"); stmt.setLong(1, Id); ResultSet rs = stmt.executeQuery(); try {     if (rs.next()) {         WrappedResultSet wrappedRs = (WrappedResultSet)rs;         BLOB oracleBlob = ((OracleResultSet)wrappedRs.getUnderlyingResultSet()).getBLOB(1);         if(oracleBlob != null) {             byte[] bytes = getData();             int pos = 0;             long bytesLeft = bytes.length;             log.debug("Attempting to write " + bytes.length + " bytes to BLOB");             while(bytesLeft > 0) {                 int bytesWritten = oracleBlob.setBytes(pos, bytes, pos, MAXBUFSIZE);                 log.debug("Wrote " + bytesWritten + " bytes to BLOB");                 bytesLeft -= bytesWritten;                 pos += bytesWritten;             }         }     } } finally {     rs.close(); } ...
    Any help would be greatly appreciated!

    Welcome to the forum!
    Thanks for posting the code and the DB, JDBC and app server versions. Those are what is needed to help.
    >
    java.sql.SQLException: Invalid argument(s) in call: putBytes()
                while(bytesLeft > 0) {
                    int bytesWritten = oracleBlob.setBytes(pos, bytes, pos, MAXBUFSIZE);
                    log.debug("Wrote " + bytesWritten + " bytes to BLOB");
                    bytesLeft -= bytesWritten;
                    pos += bytesWritten;That 'Invalid argument . . .' was your clue to look at the ARGUMENT values you are passing to the method call. You could have easily done that by displaying the values to the console each time in the loop BEFORE the method call.
    This is the signature of that method in the Javadocs (edited to highlight the relevant parts):
    http://docs.oracle.com/javase/6/docs/api/java/sql/Blob.html#setBytes(long, byte[])
    >
    int setBytes(long pos, byte[] bytes, int offset, int len) throws SQLException
    Writing starts at position pos in the BLOB value; len bytes from the given byte array are written.
    Parameters:
    pos - the position in the BLOB object at which to start writing; the first position is 1
    bytes - the array of bytes to be written to this BLOB object
    offset - the offset into the array bytes at which to start reading the bytes to be set
    len - the number of bytes to be written to the BLOB value from the array of bytes bytes
    >
    This is what you are passing for 'len': MAXBUFSIZE
    Most likely that value is LARGER than the 'byte array' that you are using; perhaps it is even the MAX int size.
    That value is invalid.
    In addition each time thru the loop you increment 'pos' and use 'pos' as the 'offset' into your array. Then you once again use MAXBUFSIZE as the number of bytes to write from your array. Even if MAXBUFSIZE is less than the length of your array at some point it will likely be greater than what is left of the array.
    For example, if MAXBUFSIZE is 2 and your array length is 3 the first 'put' will put the first two bytes. Then the second put will use a 'pos' of 2 and try to put 2 more bytes; except there is only one byte left.
    Your code updates the entire BLOB value. Best practices are to use the stream methods for reading and writing BLOB/CLOB rather than the 'setBytes' method you are using. The main reason for this is performance: the stream methods write DIRECTLY to the database.
    >
    Notes:
    The stream write methods described in this section write directly to the database when you write to the output stream. You do not need to run an UPDATE to write the data. However, you need to call close or flush to ensure all changes are written. CLOBs and BLOBs are transaction controlled. After writing to either, you must commit the transaction for the changes to be permanent.
    >
    See 'Reading and Writing BLOB and CLOB Data' in the JDBC Dev Guide
    http://docs.oracle.com/cd/B19306_01/java.102/b14355/oralob.htm#i1058044
    >
    Example: Writing BLOB Data
    Use the setBinaryOutputStream method of an oracle.sql.BLOB object to write BLOB data.
    The following example reads a vector of data into a byte array, then uses the setBinaryOutputStream method to write an array of character data to a BLOB.
    java.io.OutputStream outstream;
    // read data into a byte array
    byte[] data = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
    // write the array of binary data to a BLOB
    outstream = ((BLOB)my_blob).setBinaryOutputStream(1L);
    outstream.write(data);

  • Java.lang.AbstractMethodError: oracle.jdbc.driver.OracleResultSet.isLast()Z

    Hello.
    I'm trying to detect if a row is the last one of a ResultSet (from a
    executeQuery):
    ResultSet results = sql.executeQuery();
    if (results.isLast())
         out.println("EMPTY");
    But I get this error message:
    Error 500
    Servlet internal error:
    java.lang.AbstractMethodError: oracle.jdbc.driver.OracleResultSet.isLast()Z
         at estructura_10._jspService(mycode_10.java:93)
         at org.apache.jasper.runtime.HttpJspBase.service(Unknown Source)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java)
         at org.apache.tomcat.facade.ServletHandler.doService(Unknown Source)
    What am I doing wrong?
    Thank you very much.

    What do you want to do with a RS instead at least 1 next() ?
    Only 1 next() - then you know, if it is empty.
    If it's not empty, I assume you will do any retrieval, so you will have needed at least this first next(), don't you?
    Even if you would like to skip the first row (though you have retrieved it), it would not be too much costs.
    If you don't want to retrieve but only count your rows, do a query "SELECT COUNT(*) FROM table WHERE <your condition ...>".
    However, to get the count you would have to do one - only one - next() call.

  • Java.lang.AbstractMethodError: oracle.jdbc.driver.OracleDatabaseMetaData.lo

    I am evaluating the sun RI of javax.sql package . I downloaded the jdbc_rowset_tiger-1_0_1-mrel-jwsdp.zip package and installed in my machine.
    I tried the JdbcRowSet implmenation and it worked pretty smooth. I wanted to try the disconnected Rowset implementation. I tried CachedRowSet Implementation with thin driver. I get the following error message.
    Exception in thread "main" java.lang.AbstractMethodError: oracle.jdbc.driver.OracleDatabaseMetaData.locatorsUpdateCopy()Z
    at com.sun.rowset.CachedRowSetImpl.execute(Unknown Source)
    at com.sun.rowset.CachedRowSetImpl.execute(Unknown Source)
    at CachedRowSetSampl.main(CachedRowSetSampl.java:79)
    I am using thin driver with Oracle8i db.
    Appreciate any early responses

    I had the same problem initially.
    I fixed it by downloading an updated ojdbc14.jar (1).
    It may be because I downloaded the ocrs12.jar from there a bit earlier and the versions of ojdbc14.jar and ocrs12.jar need to match (that is, come from the Oracle10g suite of jars).
    Here is the class I used:
    import java.sql.*;
    import javax.sql.*;
    import com.sun.rowset.WebRowSetImpl;
    import com.sun.rowset.providers.RIXMLProvider;
    public class test {
      public static void main(String[] args) {
        try {
          Class.forName("oracle.jdbc.driver.OracleDriver");
          WebRowSetImpl wrs = new WebRowSetImpl();
          wrs.setCommand("select table_name from user_tables");
          wrs.setUsername("scott");
          wrs.setPassword("tiger");
          wrs.setUrl("jdbc:oracle:thin:@paramount.com:1521:ORCL");
          wrs.execute();
          wrs.writeXml(System.out);
        } catch (Exception e) {
          System.out.println("Exception:"+e);
    Dale(1) http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/htdocs/jdbc101020.html (Oracle Database 10g JDBC Drivers)

  • Exception Occur  "java.lang.AbstractMethodError: oracle.jdbc.driver....."

    I am using oracle 10.2.0.1.0. I can able to connect the database using sqlplus. I am executing some ant task. While running the ant script I am getting the following exception.
    [java] INFO: Locale id is:1
    [java] Oct 16, 2006 7:20:24 PM com.cramer.globalisation.resourcebundleloader.DataBaseMgr getLocaleI
    d
    [java] INFO: Using the default locale ID :1
    [java] Oct 16, 2006 7:20:24 PM com.cramer.globalisation.resourcebundleloader.ResourceBundleReader l
    oadPropertyFile
    [java] INFO: .\html\homepages\thersholdhomepage\config\bundle\thersholdhomepage.properties is Crame
    r resource bundle file
    [java] java.lang.AbstractMethodError: oracle.jdbc.driver.T4CConnection.setSavepoint(Ljava/lang/Stri
    ng;)Ljava/sql/Savepoint;
    [java] at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:180)
    [java] at org.apache.tools.ant.taskdefs.Java.run(Java.java:710)
    [java] at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:178)
    [java] at org.apache.tools.ant.taskdefs.Java.execute(Java.java:84)
    [java] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
    [java] at org.apache.tools.ant.Task.perform(Task.java:364)
    [java] at org.apache.tools.ant.Target.execute(Target.java:341)
    [java] at org.apache.tools.ant.Target.performTasks(Target.java:369)
    [java] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
    [java] at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.ja
    va:37)
    [java] at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
    [java] at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:382)
    [java] at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:107)
    [java] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
    [java] at org.apache.tools.ant.Task.perform(Task.java:364)
    [java] at org.apache.tools.ant.Target.execute(Target.java:341)
    [java] at org.apache.tools.ant.Target.performTasks(Target.java:369)
    [java] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
    [java] at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
    [java] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
    [java] at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
    [java] at org.apache.tools.ant.Main.runBuild(Main.java:668)
    [java] at org.apache.tools.ant.Main.startAnt(Main.java:187)
    [java] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
    [java] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
    [java] Caused by: java.lang.AbstractMethodError: oracle.jdbc.driver.T4CConnection.setSavepoint(Ljav
    a/lang/String;)Ljava/sql/Savepoint;
    [java] at com.cramer.globalisation.resourcebundleloader.DataBaseMgr.insertBundleRow(DataBaseMgr
    .java:118)
    [java] at com.cramer.globalisation.resourcebundleloader.ResourceBundleLoader.loadPropertyFiles(
    ResourceBundleLoader.java:77)
    [java] at com.cramer.globalisation.resourcebundleloader.ResourceBundleLoader.main(ResourceBundl
    eLoader.java:47)
    [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    [java] at java.lang.reflect.Method.invoke(Method.java:324)
    [java] at org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:202)
    [java] at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:134)
    [java] ... 24 more
    [java] --- Nested Exception ---
    [java] java.lang.AbstractMethodError: oracle.jdbc.driver.T4CConnection.setSavepoint(Ljava/lang/Stri
    ng;)Ljava/sql/Savepoint;
    [java] at com.cramer.globalisation.resourcebundleloader.DataBaseMgr.insertBundleRow(DataBaseMgr
    .java:118)
    Can anyone help me in this issue?.....

    few of my colligue are using the same database, and
    they are not getting these kind of error. Only my
    system and 2 more system is giving these problem.
    All of us are using the same version of oracle
    only.I said driver not database.
    >
    Only I am and 2 more friends are getting the "
    java.lang.AbstractMethodError:
    oracle.jdbc.driver.T4CConnection.setSavepoint(Ljava/la
    ng/String")
    "And are you running the same exact code as everyone else?
    Additionally you might want to check your class path to verify that only what is required is in that.
    You haven't put anything in the ext directory have you?

  • Java.lang.AbstractMethodError: oracle/jdbc/driver/OracleResultSet.getBlob

    Hi,
    I am using WSAD 4.0.3. While I am running application I am getting this error.
    [10/5/02 13:26:17:984 GMT+08:00] 7a483a9b ExceptionUtil X CNTR0020E: Non-application exception occurred while processing method lodge on bean BeanId(CePAC#CePACEJB.jar#CfsControllerBean, f0b300abe8): java.lang.AbstractMethodError: oracle/jdbc/driver/OracleResultSet.getBlob
    I have set the classpath i.e classes111.zip. This function is to insert record to a database having blob field.
    Waiting for a quick response.

    java.lang.AbstractMethodErrorIn jdbc that often occurs because you are using a newer version of JDBC (the jvm) and an older driver. It occurs because you called a method which exists in the newer JDBC but does not exist in the older driver.
    getBlob() was introduced in java 1.2, so it was not in JDBC 1.0.

  • Issue with java.lang.ClassCastException: oracle.sql.StructDescriptor

    Hi ,
    I'm creating a dbadapter for a custom API written in APPS schema -
    TYPE MISIPM_LOB IS RECORD (
    FILE_ID IPM_LOBS.FILE_ID%TYPE,
    FILE_NAME IPM_LOBS.LOB_NAME%TYPE );
    TYPE MISIPM_LOB_LIST IS TABLE OF MISIPM_LOB;
    PROCEDURE GET_FILE_ID_DETAILS(
    P_SOURCE_SYSTEM IN VARCHAR2,
    p_entity_value IN VARCHAR2,
    p_entity_code IN VARCHAR2,
    P_ORG_ID IN NUMBER,
    P_MISIPM_FILES_LIST OUT MISIPM_LOB_LIST,
    P_ERRCODE OUT VARCHAR2,
    P_ERRMESSAGE OUT VARCHAR2);
    From JDeveloper, there is a wrapper package is getting created and the compilation/deployment of this composite is also without any error.
    But when I run the composite, I'm surprisingly getting the below error -
    Exception occured when binding was invoked. Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'GetAttachmentMetaData' failed due to: Interaction processing error. Error while processing the execution of the APPS.BPEL_GETATTACHMENTMETADATA1.XX_DELIVER_BLOB$GET_FILE_ API interaction. An error occurred while processing the interaction for invoking the APPS.BPEL_GETATTACHMENTMETADATA1.XX_DELIVER_BLOB$GET_FILE_ API. Cause: java.lang.ClassCastException: oracle.sql.StructDescriptor Check to ensure that the XML containing parameter data matches the parameter definitions in the XSD. This exception is considered not retriable, likely due to a modelling mistake. ". The invoked JCA adapter raised a resource exception. Please examine the above error message carefully to determine a resolution.
    I recreated the adapter multiple times within the composite and also tried to create a separate composite and all the cases the error message received was same. There two more similar procedure call's in the composite and all rest of them are working fine.
    I can call the wrapper from sql script separately.
    Verified that the XSD generated and the wrapper package parameters are matching as well.
    Did anyone face the same issue or any explanation/help is much appreciated.
    Regards,
    Debanjan

    Hi Vijay,
    I have checked the number of parameters as well.
    <element name="InputParameters">
    <complexType>
    <sequence>
    <element name="P_SOURCE_SYSTEM" type="string" db:index="1" db:type="VARCHAR2" minOccurs="0" nillable="true"/>
    <element name="P_ENTITY_VALUE" type="string" db:index="2" db:type="VARCHAR2" minOccurs="0" nillable="true"/>
    <element name="P_ENTITY_CODE" type="string" db:index="3" db:type="VARCHAR2" minOccurs="0" nillable="true"/>
    <element name="P_ORG_ID" type="decimal" db:index="4" db:type="NUMBER" minOccurs="0" nillable="true"/>
    </sequence>
    </complexType>
    </element>
    <element name="OutputParameters">
    <complexType>
    <sequence>
    <element name="P_MISIPM_FILES_LIST" type="db:APPS.XX_DELIVER_X35784324X1X5" db:index="5" db:type="Array" minOccurs="0" nillable="true"/>
    <element name="P_ERRCODE" type="string" db:index="6" db:type="VARCHAR2" minOccurs="0" nillable="true"/>
    <element name="P_ERRMESSAGE" type="string" db:index="7" db:type="VARCHAR2" minOccurs="0" nillable="true"/>
    </sequence>
    </complexType>
    </element>
    <complexType name="APPS.XX_DELIVER_X35784324X1X6">
    <sequence>
    <element name="FILE_ID" type="decimal" db:type="NUMBER" minOccurs="0" nillable="true"/>
    <element name="FILE_NAME" db:type="VARCHAR2" minOccurs="0" nillable="true">
    <simpleType>
    <restriction base="string">
    <maxLength value="2000"/>
    </restriction>
    </simpleType>
    </element>
    </sequence>
    </complexType>
    <complexType name="APPS.XX_DELIVER_X35784324X1X5">
    <sequence>
    <element name="P_MISIPM_FILES_LIST_ITEM" type="db:APPS.XX_DELIVER_X35784324X1X6" db:type="Struct" minOccurs="0" maxOccurs="unbounded" nillable="true"/>
    </sequence>
    </complexType>
    Regards,
    Debanjan

  • Tomcat: java.lang.NoClassDefFoundError: oracle/sql/NUMBER

    hi,
    i have managed to come this far with my "simple" webapplication under tomcat.
    the exception is:
    java.lang.NoClassDefFoundError: oracle/sql/NUMBER
    since i have tried to put the classes12.jar in every reasonable directory without effect, i have to bother this forum. does anyone know "where the dog is burried"(german saying)?
    greetz
    Selim Keser

    Hi yves,
    This class is in the jdev_home/jdbc.lib/ojdbc14.jar.
    But prior to deploying your ADF application, did you install the ADF runtime libraries to Tomact as explained here?:
    http://www.oracle.com/webapps/online-help/jdeveloper/10.1.3?topic=j2ee_ptomcatdeploy_html
    Thanks
    Prasanth

  • Java.lang.NoClassDefFoundError: oracle/sql/STRUCT after 11g/GF3.1.2 upgrade

    We have recently upgraded all of our servers from:
    Java 1.6.31 to 1.6.32
    and
    Glassfish 3.1.1 to 3.1.2
    We upgraded our development server from Oracle 10g to 11g.
    Our live servers are working fine. Our development server now is spewing out a java.lang.NoClassDefFoundError: oracle/sql/STRUCT error whenever it encounters a servlet or page which uses this class.
    ojdbc14.jar and sdopai.jar were included within the WAR file, and I have tried with them excluded from the WAR file to no avail. We have tried reverting the version of ojdbc.jar on the server to the earlier version, this has made no different.
    Any ideas? The full stack trace is below:
    [#|2012-05-28T16:15:34.950+0100|WARNING|glassfish3.1.2|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=80;_ThreadName=Thread-2;|StandardWrapperValve[EnterDataSS]: PWC1406: Servlet.service() for servlet EnterDataSS threw exception
    java.lang.NoClassDefFoundError: oracle/sql/STRUCT
    at oracle.spatial.geometry.JGeometry.load(JGeometry.java:3097)
    at Bto.Location.LocatorUtils.JavaScriptifySDO(LocatorUtils.java:97)
    at Bto.Chats.Controllers.EnterDataModuleMain.<init>(EnterDataModuleMain.java:136)
    at Bto.Chats.SessionBean.initialiseEdm2(SessionBean.java:348)
    at Bto.Chats.Servlets.Enter.EnterDataSS.processRequest(EnterDataSS.java:36)
    at Bto.Chats.Servlets.ChatsServlet.doGet(ChatsServlet.java:90)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
    at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1542)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
    at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
    at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
    at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
    at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:849)
    at com.sun.grizzly.http.ajp.AjpProcessorTask.invokeAdapter(AjpProcessorTask.java:135)
    at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:746)
    at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1045)
    at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:228)
    at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
    at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
    at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
    at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
    at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
    at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
    at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
    at java.lang.Thread.run(Thread.java:662)
    Caused by: java.lang.ClassNotFoundException: oracle.sql.STRUCT
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at sun.misc.Launcher$ExtClassLoader.findClass(Launcher.java:229)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    ... 33 more
    |#]

    >
    Our live servers are working fine. Our development server now is spewing out a java.lang.NoClassDefFoundError: oracle/sql/STRUCT error whenever it encounters a servlet or page which uses this class.
    ojdbc14.jar and sdopai.jar were included within the WAR file, and I have tried with them excluded from the WAR file to no avail. We have tried reverting the version of ojdbc.jar on the server to the earlier version, this has made no different.
    >
    If your code can't find the class then you have the classic NoClassDefFoundError problem you get when any other referenced class can't be located.
    The oracle/sql/STRUCT class is in the ojdbc14.jar, ojdbc5.jar and ojdbc6.jar so if it can't be found then that class is missing from the jar you are using (which you can tell by examining the jar contents) or the jar is missing from the classpath being used.
    As already mentioned you need the Oracle 11 JDBC files to support Java 1.6
    Here is the official Oracle JDBC page that shows the Oracle DB versions supported for each of the JDBC drivers available and also describes the JDBC jars and what JDK versions they support.
    http://www.oracle.com/technetwork/database/enterprise-edition/jdbc-faq-090281.html#02_01
    >
    Which JDBC drivers support which versions of Javasoft's JDK?
    pre-8i OCI and THIN Drivers - JDK 1.0.x and JDK 1.1.x
    8.1.5 OCI and THIN Drivers - JDK 1.0.x and JDK 1.1.x
    8.1.6SDK THIN Driver - JDK 1.1.x and JDK 1.2.x (aka Java2)
    8.1.6SDK OCI Driver - Only JDK 1.1.x
    8.1.6 OCI and THIN Driver - JDK 1.1.x and JDK 1.2.x
    8.1.7 OCI and THIN Driver - JDK 1.1.x and JDK 1.2.x
    9.0.1 OCI and THIN Driver - JDK 1.1.x, JDK 1.2.x and JDK 1.3.x
    9.2.0 OCI and THIN Driver - JDK 1.1.x, JDK 1.2.x, JDK 1.3.x, and JDK 1.4.x
    10.1.0 OCI and THIN Driver - JDK 1.2.x, JDK 1.3.x, and JDK 1.4.x
    10.2.0 OCI and THIN Driver - JDK 1.2.x, JDK 1.3.x, JDK 1.4.x, and JDK 5.0.x
    11.1.0 OCI and THIN Driver - JDK 1.5.x and JDK 1.6.x
    11.2.0 OCI and THIN Driver - JDK 1.5.x and JDK 1.6.x
    Please note that JDK 1.4 is not supported by the 11 drivers.

  • Java.lang.AbstractMethodError: oracle.jdbc.driver.OracleResultSetImpl.getCl

    Hi Techies,
    I am trying to write the jdbc code which is independent to database. I am trying to access the clob datatype for oracle n mysql.
    But I am getting the following xception
    javax.servlet.ServletException: oracle.jdbc.driver.OracleResultSetImpl.getClob(Ljava/lang/String;)Ljava/sql/Clob;
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:830)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:763)
         org.apache.jsp.htmls.jsps.RuleManagement_jsp._jspService(RuleManagement_jsp.java:461)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:105)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:336)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:251)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
         sun.reflect.GeneratedMethodAccessor83.invoke(Unknown Source)
         sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         java.lang.reflect.Method.invoke(Method.java:585)
         org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
         java.security.AccessController.doPrivileged(Native Method)
         javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
         org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
         org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)Here is my code
    if (dataType.equals("CLOB")) {
         System.out.println("inside if");
         oracle.sql.CLOB expressionClob = (oracle.sql.CLOB) rs
                                  .getClob("EXPRESSION");
         System.out.println("inside");
         long clobLenLong = expressionClob.length();
         int clobLenInt = (new Long(clobLenLong)).intValue();
         System.out.println( clobLenInt);
         String expression = expressionClob.getSubString(1, clobLenInt);
    else {
              System.out.println("inside else");
              msclob = MYSQLUtil.getBlobString((java.sql.Blob) rs
                                  .getBlob("EXPRESSION"));
         }Am i missing something in my code .
    thanks,
    Krish

    no ideas

  • Java.lang.NoClassDefFoundError: oracle/sql/CharacterSet

    Okay, I give!
    I keep getting this runtime error when running this program I wrote.
    the oracle directory (where all the classes are stored) resides in the directory where my Class files live. I even added: ./
    to my classpath, but that didn't help at all.
    I navigated to: oracle/sql and did find CharacterSet.class
    What's even stranger is that I developed this application on a Sun/Solaris machine using Java 1.2.2 then I deployed it on a Sun/Solaris machine with Java 1.3 (but I am not using any of JDK's 1.2 stuff... its all just plain java).
    Very strange. Any input as to what this problem may be I would appreciate some guidance.
    thank you!

    If you are using the OCI driver, you may need to include the NLS classes:
    nls_charset12.zip
    In the classpath.

  • Java.lang.NoClassDefFoundError: oracle/sql/Datum

    Greetings -
    When using the Oracle XML SQL Utilities is there some sort of restriction as to where the two jar files (oraclexmlsql.jar xmlparser.jar) are referenced from.
    The reason I ask is that when I deployed my servlet based application under WebSphere - I received the above class not found error and had to change my setup to specify the two jar files as part of the command line options for the WebSphere program itself.
    Now I am using JRun and have the same error - unfortunately JRun doesn't like me overriding the classpath on the command line - so I have been unable to come up with a workaround.
    I would appreciate any comments or suggestions.
    Gary Bartlett
    Emory Healthcare
    null

    Thanks - I realize that App Servers have places to specify classpaths, and JRUN uses the standard JSDK 2.2 Web Application setup with the WEB-INF directory structure. All of my other jar files are there and work fine - the problem is with the xml/sql and xmlparser jar files from Oracle - they only seem to be found when I specify them as a -cp arg to the JRun executable. Which is causing problems for JRUN. I was wondering if there was any other solution to this problem.
    Thanks - Gary

  • Java.lang.AbstractMethodError: oracle/ jdbc/ driver/ OracleResultSet. getBigDecimal

    My JSP works fine using Sun's JSWDK and Jakarta-Tomcat. I just started using WebSphere Application Server v3.5 and now my JSP blows up at "rs.getBigDecimal"
    I'm using WebSphere v3.5, JDBC 2.0(classes102.zip), and JDK 1.2.2
    What can I do to fix this?
    Thanks,
    Brian
    null

    Hello Brian,
    I am facing the same problem and with JSP only. So if you have solution pl let me know.
    [email protected]
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Brian Stechly ([email protected]):
    My JSP works fine using Sun's JSWDK and Jakarta-Tomcat. I just started using WebSphere Application Server v3.5 and now my JSP blows up at "rs.getBigDecimal"
    I'm using WebSphere v3.5, JDBC 2.0(classes102.zip), and JDK 1.2.2
    What can I do to fix this?
    Thanks,
    Brian <HR></BLOCKQUOTE>
    null

  • Insert Blob column in the client errors ClassCastException: oracle.sql.BLOB

    Hi,
    When I try to insert and commit a Blob column(picture) I am getting the following exception.
    Is there any jar I need to add or any other setup I need to do to accept the BLOB column in the olite client database.
    500 Internal Server Error
    javax.faces.FacesException: #{backing_XXPBWorkOrderResultsCreatePGBean.saveButton_action}: javax.faces.el.EvaluationException: java.lang.ClassCastException: oracle.sql.BLOB
         at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:78)
         at oracle.adf.view.faces.component.UIXCommand.broadcast(UIXCommand.java:211)
    Caused by: java.lang.ClassCastException: oracle.sql.BLOB
         at oracle.lite.poljdbc.LiteEmbPreparedStmt.setVal(Unknown Source)
         at oracle.lite.poljdbc.POLJDBCPreparedStatement.setObject(Unknown Source)
         at oracle.lite.poljdbc.POLJDBCPreparedStatement.setObject(Unknown Source)
         at oracle.lite.poljdbc.POLJDBCPreparedStatement.setObject(Unknown Source)
         at oracle.lite.web.JupPreparedStatement.setObject(Unknown Source)
         at oracle.jbo.server.BaseSQLBuilderImpl.bindUpdateStatement(BaseSQLBuilderImpl.java:1765)
         at oracle.jbo.server.EntityImpl.bindDMLStatement(EntityImpl.java:7345)
    With regareds,
    Kali.
    OSSI.

    Here are examples if inserting into a Blob from text, file, and retrieving a blob.
    Insert into a Blob (Text)
    import java.io.FileNotFoundException;
    import java.sql.Connection;
    import java.sql.Driver;
    import java.sql.DriverManager;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    public class InsertBlob {
        public static void main(String[] args) throws FileNotFoundException {
            Connection con = null;
            PreparedStatement stmt = null;
            ResultSet rs = null;
            String letterText = "some letter text";
            long id = 100;
            try {
                DriverManager.registerDriver((Driver)(Class.forName("oracle.lite.poljdbc.POLJDBCDriver").newInstance()));
                try {
                    con = DriverManager.getConnection("jdbc:polite:polite", "system", "manager");
                } catch (SQLException sqle) {
                    sqle.printStackTrace();
            } catch (Exception e) {
                e.printStackTrace();
            try {
                stmt = con.prepareStatement("INSERT INTO BLOB_TABLE (BLOB_ID, BLOB_DATA) VALUES (?, EMPTY_BLOB())");
                stmt.setLong(1, id);
                stmt.executeUpdate();
                stmt = con.prepareStatement("SELECT BLOB_DATA FROM BLOB_TABLE WHERE BLOB_ID = ? FOR UPDATE");
                stmt.setLong(1, id);
                rs = stmt.executeQuery();
                if (rs.next()) {
                    try {
                        oracle.lite.poljdbc.BLOB oliteBlob = null;
                        oliteBlob = ((oracle.lite.poljdbc.OracleResultSet) rs).getBLOB(1);
                        byte[] byteLetterText = letterText.getBytes();
                        oliteBlob.putBytes(1, byteLetterText);
                        con.commit();
                    } catch (ClassCastException e) {
                        e.printStackTrace();
                    } finally {
                        rs = null;
                        stmt = null;
                        con.rollback();
                        con = null;
            } catch (SQLException e) {
                e.printStackTrace();
    }Insert Into a Blob (File)
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileNotFoundException;
    import java.sql.Connection;
    import java.sql.Driver;
    import java.sql.DriverManager;
    import java.sql.PreparedStatement;
    import java.sql.SQLException;
    public class InsertBlobFile {
        public static void main(String[] args) throws FileNotFoundException {
            Connection con = null;
            PreparedStatement stmt = null;
            long id = 200;
            try {
                DriverManager.registerDriver((Driver)(Class.forName("oracle.lite.poljdbc.POLJDBCDriver").newInstance()));
                try {
                    con = DriverManager.getConnection("jdbc:polite:polite", "system", "manager");
                } catch (SQLException sqle) {
                    sqle.printStackTrace();
            } catch (Exception e) {
                e.printStackTrace();
            try {
                stmt = con.prepareStatement("INSERT INTO BLOB_TABLE (BLOB_ID, BLOB_DATA) VALUES (?, ?)");
                stmt.setLong(1, id);
                File fBlob = new File ( "C:\\BLOB_TEST_FILE.TXT" );
                FileInputStream is = new FileInputStream ( fBlob );
                stmt.setBinaryStream (2, is, (int) fBlob.length() );
                stmt.executeUpdate();
                con.commit();
            } catch (SQLException e) {
                e.printStackTrace();
    }Retrieve from Blob (Write to file)
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.sql.Blob;
    import java.sql.Connection;
    import java.sql.Driver;
    import java.sql.DriverManager;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    public class RetrieveBlob {
        final static int bBufLen = 32 * 1024;
        final static String outFile = "C:\\BLOB_OUTPUT_FILE.TXT";
        public static void main(String[] args) throws IOException {
            Connection con = null;
            PreparedStatement stmt = null;
            ResultSet rs = null;
            try {
                DriverManager.registerDriver((Driver)(Class.forName("oracle.lite.poljdbc.POLJDBCDriver").newInstance()));
                try {
                    con = DriverManager.getConnection("jdbc:polite:polite", "system", "manager");
                } catch (SQLException sqle) {
                    sqle.printStackTrace();
            } catch (Exception e) {
                e.printStackTrace();
            try {
                stmt = con.prepareStatement("SELECT * FROM BLOB_TABLE");
                rs = stmt.executeQuery();
                while(rs.next()) {
                    int id = rs.getInt(1);
                    Blob value = rs.getBlob(2);
                    System.out.println(id + " | " + value);
                    writeBlobToFile(value);
            } catch (SQLException e) {
                e.printStackTrace();
        public static long readFromBlob(Blob blob, OutputStream out)
          throws SQLException, IOException {
            InputStream in = blob.getBinaryStream();
            int length = -1;
            long read = 0;
            byte[] buf = new byte[bBufLen];
            while ((length = in.read(buf)) > 0) {
                out.write(buf, 0, length);
                read += length;
            in.close();
            return read;
        public static long writeBlobToFile(Blob blob)
          throws IOException, SQLException {
            long wrote = 0;
            OutputStream fwriter = new FileOutputStream(outFile);
            wrote = readFromBlob(blob, fwriter);
            fwriter.close();
            return wrote;
    }

  • Oracle.sql.BLOB array

    Hi,
    I have a database table(say MY_BLOB_TABLE.) having one blob column
    I want to send each blob column as an attachment to a single email i.e. I for a particular case if I have 10 qualifying rows in MY_BLOB_TABLE,I want to send all these 10 blobs as different attachments with a SINGLE email.
    I have the working code (from asktom) that allows me to send one attchment per email ..so I changed the code so that it takes array types to the things..
    here is my code:
    Database Type:
    create or replace type xx_blobdata is varray(50) of blob;
    create or replace type xx_attachedfile is varray(50) of varchar2(1000);
    create or replace type xx_attachedfiletype is varray(50) of varchar2(1000);
    Java Code
    public class xx_attachments_mail
    static String dftMime = "application/octet-stream";
    static String dftName = "filename.dat";
    public static oracle.sql.NUMBER
    send(String from,
    String to,
    String cc,
    String bcc,
    String subject,
    String body,
    String SMTPHost,
    oracle.sql.BLOB[] attachmentData,
    String[] attachmentType,
    String[] attachmentFileName);
    PLSQL Wrapper
    create or replace function xx_attachments_mail_send(
    p_from in varchar2,
    p_to in varchar2,
    p_cc in varchar2,
    p_bcc in varchar2,
    p_subject in varchar2,
    p_body in varchar2,
    p_smtp_host in varchar2,
    p_attachment_data in xx_blobdata,
    p_attachment_type in xx_attachedfiletype,
    p_attachment_file_name in xx_attachedfile) return number
    as
    language java name 'xx_attachments_mail.send( java.lang.String,
    java.lang.String,
    java.lang.String,
    java.lang.String,
    java.lang.String,
    java.lang.String,
    java.lang.String,
    oracle.sql.BLOB[],
    java.lang.String[],
    java.lang.String[]
    ) return oracle.sql.NUMBER';
    Actual Call:
    attachment_data :=xx_blobdata();
    attachment_type :=xx_attachedfiletype();
    attachment_name :=xx_attachedfile();
    ret_code := xx_attachments_mail_send(
    p_from => '[email protected]',
    p_to => '[email protected]',
    p_cc => NULL,
    p_bcc => NULL,
    p_subject => 'testing',
    p_body => 'testing..',
    p_smtp_host => 'myserver.com',
    p_attachment_data => attachment_data,
    p_attachment_type => attachment_type,
    p_attachment_file_name => attachment_name);
    Everything compiles. All objects are valid in database.But when I call I get the following error:
    ORA-29531: no method send in class xx_attachments_mail
    ORA-06512: at "XX_ATTACHMENTS_MAIL_SEND", line 1
    Can anybody point out what is wrong that I am doing.
    Thanks.

    Its already there...
    public static oracle.sql.NUMBER send();
    The code works well if I remove arrays (i.e. []) ... my problem is the mapping or VARRAY to Java datatype...
    I just read something on oracle.sql.array ....that is the solution for mapping Oracle VARRAY to Java data type... but still I dont have a working code...
    Any help is highly appreciated...

Maybe you are looking for

  • Invoice posting possible for limit PO although final invoice is set

    Hi, I encountered a strange behavior, I think. I created a limit PO and posted several invoices against it. So far, so good. Then, I wanted to "close" the limit PO and set the "Final invoice" indicator in PO. Even though, I was able to post further i

  • Receiving IDocs from non-SAP system ...

    Hello guys, I have problem with implementing IDoc-XI-IDoc scenario. The sender system is a subsystem (non-SAP system) sending IDocs but XI is not able to receive them. I thing the IDoc metadata can not be found. Logical system name of the sender is I

  • Person responsible based Authorization in Projects is not working for me

    Hi, Does 'Person responsible' based authorization for WBSE works for the WBS element only, or for the hierarchically sub-ordinate non-WBS objects (meaning Networks, Activities, Materials etc) as well? Details: (Authorization objects: C_PROJ_VNR and C

  • Qosmio X500-110 - Webcam failed to initialize

    Hi I have a Qosmio x500-110. Bought brand new out of the box and I havnt changed nothing. It displays this error message after startup "webcamera failed to initialize...restart application or computer" and the webcam stops working. Also when this hap

  • How to find out what type of trigger (restricted/unrestricted) you are in

    I wonder if anyone has a trick to find out whether a program unit can detect whether it has been called by a trigger which allows restricted or unrestricted built-ins. I have a program unit, which is called from WHEN-VALIDATE-ITEM triggers in the app