can't make sql-address book connecting to a MSQL DB

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

can't make sql-address book connecting to a MSQL DB

Abadie Lana
Hi all
hope sb will be able to help me...
i'm new to Orbeon and new to Xforms...
so i start by reading the orbeon tutorial, was fine.
then i wanted to make a connection with an external database, MySQL. So i used the sql-address-book example. But it does not work: no error but no table is created, no insertion and no complaint....

I put the datasource-xml.sql under xform-sql-address-book/init-db/
The reference to the datasource locations has been updated in service-get/delete/add and init-address-book
The datasource-xml.sql is like
<datasource>
        <driver-class-name>com.mysql.jdbc.Driver</driver-class-name>
        <uri>jdbc:mysql://codac-mysql:3306/ICSystems</uri>
        <username>xxxxx</username>
        <password>xxxx</password>
</datasource>

I put an submission-error when when pressing on the add button, but does not help
I tried to activate the Xform Engine logger, by uncommenting the log4j.xml but nothing... I have no logging information from the server-side... no orbeon.log
thanks for helping
Lana


--
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
Reply | Threaded
Open this post in threaded view
|

Re: can't make sql-address book connecting to a MSQL DB

Andrew Bailey
Hi Lana,

Are you sure you have the mysql jar in your classpath,
the WEB-INF/lib directory would be one place to put it
after that restart the web application
touch WEB-INF/web.xml
will do that on unix or edit and save the web.xml on windows

I found that to get the orbeon.log you need to start tomcat from the
bin directory

cd $CATALINA_HOME/bin
./startup.sh

this is because there is a relative path for orbeon.log
../logs/orbeon.log

if there is no directory ../logs then no log is created

Hope that helps

If not please post the relevant part of the log

Andy Bailey

http://www.hazlorealidad.com

On Thu, Sep 24, 2009 at 11:56 AM, Abadie Lana <[hidden email]> wrote:

> Hi all
> hope sb will be able to help me...
> i'm new to Orbeon and new to Xforms...
> so i start by reading the orbeon tutorial, was fine.
> then i wanted to make a connection with an external database, MySQL. So i used the sql-address-book example. But it does not work: no error but no table is created, no insertion and no complaint....
>
> I put the datasource-xml.sql under xform-sql-address-book/init-db/
> The reference to the datasource locations has been updated in service-get/delete/add and init-address-book
> The datasource-xml.sql is like
> <datasource>
>        <driver-class-name>com.mysql.jdbc.Driver</driver-class-name>
>        <uri>jdbc:mysql://codac-mysql:3306/ICSystems</uri>
>        <username>xxxxx</username>
>        <password>xxxx</password>
> </datasource>
>
> I put an submission-error when when pressing on the add button, but does not help
> I tried to activate the Xform Engine logger, by uncommenting the log4j.xml but nothing... I have no logging information from the server-side... no orbeon.log
> thanks for helping
> Lana
>
>
> --
> 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
>
>


--
Andrew Bailey

(312) 866 9556

NOTA DE CONFIDENCIALIDAD Y DE NO DIVULGACIÓN:
La información contenida en este E-mail y sus archivos adjuntos es
confidencial y sólo puede ser utilizada por el individuo
o la empresa a la cual está dirigido. Si no es el receptor autorizado,
cualquier retención, difusión,
distribución o copia de este mensaje queda prohibida y sancionada por
la ley. Si por error recibe este
mensaje, favor devolverlo y borrarlo inmediatamente.


--
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
Reply | Threaded
Open this post in threaded view
|

RE: Re: can't make sql-address book connecting to a MySQL DB

Abadie Lana
Hi Andrew
Thanks for the hint:
--now I have the orbeon.log created
-- the connection to the mysql DB works (the problem was the tools.jar was not in my JAVA_HOME)
However now I have the following problem...
Normally in the example, it should create the table orbeon_address_book, but in my case, it never goes through the create statement, whether I call service-get or service-add...
In view.xhtml :

  <xforms:submission id="get-submission" ref="instance('main')" replace="instance" method="post" action="/xformsSqlTest/get"/>

Snippet in service-get.xpl:
<p:param type="input" name="instance"/>
    <p:param type="output" name="data"/>

    <!-- If necessary, create tables in database -->
    <p:processor name="oxf:pipeline">
        <p:input name="config" href="init-database/init-database.xpl"/>
    </p:processor>

    <p:processor name="oxf:sql">
        <p:input name="data" href="#instance"/>
        <p:input name="datasource" href="init-database/datasource-sql.xml"/>
        <p:input name="config">
            <sql:config>
                <friends>
                    <sql:connection>
                        <sql:execute>
                            <sql:query>
                                select * from orbeon_address_book
                            </sql:query>
                            <sql:result-set>
                                <sql:row-iterator>

