2 Replies Latest reply on Jan 31, 2007 2:32 AM by gmeroz

    JDBCCacheLoader error: Io exception: The Network Adapter cou

    gmeroz Newbie

      if i use the following code with a JDBCCacheLoader, i get the following exception after a while (after putting about 250 items to the cache):

      for (int i=0 ; i<10000 ;i++){
       Person x = new Person();
       x.setName("x"+i);
       x.setAddress(address);
       cache.put("engine/x"+i,x);
      }
      


      12:19:32,645 ERROR [JDBCCacheLoader] Failed to get connection for url=jdbc:oracle:thin:@dbms01:1521:besapp, user=GILEADHBVMC02_NEW2, password=GILEADHBVMC02_NEW2
      java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
       at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
       at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:162)
       at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:274)
       at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:328)
       at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:348)
       at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:151)
       at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
       at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:563)
       at java.sql.DriverManager.getConnection(DriverManager.java:525)
       at java.sql.DriverManager.getConnection(DriverManager.java:171)
       at org.jboss.cache.loader.JDBCCacheLoader$NonManagedConnectionFactory.getConnection(JDBCCacheLoader.java:1157)
       at org.jboss.cache.loader.JDBCCacheLoader.loadNode(JDBCCacheLoader.java:816)
       at org.jboss.cache.loader.JDBCCacheLoader.get(JDBCCacheLoader.java:202)
       at org.jboss.cache.interceptors.CacheLoaderInterceptor.loadData(CacheLoaderInterceptor.java:533)
       at org.jboss.cache.interceptors.CacheLoaderInterceptor.loadNode(CacheLoaderInterceptor.java:426)
       at org.jboss.cache.interceptors.CacheLoaderInterceptor.loadIfNeeded(CacheLoaderInterceptor.java:214)
       at org.jboss.cache.interceptors.CacheLoaderInterceptor.invoke(CacheLoaderInterceptor.java:185)
       at org.jboss.cache.interceptors.ActivationInterceptor.invoke(ActivationInterceptor.java:66)
       at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:75)
       at org.jboss.cache.interceptors.UnlockInterceptor.invoke(UnlockInterceptor.java:33)
       at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:75)
       at org.jboss.cache.interceptors.PassivationInterceptor.invoke(PassivationInterceptor.java:80)
       at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:75)
       at org.jboss.cache.interceptors.NotificationInterceptor.invoke(NotificationInterceptor.java:22)
       at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:75)
       at org.jboss.cache.interceptors.TxInterceptor.handleNonTxMethod(TxInterceptor.java:288)
       at org.jboss.cache.interceptors.TxInterceptor.invoke(TxInterceptor.java:126)
       at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:75)
       at org.jboss.cache.interceptors.CacheMgmtInterceptor.invoke(CacheMgmtInterceptor.java:126)
       at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:75)
       at org.jboss.cache.interceptors.InvocationContextInterceptor.invoke(InvocationContextInterceptor.java:66)
       at org.jboss.cache.CacheImpl.invokeMethod(CacheImpl.java:3750)
       at org.jboss.cache.CacheImpl.get(CacheImpl.java:1390)
       at org.jboss.cache.CacheImpl.get(CacheImpl.java:1365)
       at org.jboss.cache.pojo.impl.InternalHelper.get(InternalHelper.java:142)
       at org.jboss.cache.pojo.impl.InternalHelper.getAopInstance(InternalHelper.java:72)
       at org.jboss.cache.pojo.impl.InternalHelper.getPojo(InternalHelper.java:264)
       at org.jboss.cache.pojo.impl.PojoCacheDelegate.getObject(PojoCacheDelegate.java:88)
       at org.jboss.cache.pojo.impl.PojoCacheImpl.getObject(PojoCacheImpl.java:208)
       at org.jboss.cache.pojo.impl.PojoCacheImpl.org$jboss$cache$pojo$impl$PojoCacheImpl$find$aop(PojoCacheImpl.java:196)
       at org.jboss.cache.pojo.impl.PojoCacheImpl$PojoCacheImplAdvisor.find_N_7063709169143275953(PojoCacheImpl$PojoCacheImplAdvisor.java)
       at org.jboss.cache.pojo.impl.PojoCacheImpl.find(PojoCacheImpl.java)
       at org.jboss.cache.pojo.impl.PojoCacheImpl.org$jboss$cache$pojo$impl$PojoCacheImpl$detach$aop(PojoCacheImpl.java:160)
       at org.jboss.cache.pojo.impl.PojoCacheImpl$PojoCacheImplAdvisor.detach9209594694587929181(PojoCacheImpl$PojoCacheImplAdvisor.java)
       at org.jboss.cache.pojo.impl.PojoCacheImpl.detach(PojoCacheImpl.java)
       at org.jboss.cache.pojo.impl.PojoCacheDelegate.putObjectII(PojoCacheDelegate.java:150)
       at org.jboss.cache.pojo.impl.PojoCacheImpl.putObject(PojoCacheImpl.java:145)
       at org.jboss.cache.pojo.impl.PojoCacheImpl.org$jboss$cache$pojo$impl$PojoCacheImpl$attach$aop(PojoCacheImpl.java:122)
       at org.jboss.cache.pojo.impl.PojoCacheImpl$PojoCacheImplAdvisor.attach3085019539260813833(PojoCacheImpl$PojoCacheImplAdvisor.java)
       at org.jboss.cache.pojo.impl.PojoCacheImpl.attach(PojoCacheImpl.java)
       at org.jboss.cache.pojo.impl.PojoCacheImpl.attach(PojoCacheImpl.java:114)
       at com.bevents.infra.service.cache.JBossCacheImpl.put(JBossCacheImpl.java:41)
       at com.bevents.infra.service.cache.JBossCacheImplTest.testPutAndGet(JBossCacheImplTest.java:47)
       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:585)
       at junit.framework.TestCase.runTest(TestCase.java:154)
       at junit.framework.TestCase.runBare(TestCase.java:127)
       at junit.framework.TestResult$1.protect(TestResult.java:106)
       at junit.framework.TestResult.runProtected(TestResult.java:124)
       at junit.framework.TestResult.run(TestResult.java:109)
       at junit.framework.TestCase.run(TestCase.java:118)
       at junit.textui.TestRunner.doRun(TestRunner.java:116)
       at com.intellij.rt.execution.junit.IdeaTestRunner.doRun(IdeaTestRunner.java:69)
       at junit.textui.TestRunner.doRun(TestRunner.java:109)
       at com.intellij.rt.execution.junit.IdeaTestRunner.startRunnerWithArgs(IdeaTestRunner.java:24)
       at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:118)
       at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40)
       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:585)
       at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
      12:19:32,723 INFO [TxInterceptor] There was a problem handling this request
      


      The cache configuration::
      <mbean code="org.jboss.cache.TreeCache"
       name="jboss.cache:service=TreeCache">
      
       <depends>jboss:service=Naming</depends>
       <depends>jboss:service=TransactionManager</depends>
      
       <attribute name="TransactionManagerLookupClass">org.jboss.cache.DummyTransactionManagerLookup</attribute>
       <attribute name="IsolationLevel">READ_COMMITTED</attribute>
      
       <attribute name="CacheMode">LOCAL</attribute>
       <attribute name="CacheLoaderConfiguration">
       <config>
       <passivation>false</passivation>
       <preload>/</preload>
       <shared>true</shared>
      
       <cacheloader>
       <class>org.jboss.cache.loader.JDBCCacheLoader</class>
       <properties>
       cache.jdbc.table.name=jbosscache_test
       cache.jdbc.table.create=true
       cache.jdbc.table.drop=true
       cache.jdbc.table.primarykey=jbosscache_test_pk
       cache.jdbc.fqn.column=fqn
       cache.jdbc.fqn.type=varchar(255)
       cache.jdbc.node.column=node
       cache.jdbc.node.type=blob
       cache.jdbc.parent.column=parent
       cache.jdbc.driver=oracle.jdbc.driver.OracleDriver
       cache.jdbc.url=jdbc:oracle:thin:@dbms01:1521:besapp
       cache.jdbc.user=GILEADHBVMC02_NEW2
       cache.jdbc.password=GILEADHBVMC02_NEW2
       </properties>
      
       <!-- whether the cache loader writes are asynchronous -->
       <async>false</async>
       <!-- only one cache loader in the chain may set fetchPersistentState to true.-->
       <!--An exception is thrown if more than one cache loader sets this to true. -->
       <fetchPersistentState>false</fetchPersistentState>
       <!-- determines whether this cache loader ignores writes - defaults to false. -->
       <ignoreModifications>false</ignoreModifications>
       <!-- if set to true, purges the contents of this cache loader when the cache starts up.-->
       <!--Defaults to false. -->
       <purgeOnStartup>false</purgeOnStartup>
       </cacheloader>
       </config>
       </attribute>
       </mbean>