I have also been trying to connect to mysql database , and am experiencing
the same problems as stated below.

If any of you guys find the solution please do not forget to post it !!

It is obvious that the internal mapping of the drivers is , somehow , not
working as the declaring the <esql:driver> & <esql:dburl> inside the XSP
works fine......

 <esql:connection>
     <esql:driver>org.gjt.mm.mysql.Driver</esql:driver>
     <esql:dburl>jdbc:mysql://ip-address/database</esql:dburl>
     <esql:execute-query>
          <esql:query>select f1 from test</esql:query>
          <esql:results>
               <esql:row-results>
                  <esql:get-string column="f1"/>
               </esql:row-results>
          </esql:results>
     </esql:execute-query>
     </esql:connection>




Is anyone else testing database driven web content with the latest cvs
cocoon HEAD?  It is starting to frustrate me that what was fairly easy to
get up and running before is now making me struggle.

> Roger I Martin PhD wrote:
>
> > The current cvs of Cocoon2 produces the exception
> >
> >
> >
> > Original exception : java.lang.RuntimeException: Could not get the
> > datasource
> > org.apache.avalon.excalibur.datasource.NoAvailableConnectionException:
> > There are no connections in the pool, check your settings.
>
>
>
> is your Driver loaded?
>
After firing up tomcat and the webapp the mm.mysql-2.0.4-bin.jar is not
possible to delete because it is in use.  I have tried hsqldb and M$ Access
databases and get the same exception. I've looked at the table of contents
of the mm.mysql-2.0.4-bin.jar and the driver is there.

> Are you using the <driver>oracle.jdbc.driver.OracleDriver</driver> tag
> in the configuration?  Is the driver jar in the WEB-INF/lib directory?
> Does the jar have a ".jar" extension?
>

The deployed cocoon.xconf has the following datasources defined.

<datasources>
<jdbc name="HWITCD">
<driver>org.gjt.mm.mysql.Driver</driver>
<pool-controller min="5" max="10"/>
<!--auto-commit>false</auto-commit-->
<dburl>jdbc:mysql:///WITCD</dburl>
<user>user</user>
<password>password</password>
</jdbc>
</datasources>

and the M$ Access version is

<datasources>
<jdbc name="HWITCD">
<driver>sun.jdbc.odbc.JdbcOdbcDriver</driver>
<pool-controller min="5" max="10"/>
<!--auto-commit>false</auto-commit-->
<dburl>jdbc:odbc:Materials</dburl>
<user></user>
<password></password>
</jdbc>
</datasources>

when I deploy with it.

The stack trace starts with:

Original exception : java.lang.RuntimeException: Could not get the
datasource
org.apache.avalon.excalibur.datasource.NoAvailableConnectionException:
There are no connections in the pool, check your settings.
at org.apache.cocoon.www.dba.material_xsp.generate(material_xsp.java:281)
at
org.apache.cocoon.generation.ServerPagesGenerator.generate(ServerPagesGenerator.java:229)


at
org.apache.cocoon.components.pipeline.CachingEventPipeline.process(CachingEventPipeline.java:210)


at
org.apache.cocoon.components.pipeline.CachingStreamPipeline.process(CachingStreamPipeline.java:358)


at
org.apache.cocoon.www.sitemap_xmap.wildcardMatchN103F1(sitemap_xmap.java:6218)


at org.apache.cocoon.www.sitemap_xmap.process(sitemap_xmap.java:2850)
at org.apache.cocoon.www.sitemap_xmap.process(sitemap_xmap.java:2411)
at org.apache.cocoon.sitemap.Handler.process(Handler.java:171)
at org.apache.cocoon.sitemap.Manager.invoke(Manager.java:115)
at
org.apache.cocoon.sitemap.SitemapManager.process(SitemapManager.java:144)
at org.apache.cocoon.Cocoon.process(Cocoon.java:605)
at org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:795)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
...

The java source is generated in the tomcat work directory and compiles
successfully.


> The most common cause for this is that the server is not finding the
> class.  Some Servlet Containers do not load jars that do not have the
> ".jar" interface.  You either need to place the driver jar in the
> WEB-INF/lib directory or in $JAVA_HOME/jre/lib/ext directory.  You cannot
> ever assume that classes loaded by the server are accessible by the
webapps.
>
I've cvs'ed a brand new xml-cocoon2 everyday over the last few weeks and
excalibur was changing and the logkit had some bugs so I am inclined to
think there is a bug occuring in excalibur too.

When a driver is not suitable(not loaded) then java.sql will catch a stack
like this:

java.sql.SQLException: No suitable driver
        at java.sql.DriverManager.getConnection(DriverManager.java:535)
        at java.sql.DriverManager.getConnection(DriverManager.java:174)
...
which is more meaningful than the above excalibur
NoAvailableConnectionException. Does this excalibur exception encompass
more than one possible action that can throw it?



Regards,

Ankur.









---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to