4 Replies Latest reply on Sep 16, 2008 8:58 AM by axismundi

    can't lookup datasource via JNDI

    axismundi

      Our webapp is deployed via context-file conf/jboss.web/localhost/app.xml

      The automatic deployment is realized thru 2 modifications in server.xml:
      <Host name="localhost" autoDeploy="true" deployOnStartup="true"

      Using this strategy, the webapp is deployed _before_ the datasource.
      Hence, the webapp cannot startup due to the missing datasource.

      What is the simplest recipe to get the datasources deployed before the war?

      Is it necessary to change the EnhancedSuffixOrder-property of the MainDeployer?

        • 1. Re: can't lookup datasource via JNDI
          jaikiran

          Any specific reason for deploying the war in this fashion? Why not just place it in the deploy folder?

          • 2. Re: can't lookup datasource via JNDI
            axismundi

            the reason is, I need to deploy the same WAR several times, but have it at a single place in the file-system. On Linux, you can create symbolic links. But on windows the only solution is to deploy the war via Context-file and have the baseDoc refer to the same (external) location in the fs.

            I was wrong, the datasource is deployed properly (before the WAR).
            However it still complains that env is not bound. (The same WAR can be deployed properly if put into the deploy-dir.)

            Even more strange, for some reason, when the WAR is deployed using myapp.xml-context, JBoss starts to scan the super-directory (jboss/server/)!

            Would it help to deploy the WAR's _after_ the server has started, using the manager app?

            • 3. Re: can't lookup datasource via JNDI
              jaikiran

              I haven't tried this type of deployment on JBoss, so don't know what the actual issue is.

              "axismundi" wrote:
              the reason is, I need to deploy the same WAR several times, but have it at a single place in the file-system. On Linux, you can create symbolic links. But on windows the only solution is to deploy the war via Context-file and have the baseDoc refer to the same (external) location in the fs.



              Won't the http://wiki.jboss.org/wiki/ExplodedDeployment help in this case? You can place the exploded war in the server/< serverName>/deploy folder and redeploy it as many times you want.

              There's another way too. You can edit the jboss-service.xml in the %JBOSS_HOME%\server\< serverName>\conf folder to specify a new location (folder) on the file system to be scanned for deployments. See this for details: http://www.jboss.com/index.html?module=bb&op=viewtopic&t=139394

              • 4. Re: can't lookup datasource via JNDI
                axismundi

                yes, thanks, I know about those strategies.

                But what I need is not concerned with redeployment. What I need is to deploy a WAR "myapp" n times from a _single_ resource, using indexed context paths:
                /myapp1
                /myapp2
                /myapp3

                all of them having the same docBase /opt/myapp

                The reason is to reduce maintanance time.