db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marc Dugger" <m...@socotech.com>
Subject RE: jndi datasource factory
Date Sun, 16 Nov 2003 22:57:53 GMT
I'm using Tomcat as my container and, from my understanding, Tomcat provides
an initial JNDI context by default.  I see in the logging that an initial
context is being created:

Nov 16, 2003 4:51:54 PM org.apache.commons.modeler.Registry loadRegistry
INFO: Loading registry information
Nov 16, 2003 4:51:54 PM org.apache.commons.modeler.Registry getRegistry
INFO: Creating new Registry instance
Nov 16, 2003 4:51:54 PM org.apache.commons.modeler.Registry getServer
INFO: Creating MBeanServer
Nov 16, 2003 4:51:55 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on port 8088
Starting service Tomcat-Standalone
Apache Tomcat/4.1.27
2003-11-16 16:51:56,418 [main] DEBUG
com.socotech.loanauditor.util.ResourceResolver - getResourceURL():
attempting to load resource for torque.properties
2003-11-16 16:51:56,418 [main] DEBUG
com.socotech.loanauditor.util.ResourceResolver - getResourceURL(): loaded
torque.properties from thread's classloader
2003-11-16 16:51:56,428 [main] DEBUG org.apache.torque.Torque - Starting
initAdapters
2003-11-16 16:51:56,448 [main] DEBUG org.apache.torque.Torque - Starting
initDSF
2003-11-16 16:51:56,448 [main] DEBUG org.apache.torque.Torque - handle:
loanauditor DataSourceFactory:
org.apache.torque.dsfactory.JndiDataSourceFactory
2003-11-16 16:51:56,458 [main] DEBUG
org.apache.torque.dsfactory.JndiDataSourceFactory - Starting initJNDI
2003-11-16 16:51:56,458 [main] DEBUG
org.apache.torque.dsfactory.JndiDataSourceFactory - JNDI path:
java:comp/env/jdbc/loanauditor
2003-11-16 16:51:56,458 [main] DEBUG
org.apache.torque.dsfactory.JndiDataSourceFactory - Created new
InitialContext
2003-11-16 16:51:56,458 [main] DEBUG
org.apache.torque.dsfactory.JndiDataSourceFactory -
InitialContext -------------------------------
2003-11-16 16:51:56,458 [main] DEBUG
org.apache.torque.dsfactory.JndiDataSourceFactory - Environment properties:2
2003-11-16 16:51:56,458 [main] DEBUG
org.apache.torque.dsfactory.JndiDataSourceFactory -
java.naming.factory.initial: org.apache.naming.java.javaURLCont
extFactory
2003-11-16 16:51:56,458 [main] DEBUG
org.apache.torque.dsfactory.JndiDataSourceFactory -
java.naming.factory.url.pkgs: org.apache.naming
2003-11-16 16:51:56,458 [main] DEBUG
org.apache.torque.dsfactory.JndiDataSourceFactory - ------------------------
----------------------
2003-11-16 16:51:56,458 [main] DEBUG
org.apache.torque.dsfactory.JndiDataSourceFactory - Starting initDataSources
2003-11-16 16:51:56,458 [main] DEBUG org.apache.torque.Torque - Adding a
dummy entry for default, mapped onto loanauditor
2003-11-16 16:51:56,518 [main] WARN org.apache.torque.oid.IDBroker -
IDBroker is being used with db 'loanauditor', which does not support
transactions. IDBr
oker attempts to use transactions to limit the possibility of duplicate key
generation.  Without transactions, duplicate key generation is possible if
multi
ple JVMs are used or other means are used to write to the database.
2003-11-16 16:51:56,528 [Thread-2] DEBUG org.apache.torque.oid.IDBroker -
IDBroker thread was started.
2003-11-16 16:51:56,548 [main] ERROR org.apache.torque.util.Transaction -
Connection object was null. This could be due to a misconfiguration of the
DataSou
rceFactory. Check the logs and Torque.properties to better determine the
cause.
2003-11-16 16:51:56,558 [main] FATAL
com.socotech.loanauditor.dao.TorqueDomainTypeDAO - Cannot create resource
instance
javax.naming.NamingException: Cannot create resource instance
        at
