5 Replies Latest reply on Jun 16, 2004 9:51 AM by kirkh

    ????  How to Deploy a .War file on JBOSS ????

    nuser

      Hi All,
      I deployed an Application on Tomcat server and it is running fine.
      Now, I want to deploy the same on my newly installed JBoss server.
      I have the .war, server.xml and web.xml files with me.
      Where should I copy all these files to deploy them on JBoss Server?
      Any help is really appreciated.

      Thanks!

        • 1. Re: ????  How to Deploy a .War file on JBOSS ????
          kirkh

          If you place the .war file in the jboss/server/xx/deploy/ directory, where xx is either all, default, etc, (depending on which you are using) it should be automatically deployed.

          Make sure that your web.xml and jboss-web.xml files are in your WEB-INF directory.

          • 2. Re: ????  How to Deploy a .War file on JBOSS ????
            nuser

            thanks kirkh!

            In fact, previously I deployed it on tomcat successfully. So, can I use the same web.xml here?

            Moreover, when I placed the .war file at specified place, and tried to execute run command, it gave me one error while deploying it...

            
            14:57:02,656 ERROR [MainDeployer] could not start deployment: file:/C:/jboss-3.2
            .3/server/default/deploy/ixreg.war
             org.jboss.deployment.DeploymentException: Error during deploy; - nested throwabl
            e: (javax.naming.NamingException: resource-ref: jdbc/myoracle has no valid JNDI
            binding. Check the jboss-web/resource-ref.)
             at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:44
            0)
             at org.jboss.deployment.MainDeployer.start(MainDeployer.java:832)
             at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:642)
             at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:605)
             at sun.reflect.GeneratedMethodAccessor22.invoke(Unknown Source)
             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
            sorImpl.java:25)
             at java.lang.reflect.Method.invoke(Method.java:324)
             at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
            nDispatcher.java:284)
             at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
             at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
             at $Proxy6.deploy(Unknown Source)
             at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymen
            tScanner.java:302)
             at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentS
            canner.java:476)
             at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
            doScan(AbstractDeploymentScanner.java:201)
             at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(A
            bstractDeploymentScanner.java:274)
             at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:1
            92)
             at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
            sorImpl.java:25)
             at java.lang.reflect.Method.invoke(Method.java:324)
             at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
            nDispatcher.java:284)
             at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
             at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceControl
            ler.java:976)
             at $Proxy0.start(Unknown Source)
             at org.jboss.system.ServiceController.start(ServiceController.java:394)
             at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
            sorImpl.java:25)
             at java.lang.reflect.Method.invoke(Method.java:324)
             at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
            nDispatcher.java:284)
             at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
             at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
             at $Proxy4.start(Unknown Source)
             at org.jboss.deployment.SARDeployer.start(SARDeployer.java:226)
             at org.jboss.deployment.MainDeployer.start(MainDeployer.java:832)
             at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:642)
             at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:605)
             at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:589)
             at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
             at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
            java:39)
             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
            sorImpl.java:25)
             at java.lang.reflect.Method.invoke(Method.java:324)
             at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
            nDispatcher.java:284)
             at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
             at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
             at $Proxy5.deploy(Unknown Source)
             at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:384)
             at org.jboss.system.server.ServerImpl.start(ServerImpl.java:291)
             at org.jboss.Main.boot(Main.java:150)
             at org.jboss.Main$1.run(Main.java:395)
             at java.lang.Thread.run(Thread.java:534)
            Caused by: javax.naming.NamingException: resource-ref: jdbc/myoracle has no vali
            d JNDI binding. Check the jboss-web/resource-ref.
             at org.jboss.web.AbstractWebContainer.linkResourceRefs(AbstractWebContai
            ner.java:679)
             at org.jboss.web.AbstractWebContainer.parseWebAppDescriptors(AbstractWeb
            Container.java:592)
             at org.jboss.web.AbstractWebContainer$DescriptorParser.parseWebAppDescri
            ptors(AbstractWebContainer.java:1051)
             at org.jboss.web.tomcat.tc4.EmbeddedTomcatService.initENC(EmbeddedTomcat
            Service.java:579)
             at org.jboss.web.tomcat.tc4.EmbeddedTomcatService.createWebContext(Embed
            dedTomcatService.java:542)
             at org.jboss.web.tomcat.tc4.EmbeddedTomcatService.performDeploy(Embedded
            TomcatService.java:309)
             at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:42
            8)
             ... 48 more
            14:57:02,750 INFO [MainDeployer] Starting deployment of package: file:/C:/jboss
            -3.2.3/server/default/deploy/jmx-console.war/
            14:57:02,875 INFO [EmbeddedTomcatService] deploy, ctxPath=/jmx-console, warUrl=
            file:/C:/jboss-3.2.3/server/default/deploy/jmx-console.war/
            14:57:03,218 INFO [Engine] SingleSignOnContextConfig[/jmx-console]: Added certi
            ficates -> request attribute Valve
            14:57:03,250 WARN [EmbeddedTomcatService] Unable to invoke setDelegate on class
             loader:org.jboss.web.tomcat.tc4.WebCtxLoader$ENCLoader@1909385
            14:57:03,250 INFO [Engine] StandardManager[/jmx-console]: Seeding random number
             generator class java.security.SecureRandom
            14:57:03,250 INFO [Engine] StandardManager[/jmx-console]: Seeding of random num
            ber generator has been completed
            14:57:03,250 INFO [Engine] StandardWrapper[/jmx-console:default]: Loading conta
            iner servlet default
            14:57:03,250 INFO [Engine] StandardWrapper[/jmx-console:invoker]: Loading conta
            iner servlet invoker
            14:57:04,031 INFO [MainDeployer] Deployed package: file:/C:/jboss-3.2.3/server/
            default/deploy/jmx-console.war/
            14:57:04,046 INFO [MainDeployer] Starting deployment of package: file:/C:/jboss
            -3.2.3/server/default/deploy/management/web-console.war
            14:57:04,890 INFO [EmbeddedTomcatService] deploy, ctxPath=/web-console, warUrl=
            file:/C:/jboss-3.2.3/server/default/tmp/deploy/tmp11762web-console.war/
            14:57:05,234 INFO [Engine] SingleSignOnContextConfig[/web-console]: Added certi
            ficates -> request attribute Valve
            14:57:05,250 WARN [EmbeddedTomcatService] Unable to invoke setDelegate on class
             loader:org.jboss.web.tomcat.tc4.WebCtxLoader$ENCLoader@14c7a98
            14:57:05,250 INFO [Engine] StandardManager[/web-console]: Seeding random number
             generator class java.security.SecureRandom
            14:57:05,250 INFO [Engine] StandardManager[/web-console]: Seeding of random num
            ber generator has been completed
            14:57:05,468 INFO [Engine] StandardWrapper[/web-console:default]: Loading conta
            iner servlet default
            14:57:05,484 INFO [Engine] StandardWrapper[/web-console:invoker]: Loading conta
            iner servlet invoker
            14:57:06,296 INFO [MainDeployer] Deployed package: file:/C:/jboss-3.2.3/server/
            default/deploy/management/web-console.war
            14:57:06,312 ERROR [URLDeploymentScanner] MBeanException: Exception in MBean ope
            ration 'checkIncompleteDeployments()'
            Cause: Incomplete Deployment listing:
            Packages waiting for a deployer:
             <none>
            Incompletely deployed packages:
            [org.jboss.deployment.DeploymentInfo@d299fd1a { url=file:/C:/jboss-3.2.3/server/
            default/deploy/ixreg.war }
             deployer: org.jboss.web.tomcat.tc4.EmbeddedTomcatService@1f1680f
             status: Deployment FAILED reason: Error during deploy; - nested throwable: (ja
            vax.naming.NamingException: resource-ref: jdbc/myoracle has no valid JNDI bindin
            g. Check the jboss-web/resource-ref.)
             state: FAILED
             watch: file:/C:/jboss-3.2.3/server/default/deploy/ixreg.war
             lastDeployed: 1087336622156
             lastModified: 1087336621906
             mbeans:
            ]MBeans waiting for classes:
             <none>
            MBeans waiting for other MBeans:
             <none>
            
            14:57:06,312 INFO [URLDeploymentScanner] Started jboss.deployment:type=Deployme
            ntScanner,flavor=URL
            14:57:06,343 INFO [MainDeployer] Deployed package: file:/C:/jboss-3.2.3/server/
            default/conf/jboss-service.xml
            14:57:06,343 INFO [Server] JBoss (MX MicroKernel) [3.2.3 (build: CVSTag=JBoss_3
            _2_3 date=200311301445)] Started in 17s:140ms
            
            
            



            Here ixreg.war is the .war file. But, in some separate server config file (on tomcat) I have configured the server context-root path.
            How to set it on JBoss?

            Thanks.




            • 3. Re: ????  How to Deploy a .War file on JBOSS ????
              kirkh

              The same web.xml file should be ok, but you'll need a jboss-web.xml file there as well to configure the context and any external references that are needed (like your Oracle jdbc reference). You can lookup the format for the jboss-web.xml in the jboss/doc/dtd directory, but here's a sample snippet:

              <?xml version="1.0" encoding="UTF-8"?>
              <!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.3//EN"
              "http://www.jboss.org/j2ee/dtd/jboss-web_3_0.dtd">

              <jboss-web>

              <!-- Resource references -->
              <context-root>/</context-root>
              <resource-ref>
              <res-ref-name>jms/TCF</res-ref-name>
              <jndi-name>ConnectionFactory</jndi-name>
              </resource-ref>

              <!-- EJB References -->

              </jboss-web>

              You'll need to figure out how to add the jdbc pieces here (look at the data source sample code) in order to resolve your jdbc reference issue. Since I'm not accessing a database from my servlets, I can't give you the sample code you need.

              kirk

              • 4. Re: ????  How to Deploy a .War file on JBOSS ????
                nuser

                Hi Kirk,

                Let me try that. Meanwhile, a quick quesiton -
                what are the Equivalent files in JBoss for the conf/server.xml and conf/web.xml?

                Any clue?

                I mean, I have all my configs in these 2 files. So, what other places I need to make changes in JBoss?

                Thanks,
                Nirav

                • 5. Re: ????  How to Deploy a .War file on JBOSS ????
                  kirkh

                  I've never used Tomcat in standalone mode, so I can't tell you for sure. My guess would be that the web.xml is the same (standard), and the server.xml would be the jboss-web.xml. However, every server has its own specific setup xml files that are completely different from every other server. With that in mind, I would recommend getting the docs for JBoss and reading through the setup procedures. They are pretty simple once you get the hang of them, but the docs are marginally helpful.

                  Good luck,
                  kirk