sergio morlan
sergio morlan

Reputation: 41

java.lang.AbstractMethodError: org.jboss.resource.adapter.jdbc.jdk5.WrappedConnectionJDK5.createBlob()Ljava/sql/Blob;

I have a problem, I have a web application hosted on a JBoss 5.1.0.GA and in which we are using Oracle11g as database server.

When trying to store a Blob in a field in a table DB using a PreparedStatement gives me this error

java.lang.AbstractMethodError: org.jboss.resource.adapter.jdbc.jdk5.WrappedConnectionJDK5.createBlob()Ljava/sql/Blob;

in line

Blob bl = pstmt.getConnection().createBlob();

The code I use is this, bob is a byte[]:

 if (this.conexion.isOracle()) {
        Blob bl = pstmt.getConnection().createBlob();
        bl.setBytes(1,bob);
        pstmt.setBlob(indice++, bl);

    } else {
        pstmt.setBytes(indice++, bob);
    }

In the Jboss I have the ojdbc6.jar driver and the code is also compiled with that jar. The version of jdk installed on my computer is 1.6.0_32

You know what might be causing this error? You might have to do with using that version of JBoss?

Because the class that references the error is in the org.jboss.jbossas jar: jboss-as-connector: 5.1.0.GA: jar, but within the server is not.

A test I did was descargarme version 6.1 of the jar, if it contains the implementation of createBlob method, and I got in my JBoss but the error remains the same.

thank you very much, a greeting,

Upvotes: 2

Views: 1025

Answers (2)

Bruno Ranschaert
Bruno Ranschaert

Reputation: 7603

JBoss uses jdbc wrapper classes which in the distribution are written for JDK5 and not all methods are implemented (I suspect because JDK5 is still JDBC3, and JDK6 is JDBC4).

There is a newer jboss-common-jdbc-wrapper-4.2.3.GA.jar available (eg. from the public maven repository) which implements the wrappers for JDK6 and implements the methods (related to national character sets).

So you have to download the 'newer' wrapper classes from maven, and replace the corresponding jar in the server distribution.

Edit 1 - Use correct build flavor of the server (jdk6)

During the time that JDK5 was becoming obsolete and JDK6 was released each JBoss server was built in two flavors: the normal one and the -jdk6 one. So the easiest solution would be to download the jdk6 version and go with that flavor, no patching necessary.

Upvotes: 0

ibre5041
ibre5041

Reputation: 5298

You need at least JDK 1.6 to run your JBOSS and also the newest version of ojdbc6.jar (Oracle JDBC driver).

Upvotes: 0

Related Questions