3 Replies Latest reply on Feb 3, 2017 11:01 AM by Mario Fiorentino

    WildFly EAR deployment Error "premature end of file"

    Mario Fiorentino Newbie

      Dear Jboss Developer community,

      I am writing here because I'm loosing my head trying to fix what to me seems to be a bug.

       

      I am experiencing a great problem using WildFly9.0.2.Final.

      In particular I've SOAP CXF Web Services generated starting from WSDL and schemas using wsconsume utility contained in the bin folder.

      Each "service" has been then implemented and packaged in a WAR and the complete services' set has been packaged in an EAR.

      The problem I am encountering is that the higher are the components within the EAR  more the EAR deployment fails.

       

      The error happens randomly on different wars and it says "premature end of file" or "Caused by: java.io.IOException: org.xml.sax.SAXParseException; lineNumber: 207; columnNumber: 11; The element type \"xs:annotation\" must be terminated by the matching end-tag \"</xs:annotation>\"."

       

      I've checked again my WSDLs tons of times and they are correct (in addition i do not have any annotation tag in my wsdl/schema).

      The mad thing, is that it could happen that the EAR is deployed correctly.

      I would say 90% fails, while 10%starts correctly.

       

      This is the environment: CentOS 6, java 1.8_77, standalone.xml as server configuration with no changes (the default one), wildfly9.0.2.final

       

      Do you have any idea of what could be the problem?

      Have you ever experienced such a problem?

       

      So many thanks in advance.

        • 1. Re: WildFly EAR deployment Error "premature end of file"
          jaikiran pai Master

          Please post the entire exception stacktrace and more details on how to deploy or trigger the deployment of the .ear. Also, is any IDE (like Eclipse) involved in these deployments?

          • 2. Re: WildFly EAR deployment Error "premature end of file"
            Mario Fiorentino Newbie

            Hi jaikiran,

            thanks for the fast reply.

             

            If it can help, here's my JAVA_OPT when starting the WildFly instance:

            export JAVA_OPTS="-server -Xms64m -Xmx2048m -XX:MaxPermSize=512m -XX:-UseGCOverheadLimit-Dorg.jboss.resolver.warning=true -Djava.net.preferIPv4Stack=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djboss.modules.system.pkgs=$JBOSS_MODULES_SYSTEM_PKGS-Djava.awt.headless=true -Dorg.jboss.boot.log.file=/home/sector/ENV/COTs/TOOLs/wildfly-9.0.2.Final/standalone/log/boot.log -Dlogging.configuration=file:/home/sector/ENV/COTs/TOOLs/wildfly-9.0.2.Final/standalone/configuration/logging.properties -Djboss.home.dir="$SERVERIP" -Dorg.jboss.logmanager.nocolor=false -Djboss.bind.address.management="$SERVERIP" -Dorg.apache.coyote.ajp.MAX_PACKET_SIZE=65536 -Dorg.apache.cxf.logging.enabled=true"

             

            Regarding the IDE I am using:

            Eclipse Java EE IDE for Web Developers.

            Version: Mars.2 Release (4.5.2)

            Build id: 20160218-0600

            The EAR is not deployed starting the server via Eclipse.

            The container is managed outside the development environment.

            • 3. Re: WildFly EAR deployment Error "premature end of file"
              Mario Fiorentino Newbie

              Hi all, it's me again.

               

              I was finally able to mange the bug (after 3 stressing days).

              Starting from WildFly 8 the EAR components (WAR/JAR) are deployed in parallel. Due to the fact that each WAR we realized share the same XSDS that at runtime are deployed under wildfly data folder, it happened that a concurrent read/write on the same schema file was on stage at each deploy. The SAX reader was trying to read a file that in the meanwhile was in write by another deployment. That’s why the component who failed was totally random and also the type of the message.

               

              The solution has been simply to make sequential the deployment of each of the components composing the EAR.

              This has been done by adding to the application.xml of the EAR the following property:

              <initialize-in-order>true</initialize-in-order>

               

              To automatize the process for letting maven generate this value during the EAR generation process you should add

              <initializeInOrder>true</initializeInOrder>

              to the maven-ear-plugin configuration

               

              Thank you jaikiran as well for the interest,

              All the Best,

              Mario