I sent this yesterday, but for some reason it never made it to the mailing
list.


********************************************
Steve Ebersole
IT Integration Engineer
Vignette Corporation 
512.741.4195

Visit http://www.vignette.com

********************************************


-----Original Message-----
From: Ebersole, Steven 
Sent: Wednesday, April 24, 2002 3:26 PM
To: '[EMAIL PROTECTED]'
Subject: RE: [castor-dev] DataSource through JNDI?


What is "java:/MSSQLPool"?  It seems like you have, in your database.xml
file, something like the following:

<database name="..." engine="...">
    <jndi name="java:/MSSQLPool" />
</database>


Generally speaking (JBoss may work differently, but I doubt it since it is
supposedly pretty standards based), the "java:/" part is incorrect.  Instead
try:

<database name="..." engine="...">
    <jndi name="MSSQLPool" />
</database>




********************************************
Steve Ebersole
IT Integration Engineer
Vignette Corporation 
512.741.4195

Visit http://www.vignette.com

********************************************


-----Original Message-----
From: Tse, Leo [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 24, 2002 3:00 PM
To: [EMAIL PROTECTED]
Subject: Re: [castor-dev] DataSource through JNDI?


sorry for the un-finished msg earlier... but here's the exception that i'm
getting... and just want to see if anyone can tell me how to config the jcml
file correctly (assuming this is the cause of the erorr)

Thanks!!


[test] org.exolab.castor.jdo.DatabaseNotFoundException: The JNDI name
java:/MSSQLPool does not map to a JDBC DataSource 
[test] org.exolab.castor.mapping.MappingException: The JNDI name
java:/MSSQLPool does not map to a JDBC DataSource
-----Original Message-----
From: Tse, Leo [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 24, 2002 3:53 PM
To: [EMAIL PROTECTED]
Subject: Re: [castor-dev] DataSource through JNDI?


o the solution below works and set up the InitialContext properly..which
brings up my original question....
I have modified the jcml file with this:

 <mbean code="org.jboss.jdbc.XADataSourceLoader"
name="DefaultDomain:service=XADataSource,name=MSSQLPool">
    <attribute name="PoolName">MSSQLPool</attribute>
    <attribute
name="DataSourceClass">org.jboss.pool.jdbc.xa.wrapper.XADataSourceImpl</attr
ibute>
    <attribute name="Properties"></attribute>
    <attribute name="URL">jdbc:inetdae7:ECOG-DC1:Leo</attribute>
    <attribute name="GCMinIdleTime">1200000</attribute>
    <attribute name="JDBCUser">sa</attribute>
    <attribute name="MaxSize">10</attribute>
    <attribute name="Password" />
    <attribute name="GCEnabled">false</attribute>
    <attribute name="InvalidateOnError">false</attribute>
    <attribute name="TimestampUsed">false</attribute>
    <attribute name="Blocking">true</attribute>
    <attribute name="GCInterval">120000</attribute>
    <attribute name="IdleTimeout">1800000</attribute>
    <attribute name="IdleTimeoutEnabled">false</attribute>
    <attribute name="LoggingEnabled">false</attribute>
    <attribute name="MaxIdleTimeoutPercent">1.0</attribute>
    <attribute name="MinSize">0</attribute>
  </mbean>

and when i try to look up the DataSource through JNDI... its giving me a 

-----Original Message-----
From: Ebersole, Steven [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 24, 2002 2:24 PM
To: [EMAIL PROTECTED]
Subject: Re: [castor-dev] DataSource through JNDI?


But the problem you are having is not with Castor per se...  That
"NoInitialContextException" means that the JVM in which you are running was
not able to obtain an InitialContext object (which is the beginning of all
JNDI operations).  So basically your environment is not set up properly to
perform JNDI lookups.  

What happens if you write a test java program which simply tries to obtain
an InitialContext and do some sort of lookup, and then run it in the same
environment?

So the class is running on the same box; is it running _inside_ the app
server?  If not, you still need to tell java how to find the JNDI to use for
lookup as I detailed below.



********************************************
Steve Ebersole
IT Integration Engineer
Vignette Corporation 
512.741.4195

Visit http://www.vignette.com

********************************************


-----Original Message-----
From: Tse, Leo [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 24, 2002 12:58 PM
To: [EMAIL PROTECTED]
Subject: Re: [castor-dev] DataSource through JNDI?


O sorry for not being more clear on this.. but I'm running the app server on
the same machine


-----Original Message-----
From: Ebersole, Steven [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 24, 2002 12:32 PM
To: [EMAIL PROTECTED]
Subject: Re: [castor-dev] DataSource through JNDI?


Are you running this on the same box as the app server?  Doesn't sound like
it.

If not, you need to point java to that app server.  The easy way is to do
the following prior to trying to init Castor:

    < use appropriate values! >
System.setProperty( Context.PROVIDER_URL, "t3://myserver:7001" );
System.setProperty( Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory" );


HTH


********************************************
Steve Ebersole
IT Integration Engineer
Vignette Corporation 
512.741.4195

Visit http://www.vignette.com

********************************************


-----Original Message-----
From: Tse, Leo [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 24, 2002 11:12 AM
To: [EMAIL PROTECTED]
Subject: Re: [castor-dev] DataSource through JNDI?


I'm getting this following output when i call _jdo.getDatabase , and I'm
pretty sure the JDO is valid

[test] org.exolab.castor.jdo.DatabaseNotFoundException: Nested error:
javax.naming.NoInitialContextException: Need to specify class name in
environment or system property, or as an applet parameter, or in an
application resource file:  java.naming.factory.initial [test]
javax.naming.NoInitialContextException: Need to specify class name in
environment or system property, or as an applet parameter, or in an
application resource file:  java.naming.factory.initial [test]  at
javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:640)
[test]  at
javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
[test]  at
javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:280)
[test]  at javax.naming.InitialContext.lookup(InitialContext.java:347)
[test]  at
org.exolab.castor.jdo.engine.DatabaseRegistry.loadDatabase(DatabaseRegistry.
java:308) [test]        at
org.exolab.castor.jdo.JDO.getDatabase(JDO.java:559) [test]      at
jdo.Test.run(Test.java:172) [test]      at jdo.Test.main(Test.java:58)

-----Original Message-----
From: Ebersole, Steven [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 24, 2002 12:00 PM
To: [EMAIL PROTECTED]
Subject: Re: [castor-dev] DataSource through JNDI?


I use a JNDI DataSource in my database.xml and then bind the resulting JDO
object into JNDI.  Works fine for me.  What is the problem you are having?


********************************************
Steve Ebersole
IT Integration Engineer
Vignette Corporation 
512.741.4195

Visit http://www.vignette.com

********************************************


-----Original Message-----
From: Tse, Leo [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 24, 2002 10:19 AM
To: [EMAIL PROTECTED]
Subject: [castor-dev] DataSource through JNDI?


Hi,

Does anyone have any luck using JDO through a DataSource lookup from the
JNDI tree?
I've read the postings on retrieving a JDO from JNDI, and I've gotten that
part to go... 
but I can only specifiy a driver in my database.xml,
not a DataSource from JNDI...  
any pointers would be great!!
thanks!!
        

----------------------------------------------------------- 
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

----------------------------------------------------------- 
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

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

Reply via email to