|
Hi patrick,
I am not using castor in J2EE mode. I want
to use Castor in non-EJB application.
For this I use Tomcat-4.1.24, MySQL-4.0.12
DB, JDK 1.4.2.
I tried to configure XA-compliant
Datasource XAPool with Castor. But I couldnt succeed.
How can I use JNDI option in database.xml.
When I configured JNDI resource like this
in database.xml:
<database name="test" engine="mysql"
> <jndi
name="java:comp/env/jdbc/mydb"> <param name="factory"
value="org.objectweb.jndi.DataSourceFactory"/> <param name="url"
value="jdbc:mysql://10.10.10.16/javatest"/> <param
name="username" value="root"/> <param name="password"
value=""/> <param name="driverClassName"
value="org.gjt.mm.mysql.Driver"/>
</jndi> </database>
I am getting this
errors:
[test]
org.exolab.castor.jdo.DatabaseNotFoundException: Nested error:
org.xml.sax.SAXException: unable to find FieldDescriptor for 'param' in
ClassDescriptor of jndi{file:
file:/D:/Tech/jdo/castor-0.9.5-src/build/examples/jdo/database.xml; line: 47;
column: 70} [test] org.xml.sax.SAXException: unable to find FieldDescriptor
for 'param' in ClassDescriptor of jndi [test] at
org.exolab.castor.xml.UnmarshalHandler.startElement(UnmarshalHandler.java:1224) [test]
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown
Source) [test] at
org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown
Source) [test] at
org.apache.xerces.impl.dtd.XMLDTDValidator.emptyElement(Unknown
Source) [test] at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown
Source) [test] at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source) [test] at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) [test]
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown
Source) [test] at
org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source) [test]
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) [test] at
org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
Source) [test] at
org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:555) [test]
at
org.exolab.castor.jdo.engine.DatabaseRegistry.loadDatabase(DatabaseRegistry.java:241) [test]
at org.exolab.castor.jdo.JDO.getDatabase(JDO.java:583) [test] at
jdo.Test.runMyProduct(Test.java:375) [test] at
jdo.Test.main(Test.java:63)
Can I use JNDI tag in database.xml to load
JNDI resource? what was the problem with my configuration data.
thanx
Venkat
----- Original Message -----
Sent: Tuesday, August 19, 2003 5:18
PM
Subject: Re: [castor-dev] using
TransactionManager & XA Resource Pool
Venkat,
just reading this a bit late, but
can you please briefly describe your runtime enviroment. From your
description, I am getting the impression that you want to use Castor in
J2EE mode ? If that's the case, what's your application server ? Rather
than trying to configure XA-compliant DataSources, etc. yourself, you could
rely on the features of the application server and simply use these
features from within Castor by the means of a JNDI
lookup.
Werner
On Mon, 18 Aug 2003 11:50:47 +0530, Venkat
Dosapati wrote:
>Sorry patrick, > >I came to know that
we can configure datasources from mapping.xml. >I will have a try and
will ask you if I get any
problems. > >thanx >Venkat > >----- Original
Message ----- >From: "Venkat Dosapati" <[EMAIL PROTECTED]> >To: <[EMAIL PROTECTED]> >Sent: Monday, August 18, 2003 9:37
AM >Subject: Re: [castor-dev] using TransactionManager & XA Resource
Pool > > >> Hi pattrick, >> Thank you for your
response! >> >> At the same time I want to use connection
pool which can be like >> XAPool(XA-compliant). >> How can I
use that with addition to TransactionManager in this
JDO. >> >> thanx >> Venkat >> -----
Original Message ----- >> From: "Patrick van Kann" <[EMAIL PROTECTED]> >> To: <[EMAIL PROTECTED]> >> Sent: Wednesday, August 13, 2003 7:12
PM >> Subject: Re: [castor-dev] using TransactionManager & XA
Resource Pool >> >> >> > You can call
setTransactionManager(String >> >
jndiNameOfTransactionManagerInYourJ2EEServer) on the JDO object. >>
> Typically you would do this on a JDO instance that itself would then
be >> > registered in JNDI for use by your app. >>
> >> > You would then manage the transactions in castor using a
UserTransaction >> > obtained from the TransactionManager managing
JDO. >> > >> > UserTransaction ut = ( UserTransaction
) >> ic.lookup( "java/utJndiAddress" ); >> > DataObjects
jdo jdo = ( DataObjects ) >> >p( >> >
"java/jdoJndiAddressOfJDOInstanceUponWhichYouHaveSetTransactionManagerAbove"
>> > ); >> > ut.begin() >> > Database db
= jdo.getDatabase(); >> > file://...do your
stuff >> > ut.commit(); >> > return data; >>
> >> > Note that you must begin your tranny before you get the
Database from >> > the DataObject. >> > >>
> Hope this helps. >> > >> > Patrick >>
> >> > >> > Venkat Dosapati wrote: >>
> >> > >hi all, >> > > >> >
>Can I use JTA & JTS compliant Transaction Manager & XA-compliant
connection >> > >pool >> > >with Castor JDO.
where can set the configuration to use them. >> > > >>
> >In my case I want to use JOTM [ >TransactionManager] &
XAPool [XA resource >> > >pool] >> > >with
Castor JDO. >> > > >> > >Did anyone try
this? >> > > >> > >thanks >> >
>Venkat >> > > >> >
>----------------------------------------------------------- >>
> >If you wish to unsubscribe from this mailing, send mail
to >> > >[EMAIL PROTECTED] with a subject of: >> > >
unsubscribe castor-dev >> > > >> > > >>
> >> >
----------------------------------------------------------- >> >
If you wish to unsubscribe from this mailing, send mail to >>
> >> [EMAIL PROTECTED] with a subject of: >> >
unsubscribe castor-dev >> >>
----------------------------------------------------------- >> If you
wish to unsubscribe from this mailing, send mail to >> [EMAIL PROTECTED]
with a subject of: >> unsubscribe
castor-dev > >-----------------------------------------------------------
>If you wish to unsubscribe from this mailing, send mail
to >[EMAIL PROTECTED] with a subject of: > unsubscribe
castor-dev >
|