cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASHLEY D'SOUZA" <ADSO...@ALLMERICA.COM>
Subject Cocoon2.0.2 Command line connection to database
Date Mon, 15 Jul 2002 16:02:12 GMT
I want to use Cocoon2.0.2 to access a database using the command line.
The following describes my setup:

1. Set up of CLASSPATH
===================
I copied classes111.zip to the WEB-INF/lib directory. I see it in the
classpath in the DEBUG output. I also tried modifying WEB-INF/web.xml
for "extra-classpath". The DEBUG output never showed it this way.  I
think that WEB-INF/web.xml is not being used in commandline mode
(wherein lies my problem -- see step 2)

2. Setup of database driver
====================
I modified WEB-INF/web.xml, and added "oracle.jdbc.driver.OracleDriver"
(without the quotes) in the load-class section.
I think this is not being loaded because WEB-INF/web.xml is not used in
commandline mode, but proceeded with the steps below anyway.

3. Configured a connection pool
=======================
I modified WEB-INF/cocoon.xconf and added a new jdbc tag. A jdbc tag
for hsql stuff was already there; mine went above it:
  <datasources>
    <jdbc name="MWJR">
      <pool-controller min="1" max="5" oradb="true"/>
      <auto-commit>true</auto-commit>
      <dburl>jdbc:oracle:thin:@beacon1:1521:MWJR</dburl>
      <user>dbo</user>
      <password>dbo</password>
    </jdbc>

    <jdbc logger="core.datasources.personnel" name="personnel">
the hsqldb stuff
    </jdbc>
   </datasources>

This is the sitemap pipeline entry:
=========================
<!--access database and get XML data-->
  <map:pipeline>
    <map:match pattern="x.dat">
      <map:generate src="ADxml/pricequery.xml"/>
      <map:transform type="sql">
         <map:parameter name="use-connection" value="MWJR"/>
      </map:transform>
      <map:serialize type="text"/>
    </map:match>
  </map:pipeline>

This is pricequery.xml:
=================
<?xml version="1.0" encoding="UTF-8"?>
<page xmlns:sql="http://apache.org/cocoon/SQL/2.0">
	<execute-query xmlns="http://apache.org/cocoon/SQL/2.0">
		<query name="systemDate">
		  select sysdate from dual
		</query>
	</execute-query>
</page>

This is my command line:
===================
run -c .\build\cocoon\webapp -C
.\build\cocoon\webapp\WEB-INF\cocoon.xconf x.dat

where "run" is run.bat, the script which comes with Cocoon2.0.2

This is part of the log file: (Keeps repeating the "No suitable driver"
message):
========================================================
DEBUG   10252   [manager ] (): ComponentHandler initialized for:
org.apache.cocoon.www.file_.C_.Cocoon.cocoon_2_0_2.build.cocoon.webapp.sitemap_xmap

DEBUG   10252   [manager ] (): Adding
org.apache.cocoon.www.file_.C_.Cocoon.cocoon_2_0_2.build.cocoon.webapp.sitemap_xmap
for
org\apache\cocoon\www\file_\C_\Cocoon\cocoon_2_0_2\build\cocoon\webapp\sitemap_xmap

DEBUG   10252   [manager ] (): Returning a
org.apache.cocoon.components.language.markup.sitemap.SitemapMarkupLanguage
to the pool

DEBUG   10252   [manager ] (): Sitemap regeneration complete

DEBUG   10252   [manager ] (): The sitemap has been successfully
compiled!

INFO    10252   [        ] (): ...ready, let's go:

INFO    10252   [        ] (): Processing URI: x.dat

DEBUG   10252   [        ] (): mangle("x.dat")

DEBUG   10252   [        ] (): x.dat

DEBUG   10252   [        ] (): FileSavingEnvironment: uri = x.dat

DEBUG   10252   [        ] (): DEBUGGING INFORMATION:

REQUEST: x.dat

CONTEXT PATH: null

SERVLET PATH: x.dat

PATH INFO: null

REMOTE HOST: localhost

REMOTE ADDRESS: 127.0.0.1

REMOTE USER: ALD118

REQUEST SESSION ID: null

REQUEST PREFERRED LOCALE: en_US

SERVER HOST: Apache Cocoon 2.0.2

SERVER PORT: -1

METHOD: get

CONTENT LENGTH: -1

PROTOCOL: cli

SCHEME: cli

AUTH TYPE: null



CURRENT ACTIVE REQUESTS: 1

REQUEST PARAMETERS:



PARAM: 'accept' VALUES: '[text/html, */*]'

