Hi.
I am facing problem in accessing the Oracle DB.
My Environment:
-------------------------------------------------------------------------------------------------------------------------------------
Win NT 4.0 Client
Apache Tomcat 4.0.2 (Standalone)
Cocoon 2.0
Oracle 8.1.6 Client
*Oracle 8.1.6 Server (Running under different machine in the network)
-------------------------------------------------------------------------------------------------------------------------------------
I copied Oracle database classes12.zip and classes111.zip files to \cocoon\web-inf\lib and renamed them as jar files.
Error:
-------------------------------------------------------------------------------------------------------------------------------------
The org.apache.cocoon.www.sitemap_xmap notifies that org.apache.cocoon.ProcessingException says:
Exception in ServerPagesGenerator.generate()
More precisely:
org.apache.cocoon.ProcessingException: Exception in ServerPagesGenerator.generate(): java.lang.RuntimeException: Could not get the datasource org.apache.avalon.excalibur.datasource.NoAvailableConnectionException: There are no connections in the pool, check your settings.
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.
Full Exception chain stacktrace:
at org.apache.cocoon.www.docs.samples.xsp.esql_xsp.generate(esql_xsp.java:277)
at org.apache.cocoon.generation.ServerPagesGenerator.generate(ServerPagesGenerator.java:226)
at org.apache.cocoon.components.pipeline.CachingEventPipeline.process(CachingEventPipeline.java:209)
at org.apache.cocoon.components.pipeline.CachingStreamPipeline.process(CachingStreamPipeline.java:355)
at org.apache.cocoon.www.sitemap_xmap.matchN104AD(sitemap_xmap.java:6239)
at org.apache.cocoon.www.sitemap_xmap.process(sitemap_xmap.java:3001)
at org.apache.cocoon.www.sitemap_xmap.process(sitemap_xmap.java:2426)
at org.apache.cocoon.sitemap.Handler.process(Handler.java:180)
at org.apache.cocoon.sitemap.Manager.invoke(Manager.java:127)
at org.apache.cocoon.sitemap.SitemapManager.process(SitemapManager.java:144)
at org.apache.cocoon.Cocoon.process(Cocoon.java:582)
at org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:795)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2343)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1012)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1107)
at java.lang.Thread.run(Thread.java:484)
-------------------------------------------------------------------------------------------------------------------------------------
For your reference I am giving following file contents..
My Web.xml file contains:
-------------------------------------------------------------------------------------------------------------------------------------
<init-param>
<param-name>load-class</param-name>
<param-value>
<!-- For IBM WebSphere:
com.ibm.servlet.classloader.Handler -->
<!-- For Database Driver: -->
org.hsqldb.jdbcDriver
<!-- For Oracle Database Driver: -->
oracle.jdbc.driver.OracleDriver
<!-- For parent ComponentManager sample:
org.apache.cocoon.samples.parentcm.Configurator
-->
</param-value>
</init-param>
------------------------------------------------------------------------------------------------------------------
My Cocoon.xconf file contains::
------------------------------------------------------------------------------------------------------------------
<datasources>
<jdbc name="personnel" logger="core.datasources.personnel">
<!--
If you have an Oracle database, and are using the the
pool-controller below, you should add the attribute
"oradb" and set it to true.
<pool-controller min="5" max="10" oradb="true"/>
That way the test to see if the server has disconnected
the JdbcConnection will function properly.
-->
<pool-controller min="5" max="10"/>
<!--
If you need to ensure an autocommit is set to true or
false, then create the "auto-commit" element below.
<auto-commit>false</auto-commit>
The default is true.
-->
<dburl>jdbc:hsqldb:hsql://localhost:9002</dburl>
<user>sa</user>
<password></password>
</jdbc>
<jdbc name="MyOrclConn">
<pool-controller min="5" max="10" oradb="true"/>
<auto-commit>true</auto-commit>
<dburl>jdbc:oracle:thin://u-oracleserver:1521</dburl>
<user>test</user>
<password>test</password>
</jdbc>
</datasources>
----------------------------------------------------------------------------------------------------------------------
My Sitemap.xmap file contains:
----------------------------------------------------------------------------------------------------------------------
<map:parameter name="use-connection" value="MyOrclConn"/>
----------------------------------------------------------------------------------------------------------------------
My esql.xsp file: (I made simple changes in sample esql.xsp file)
----------------------------------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsp:page
language="java"
xmlns:xsp="http://apache.org/xsp"
xmlns:esql="http://apache.org/cocoon/SQL/v2"
>
<page>
<title>A Database Driven XSP Page</title>
<content>
<esql:connection>
<esql:pool>MyOrclConn</esql:pool>
<esql:execute-query>
<esql:query>select * from test</esql:query>
<esql:results>
<esql:row-results>
<para><esql:get-string column="name"/></para>
<esql:get-columns/>
</esql:row-results>
</esql:results>
</esql:execute-query>
</esql:connection>
</content>
</page>
</xsp:page>
----------------------------------------------------------------------------------------------------------------------
I am able to connect to the Oracle server in the network from my machine using Oracle client tool.
Any assistance in this regard will be highly appreciated.
Thanks
Srinivas Chervirala