-
1. Re: TreeCache - JDBCCacheLoader - Failed to lookup datasourc
brian.stansberry Dec 13, 2005 6:22 PM (in response to raulscosta)Are you using JBossCache 1.2.4 beta? This sounds like http://jira.jboss.com/jira/browse/JBCACHE-303, which was fixed in the final 1.2.4 release.
-
2. Re: TreeCache - JDBCCacheLoader - Failed to lookup datasourc
raulscosta Dec 14, 2005 8:31 AM (in response to raulscosta)I've checked my version and I even downloaded it again. I'm using JBossCache 1.2.4 version released on 20 October, so it is the final version.
Is it possible that the bug wasn't completely solved or am I doing something wrong? The error I'm having is exactely the same reported in http://jira.jboss.com/jira/browse/JBCACHE-303.
Thanks again. -
3. Re: TreeCache - JDBCCacheLoader - Failed to lookup datasourc
brian.stansberry Dec 14, 2005 8:11 PM (in response to raulscosta)<p>How were you specifying the cache dependency? With 4.0.3SP1, adding this to a treecache's -service.xml file worked. <br/> <br/>[<depends>jboss.jca:service=DataSourceBinding,name=DefaultDS</depends> | <depends>jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>]</p>
-
4. Re: TreeCache - JDBCCacheLoader - Failed to lookup datasourc
brian.stansberry Dec 14, 2005 8:22 PM (in response to raulscosta)Sorry, forgot the forum hates xml :-)
Imagine it was surrounded by a "depends" tag -
5. Re: TreeCache - JDBCCacheLoader - Failed to lookup datasourc
raulscosta Dec 15, 2005 9:41 AM (in response to raulscosta)I have my problem solved with this include as the lookup() of my DataSource works fine now thaks to the include you recommended.
But I find curious the fact that I have a Oracle datasource defined by my self and if I try to stablish the dependency on that DataSource on the -service.xml file that datasource isn't bound before the TreeCache setCache() method in the CacheLoader, as it should be.
My DataSource is defined this way<datasources> <local-tx-datasource> <jndi-name>agorang/alarmMonitorDB</jndi-name> <connection-url>jdbc:oracle:thin:@localhost_IP:PORT:SEQ9i</connection-url> <driver-class>oracle.jdbc.driver.OracleDriver</driver-class> <user-name>123</user-name> <password>xxx</password> <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name> <blocking-timeout-millis>0</blocking-timeout-millis> <idle-timeout-minutes>1</idle-timeout-minutes> <max-pool-size>100</max-pool-size> <min-pool-size>10</min-pool-size> </local-tx-datasource> </datasources>
The "debug", when I include the dependency on my datasource looks like this:14:25:57,546 INFO [STDOUT] super setCache 14:25:57,546 INFO [STDOUT] init() 14:25:57,562 ERROR [main][agorang.helpers.MyCacheLoader] - javax.naming.NameNotFoundException: agorang not bound 14:25:57,562 ERROR [MyCacheLoader] javax.naming.NameNotFoundException: agorang not bound 14:25:57,562 ERROR [main][agorang.helpers.MyCacheLoader] - java.lang.NullPointerException 14:25:57,562 ERROR [MyCacheLoader] java.lang.NullPointerException 14:25:57,562 INFO [STDOUT] cacheAllOperators(/pt/ptinovacao/agorang/catOperadores/) 14:25:57,562 ERROR [main][agorang.helpers.MyCacheLoader] - java.lang.NullPointerException 14:25:57,562 ERROR [MyCacheLoader] java.lang.NullPointerException 14:25:57,562 INFO [STDOUT] setCache method succeeded. 14:25:57,593 INFO [TreeCache] interceptor chain is: class org.jboss.cache.interceptors.CallInterceptor class org.jboss.cache.interceptors.PessimisticLockInterceptor class org.jboss.cache.interceptors.CacheLoaderInterceptor class org.jboss.cache.interceptors.UnlockInterceptor class org.jboss.cache.interceptors.ReplicationInterceptor class org.jboss.cache.interceptors.CacheStoreInterceptor 14:25:57,593 INFO [TreeCache] cache mode is REPL_SYNC 14:25:57,703 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=a gorang/alarmMonitorDB' to JNDI name 'java:agorang/alarmMonitorDB'
Note that the binding of the DataSource is done after is has been looked up wich causes the ERROR.
I would like to be sure thad including the dependency on the DefaultDatasource all other DataSources are bound in time to be used by methods in CacheLoader classes.
Thanks for your attention. -
6. Re: TreeCache - JDBCCacheLoader - Failed to lookup datasourc
brian.stansberry Dec 15, 2005 10:47 AM (in response to raulscosta)I don't understand -- did you make your depends on "'jboss.jca:service=DataSourceBinding,name=agorang/alarmMonitorDB"?? If not, that's what you need to do.
-
7. Re: TreeCache - JDBCCacheLoader - Failed to lookup datasourc
raulscosta Dec 15, 2005 11:56 AM (in response to raulscosta)Sorry if I didn't make myself clear.
When I include the dependency on agorang/alarmMonitorDB it doesn't work!
When I include the dependency on DefaultDS JBoss binds the DefaultDS and the agorang/alarmMonitorDB DataSources.
So I can use my DataSource to preload TreeCache with MyCacheLoader class.