PARAM: 'user-agent' VALUES: '[Apache Cocoon 2.0.2]'

HEADER PARAMETERS:





SESSION ATTRIBUTES:





DEBUG   10252   [        ] (): Changing Cocoon context

DEBUG   10252   [        ] ():   from
context(file:/C:/Cocoon/cocoon-2.0.2/./build/cocoon/webapp/) and
prefix()

DEBUG   10252   [        ] ():   to context(sitemap.xmap) and prefix()

DEBUG   10252   [        ] ():   at URI x.dat

DEBUG   10252   [        ] (): New context is
file:/C:/Cocoon/cocoon-2.0.2/build/cocoon/webapp/

DEBUG   10252   [manager ] (): Retrieving a
org.apache.cocoon.components.pipeline.CachingEventPipeline from the
pool

DEBUG   10252   [manager ] (): Retrieving a
org.apache.cocoon.components.pipeline.CachingStreamPipeline from the
pool

DEBUG   10252   [manager ] (): Matched wildcard pattern x.dat

DEBUG   10252   [manager ] (): 
Current Sitemap Parameters:
PARAM: '0' VALUE: 'x.dat'


DEBUG   10252   [manager ] (): Component
generator:file(Parameters.EMPTY_PARAMETERS)

DEBUG   10252   [manager ] (): Source= ADxml/pricequery.xml

DEBUG   10252   [manager ] (): Retrieving a
org.apache.cocoon.generation.FileGenerator from the pool

DEBUG   10252   [manager ] (): Component transformer:sql(param)

DEBUG   10252   [manager ] (): Retrieving a
org.apache.cocoon.transformation.SQLTransformer from the pool

DEBUG   10252   [manager ] (): Retrieving a
org.apache.cocoon.sitemap.LinkTranslator from the pool

DEBUG   10252   [manager ] (): Component
serializer:text(Parameters.EMPTY_PARAMETERS)

DEBUG   10252   [manager ] (): Retrieving a
org.apache.cocoon.serialization.TextSerializer from the pool

DEBUG   10252   [        ] (): Resolving 'ADxml/pricequery.xml' in
context 'file:/C:/Cocoon/cocoon-2.0.2/build/cocoon/webapp/'

DEBUG   10252   [        ] (): Resolved to
'file:/C:/Cocoon/cocoon-2.0.2/build/cocoon/webapp/ADxml/pricequery.xml'

DEBUG   10252   [manager ] (): CONNECTION: MWJR

DEBUG   10252   [manager ] (): DOC-ELEMENT: rowset

DEBUG   10252   [manager ] (): ROW-ELEMENT: row

DEBUG   10252   [manager ] (): NS-URI:
http://apache.org/cocoon/SQL/2.0

DEBUG   10252   [manager ] (): NS-PREFIX: 

DEBUG   10252   [manager ] (): NOT Found key:
PCK:CCK:1-file-1762965962329822627

DEBUG   10252   [manager ] (): Found file:
PCK%3ACCK%3A1-file-1762965962329822627

DEBUG   10252   [manager ] (): Holding object in memory:

DEBUG   10252   [manager ] ():   key:
PCK:CCK:1-file-1762965962329822627

DEBUG   10252   [manager ] ():   value:
org.apache.cocoon.caching.CachedEventObject@633e18

DEBUG   10252   [manager ] (): Found cached content for 'x.dat'.

DEBUG   10252   [manager ] (): Compared cached validity
'TimeStampCacheValidity: 1025201310546' with new validity
'TimeStampCacheValidity: 1025201310546' : valid

DEBUG   10252   [manager ] (): Using valid cached content for 'x.dat'.

DEBUG   10252   [manager ] (): Retrieving a
org.apache.cocoon.components.sax.XMLByteStreamInterpreter from the pool

DEBUG   10252   [manager ] (): PUBLIC ID: 

DEBUG   10252   [manager ] (): SYSTEM ID:
file:/C:/Cocoon/cocoon-2.0.2/build/cocoon/webapp/ADxml/pricequery.xml

DEBUG   10252   [manager ] (): RECEIVED CHARACTERS: 
	

DEBUG   10252   [manager ] (): RECEIVED START ELEMENT execute-query

DEBUG   10252   [manager ] (): RECEIVED CHARACTERS: 
		

DEBUG   10252   [manager ] (): RECEIVED START ELEMENT query

DEBUG   10252   [manager ] (): RECEIVED CHARACTERS: 
		  select sysdate from dual

DEBUG   10252   [manager ] (): RECEIVED CHARACTERS: 
		

