1 Reply Latest reply on Jul 15, 2009 11:47 AM by Peter Johnson

    Problem with JBoss and DataSource

    Gabriel Correa Newbie


      I've a problem. i'm developing an application with Google Web Toolkit run on server JBoss 4.2.2. I'm using a DataSource, and it´s good. The problem is that i modify the file web.xml to add the datasource:

      <?xml version="1.0" encoding="UTF-8"?>
      <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

      Conecta con la BD oracle


      the lines in bold are new. If i remove this lines, the aplication runs, but if i put it, the server don't executes the aplication. This is wrong??

      Help and Thanks

        • 1. Re: Problem with JBoss and DataSource
          Peter Johnson Master

          The issue is that once you place a resource-ref into web.xml, then the app expects to find the resource in the local naming context (java:/comp/env/portalDS). But you need to tell JBoss AS to map the name back to the java: namespace. To do that, place an entry for the datasource in WEB-INF/jboss-web.xml:


          Also, please use 'code' tags around your XML text - select the text and click the Code button above the editor window.