org.apache.naming.factory.ResourceEnvFactory.getObjectInstance(ResourceEnvFa
ctory.java:146)
        at
javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:301)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:834)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:181)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:822)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:181)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:822)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:181)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:822)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:194)
        at
org.apache.naming.SelectorContext.lookup(SelectorContext.java:183)
        at javax.naming.InitialContext.lookup(InitialContext.java:347)
        at
org.apache.torque.dsfactory.JndiDataSourceFactory.getDataSource(JndiDataSour
ceFactory.java:102)
        at org.apache.torque.Torque.getConnection(Torque.java:890)
        at
org.apache.torque.util.Transaction.beginOptional(Transaction.java:114)
        at org.apache.torque.util.BasePeer.doSelect(BasePeer.java:1328)
        at
com.socotech.loanauditor.or.torque.BaseTimeIntervalImplPeer.doSelectVillageR
ecords(BaseTimeIntervalImplPeer.java:375)
        at
com.socotech.loanauditor.or.torque.BaseTimeIntervalImplPeer.doSelectVillageR
ecords(BaseTimeIntervalImplPeer.java:342)
        at
com.socotech.loanauditor.or.torque.BaseTimeIntervalImplPeer.doSelect(BaseTim
eIntervalImplPeer.java:311)
        at
com.socotech.loanauditor.dao.TorqueDomainTypeDAO.getTimeIntervals(TorqueDoma
inTypeDAO.java:36)
        at
com.socotech.loanauditor.web.listener.DomainTypeLoader.contextInitialized(Do
mainTypeLoader.java:32)
        at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:
3270)
        at
org.apache.catalina.core.StandardContext.start(StandardContext.java:3599)
        at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
        at
org.apache.catalina.core.StandardHost.start(StandardHost.java:738)
        at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
        at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:347)
        at
org.apache.catalina.core.StandardService.start(StandardService.java:497)
        at
org.apache.catalina.core.StandardServer.start(StandardServer.java:2190)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:512)
        at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
        at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)

Any additional insight is greatly appreciated.  Thanks in advance.





> -----Original Message-----
> From: Charles Bergeron [mailto:bergeroncharles@hotmail.com]
> Sent: Sunday, November 16, 2003 2:51 PM
> To: 'Apache Torque Users List'; marc@socotech.com
> Subject: RE: jndi datasource factory
>
>
> Hi,
>
> Try remove the java:comp/env
>
> And you should look at this parameter:
> torque.dsfactory.bookstore.jndi.java.naming.factory.initial =
> org.apache.naming.java.javaURLContextFactory
> torque.dsfactory.bookstore.jndi.java.naming.factory.url.pkgs =
> org.apache.naming
>
> I think this is a initial context problem.
>
> Look the code that create the datasource form the jndi.
>
> I have no problem running a jndi datasource with torque 3.0.2 and WAS 4
>
> Bye
>
>
> -----Message d'origine-----
> De : Marc Dugger [mailto:marc@socotech.com]
> Envoyé : dimanche 16 novembre 2003 20:24
> À : torque-user@db.apache.org
> Objet : jndi datasource factory
>
> I am trying to integrate JOTM into my webapp for transaction
> support.  As a
> result, I'm modifiying my torque.properties to use the
> JndiDataSourceFactory
> as follows:
>
> torque.database.default=loanauditor
> torque.database.loanauditor.adapter=mysql
> torque.dsfactory.loanauditor.factory=org.apache.torque.dsfactory.J
> ndiDataSou
> rceFactory
> torque.dsfactory.loanauditor.jndi.path=java:comp/env/jdbc/loanauditor
>
> However, my calls to Peer classes now fail with:
>
> "2003-11-16 12:44:01,912 [main] ERROR org.apache.torque.util.Transaction -
> Connection object was null. This could be due to a misconfiguration of the
> DataSourceFactory. Check the logs and Torque.properties to better
> determine
> the cause."
>
> What other configuration have I missed?
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message