cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Berin Loritsch <blorit...@apache.org>
Subject Re: C2.0: connection pool/ datasource problem
Date Wed, 17 Oct 2001 13:09:30 GMT
Russell Castagnaro wrote:
> 
> Aloha Gary,
> 
> I am loading the class in the initargs.  I did not rename the
> classes12.zip to jar, but it doesn't work for mysql either, which is
> in a jar.
> 
> I've placed the JDBC files (zip and jar) in the common/lib directory
> in tomcat 4.0  could this be the problem?

Yes.  The only way to guarantee the JAR is in the correct path is to
place it in $JAVA_HOME/jre/lib/ext (${ext.dir}), reference it in
$CLASSPATH, or place it in ${context}/WEB-INF/lib.  Also, some parsers
mistakenly remove ALL the whitespace in the "load-class" parameter,
so a comma will work to make sure the classes are treated separately.

If you have a parser that removes all whitespace, you will have an
entry at the top of your log file like this:

Could not load class: com.ibm.servlet.classloader.Handleroracle.jdbc.driver.OracleDriver

In that case adding a comma after "com.ibm.servlet.classloader.Handler"
is all you need to do.

> 
> Thanks
> 
> Tuesday, October 16, 2001, 8:56:45 AM, you wrote:
> 
> GGGM> Do you have the Oracle JDBC driver class defined in the Cocoon
> GGGM> WEB-INF/web.xml file?
> 
> GGGM> Mine has
> GGGM>     .
> GGGM>     .
> GGGM>     .
> GGGM>     <init-param>
> GGGM>       <param-name>load-class</param-name>
> GGGM>       <param-value>
> GGGM>         <!-- For IBM WebSphere:
> GGGM>         com.ibm.servlet.classloader.Handler -->
> 
> GGGM>         <!-- For Database Driver: -->
> GGGM>         oracle.jdbc.driver.OracleDriver
> 
> GGGM>         <!-- For parent ComponentManager sample:
> GGGM>         org.apache.cocoon.samples.parentcm.Configurator
> GGGM>         -->
> GGGM>       </param-value>
> GGGM>     </init-param>
> GGGM>     .
> GGGM>     .
> GGGM>     .
> 
> GGGM> and I have placed classes12.zip, *renamed to classes12.jar*, in the
> GGGM> CATALINA_HOME/common/lib directory.
> 
> GGGM> You should also see success (or failure, in your case) indications wrt the
> GGGM> JDBC connections in the WEB-INF/logs/cocoon.log file.
> 
> GGGM> -----Original Message-----
> GGGM> From: Russell Castagnaro [mailto:russell@castagnaro.com]
> GGGM> Sent: Tuesday, October 16, 2001 1:21 PM
> GGGM> To: cocoon-users@xml.apache.org
> GGGM> Subject: C2.0: connection pool/ datasource problem
> 
> GGGM> Aloha folks,
> 
> GGGM> I'm having a strange problem with C2 for All db connections
> 
> GGGM> I've tried using mysql and oracle and they both have the same
> GGGM> problem..
> 
> GGGM> I'm preloading the driver classes and I've tested my db connections.
> GGGM> The error I get when using the esql taglib is:
> 
> GGGM> org.apache.cocoon.ProcessingException: Exception in
> GGGM> ServerPagesGenerator.generate():
> GGGM> java.lang.RuntimeException: Could not get the datasource
> GGGM> java.sql.SQLException:
> GGGM> There are no connections in the pool, check your settings.
> GGGM> at
> GGGM> org.apache.cocoon.generation.ServerPagesGenerator.generate(ServerPagesGenera
> GGGM> tor.java:187)
> GGGM> at
> GGGM> org.apache.cocoon.components.pipeline.CachingEventPipeline.process(CachingEv
> GGGM> entPipeline.java:214)
> GGGM> at
> GGGM> org.apache.cocoon.components.pipeline.CachingStreamPipeline.process(CachingS
> GGGM> treamPipeline.java:364)
> GGGM> at
> GGGM> org.apache.cocoon.www.sitemap_xmap.wildcardMatchN40043E(sitemap_xmap.java:57
> GGGM> 40)
> GGGM> at org.apache.cocoon.www.sitemap_xmap.process(sitemap_xmap.java:2593)
> GGGM> at org.apache.cocoon.www.sitemap_xmap.process(sitemap_xmap.java:2205)
> GGGM> at org.apache.cocoon.sitemap.Handler.process(Handler.java:163)
> 
> GGGM> Why wouldn't any connections be available?
> 
> GGGM> I'm using:
> 
> GGGM>   <datasources>
> GGGM>     <jdbc name="fun">
> GGGM>       <pool-controller min="5" max="10" oradb="true"/>
> GGGM>       <dburl>jdbc:oracle:thin:@localhost:1521:ORCL</dburl>
> GGGM>       <user>scott</user>
> GGGM>       <password>tiger</password>
> GGGM>     </jdbc>
> 
> GGGM>     and
> GGGM> <?xml version="1.0" encoding="ISO-8859-1"?>
> 
> GGGM> <xsp:page
> GGGM>           language="java"
> GGGM>           xmlns:xsp="http://apache.org/xsp"
> GGGM>           xmlns:esql="http://apache.org/cocoon/SQL/v2"
> >>
> 
> GGGM>   <page>
> GGGM>    <title>A Database Driven XSP Page</title>
> GGGM>    <content>
> 
> GGGM>    <esql:connection>
> GGGM>      <esql:pool>fun</esql:pool>
> GGGM>      <esql:execute-query>
> GGGM>        <esql:query>Select * from EMP</esql:query>
> GGGM>        <esql:results>
> GGGM>          <esql:row-results>
> GGGM>            <para><esql:get-string column="ename"/></para>
> GGGM>            <esql:get-columns/>
> GGGM>          </esql:row-results>
> GGGM>        </esql:results>
> GGGM>      </esql:execute-query>
> GGGM>    </esql:connection>
> 
> GGGM>    </content>
> GGGM>   </page>
> GGGM> </xsp:page>
> GGGM> </xsp:page>
> 
> GGGM> any ideas??
> 
> 
> 
> --
> Mahalo,
>  Russell                            mailto:russell@4charity.com
> Chief Mentor
> 
> 4Charity - Changing the world,
>  one click at a time.
> 
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
> 
> To unsubscribe, e-mail: <cocoon-users-unsubscribe@xml.apache.org>
> For additional commands, e-mail: <cocoon-users-help@xml.apache.org>

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

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


Mime
View raw message