You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Bertrand Delacretaz <bd...@codeconsult.ch> on 2002/06/18 10:33:09 UTC

SQLTransformer, AbstractMethodError in prepareStatement

I'm trying to access a Basis Plus database using their JDBC driver.

It looks like the connection opens correctly, but then I get "500 internal 
error" from Cocoon, and the following messages in the tomcat logs:

java.lang.AbstractMethodError
        at 
org.apache.avalon.excalibur.datasource.JdbcConnection.prepareStatement(JdbcConnection.java:172)
        at 
org.apache.cocoon.transformation.SQLTransformer$Query.execute(SQLTransformer.java:1014)
. . .

It works fine from an XSP page running in the same instance of Cocoon (going 
directly to JDBC using Class.forName, DriverManager.getConnection and 
Connection.PrepareStatement), meaning the driver supports PreparedStatements.

Suspecting a classloader problem, I tried putting the JDBC driver jar in 
WEB-INF/lib, then in the main lib directory and then even in the JRE lib/ext 
directory, with same results.

Here's what I have in web.xml (works according to the logs):
    <init-param>
      <param-name>load-class</param-name>
      <param-value>
        <!-- for Basis Plus -->
        com.opentext.basis.jdbc.BasisDriver
      </param-value>
    </init-param>

And in cocoon.xconf:

  <datasources>
    <!-- bd BasisPlus -->
    <jdbc logger="core.datasources.basisplus.eiger" name="eiger">
      <pool-controller max="1" min="1"/>
      <dburl>jdbc:opentext:basis://bla:stit@eiger:2033/some_dba</dburl>
      <user>bla</user>
      <password>stit</password>
    </jdbc>

Also seems to work, if I put a wrong password I get the proper error message 
("Could not return connection").

Any clues?

-- 
 Bertrand Delacrétaz (codeconsult.ch, jfor.org)

 buzzwords: XML, java, XSLT, cocoon, mentoring/teaching/coding.
 disclaimer: eternity is very long. mostly towards the end. get ready.






---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


SOLVED: SQLTransformer, AbstractMethodError in prepareStatement

Posted by Bertrand Delacretaz <bd...@codeconsult.ch>.
On Tuesday 18 June 2002 10:33, Bertrand Delacretaz wrote:
>. . .
> It looks like the connection opens correctly, but then I get "500 internal
> error" from Cocoon, and the following messages in the tomcat logs:
>
> java.lang.AbstractMethodError
>         at
> org.apache.avalon.excalibur.datasource.JdbcConnection.prepareStatement
>....

I found my problem: the JDBC driver I'm using is not JDBC 1.2 compliant - 
need to tell the SQLTransformer to use the "old-driver" interface by 
configuring it like follows in the sitemap:

<map:transformer 
	logger="sitemap.transformer.sql-old" 
	name="sql-old" 
	src="org.apache.cocoon.transformation.SQLTransformer"
>
	<old-driver>true</old-driver>
</map:transformer> 

And then use <map:transform type="sql-old"> in the sitemap.

-Bertrand

---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>