So if I understood correctly the xpl processor concept:
First when the orbeon engine get the service-get request, it should check first if the database and table exist (i.e. go to oxf:pipeline... but never go through this processor...). However no mention of going through this step is found in the orbeon.log


Some snippet in orbeon.log:
6.0.20/logs/orbeon.log
[codac-dev@ws2 xformsSqlTest]$ grep service-get /opt/tomcat6/apache-tomcat-6.0.20/logs/orbeon.log
2009-09-29 08:47:51,666 ERROR ProcessorService  - Exception at line 37 of oxf:/apps/xformsSqlTest/service-get.xpl
<td class="orbeon-error-panel-url-cell">oxf:/apps/xformsSqlTest/service-get.xpl</td>
<td class="orbeon-error-panel-url-cell">oxf:/apps/xformsSqlTest/service-get.xpl</td>
<div class="orbeon-error-panel-param-block">view \u2192 service-get.xpl</div>
<td class="orbeon-error-panel-xml-cell"><span class="xml-rd"><span class="xml-symbol">&lt;</span><span class="xml-elt-name">page</span> <span class="xml-att-name">path-info</span><span class="xml-symbol">="</span><span class="xml-att-value">/xformsSqlTest/get</span><span class="xml-symbol">"</span> <span class="xml-att-name">view</span><span class="xml-symbol">="</span><span class="xml-att-value">service-get.xpl</span><span class="xml-symbol">"</span><span class="xml-symbol">/&gt;</span></span></td>
<td>oxf:/apps/xformsSqlTest/service-get.xpl</td>
<td style="color: red">line&nbsp;37&nbsp;of&nbsp;oxf:/apps/xformsSqlTest/service-get.xpl:&nbsp;Table&nbsp;'ICSystems.orbeon_address_book'&nbsp;doesn't&nbsp;exist<br>Table&nbsp;'ICSystems.orbeon_address_book'&nbsp;doesn't&nbsp;exist
<td>oxf:/apps/xformsSqlTest/service-get.xpl</td>


Let me know if more information is needed and thanks for helping
Lana
-----Original Message-----
From: Andrew Bailey [mailto:[hidden email]]
Sent: 29 September 2009 00:27
To: [hidden email]
Subject: [ops-users] Re: can't make sql-address book connecting to a MSQL DB

Hi Lana,

Are you sure you have the mysql jar in your classpath, the WEB-INF/lib directory would be one place to put it after that restart the web application touch WEB-INF/web.xml will do that on unix or edit and save the web.xml on windows

I found that to get the orbeon.log you need to start tomcat from the bin directory

cd $CATALINA_HOME/bin
./startup.sh

this is because there is a relative path for orbeon.log ../logs/orbeon.log

if there is no directory ../logs then no log is created

Hope that helps

If not please post the relevant part of the log

Andy Bailey

http://www.hazlorealidad.com

On Thu, Sep 24, 2009 at 11:56 AM, Abadie Lana <[hidden email]> wrote:

> Hi all
> hope sb will be able to help me...
> i'm new to Orbeon and new to Xforms...
> so i start by reading the orbeon tutorial, was fine.
> then i wanted to make a connection with an external database, MySQL. So i used the sql-address-book example. But it does not work: no error but no table is created, no insertion and no complaint....
>
> I put the datasource-xml.sql under xform-sql-address-book/init-db/ The
> reference to the datasource locations has been updated in
> service-get/delete/add and init-address-book The datasource-xml.sql is
> like <datasource>
>        <driver-class-name>com.mysql.jdbc.Driver</driver-class-name>
>        <uri>jdbc:mysql://codac-mysql:3306/ICSystems</uri>
>        <username>xxxxx</username>
>        <password>xxxx</password>
> </datasource>
>
> I put an submission-error when when pressing on the add button, but
> does not help I tried to activate the Xform Engine logger, by
> uncommenting the log4j.xml but nothing... I have no logging
> information from the server-side... no orbeon.log thanks for helping
> Lana
>
>
> --
> 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
>
>


--
Andrew Bailey

(312) 866 9556

NOTA DE CONFIDENCIALIDAD Y DE NO DIVULGACIÓN:
La información contenida en este E-mail y sus archivos adjuntos es confidencial y sólo puede ser utilizada por el individuo o la empresa a la cual está dirigido. Si no es el receptor autorizado, cualquier retención, difusión, distribución o copia de este mensaje queda prohibida y sancionada por la ley. Si por error recibe este mensaje, favor devolverlo y borrarlo inmediatamente.


--
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