2 Replies Latest reply on Feb 7, 2007 12:52 AM by katomi

    unpacked WAR access to datasource - not found

    fbadt

      jboss 4.04

      Installed XWiki as an inpacked WAR in the server/deploy directory.

      The web.xml has the following entry:
      <resource-ref>
      DB Connection
      <res-ref-name>java:jdbc/XWikiDS</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
      </resource-ref>

      What needs to be in what config file for the datasource to be found? I would prefer to use a WAR related config for this; however have tried the jboss-ds.xml and also failed to have the JNDI name found.

      org.jboss.deployment.DeploymentException: Error during deploy; - nested throwable: (javax.naming.NamingException: resource-ref: java:jdbc/XWikiDS has no valid JNDI binding. Check the jboss-web/resource-ref.)

      resource-ref is not in the filesystem

        • 1. Re: unpacked WAR access to datasource - not found
          peterj

          What is in your jboss-ds.xml file? You should have something like this:

          <datasources>
           <local-tx-datasource>
           <jndi-name>jdbc/XWikiDS</jndi-name>
           . . .
           </local-tx-datasource>
          </datasource>


          You might also have to add a WEB-INF/jboss-web.xml file to the xwiki war file:

          <jboss-web>
           <resource-ref>
           <res-ref-name>jdbc/XWikiDS</res-ref-name>
           <jndi-name>java:jdbc/XWikiDS</jndi-name>
           </resource-ref>
          </jboss-web>



          • 2. Re: unpacked WAR access to datasource - not found
            katomi

            I got the same error, and after commenting the <resource-ref> out in the web.xml file I got another error. I didn't copy the error but it referenced the Log4j.jar file. I moved the [jboss-server-dir]\xwiki.war\WEB-INF\lib\log4j-1.2.13.jar file into another directory. There are probably other jar files that can be moved (deleted) so the jar files that ship with jboss are used.

            After I got rid of the Log4j parse error I added in the jboss-web.xml file as PeterJ suggested with the modification "<jndi-name>java:/XWikiDS</jndi-name>" -- I removed the "jndi" after the colon.

            After that it ran -- with other errors, but I managed to log in using "admin" and "admin" then importing the .xar example file. It's running -- for now. I'll be checking it out more later.