DEBUG   10252   [manager ] (): RECEIVED END ELEMENT
query(http://apache.org/cocoon/SQL/2.0)

DEBUG   10252   [manager ] (): QUERY IS "
		  select sysdate from dual
		"

DEBUG   10252   [manager ] (): RECEIVED CHARACTERS: 
	

DEBUG   10252   [manager ] (): RECEIVED END ELEMENT
execute-query(http://apache.org/cocoon/SQL/2.0)

DEBUG   10252   [manager ] (): SQLTransformer executing query nr 0

DEBUG   10252   [manager ] (): EXECUTING 
		  select sysdate from dual
		

DEBUG   10252   [manager ] (): Marking 0 objects as old in pool.

WARN    10252   [manager ] (): Could not return Connection

java.sql.SQLException: No suitable driver

	at java.sql.DriverManager.getConnection(DriverManager.java:537)

	at java.sql.DriverManager.getConnection(DriverManager.java:177)

	at
org.apache.avalon.excalibur.datasource.JdbcConnectionFactory.newInstance(JdbcConnectionFactory.java:139)

	at
org.apache.avalon.excalibur.pool.ResourceLimitingPool.newPoolable(ResourceLimitingPool.java:491)

	at
org.apache.avalon.excalibur.pool.ValidatedResourceLimitingPool.newPoolable(ValidatedResourceLimitingPool.java:140)

	at
org.apache.avalon.excalibur.datasource.ResourceLimitingJdbcConnectionPool.newPoolable(ResourceLimitingJdbcConnectionPool.java:81)

	at
org.apache.avalon.excalibur.pool.ResourceLimitingPool.get(ResourceLimitingPool.java:314)

	at
org.apache.avalon.excalibur.pool.ValidatedResourceLimitingPool.get(ValidatedResourceLimitingPool.java:91)

	at
org.apache.avalon.excalibur.datasource.ResourceLimitingJdbcDataSource.getConnection(ResourceLimitingJdbcDataSource.java:131)

	at
org.apache.cocoon.transformation.SQLTransformer$Query.getConnection(SQLTransformer.java:951)

	at
org.apache.cocoon.transformation.SQLTransformer$Query.execute(SQLTransformer.java:1007)

	at
org.apache.cocoon.transformation.SQLTransformer.executeQuery(SQLTransformer.java:271)

	at
org.apache.cocoon.transformation.SQLTransformer.endExecuteQueryElement(SQLTransformer.java:417)

	at
org.apache.cocoon.transformation.SQLTransformer.endElement(SQLTransformer.java:702)

	at
org.apache.cocoon.components.sax.XMLByteStreamInterpreter.parse(XMLByteStreamInterpreter.java:129)

	at
org.apache.cocoon.components.sax.XMLByteStreamInterpreter.deserialize(XMLByteStreamInterpreter.java:102)

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

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

	at
org.apache.cocoon.www.file_.C_.Cocoon.cocoon_2_0_2.build.cocoon.webapp.sitemap_xmap.matchN102D3(C:\Cocoon\cocoon-2.0.2\work\org/apache/cocoon/www/file_/C_/Cocoon/cocoon_2_0_2/build/cocoon/webapp\sitemap_xmap.java:3528)

	at
org.apache.cocoon.www.file_.C_.Cocoon.cocoon_2_0_2.build.cocoon.webapp.sitemap_xmap.process(C:\Cocoon\cocoon-2.0.2\work\org/apache/cocoon/www/file_/C_/Cocoon/cocoon_2_0_2/build/cocoon/webapp\sitemap_xmap.java:2611)

	at
org.apache.cocoon.www.file_.C_.Cocoon.cocoon_2_0_2.build.cocoon.webapp.sitemap_xmap.process(C:\Cocoon\cocoon-2.0.2\work\org/apache/cocoon/www/file_/C_/Cocoon/cocoon_2_0_2/build/cocoon/webapp\sitemap_xmap.java:2507)

	at org.apache.cocoon.sitemap.Handler.process(Handler.java:222)

	at org.apache.cocoon.sitemap.Manager.invoke(Manager.java:179)

	at
org.apache.cocoon.sitemap.SitemapManager.process(SitemapManager.java:154)

	at org.apache.cocoon.Cocoon.process(Cocoon.java:575)

	at org.apache.cocoon.Main.getType(Main.java:943)

	at org.apache.cocoon.Main.processURI(Main.java:707)

	at org.apache.cocoon.Main.process(Main.java:583)

	at org.apache.cocoon.Main.main(Main.java:401)

DEBUG   10252   [manager ] (): SQLTransformer$Query: could not acquire
a Connection -- waiting 5000 ms to try again.

WARN    10252   [manager ] (): Could not return Connection

java.sql.SQLException: No suitable driver

	at java.sql.DriverManager.getConnection(DriverManager.java:537)

	at java.sql.DriverManager.getConnection(DriverManager.java:177)

	at
org.apache.avalon.excalibur.datasource.JdbcConnectionFactory.newInstance(JdbcConnectionFactory.java:139)

	at
org.apache.avalon.excalibur.pool.ResourceLimitingPool.newPoolable(ResourceLimitingPool.java:491)

	at
org.apache.avalon.excalibur.pool.ValidatedResourceLimitingPool.newPoolable(ValidatedResourceLimitingPool.java:140)

	at
org.apache.avalon.excalibur.datasource.ResourceLimitingJdbcConnectionPool.newPoolable(ResourceLimitingJdbcConnectionPool.java:81)

	at
org.apache.avalon.excalibur.pool.ResourceLimitingPool.get(ResourceLimitingPool.java:314)

	at
org.apache.avalon.excalibur.pool.ValidatedResourceLimitingPool.get(ValidatedResourceLimitingPool.java:91)

	at
org.apache.avalon.excalibur.datasource.ResourceLimitingJdbcDataSource.getConnection(ResourceLimitingJdbcDataSource.java:131)

	at
org.apache.cocoon.transformation.SQLTransformer$Query.getConnection(SQLTransformer.java:951)

	at
org.apache.cocoon.transformation.SQLTransformer$Query.execute(SQLTransformer.java:1007)

	at
org.apache.cocoon.transformation.SQLTransformer.executeQuery(SQLTransformer.java:271)

	at
org.apache.cocoon.transformation.SQLTransformer.endExecuteQueryElement(SQLTransformer.java:417)

	at
org.apache.cocoon.transformation.SQLTransformer.endElement(SQLTransformer.java:702)

	at
org.apache.cocoon.components.sax.XMLByteStreamInterpreter.parse(XMLByteStreamInterpreter.java:129)

	at
org.apache.cocoon.components.sax.XMLByteStreamInterpreter.deserialize(XMLByteStreamInterpreter.java:102)

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

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

	at
org.apache.cocoon.www.file_.C_.Cocoon.cocoon_2_0_2.build.cocoon.webapp.sitemap_xmap.matchN102D3(C:\Cocoon\cocoon-2.0.2\work\org/apache/cocoon/www/file_/C_/Cocoon/cocoon_2_0_2/build/cocoon/webapp\sitemap_xmap.java:3528)

	at
org.apache.cocoon.www.file_.C_.Cocoon.cocoon_2_0_2.build.cocoon.webapp.sitemap_xmap.process(C:\Cocoon\cocoon-2.0.2\work\org/apache/cocoon/www/file_/C_/Cocoon/cocoon_2_0_2/build/cocoon/webapp\sitemap_xmap.java:2611)

	at
org.apache.cocoon.www.file_.C_.Cocoon.cocoon_2_0_2.build.cocoon.webapp.sitemap_xmap.process(C:\Cocoon\cocoon-2.0.2\work\org/apache/cocoon/www/file_/C_/Cocoon/cocoon_2_0_2/build/cocoon/webapp\sitemap_xmap.java:2507)

	at org.apache.cocoon.sitemap.Handler.process(Handler.java:222)

	at org.apache.cocoon.sitemap.Manager.invoke(Manager.java:179)

	at
org.apache.cocoon.sitemap.SitemapManager.process(SitemapManager.java:154)

	at org.apache.cocoon.Cocoon.process(Cocoon.java:575)

	at org.apache.cocoon.Main.getType(Main.java:943)

	at org.apache.cocoon.Main.processURI(Main.java:707)

	at org.apache.cocoon.Main.process(Main.java:583)

	at org.apache.cocoon.Main.main(Main.java:401)

DEBUG   10252   [manager ] (): SQLTransformer$Query: could not acquire
a Connection -- waiting 5000 ms to try again.

DEBUG   10252   [manager ] (): JVM total Memory: 9293824

DEBUG   10252   [manager ] (): JVM free Memory: 1424016

DEBUG   10252   [manager ] (): Memory is low = false

WARN    10252   [manager ] (): Could not return Connection

java.sql.SQLException: No suitable driver


End of Log file stuff ===================================

Looks like if I can get the Oracle driver loaded, it may work. Any
pointers to what I could do?

-ashley


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.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