2 Replies Latest reply on Aug 15, 2013 8:52 AM by suyograj

    javax.naming.NameNotFoundException

    suyograj Newbie

      Hello community, I am trying to user connection pooling in Jboss AS 7.1.1 final. I used console based connection pooling configuration. JBoss gives successful datasource bound message, follows is the screen shot.

      service thread 1-2) JBAS010401: Bound JCA ConnectionFactory [java:/JmsXA]

      [Server:server-two] 19:39:16,573 INFO  [org.hornetq.ra.HornetQResourceAdapter]

      (MSC service thread 1-1) HornetQ resource adaptor started

      [Server:server-two] 19:39:16,574 INFO  [org.jboss.as.connector.services.Resource

      AdapterActivatorService$ResourceAdapterActivator] (MSC service thread 1-1) IJ020002: Deployed: file://RaActivatorhornetq-ra

      [Server:server-two] 19:39:16,577 INFO  [org.jboss.as.deployment.connector]

      (MSCservice thread 1-1) JBAS010401: Bound JCA ConnectionFactory [java:/JmsXA]

      [Server:server-one] 19:39:16,582 INFO  [org.jboss.as.server] (Controller Boot Thread) JBAS018559: Deployed "DbApp2.war"

      [Server:server-one] 19:39:16,582 INFO  [org.jboss.as.server] (Controller Boot Thread) JBAS018559: Deployed "sqljdbc.jar"

      [Server:server-one] 19:39:16,583 INFO  [org.jboss.as.server] (Controller Boot Thread) JBAS018559: Deployed "TestApp.war"

      [Server:server-one] 19:39:16,602 INFO  [org.jboss.as] (Controller Boot Thread) J

      BAS015874: JBoss AS 7.1.1.Final "Brontes" started in 12210ms - Started 285 of 36

      7 services (81 services are passive or on-demand)

      [Server:server-two] 19:39:16,608 INFO  [org.jboss.as.messaging] (MSC service thread 1-3)

      JBAS011601: Bound messaging object to jndi name java:/topic/test

      [Server:server-two] 19:39:16,609 INFO  [org.jboss.as.messaging] (MSC service thread 1-3)

      JBAS011601: Bound messaging object to jndi name java:jboss/exported/jms/topic/test

      [Server:server-two] 19:39:16,611 INFO  [org.hornetq.core.server.impl.HornetQServerImpl]

      (MSC service thread 1-4) trying to deploy queue jms.queue.testQueue

      [Server:server-two] 19:39:16,619 INFO  [org.jboss.as.messaging] (MSC service thread 1-4) JBAS011601: Bound messaging object to jndi name java:/queue/test

      [Server:server-two] 19:39:16,620 INFO  [org.jboss.as.messaging] (MSC service thread 1-4)

      JBAS011601: Bound messaging object to jndi name java:jboss/exported/jms/queue/test

      [Server:server-two] 19:39:16,635 INFO  [org.jboss.as.server] (Controller Boot Thread) JBAS018559: Deployed "DbApp2.war"

      [Server:server-two] 19:39:16,636 INFO  [org.jboss.as.server] (Controller Boot Thread) JBAS018559: Deployed "sqljdbc.jar"

      [Server:server-two] 19:39:16,637 INFO  [org.jboss.as.server] (Controller Boot Thread) JBAS018559: Deployed "TestApp.war"

      [Server:server-two] 19:39:16,642 INFO  [org.jboss.as] (Controller Boot Thread) J

      BAS015874: JBoss AS 7.1.1.Final "Brontes" started in 10895ms - Started 285 of 36

      7 services (81 services are passive or on-demand)

      [Server:server-one] 19:40:31,576 INFO  [org.jboss.as.connector.subsystems.datasources]

      (MSC service thread 1-1) JBAS010400: Bound data source [java:jboss/mypool]

      [Server:server-two] 19:40:31,580 INFO  [org.jboss.as.connector.subsystems.datasources]

      (MSC service thread 1-1) JBAS010400: Bound data source [java:jboss/mypool]

      [Server:server-one] 19:51:35,091 INFO  [stdout] (http--127.0.0.1-9890-1) javax.n

      aming.NameNotFoundException: mypool -- service jboss.naming.context.java.mypool

      [Server:server-one]

      [Server:server-one] 19:51:35,096 INFO  [stdout] (http--127.0.0.1-9890-1) in doPo

      st() of errsrv

      [Server:server-one]

       

      I also test connection pool using jboss-cli.bat command

       

      C:\SamyakSoft\jboss-as-7.1.1.Final\bin>jboss-cli.bat

      JAVA_HOME is not set. Unexpected results may occur.

      Set JAVA_HOME to the directory of your local JDK to avoid this message.

      You are disconnected at the moment. Type 'connect' to connect to the server or '

      help' for the list of supported commands.

      [disconnected /] connect

      [domain@localhost:9999 /] /host=master/server=server-one/subsystem=datasources/d

      ata-source=mypool:test-connection-in-pool

      {

      "outcome" => "success",
      "result" => [true]

      }

       

      I have attached java source code in PoolSrv.java. Findout it & suggest me the where is the problem or what mistake I have done...

      thanks in advance