Tnanks Bruce, Werner

Unfortunately I tried to change my conf file following your hint
(minLimit -> min-limit) and I got this exception

org.xml.sax.SAXException: unable to add attribute "min-limit" to
'oracle.jdbc.pool.OracleConnectionCacheImpl' due to the following error:
org.exolab.castor.mapping.MappingRuntimeException: Nested error:
java.sql.SQLException: User credentials doesn't match the existing ones
        at
org.exolab.castor.xml.UnmarshalHandler.processAttributes(UnmarshalHandle
r.java:2485)
        at
org.exolab.castor.xml.UnmarshalHandler.startElement(UnmarshalHandler.jav
a:2147)
        at
org.exolab.castor.xml.UnmarshalHandler.startElement(UnmarshalHandler.jav
a:1292)
        at
org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
        at
org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown
Source)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(U
nknown Source)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDis
patcher.dispatch(Unknown Source)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unkno
wn Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
        at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown
Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
Source)
        at
org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:605)
        at
org.exolab.castor.jdo.engine.DatabaseRegistry.loadDatabase(DatabaseRegis
try.java:235)
        at org.exolab.castor.jdo.JDO.loadConfiguration(JDO.java:659)
        at com.tilab.wants.logger.ManageLog.init(Unknown Source)
        at com.tilab.wants.logger.ManageLog.insertLog(Unknown Source)
        at com.tilab.wants.logger.ManageLogTest.main(Unknown Source)
java.lang.NullPointerException
        at com.tilab.wants.logger.ManageLog.insertDB(Unknown Source)
        at com.tilab.wants.logger.ManageLog.insertLog(Unknown Source)
        at com.tilab.wants.logger.ManageLogTest.main(Unknown Source)


The previous exception (with minLimit instead of min-limit) was 

java.lang.NullPointerException
        at
org.exolab.castor.xml.util.XMLClassDescriptorImpl.validate(XMLClassDescr
iptorImpl.java:890)
        at org.exolab.castor.xml.Validator.validate(Validator.java:122)
        at
org.exolab.castor.xml.FieldValidator.validate(FieldValidator.java:258)
        at org.exolab.castor.xml.Validator.validate(Validator.java:135)
        at
org.exolab.castor.xml.FieldValidator.validate(FieldValidator.java:258)
        at org.exolab.castor.xml.Validator.validate(Validator.java:135)
        at
org.exolab.castor.xml.UnmarshalHandler.endElement(UnmarshalHandler.java:
843)
        at
org.exolab.castor.xml.UnmarshalHandler.endElement(UnmarshalHandler.java:
1038)
        at
org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unk
nown Source)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDis
patcher.dispatch(Unknown Source)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unkno
wn Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
        at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown
Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
Source)
        at
org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:605)
        at
org.exolab.castor.jdo.engine.DatabaseRegistry.loadDatabase(DatabaseRegis
try.java:235)
        at org.exolab.castor.jdo.JDO.loadConfiguration(JDO.java:659)
        at com.tilab.wants.logger.ManageLog.init(Unknown Source)
        at com.tilab.wants.logger.ManageLog.insertLog(Unknown Source)
        at com.tilab.wants.logger.ManageLogTest.main(Unknown Source)
java.lang.NullPointerException
        at com.tilab.wants.logger.ManageLog.insertDB(Unknown Source)
        at com.tilab.wants.logger.ManageLog.insertLog(Unknown Source)
        at com.tilab.wants.logger.ManageLogTest.main(Unknown Source)


Marco
-----Original Message-----
From: Werner Guttmann [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 15, 2004 4:26 PM
To: Bruce Snyder; [EMAIL PROTECTED]
Subject: Re: [castor-dev] problem with connection pooling for Oracle


Bruce, Marco

On Thu, 15 Apr 2004 08:14:58 -0600 (MDT), Bruce Snyder wrote:

>This one time, at band camp, Ughetti Marco said:
>
>UM>This is a re-send after the dev mailing list subscription:
>UM>
>UM>
>UM>
>UM>Hi,
>UM>
>UM>Using this conf file:
>UM>
>UM>
>UM>
>UM><database name="myDb engine="oracle">
>UM>
>UM>    <data-source
class-name="oracle.jdbc.pool.OracleConnectionCacheImpl"
>UM>>
>UM>
>UM>     <params URL="jdbc:oracle:thin:@host:1521:myDb" user="user"
>UM>password="pwd"
>UM>
>UM>            minLimit="5" maxLimit="10" cache-scheme="1" />
>UM>
>UM>    </data-source>
>UM>
>UM>    <mapping href="mapping.xml" />
>UM>
>UM></database>
>UM>
>UM>
>UM>
>UM>I get a NullPointerException indicating that the pool is not active
when
>UM>I insert a row through this set of instructions:
>UM>
>UM>
>UM>
>UM>jdo = new JDO("myDb");
>UM>
>UM>            db.begin();
>UM>
>UM>            db.create(row);
>UM>
>UM>            db.commit();
>UM>
>UM>            db.close();
>UM>
>UM>
>UM>
>UM>If a change something about the sintax (i.e. minLimit -> min-limit)
I
>UM>get a parsing exception
>UM>
>UM>
>UM>
>UM>Obviously without using the pooling it works
>UM>
>UM>
>UM>
>UM>Please, anyone can tell me where is the error?
>
>Marco,
>
>The problem is that Castor doesn't have any knowledge of those
>additional attributes on the <params> element. Werner was working
>on a fix for this so I'm not sure of the progress. Werner will be
>out of town through Sunday, but maybe we can catch him before he
>leaves. Werner, can you comment on this?

Whilst it is true that I have been working on a patch related to this,
things should work out of the box in your scenario if - and only if -
you follow the 
following guidelines:

<database name="myDb engine="oracle">
   <data-source class-name="oracle.jdbc.pool.OracleConnectionCacheImpl">
     <params URL="jdbc:oracle:thin:@host:1521:myDb" user="user"
password="pwd"
            minLimit="5" maxLimit="10" cache-scheme="1" />
    </data-source>
    <mapping href="mapping.xml" />
</database>

should read 

<database name="myDb engine="oracle">
   <data-source class-name="oracle.jdbc.pool.OracleConnectionCacheImpl">
     <params URL="jdbc:oracle:thin:@host:1521:myDb" user="user"
password="pwd"
            min-limit="5" max-limit="10" cache-scheme="1" />
    </data-source>
    <mapping href="mapping.xml" />
</database>

Iow, attributes made up from more than one word should re written as
first-second and NOT firstSecond. If that does not work, what exception
do you 
get then ?

Werner

>
>Bruce
>--
>perl -e 'print
unpack("u30","<0G)[EMAIL PROTECTED]&5R\"F9E<G)E=\$\!F<FEI+F-O;0\`\`");'
>
>The Castor Project
>http://www.castor.org/
>
>Apache Geronimo
>http://incubator.apache.org/projects/geronimo.html
>

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev



====================================================================
CONFIDENTIALITY NOTICE
This message and its attachments are addressed solely to the persons
above and may contain confidential information. If you have received
the message in error, be informed that any use of the content hereof
is prohibited. Please return it immediately to the sender and delete
the message. Should you have any questions, please contact us by
replying to [EMAIL PROTECTED] Thank you
====================================================================

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to