cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Lianoglou <j...@arachnedesign.net>
Subject Re: db connection problem
Date Mon, 15 Mar 2004 15:52:18 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

make sure you're preloading the driver in $cocoon/WEB-INF/web.xml

you should see something like this:

=================================
<init-param>
    <param-name>load-class</param-name>
    <param-value>

       <!-- ... lines missing -->

       <!-- For Database Driver: -->
       org.hsqldb.jdbcDriver
       com.mysql.jdbc.Driver

    </param-value>
</init-param>
=================================

org.hsqldb.jdbcDriver is in the default version of web.xml ... just  
make sure your driver's name is in there, and that you have its jar  
file in:

$cocoon/WEB-INF/lib

apologies for any lack of coherency ... i'm posting hot on the heels of  
an all-nighter. :)



regards,
jL

On Mar 15, 2004, at 6:50 AM, Derek Hohls wrote:

> Hey
> Im trying to connect to a MS SQL database. Im pretty sure the driver is
> fine
> and the URL, username and password for the database is correct, yet im
>
> unable to bring up any info from the databsae. This is the sample page
> im
> using to bring up some info.
> <xsp:page
>                language="java"
>                xmlns:xsp="http://apache.org/xsp"
>                xmlns:esql="http://apache.org/cocoon/SQL/v2"
>                xmlns:xsp-request="http://apache.org/xsp/request/2.0">
> <user_info>
>    <esql:connection>
>        <esql:pool>ldd</esql:pool>
>
>          <esql:execute-query>
>             <esql:query>
>                select * from dbo_episode
>             </esql:query>
>             <esql:results>
>                     <hello>HELLO</hello>
>             </esql:results>
>
>             <esql:no-results>
>                <user_not_present>
>                   <user_present>
>                       <episode_no>Not present</episode_no>
>                   </user_present>
>                </user_not_present>
>             </esql:no-results>
>
>             <esql:error-results>
> 		    <esql:get-message/>
> 		    <esql:get-stacktrace/>
> 		    <esql:to-string/>
>             </esql:error-results>
>
>          </esql:execute-query>
>    </esql:connection>
> </user_info>
>
> </xsp:page>
> ============================================================
>
> This is what i get on the page.
>
> The XML page cannot be displayed
> Cannot view XML input using XSL style sheet. Please correct the error
> and
> then click the Refresh button, or try again later.
>
>
> ----------------------------------------------------------------------- 
> ---------
>
> The following tags were not closed: user_info. Error processing
> resource
> 'http://localhost:13001/icdb/test.html'.
>
> =============================================================
>
> I checked the error logs and this is what is present.
>
> java.lang.NullPointerException
> 	at
> org.apache.cocoon.components.language.markup.xsp.EsqlQuery.<init>(EsqlQ 
> uery.java:99)
> 	at org.apache.cocoon.www.xsp.sample_xsp.generate(E:\Infection
> Control
> Database\jakarta-tomcat-4.1.18\work\Standalone\localhost\icdb\cocoon- 
> files\org/apache/cocoon/www/xsp\sample_xsp.java:341)
> 	at
> org.apache.cocoon.generation.ServerPagesGenerator.generate(ServerPagesG 
> enerator.java:258)
> 	at
> org.apache.cocoon.components.pipeline.CachingEventPipeline.process(Cach 
> ingEventPipeline.java:250)
> 	at
> org.apache.cocoon.components.pipeline.CachingStreamPipeline.process(Cac 
> hingStreamPipeline.java:395)
> 	at org.apache.cocoon.www.sitemap_xmap.matchN400076(E:\Infection
> Control
> Database\jakarta-tomcat-4.1.18\work\Standalone\localhost\icdb\cocoon- 
> files\org/apache/cocoon/www\sitemap_xmap.java:1199)
> 	at org.apache.cocoon.www.sitemap_xmap.process(E:\Infection
> Control
> Database\jakarta-tomcat-4.1.18\work\Standalone\localhost\icdb\cocoon- 
> files\org/apache/cocoon/www\sitemap_xmap.java:835)
> 	at org.apache.cocoon.www.sitemap_xmap.process(E:\Infection
> Control
> Database\jakarta-tomcat-4.1.18\work\Standalone\localhost\icdb\cocoon- 
> files\org/apache/cocoon/www\sitemap_xmap.java:781)
> 	at org.apache.cocoon.sitemap.Handler.process(Handler.java:227)
> 	at org.apache.cocoon.sitemap.Manager.invoke(Manager.java:173)
> 	at
> org.apache.cocoon.sitemap.SitemapManager.process(SitemapManager.java: 
> 152)
> 	at org.apache.cocoon.Cocoon.process(Cocoon.java:579)
> 	at
> org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java: 
> 1043)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> 	at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applic 
> ationFilterChain.java:247)
> 	at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFil 
> terChain.java:193)
> 	at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperVal 
> ve.java:260)
> 	at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext. 
> invokeNext(StandardPipeline.java:643)
> 	at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java: 
> 480)
> 	at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> 	at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextVal 
> ve.java:191)
> 	at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext. 
> invokeNext(StandardPipeline.java:643)
> 	at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java: 
> 480)
> 	at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> 	at
> org.apache.catalina.core.StandardContext.invoke(StandardContext.java: 
> 2415)
> 	at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.jav 
> a:180)
> 	at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext. 
> invokeNext(StandardPipeline.java:643)
> 	at
> org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherV 
> alve.java:170)
> 	at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext. 
> invokeNext(StandardPipeline.java:641)
> 	at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.jav 
> a:172)
> 	at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext. 
> invokeNext(StandardPipeline.java:641)
> 	at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java: 
> 480)
> 	at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> 	at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve 
> .java:174)
> 	at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext. 
> invokeNext(StandardPipeline.java:643)
> 	at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java: 
> 480)
> 	at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> 	at
> org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
> 	at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java: 
> 432)
> 	at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process 
> Connection(Http11Protocol.java:386)
> 	at
> org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java: 
> 534)
> 	at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPoo 
> l.java:530)
> 	at java.lang.Thread.run(Thread.java:536)
> =============================================================
> I checked sample_xsp.java........line 341
>
> 338    if (_esql_query != null) {
> 339      _esql_queries.push(_esql_query);
> 340    }
> 341    _esql_query = new EsqlQuery( _esql_connection, String.valueOf(
> 342      ""
>
>
>                 + "                select *"
>
>
>                 + "                from dbo_episode"
>
>
>                 + "             "
>               ) );
>
> Does anyone see any problems with this??
> Any help would be greatly appreciated.
>
> Thanks for ur time
> Ian.
>



John Lianoglou | Vice President | ARACHNEdesign
http://www.arachnedesign.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (Darwin)

iD8DBQFAVdE02mjmCyerauURAui7AKDVfIiHI1tpPVjX1zoRzHGhuCIrRACgmdig
VhcL57Tz4Fp2oY7ylitM4s4=
=Fe2M
-----END PGP SIGNATURE-----


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message