1 Reply Latest reply on Dec 22, 2016 5:17 AM by Anup Dey

    Problem lookingup datasource with JNDI in JBoss EAP 6.4.

    Amarender Adupa Newbie

      Hi,

      we are currently in JBoss EAP 5.1.2 and are migrating to JBoss EAP 6.4.

      I am facing serious problem in datasource lookup with JNDI from spring application context xml.
      from management console, I have tested the datasource connection and it is success.

      in application-context.xml.

       

      Raw

       

      <jee:jndi-lookup id="dataSourceCMC" jndi-name="java:jboss/datasources/CmcDS" /> 

      in standalone-full.xml

       

      Raw

       

                  <datasource jta="true" jndi-name="java:jboss/datasources/CmcDS" pool-name="CmcDS" enabled="true" use-ccm="true" statistics-enabled="true"> <connection-url>jdbc:oracle:thin:@cmcdevdb:1521:CMC</connection-url> <driver-class>oracle.jdbc.OracleDriver</driver-class> <driver>Oracle11g</driver> <pool> <min-pool-size>0</min-pool-size> <max-pool-size>10</max-pool-size> <prefill>true</prefill> <use-strict-min>true</use-strict-min> </pool> <security> <user-name>cmc</user-name> <password>cmc123</password> </security> <validation> <check-valid-connection-sql>SELECT 1 FROM DUAL</check-valid-connection-sql> <validate-on-match>true</validate-on-match> <background-validation>false</background-validation> </validation> <statement> <prepared-statement-cache-size>10</prepared-statement-cache-size> <share-prepared-statements>false</share-prepared-statements> </statement> </datasource> 

      when deploying the application, I am getting the error below.
      Can someone please help me to resolve, I tried a lot in JBoss forum but couldn't get any solution for this.

      Thank you in advance...

      21:44:59,216 ERROR [org.springframework.web.context.ContextLoader] (ServerService Thread Pool -- 62) Context initialization failed: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSourceCMC': Invocation of init method failed; nested exception is javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out]
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420) [org.springframework.beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) [org.springframework.beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) [org.springframework.beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291) [org.springframework.beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) [org.springframework.beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288) [org.springframework.beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190) [org.springframework.beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:563) [org.springframework.beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
      at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895) [org.springframework.context-3.0.5.RELEASE.jar:3.0.5.RELEASE]
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425) [org.springframework.context-3.0.5.RELEASE.jar:3.0.5.RELEASE]
      at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276) [org.springframework.web-3.0.5.RELEASE.jar:3.0.5.RELEASE]
      at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197) [org.springframework.web-3.0.5.RELEASE.jar:3.0.5.RELEASE]
      at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47) [org.springframework.web-3.0.5.RELEASE.jar:3.0.5.RELEASE]
      at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3339) [jbossweb-7.5.17.Final-redhat-1.jar:7.5.17.Final-redhat-1]
      at org.apache.catalina.core.StandardContext.start(StandardContext.java:3780) [jbossweb-7.5.17.Final-redhat-1.jar:7.5.17.Final-redhat-1]
      at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:163) [jboss-as-web-7.5.10.Final-redhat-2.jar:7.5.10.Final-redhat-2]
      at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:61) [jboss-as-web-7.5.10.Final-redhat-2.jar:7.5.10.Final-redhat-2]
      at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:96) [jboss-as-web-7.5.10.Final-redhat-2.jar:7.5.10.Final-redhat-2]
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_79]
      at java.util.concurrent.FutureTask.run(FutureTask.java:262) [rt.jar:1.7.0_79]
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_79]
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_79]
      at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_79]
      at org.jboss.threads.JBossThread.run(JBossThread.java:122)
      Caused by: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out]
      at org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:1678) [jnp-client.jar:]
      at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1795) [jnp-client.jar:]
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:693) [jnp-client.jar:]
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686) [jnp-client.jar:]
      at javax.naming.InitialContext.lookup(InitialContext.java:411) [rt.jar:1.7.0_79]
      at javax.naming.InitialContext.lookup(InitialContext.java:411) [rt.jar:1.7.0_79]
      at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:154) [org.springframework.context-3.0.5.RELEASE.jar:3.0.5.RELEASE]
      at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:87) [org.springframework.context-3.0.5.RELEASE.jar:3.0.5.RELEASE]
      at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:152) [org.springframework.context-3.0.5.RELEASE.jar:3.0.5.RELEASE]
      at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:178) [org.springframework.context-3.0.5.RELEASE.jar:3.0.5.RELEASE]
      at org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:95) [org.springframework.context-3.0.5.RELEASE.jar:3.0.5.RELEASE]
      at org.springframework.jndi.JndiObjectLocator.lookup(JndiObjectLocator.java:105) [org.springframework.context-3.0.5.RELEASE.jar:3.0.5.RELEASE]
      at org.springframework.jndi.JndiObjectFactoryBean.lookupWithFallback(JndiObjectFactoryBean.java:201) [org.springframework.context-3.0.5.RELEASE.jar:3.0.5.RELEASE]
      at org.springframework.jndi.JndiObjectFactoryBean.afterPropertiesSet(JndiObjectFactoryBean.java:187) [org.springframework.context-3.0.5.RELEASE.jar:3.0.5.RELEASE]
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477) [org.springframework.beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417) [org.springframework.beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
      ... 23 more
      Caused by: java.net.SocketTimeoutException: Receive timed out
      at java.net.TwoStacksPlainDatagramSocketImpl.receive0(Native Method) [rt.jar:1.7.0_79]
      at java.net.TwoStacksPlainDatagramSocketImpl.receive(TwoStacksPlainDatagramSocketImpl.java:114) [rt.jar:1.7.0_79]
      at java.net.DatagramSocket.receive(DatagramSocket.java:816) [rt.jar:1.7.0_79]
      at org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:1647) [jnp-client.jar:]
      ... 38 more