0 Replies Latest reply on Nov 3, 2003 6:37 PM by porridge

    Does jboss.xml "resource-manager" work for CMP at all?

    porridge Newbie


      This is jboss-3.2.2.
      I'm using a PostgreSQL data source, bound to "java:/PostgresDS" by postgres-ds.xml like this:

      <local-tx-datasource>
      <jndi-name>PostgresDS</jndi-name>
      <connection-url>..blah..blah...</connection-url>
      <driver-class>org.postgresql.Driver</driver-class>
      <user-name>sbank</user-name>
      sbank
      </local-tx-datasource>

      It works just fine when I use this name direcly in jbosscmp-jdbc.xml, like this:


      java:/PostgresDS
      <datasource-mapping>PostgreSQL</datasource-mapping>



      However I would like to use something like "jdbc/SbankDS" in jbosscmp-jdbc.xml, and map it to "java:/PostgresDS" in jboss.xml like this:


      ...
      <resource-managers>
      <resource-manager>
      <res-name>jdbc/sbankDS</res-name>
      <res-jndi-name>java:/PostgresDS</res-jndi-name>
      </resource-manager>
      </resource-managers>



      However this does NOT work, it reports the following on deployment time:

      org.jboss.deployment.DeploymentException: Error: can't find data source: jdbc/SbankDS; - nested throwable: (javax.naming.NameNotFoundException: jdbc not bound)

      It doesn't seem to matter whether I use relative or absolute names.

      So the question is: does the "resource-manager" work for this at all, or is the bean provider/assembler forced to use (in jbosscmp-jdbc.xml) the name specified in foo-ds.xml (as deployed by the admin).

      Or maybe I misunderstand the roles completly? :-)

      regards

      Marcin