4 Replies Latest reply on Dec 13, 2015 8:53 PM by subaochen

    Wildfly 8.2 standalone deploy war question

    jj83

      I am running wildfly 8.2 Final on window and also linux red hat.

      Trying to deploy a MyApps.war via console, it is appeared wildfly create some registry to standalone.xml and create a binary file \standalone\data\content\0a\5f694277c092efaf1ecfd9bdc59cd907e62d52\content, therefore, while it is trying to reading some xml bundle into my war, it failed.

       

      If I use eclipse, deploy from there, it is drop the exploded war into \wildfly-8.2.0.Final\standalone\deployments, and the reading my xml is OK. because it found the file that I place into web-inf\classes\MyFile.xml

       

      Please help how to deploy via console or cli and it force to drop into deployment folder just like using via Eclipse.

       

      I am so new to Wildfly, so any assist would help.

       

      Thanks

        • 1. Re: Wildfly 8.2 standalone deploy war question
          jaikiran

          What does your code to read the xml file look like?

          • 2. Re: Wildfly 8.2 standalone deploy war question
            jj83

            Hello Pai.

            I spend 3 hrs to search for solutions, it is appear wildfly generate a vfs (virtual file system) on the fly when deploy the apps. So for anyone have same issue, this is a working code that I have a slightly change to return InputStream.

             

            URL url = Thread.currentThread().getContextClassLoader().getResource(xmlLocation); (This is NOT working code, complain not found FileNotFound exception xml)

                       

            InputStream xmlStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(xmlLocation); (this is working code, return xmlStream and then I use jax-rs to post the input stream instead of using url.getPath() where it failed)

            Response response = webTarget.request().post(Entity.entity(xmlStream,MediaType.APPLICATION_XML));


            thanks

            • 3. Re: Wildfly 8.2 standalone deploy war question
              jaikiran

              Using the InputStream is the right way to deal with resources that are part of your deployment. So what you did is the correct change.

              • 4. Re: Wildfly 8.2 standalone deploy war question
                subaochen

                I also wondered why wildfly-maven-plugin deploy my war to standalone/data/content directory other than standalone/deployments ? and how to configure wildfly-maven-plugin that can deploy my war file to standalone/deployments?

                 

                Thanks in advance!