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.getTransactionManager(TransactionManagerRegistry.java:77)
at
org.castor.jdo.engine.AbstractConnectionFactory.initialize(AbstractConnectionFactory.java:131)
at
org.castor.jdo.engine.DatabaseRegistry.loadDatabase(DatabaseRegistry.java:177)
at
org.castor.jdo.engine.DatabaseRegistry.loadDatabase(DatabaseRegistry.java:136)
at org.exolab.castor.jdo.JDO.getDatabase(JDO.java:562)
at
org.openejb.alt.containers.castor_cmp11.CastorCMP11_EntityContainer.postInit(CastorCMP11_EntityContainer.java:428)
at
org.openejb.alt.containers.castor_cmp11.CastorCMP11_EntityContainer.invoke(CastorCMP11_EntityContainer.java:516)
at
org.openejb.core.entity.EntityEjbHomeHandler.findX(EntityEjbHomeHandler.java:110)
at
org.openejb.core.ivm.EjbHomeProxyHandler._invoke(EjbHomeProxyHandler.java:145)
at
org.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:299)
at
org.openejb.util.proxy.Jdk13InvocationHandler.invoke(Jdk13InvocationHandler.java:87)
at $Proxy0.findByPrimaryKey(Unknown Source)
at edushop.ctrl.LoginCtrl.<init>(LoginCtrl.java:87)
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!
I've put all the relevant files at www.runlevel5.co.uk/probs
[DIR] EJB/ <-- The META-INF cmp_*_database and ejb classes
[TXT] LoginCtrl.java <-- The class I'm calling from in my webapp
[ ] eduShop <-- The commands I use to compile / deploy the app
(generates no errors at this point)
[ ] openejb.conf <-- from $OPENEJB_HOME/conf/
[ ] openejb.log <-- from $OPENEJB_HOME/log/
[DIR] tomcat-conf/ <-- tomcat web.xml for app and server.xml
I've followed just about every how-to I can find; searched through the
castor docs and am yet again at the point where I don't know where to
look.
If it help the main webapp never returns from the remote call to: User
user = home.findByPrimaryKey(new Integer(uid)); after seeming to
sucessfully retreive UserHome home in the lines before.
Thanks in advance for any help you can provide,
Jason
> On Apr 11, 2006, at 5:54 AM, Jason Woollard wrote:
>
>> Hi,
>>
>> I'm very new to EJBs in general and am trying to replace some POJO
>> classes
>> used to access mySQL in a tomcat webapp. I've had a very interesting
>> journey configuring all the relevant xml files and so forth but
>> have hit
>> against the following error message:
>>
>> 11-Apr-2006 00:50:25 org.exolab.castor.jdo.engine.DatabaseImpl
>> finalize
>> WARNING: An open database instance
>> (org.exolab.castor.jdo.engine.DatabaseImpl@1c1eceb:Local_TX_Database)
>> against database: Local_TX_Database has been encountered. This
>> instance
>> will be closed now to release system resources. Please consider
>> changing
>> your code as well to enforce that all database connections are closed
>> after use.SQL executed, but not closed:null
>> 11-Apr-2006 00:50:25 org.castor.jdo.engine.DatabaseRegistry
>> loadDatabase
>>
>> I'm using mySQL 5, Tomcat 5 and the stable release of openEJB 1.0
>>
>> I was curious as to whether the fact tomcat is still connecting to
>> mySQL
>> via a JDCB declaration in its server.xml could cause this error -
>> although
>> surely mySQL can handle simultaneous connections. I saw this was
>> recorded
>> as a bug (
http://www.mail-archive.com/dev@.../>> msg00595.html) and
>> its apparently resolved so I'm really stuck as to what to try next.
>>
>> I can provide all my relevant source and conf files if it helps, in
>> this
>> instance I'm trying to retreive a pre-existing users details via their
>> logon id (primary key integer in the db) using a findByUserID(int id)
>> method - perhaps its just me doing something wrong with the remote,
>> home,
>> object classes.
>>
>
> Hi Jason,
>
> Your app is fine. That's a very nasty and false warning. I did work
> this out with the Castor guys, here is the jira for reference:
>
http://jira.codehaus.org/browse/CASTOR-1356>
> It's fixed in Castor 1.0-M4 and Castor 1.0 final. Our OpenEJB 1.0
> pre-dates either of those, so if you replace the castor 1.0-M1 jar
> with either the castor-1.0-M4 or castor-1.0 jar the false error
> message should go away.
>
> A side note on the Castor config files, in the 3.0 branch of OpenEJB
> you only need a cmp.mapping.xml file next to the ejb-jar.xml your ejb
> jar archive and no longer need to supply all those other database
> files (e.g local tx database and global tx database).
>
> If you or anyone wanted to contribute, backporting that fix from 3.0
> to 1.0 would be excellent. I'd be happy to release an OpenEJB 1.1
> immediately with that fix and as well as including the final 1.0 of
> Castor.
>
> -David
>
--
Jason Woollard
17 North Way
Lewes
East Sussex
BN7 1DS
+44 7730 930 306
www.runlevel5.co.uk