This one time, at band camp, Ron Ridenour said:
Please see my comments inline.
RR>I used the rooms example by Terry Child combined with the template example from the
src
RR>distribution to try to get Castor working with MSSQL and Jboss-3.0.3.
RR>The rooms example was for 2.x so I modified it as best I could. The problem I am
having
RR>is that I am getting a null _jdo object back from the jndi lookup. any help would be
RR>greatly appreciated.
This is something that I'd like to eventually make available via the
Castor project - the Rooms example for JBoss 2.4.x and one updated for
JBoss 3.x.
RR>**************************************************************************************************
RR>************ The Problem ****
RR>**************************************************************************************************
RR>
RR> The problem is that things look like they are bound correctly,
RR> but I get a null object back from the call to:
RR> _jdo = (DataObjects) compEnv.lookup("jdo/modelJDO"); in CastorHelper()
RR>
RR>*************************************************************************************************
RR>
RR>****************************************************************************************
RR>Cleint code from CastorHelper:
RR>****************************************************************************************
RR>
RR>import org.exolab.castor.jdo.DataObjects;
RR>public class CastorHelper implements java.io.Serializable {
RR>
RR> public DataObjects _jdo;
RR>
RR> public CastorHelper() {
RR>
RR> Context compEnv = (Context) iniCtx.lookup("java:comp/env");
RR> _jdo = (DataObjects) compEnv.lookup("jdo/modelJDO");
RR> if (_jdo = =null) {
RR> //********************** here is the problem ************************
RR> //_jdo is null even though I did not get any Naming exceptions or
RR> //any other kind of exceptions
RR> //****************************************************************
RR> }
RR> }
RR>}
It's interesting that there are no exceptions. Have you taken a look at the
JDO object in the JMX console (http://localhost:8080/jmx-console/)? Maybe
there are errors there...?
RR>****************************************************************************************
RR>********** database.xml specified in the MBean above references the MSSQLXaDS bound
above
RR>****************************************************************************************
RR> <database name="mssql" engine="sql-server" >
RR> <jndi name="java:/MSSQLXaDS"/>
RR> <mapping href="mapping.xml" />
RR> </database>
RR>
RR>
RR>****************************************************************************************
RR>********** jndi bindings printed at runtime before
RR>********** I invoke _jdo = (DataObjects) compEnv.lookup("jdo/modelJDO"); in
CastorHelper()
RR>****************************************************************************************
RR>15:35:38,307 INFO [STDOUT] CastorHelper(): binding for: java
RR>15:35:38,307 INFO [STDOUT] MSSQLXaDS:
org.jboss.resource.adapter.jdbc.JDBCDataSource:Reference Class Name:
org.jboss.resource.adapter.jdbc.JDBCDataSource
RR>15:35:38,307 INFO [STDOUT] CastorHelper(): name: MSSQLXaDS
RR>15:35:38,307 INFO [STDOUT] CastorHelper(): object: Reference Class Name:
org.jboss.resource.adapter.jdbc.JDBCDataSource
I'm not sure what this tells us other than the fact that the JDBC
connection is in place and ready to be used, correct? The CastorHelper()
constructor performs the lookup for the JDO, is this where it is failing?
So far I've only used Castor JDO with JBoss 2.4.x. I'll try to hook it
up to JBoss 3.x tonight or tomorrow night and see if I can get past
this problem. In the meantime, if you make any progress, please post
information about it.
Bruce
--
perl -e 'print unpack("u30","<0G)U8V4\@4VYY9&5R\"F9E<G)E=\$\!F<FEI+F-O;0\`\`");'
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev