6 Replies Latest reply on Jun 20, 2006 6:08 PM by Sirajudeen Mohamed

    Problem in deployment order

    Sirajudeen Mohamed Newbie

      Hi,
      I have web application which access the database reading the details from oracle-ds.xml. I want the oracle-ds.xml to be deployed first and the JNDI name be readily available so that when my application gets deployed, it can access it thru the JNDI name, but my app gets deployed first and so i get NameNotFound Exception when try to access that JNDI. I tried changed the deployment order in org.jboss.deployment.MainDeployer-xmbean.xml giving lower value for -ds.xml but still it doesn't work. Anybody has gone thru similar problem, pls help me out.

      Thanks
      Siraj

        • 1. Re: Problem in deployment order
          Sirajudeen Mohamed Newbie

          This is what i use in applicationContext.xml




          And my oracle-ds.xml is

          <local-tx-datasource>
          <jndi-name>CcpiDS</jndi-name>
          <connection-url>{T}db.ccpi.url{/T}</connection-url>
          <driver-class>{T}db.driver{/T}</driver-class>
          <user-name>{T}db.ccpi.user{/T}</user-name>
          {T}db.ccpi.password{/T}
          <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
          <min-pool-size>2</min-pool-size>
          <max-pool-size>5</max-pool-size>
          </local-tx-datasource>


          Also am accessing the JNDI in my ServletContextListener class.

          • 2. Re: Problem in deployment order
            Sirajudeen Mohamed Newbie

            applicationContext.xml



            • 3. Re: Problem in deployment order
              Tamir Efron Newbie

              are you sure that the problem is the order of deployment and not some other jndi configuration problem? you can try to hot deploy your application after the sever is already running...

              • 4. Re: Problem in deployment order
                Sirajudeen Mohamed Newbie

                actually i tried changing the order of deployment after i got the NameNotFoundException. I guess in default, the oracle-ds.xml will be deployed before the web app gets deployed, correct me if am wrong? If so why in my listener class it says NameNotException when i try to lookup the JNDI name(java:/CcpiDS). Pls help me out

                • 5. Re: Problem in deployment order
                  Sirajudeen Mohamed Newbie

                  This is what am using in the MainDeployer XML so that oracle-ds.xml gets deployed before the web app.


                  Also if am not looking the JNDI in my app during the startup(ie in listener), everything is fine and the server gets started and app gets deployed, and if lookup the JNDI at this stage, am able to do it. So i think definitely the problem is with the order of deployment. web app getting deployed even before oracle-ds.xml is deployed.

                  • 6. Re: Problem in deployment order
                    Sirajudeen Mohamed Newbie

                     

                    <attribute access='read-write' setMethod='setEnhancedSuffixOrder' getMethod='getEnhancedSuffixOrder'>
                     <description>Allows the override of the suffix order declared by subdeployers, using the syntax [order:]suffix
                     </description>
                     <name>EnhancedSuffixOrder</name>
                     <type>[Ljava.lang.String;</type>
                     <!--
                     Statically set one or more enhanced suffix orders, independent of the value proposed by subdeployers.
                     Some deployers may also allow the suffixes/orders to be set locally, so that's preferable too.
                     For reference, this is the list of enhanced suffixes likely to be set by deployers (it may not
                     be completely up-to-date, or there can be user-defined deployers).
                    
                     050:.deployer,050:-deployer.xml,100:.aop,100:-aop.xml,150:.sar,150:-service.xml,200:.beans,250:.rar,300:-ds.xml,350:.har,400:.jar,450:.ejb3,450:.par,500:.war,600:.wsr,650:.ear,700:.jar,750:.zip,800:.bsh,900:.last
                    
                     Until we resolve some startup issues, we'll setup some static enhanced suffix orders bellow
                     and leave the rest of the suffixes contributed dynamically by registering deployers.
                     -->
                     <descriptors>
                     <value value="100:-ds.xml,150:.sar,150:-service.xml,250:.rar,400:.jar,500:.war,650:.ear,800:.bsh,900:.last"/>
                     </descriptors>
                     </attribute>