11 Replies Latest reply on Apr 3, 2012 7:15 AM by cat77

    How to deploy war file into Jboss 5.0

      Hi,

       

          I have application which is running properly under Tomcat 5.5 and now I want to move that application to Jboss 5.

       

         For that purpose i have deployed the war file at the location C:\jboss-5.0.0.GA\server\default\deploy

       

         Is it must to deploy .sar also for the application of Tomcat ??

       

         but when i start the jboss server, i am unable to start it and it is giving the following errors..

       

       14:41:56,281 ERROR [AbstractKernelController] Error installing to Parse: name=vfszip:/C:/jboss-5.0.0.GA/server/default/deploy/datanet.war state=Not Installed mode=Manual requiredState=Parse
      org.jboss.deployers.spi.DeploymentException: Error creating managed object for vfszip:/C:/jboss-5.0.0.GA/server/default/deploy/datanet.war ( This is My application war file)
           at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)
           at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:337)
           at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:297)
           at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:269)
           at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.deploy(AbstractParsingDeployerWithOutput.java:230)
           at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
           at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
           at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
           at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
           at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
           at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
           at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
           at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
           at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
           at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
           at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
           at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
           at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:545)
           at org.jboss.system.server.profileservice.ProfileServiceBootstrap.loadProfile(ProfileServiceBootstrap.java:304)
           at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:205)
           at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:405)
           at org.jboss.Main.boot(Main.java:209)
           at org.jboss.Main$1.run(Main.java:547)
           at java.lang.Thread.run(Unknown Source)
      Caused by: org.jboss.xb.binding.JBossXBException: Failed to parse source: Failed to start role-name: the element is not repeatable, repeatable parent expected to be a model group but got element security-role
           at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:203)
           at org.jboss.xb.binding.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:168)
           at org.jboss.deployers.vfs.spi.deployer.JBossXBDeployerHelper.parse(JBossXBDeployerHelper.java:199)
           at org.jboss.deployers.vfs.spi.deployer.JBossXBDeployerHelper.parse(JBossXBDeployerHelper.java:170)
           at org.jboss.deployers.vfs.spi.deployer.SchemaResolverDeployer.parse(SchemaResolverDeployer.java:132)
           at org.jboss.deployers.vfs.spi.deployer.SchemaResolverDeployer.parse(SchemaResolverDeployer.java:118)
           at org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer.parseAndInit(AbstractVFSParsingDeployer.java:256)
           at org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer.parse(AbstractVFSParsingDeployer.java:188)
           at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:323)
           ... 22 more
      Caused by: org.jboss.xb.binding.JBossXBRuntimeException: Failed to start role-name: the element is not repeatable, repeatable parent expected to be a model group but got element security-role
           at org.jboss.xb.binding.sunday.unmarshalling.SundayContentHandler.endRepeatableParent(SundayContentHandler.java:703)
           at org.jboss.xb.binding.sunday.unmarshalling.SundayContentHandler.startElement(SundayContentHandler.java:341)
           at org.jboss.xb.binding.parser.sax.SaxJBossXBParser$DelegatingContentHandler.startElement(SaxJBossXBParser.java:401)
           at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
           at org.apache.xerces.xinclude.XIncludeHandler.startElement(Unknown Source)
           at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source)
           at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
           at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
           at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
           at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
           at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
           at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
           at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
           at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
           at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:199)
           ... 30 more
      

       

      and at the end it is giving as:

       

      14:42:30,562 ERROR [ProfileServiceBootstrap] Failed to load profile: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
       
      *** CONTEXTS IN ERROR: Name -> Error
       
      vfszip:/C:/jboss-5.0.0.GA/server/default/deploy/datanet.war -> org.jboss.xb.binding.JBossXBRuntimeException: Failed to start role-name: the element is not repeatable, repeatable parent expected to be a model group but got element security-role
       
       
      

       

      Can anyone help me in deploying the war file in jboss or provide some pointers why this is happening in Jboss

       

      Thanks in advance

        • 1. Re: How to deploy war file into Jboss 5.0
          jaikiran
          • 2. Re: How to deploy war file into Jboss 5.0
            jaikiran

            It looks like your jboss-web.xml doesn't follow the dtd/xsd. Use a xml editor with validation support and fix that xml. By the way, i would recommend that you switch to the latest stable 5.1.0 AS which has a major bug fix from 5.0.0

            • 3. Re: How to deploy war file into Jboss 5.0

              Thank you for your reply...

               

              i would like to know what are the thing i have to add in it and where it is located in deploy folder (the file jboss-web.xml)

               

              as we i have four different files in jboss 5.0 under deploy folder

               

              1. in jmx-console.war/WEB-INF

              2. in http-invoker.sar/WEB-INF

              3. in jbossws.sar/WEB-INF

              4. in management/console...../.../WEB-INF

               

              or i have to create my own for the application and where it should be then??

              • 4. Re: How to deploy war file into Jboss 5.0
                jaikiran

                I just guessed that the file running into problem was a jboss-web.xml in your datanet.war. If you don't have that file, then check the contents of the web.xml and use a xml editor to ensure that you don't have any errors because of not following the xsd/dtd. Specifically, there's something wrong with this element in your file:

                 

                Caused by: org.jboss.xb.binding.JBossXBRuntimeException: Failed to start role-name: the element is not repeatable, repeatable parent expected to be a model group but got element security-role

                 

                P.S: It's a bit annoying that the log prints everything including the war name, but not the file in which this problem is present. I'll create a JIRA to track this.

                • 5. Re: How to deploy war file into Jboss 5.0

                  Thanks once again for your reply 

                   

                  But after changing the variable of security role in web.xml file, it is giving as new error which is now related to some context parameter and now i have to use any context parameter file as we have used in tomcat server called as context.xml file. The error is given below:

                   

                  10:39:33,437 INFO  [NativeServerConfig] JBoss Web Services - Stack Native Core
                  10:39:33,437 INFO  [NativeServerConfig] 3.0.4.SP1
                  10:39:43,500 ERROR [AbstractKernelController] Error installing to Parse: name=vfszip:/C:/jboss-5.0.0.GA/server/default/deploy/datanet.war state=Not Installed mode=Manual requiredState=Parse
                  org.jboss.deployers.spi.DeploymentException: Error creating managed object for vfszip:/C:/jboss-5.0.0.GA/server/default/deploy/datanet.war
                       at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)
                       at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:337)
                       at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:297)
                       at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:269)
                       at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.deploy(AbstractParsingDeployerWithOutput.java:230)
                       at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
                       at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
                       at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
                       at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
                       at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
                       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
                       at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
                       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
                       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
                       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
                       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
                       at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
                       at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:545)
                       at org.jboss.system.server.profileservice.ProfileServiceBootstrap.loadProfile(ProfileServiceBootstrap.java:304)
                       at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:205)
                       at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:405)
                       at org.jboss.Main.boot(Main.java:209)
                       at org.jboss.Main$1.run(Main.java:547)
                       at java.lang.Thread.run(Unknown Source)
                  Caused by: org.jboss.xb.binding.JBossXBException: Failed to parse source: The content of element type "context-param" must match "(param-name,param-value,description?)". @ vfszip:/C:/jboss-5.0.0.GA/server/default/deploy/datanet.war/WEB-INF/web.xml[160,17]
                       at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:203)
                       at org.jboss.xb.binding.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:168)
                       at org.jboss.deployers.vfs.spi.deployer.JBossXBDeployerHelper.parse(JBossXBDeployerHelper.java:199)
                       at org.jboss.deployers.vfs.spi.deployer.JBossXBDeployerHelper.parse(JBossXBDeployerHelper.java:170)
                       at org.jboss.deployers.vfs.spi.deployer.SchemaResolverDeployer.parse(SchemaResolverDeployer.java:132)
                       at org.jboss.deployers.vfs.spi.deployer.SchemaResolverDeployer.parse(SchemaResolverDeployer.java:118)
                       at org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer.parseAndInit(AbstractVFSParsingDeployer.java:256)
                       at org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer.parse(AbstractVFSParsingDeployer.java:188)
                       at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:323)
                       ... 22 more
                  Caused by: org.xml.sax.SAXException: The content of element type "context-param" must match "(param-name,param-value,description?)". @ vfszip:/C:/jboss-5.0.0.GA/server/default/deploy/datanet.war/WEB-INF/web.xml[160,17]
                       at org.jboss.xb.binding.parser.sax.SaxJBossXBParser$MetaDataErrorHandler.error(SaxJBossXBParser.java:426)
                       at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
                       at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
                       at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
                       at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
                       at org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(Unknown Source)
                       at org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(Unknown Source)
                       at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
                       at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
                       at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
                       at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
                       at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
                       at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
                       at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
                       at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
                       at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:199)
                       ... 30 more
                  10:39:50,453 INFO  [ContainerDependencyMetaData] addJndiDependency, JndiDependencyMetaData@4a3596{queue/DLQ}
                  10:39:50,562 INFO  [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@3329407{vfsfile:/C:/jboss-5.0.0.GA/server/default/deploy/jbpm/jbpm-enterprise.jar/}
                  

                   

                  If i have use the context file then where it should be stored in the jboss directory and and what should be the contents of it .

                   

                  Looking for more pointers in this regards....

                  • 6. Re: How to deploy war file into Jboss 5.0
                    wolfgangknauf

                    Hi,

                     

                    your web.xml now contains a validation error (the exception points exactly to the broken location).

                     

                    To avoid those problems in the future: use an IDE like Eclipse, which automatically validates your XML files and detect those errors.

                     

                    Best regards

                     

                    Wolfgang

                    • 7. Re: How to deploy war file into Jboss 5.0

                      Thanks for your reply

                       

                      I have been using IDE eclipse for the development purpose and it does not give any error of that kind in it.

                      but when the version of Web-app Document type is changed it is giving errors and how to find which version to use and which not to use ?

                       

                      Is there any specific version for a particular type or a common version while developing it??

                      • 8. Re: How to deploy war file into Jboss 5.0
                        wolfgangknauf

                        Hi,

                         

                        do you use core Eclipse or do you have the WebToolsPlatform plugin (or something similar like JBossIDE)? WTP will validate web.xml and will show  errors.

                         

                        About your web.xml version: I would use 2.5 in JBoss 5.0:

                         

                        {code:xml}<web-app xmlns="http://java.sun.com/xml/ns/javaee"

                           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                           xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"

                           xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"

                           version="2.5">

                        ...
                        </web-app>{code}

                         

                        (hope that wiki markup works. Last time some quotes were lost).

                         

                        Best regards

                         

                        Wolfgang

                        • 9. Re: How to deploy war file into Jboss 5.0

                          Thank you for your reply

                           

                          As i said earlier that i am using eclipse and i have the WebToolsPlatform plugin in it.

                          • 10. Re: How to deploy war file into Jboss 5.0
                            jacobrey

                            I was having a similar issue as Anand, I ended up using Eclipse and it fixed the error.  Thanks Guys

                            • 11. Re: How to deploy war file into Jboss 5.0
                              cat77

                              I had no problem deploying WAR files when they had the correct structure and were valid; that is, WEB-INF, web.xml, and all the rest. As mentioned above, the WAR goes into your JBoss's default/deploy directory, after which you need to restart the server and check the project's start page.