1 Reply Latest reply on Jan 9, 2006 7:42 PM by mandelbr0t

    Required resources not being created

    mandelbr0t

      Hello,

      I'm having difficulty deploying an application into JBoss 4.0.3SP1. I need to create a DataSource resource, and then attach a DataSourceRealm to it.

      I've done a few things without success:

      1) add the Resource and Realm globally to the server/default/deploy/jbossweb-tomcat55.sar/server.xml in the localhost Host container (with the defined Realm being the only defined Realm)

      2) created a file called Application.xml in the directory server/default/deploy/jbossweb-tomcat55.sar/conf/jboss.web/localhost with the following Context definition:

      <Context docBase="deploy/Application.war">
       <Resource ... />
       <Realm ... />
      </Context>
      


      (I also tried < Context path="/application" > with no luck. I also added the above snippet directly to server.xml above with no luck.)

      3) created the same file as META-INF/context.xml in the Application.war file.

      I can verify that the server.xml file is being read, as I can change the HTTP port that the Tomcat service listens on; however there is no sign that the DataSource is being created, or that the Realm has been created (and in fact I get warnings about roles not being defined -- which they would be if the Realm was actually reading roles from the DataSource). There's no errors or warnings either. It's like the Resource and Realm definitions are being ignored outright.

      Can anybody suggest what I may have missed? I'm deploying the application directly from Eclipse, if that matters.

      Thanks.

        • 1. Re: Required resources not being created
          mandelbr0t

          Never mind. The problem is, of course, that JBoss does not use the standard DataSourceRealm that Tomcat uses. So, the correct thing to do here is to add my DataSource to mysql-ds.xml (or whatever database you are using), add an application-policy entry to login-config.xml, and set the security-domain in jboss-web.xml. Phew!