ERROR SQLProcessor - PreparedStatement: null

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

ERROR SQLProcessor - PreparedStatement: null

Kal Sze
I'm trying to use the SQL processor in Orbeon Forms 3.7 beta 1, but have run into a lot of trouble.

I have a pipeline like this:
<p:pipeline xmlns:p="http://www.orbeon.com/oxf/pipeline"
        xmlns:oxf="http://www.orbeon.com/oxf/processors"
        xmlns:xforms="http://www.w3.org/2002/xforms"
        xmlns:sql="http://orbeon.org/oxf/xml/sql"
        xmlns:odt="http://orbeon.org/oxf/xml/datatypes"
        xmlns:xs="http://www.w3.org/2001/XMLSchema">
        <p:param type="input" name="instance"/>
        <p:param type="output" name="data"/>

       
        <p:processor name="oxf:sql">
                <p:input name="data" href="#instance" debug="true"/>
                <p:input name="config">
                        <sql:config>
                                <CustomerSuggestions>
                                        <sql:connection>
                                                <sql:datasource>sandbox</sql:datasource>
                                                <sql:execute>
                                                        <sql:query>select CUSTOMER_NAME from CUSTOMERS where CUSTOMER_NAME like '%A%'</sql:query>
                                                       
                                                        <sql:result-set>
                                                                <sql:row-iterator>
                                                                        <CustomerSuggestion><sql:get-column-value column-name="CUSTOMER_NAME" type="xs:string"/></CustomerSuggestion>
                                                                </sql:row-iterator>
                                                        </sql:result-set>
                                                </sql:execute>
                                        </sql:connection>
                                </CustomerSuggestions>
                        </sql:config>
                </p:input>
                <p:output name="data" ref="data" debug="true"/>
        </p:processor>
</p:pipeline>

And I have defined my JDBC datasource in META-INF/context.xml:
<Context>
        <Resource name="jdbc/sandbox" auth="Container" type="javax.sql.DataSource"
                maxActive="100" maxIdle="30" maxWait="10000" user="sandbox"
                password="sandbox" driverClassName="org.hsqldb.jdbcDriver"
                url="jdbc:hsqldb:hsql://localhost/sandbox"/>
</Context>

And in WEB-INF/web.xml:
    <resource-ref>
    <description>Sandbox HSQL DB</description>
    <res-ref-name>jdbc/sandbox</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>       

I am sure that my HSQL database is up and running because I could use the Database Manager bundled with the hsqldb.jar to access it, using the jdbc:hsqldb:hsql protocol.

Somehow, Orbeon Forms complains about "ERROR SQLProcessor  - PreparedStatement: null." In addition, I get a "ERROR ProcessorService  - Exception at line 19 of oxf:/apps/my-sandbox/suggest-customers.xpl
java.sql.SQLException: No suitable driver" at line 19 of my pipeline definition.

Does somebody know what's wrong?
Reply | Threaded
Open this post in threaded view
|

Re: ERROR SQLProcessor - PreparedStatement: null

Kal Sze
It looks like the issue goes deeper. I just checked my catalina.out log and it contains this line:

"Cannot create JDBC driver of class '' for connect URL 'null'

I had already placed hsqldb.jar in $CATALINA_HOME/lib though (Tomcat 6.0.18, JDK 1.5.0_16, Mac OS X 10.5.6).
Reply | Threaded
Open this post in threaded view
|

Re: ERROR SQLProcessor - PreparedStatement: null

Kal Sze
I am out of idea as to why this error is occurring. I have even placed the latest stable hsqldb.jar (as of this writing, version 1.8.0.10) into WEB-INF/lib.

Some people on #tomcat of freenode suggest that I may have made mistakes while changing the web.xml. This is unlikely as I have only inserted the <resource-ref> node under the root web-app node, and have not touched anything else. As anyone can see from my first post, the <resource-ref> node is extremely simple and should not contain any error.

Any hint would be much appreciated.

Kal Sze wrote
It looks like the issue goes deeper. I just checked my catalina.out log and it contains this line:

"Cannot create JDBC driver of class '' for connect URL 'null'

I had already placed hsqldb.jar in $CATALINA_HOME/lib though (Tomcat 6.0.18, JDK 1.5.0_16, Mac OS X 10.5.6).
Reply | Threaded
Open this post in threaded view
|

Re: Re: ERROR SQLProcessor - PreparedStatement: null

fl.schmitt
Kal Sze,

i think you could do two things:

- test if it works with an external datasource definition as described
here: http://www.orbeon.com/ops/doc/processors-sql#d39e126

- check out some hints like those:
http://forum.springsource.org/showthread.php?t=30679
http://www.laliluna.de/260.html

HTH
florian



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws