On Apr 11, 2006, at 6:18 AM, Jason Woollard wrote:
Hi,
Thanks to David and Bruce for their replies - you were right that
changing
to the castor-1.0.jar fixed the error message. However I'm still
having
troubles with my application now producing:
INFO : OpenEJB ready.
FATAL: Castor JDO initialization failed: null
java.lang.NullPointerException
at
org.exolab.castor.jdo.transactionmanager.TransactionManagerRegistry.ge
tTransactionManager(TransactionManagerRegistry.java:77)
[...]
in openejb.log. I'm not sure if this list is the best place to ask for
help, but if anyone could offer an opinion as to what is causing
this or
suggest a better place to ask I would be very gratefull - I'm
running out
of time for this job!
My guess is that your local/global tx database files are setup
wrong. I can't blame you as those things are less than intuitive,
which is why I yanked the need for them in the 3.x branch. That
said, I went ahead and backported that feature to the 1.x branch and
whipped up an unstable release for you which also includes Castor 1.0:
openejb-1.1-20060411
http://www.openejb.org/Latest+Unstable
That basically contains these three fixes:
OPENEJB-138: Upgrade to Castor 1.0
OPENEJB-137: Allow Castor cmp mapping files to be in the ejb jar
archive
OPENEJB-136: Remove need for Castor local and global tx database
files
Here is how you deal with the slight change:
1. Edit the your openejb.conf/xml file
Add these properties to your CMP container definition:
<Container id="Default CMP Container" ctype="CMP_ENTITY">
PoolSize 100
Engine instantdb
ConnectorName Default JDBC Database
JdbcDriver org.enhydra.instantdb.jdbc.idbDriver
JdbcUrl jdbc:idb:conf/instantdb.properties
UserName Admin
Password pass
</Container>
The "Engine" property is the same as what would have been in your
Castor JDO database xml files. We will build those for you at
startup, so we still need that.
The "ConnectorName" property is the name of which ever Connector
definition you wish to use for CMP Container. We're actually going
to use that when your CMP bean requires that it participate in any
JTA transactions (aka. global transactions).
The other four properties (JdbcDriver, JdbcUrl, UserName, Password)
you can copy straight from the Connector definition. It'd be nice if
we did that for you, but the config data for a Connector is not
available to a Container so we'll have to work on that in the
future. This information is going to be used to establish direct
connections to the database when your CMP bean does not want to
participate in any JTA transactions (global transactions) -- in this
situation we start a local transaction that isn't XA enabled that
just your CMP participates in.
2. Delete your old foo.database.xml files
3. Move your cmp mapping.xml file
The cmp mapping.xml must be in your ejb jar archive at "META-INF/
cmp.mapping.xml"
That's it.
Let us know how it goes.
-David