6 Replies Latest reply on Mar 17, 2003 1:04 PM by Tad Hitchcock

    Please help for Datasource not bound error

    Soemoe Aung Newbie

      I don’t know what I did was incorrect.
      Here is my setup
      Jboss-3.0.6 and tomcat 4.1
      Postgresql 7.2

      Placed the postgres-service.xml in server/default/deploy.

      Changed the parameters accordingly. (see attached file)

      Placed the pg73jdbc3.jar in server/default/lib.

      Server startup with no error.


      I have this helper class in server/default/lib.

      static Properties contextProperties;

      static {
      contextProperties = new Properties();
      contextProperties.put(Context.URL_PKG_PREFIXES,"org.jboss.naming:org.jnp.interfaces");
      contextProperties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
      contextProperties.put(Context.PROVIDER_URL, "jnp://localhost:1099");
      }


      context = new InitialContext(contextProperties);
      dataSource = (javax.sql.DataSource)context.lookup(“jdbc/DefaultDS”);

      I tried all combinations, InitialContext with or without properties without success.


      The unit test class in the xxxejb.jar which I placed in server/default/deploy and calls the above helper class.

      The attached ejb-jar.xml and jboss.xml is in that xxxejb.jar
      Please help me I am stuck here for 3 days.

      JNDIView

      java:

      DefaultDS
      org.jboss.resource.adapter.jdbc.local.LocalDataSource


      List Deployed view
      org.jboss.deployment.DeploymentInfo@57d446 { url=file:/E:/jboss-3.0.6/server/default/deploy/postgres-service.xml }
      deployer: org.jboss.deployment.SARDeployer@2f1921
      status: Deployed
      state: STARTED
      watch: file:/E:/jboss-3.0.6/server/default/deploy/postgres-service.xml
      lastDeployed: 1047330630407
      lastModified: 1047330630387
      mbeans:
      jboss.jca:service=LocalTxCM,name=DefaultDS state: Started
      jboss.jca:service=LocalTxDS,name=DefaultDS (state not available)
      jboss.jca:service=LocalTxPool,name=DefaultDS state: Started
      ]