Topic
15 replies Latest Post - ‏2012-12-12T19:37:13Z by SystemAdmin
NyRVA
NyRVA
57 Posts
ACCEPTED ANSWER

Pinned topic WAR file generation: Multiple root elements detected

‏2009-05-28T16:23:30Z |
Every once in a while I get the following error while trying to generate a portlet WAR file in WPF.

An error occurred during deployment: C:\workspace\WPF612\ProjectName\WebContent\projectDeploy.xml:22: The following error occurred while executing this line:
C:\IBM\WPF612\Designer\FeatureSets\Web-App_6.1.2\Deployment\antscripts\deployment.xml:28: The following error occurred while executing this line:
C:\IBM\WPF612\Designer\FeatureSets\Web-App_6.1.2\Deployment\antscripts\publish\WebSphere.xml:15: The following error occurred while executing this line:
C:\workspace\WPF612\ProjectName\.deployment\portletwar.xml:175: org.jdom.JDOMException: Error in building: Ill-formed XML document (multiple root elements detected) ProjectName Unknown WebApp Error

The only way of recovery from this seems to be to remove the project from the work space, create a new one with the same name, copy that to some other location, import the project from SVN again, copy the "empty" project over the imported one, and then refresh, rebuild, clean etc. until it starts working.

Any ideas on what causes this?
Updated on 2012-12-12T19:37:13Z at 2012-12-12T19:37:13Z by SystemAdmin
  • mburati
    mburati
    2544 Posts
    ACCEPTED ANSWER

    Re: WAR file generation: Multiple root elements detected

    ‏2009-05-28T17:15:53Z  in response to NyRVA
    I've never heard of that happening and am not sure what causes it, but having to recreate the project doesn't seem necessary.

    If it happens again, I suggest contacting customer support right away so they can help you diagnose what's causing it and which file(s) are getting corrupted that is causing that error. The first file I would check is the portlet.xml template under your project's WEN-INF/bin/deployment folder to make sure that hasn't been corrupted somehow.

    ..mb1
    • NyRVA
      NyRVA
      57 Posts
      ACCEPTED ANSWER

      Re: WAR file generation: Multiple root elements detected

      ‏2009-06-02T14:54:00Z  in response to mburati
      It happened to me again, but now I found a faster way of solving it.

      First I looked at the WEB-INF/bin folder and concluded that all files were the same as when I started the new project. So nothing corrupted there.

      Then I realized I could try to generate a JSR168 WAR instead of a 286 one. Did that, worked fine.

      Then when I switched back to the JSR286 WAR, it was generating fine again as well. I'm using two different deployment configs for either case, so it's not like that one was corrupted.

      Hope that helps to track things down a bit for a techie on your side of the fence. =)
      • mburati
        mburati
        2544 Posts
        ACCEPTED ANSWER

        Re: WAR file generation: Multiple root elements detected

        ‏2009-06-02T15:07:41Z  in response to NyRVA
        There's still nobody here that's seen that or can reproduce that afaik.

        If it happens again, please check WEB-INF/portlet.xml and WEB-INF/bin/deployment/portlet_base.standard286 files to make sure they look reasonable.

        ..mb1
        • NyRVA
          NyRVA
          57 Posts
          ACCEPTED ANSWER

          Re: WAR file generation: Multiple root elements detected

          ‏2009-06-02T16:53:41Z  in response to mburati
          Actually I was checking portlet.xml in WEB-INF to make sure it was going alright. That was the one that got badly generated. It would not have any portlets in it. I'm sure it's going to happen again sooner or later, then I shall provide those files. But like I said, nothing in the WEB-INF/bin folder seems to be changing.
          • mburati
            mburati
            2544 Posts
            ACCEPTED ANSWER

            Re: WAR file generation: Multiple root elements detected

            ‏2009-06-02T17:44:22Z  in response to NyRVA
            In that case, I recommend making a zip archive of your entire project and contacting customer support to help diagnose what's wrong with it, when it gets into that state again, so you won't have to keep working around it. This really shouldn't be happening (and isn't happening to others that I know of) so having support help resolve it could help save you and possibly others a fair bit of time in the long run...

            ..mb1
  • TomNBS
    TomNBS
    1 Post
    ACCEPTED ANSWER

    Re: WAR file generation: Multiple root elements detected

    ‏2009-10-25T16:11:50Z  in response to NyRVA
    I also received this error. I've packaged up the project and will send it in. However, I need to move on, so will recreate another project and put the model into it.

    -Tom
    • NyRVA
      NyRVA
      57 Posts
      ACCEPTED ANSWER

      Re: WAR file generation: Multiple root elements detected

      ‏2009-10-26T16:26:32Z  in response to TomNBS
      I suspect that it may have something to do with Subclipse, although my other projects don't seem to have the same problem. It just seems to break more easily when I am doing certain things with Subclipse like committing the project files (in the root) or reverting or cleaning up.

      The easiest way of solving this problem (until it occurs again) has been the following:
      • Submit all changes to SVN
      • Remove project from workspace
      • Restart WPF
      • Create new project with same name and same feature sets
      • Close project
      • Check project out from SVN "over" the newly created version
      • Open project and refresh

      I've noticed that when you re-open the project, the building of the work space takes a long time; something like 10 minutes. But after that it is working again.

      I've also tried building a production WAR instead of a development WAR when this problem starts occurring, but the same thing happens in the production WAR.
      • SystemAdmin
        SystemAdmin
        9029 Posts
        ACCEPTED ANSWER

        Re: WAR file generation: Multiple root elements detected

        ‏2012-12-05T21:07:41Z  in response to NyRVA
        Hi, I'm getting the exact same issue on a Portlet that's currently in production.

        I performed a couple of modifications on it and it was working without problems,
        but today it just decided to fail on me.

        Now I've been able to successfully delete the project and copy all of the objects
        into the project to get it up and running again, but after a couple of deployments
        it fails again.

        Has anyone been able to pinpoint the solution?

        Thank you,
        • kevintap
          kevintap
          742 Posts
          ACCEPTED ANSWER

          Re: WAR file generation: Multiple root elements detected

          ‏2012-12-05T21:25:08Z  in response to SystemAdmin
          hi Juan,

          Can you provide the exact error messages (and stack traces) for any errors that you're getting? You should look in the WebContent/WEB-INF/logs directory of your project (in your Eclipse workspace) and see if there are any errors in the logs there. Also, Eclipse may log some errors, so you might benefit from running Eclipse with the -debug -consolelog command line options.

          We'll also need to know what version of WEF you're running - I assume (hope) that you're on something newer than 6.1.2 that this problem was originally reported on.

          As the thread previously suggested, check your portlet.xml and the portlet.xml template file under WEB-INF/bin/deployment for any signs of corruption.

          Also, another relevant question here: are you using SVN or some other source control as the original poster mentioned? Is it possible that the source control somehow placed a lock or readonly flag on one or more of your files (portlet.xml), preventing them from being updated during the publish process?

          The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM.
          • SystemAdmin
            SystemAdmin
            9029 Posts
            ACCEPTED ANSWER

            Re: WAR file generation: Multiple root elements detected

            ‏2012-12-05T22:00:09Z  in response to kevintap
            Hi Kevin,

            Right now I just finished recreating the project so I don't have anything in the logs as of this moment, but I'll turn on those flags that you mentioned, so that I can post back here the exact stack trace I get.

            Now the error that I do have is the following:
            C:\Users\jcmoreno\RTC_WPF_Workspace_612\UnivPortal_PA_E_VisitReg\WebContent\projectDeploy.xml:22: The following error occurred while executing this line:
            c:\Program Files\ibm\WPF\WPF 612\Designer\FeatureSets\Web-App_6.1.2\Deployment\antscripts\deployment.xml:28: The following error occurred while executing this line:
            c:\Program Files\ibm\WPF\WPF 612\Designer\FeatureSets\Web-App_6.1.2\Deployment\antscripts\publish\WebSphere.xml:15: The following error occurred while executing this line:
            C:\Users\jcmoreno\RTC_WPF_Workspace_612\UnivPortal_PA_E_VisitReg\.deployment\portletwar.xml:175: org.jdom.JDOMException: Error in building: Ill-formed XML document (multiple root elements detected) ProjectName Unknown WebApp Error

            Now the portletwar.xml doesn't show anything odd.

            
            <JavaStandardPortletXML rootDirectory=
            "${webcontent.location}/WEB-INF" includeNonPortletModels=
            "false" templateFile=
            "${webcontent.location}/WEB-INF/bin/deployment/portlet_base.standard286" outputFile=
            "${webcontent.location}/WEB-INF/portlet.xml" uniqueSuffix=
            "${project.name}" *onWebSphere=
            "${isJSR4WP}">* _(175th line)_   <fileset> <include name=
            "**/*.model" /> <exclude name=
            "**/portletbase/*.model" /> <exclude name=
            "**/wizardbase/*.model" /> </fileset> </JavaStandardPortletXML>
            


            Since this is a maintenance on an existing application I'm actually working on Version: 6.1.2.2 Build id: 200907161144. (I have all versions from 6.1.2 to 8 installed). I once tried to migrate it into 6.1.5, but bugs started appearing on the portlet, and it was a time sensitive project so I rolled it back and kept it on 6.1.2.

            The portlet_base.standard286 Looks fine.

            At the moment I'm not connected to any source control, because the version of exclipse in this portlet factory was below the required version for our source control (Rational Team Concert). What I do is that a create a copy on the project; which is imported into RAD's workspace and deliver everything from there. So no source control is marking file as read only in my project.

            As soon as I get the same problem again I'll post back more details.

            Thank you,
          • SystemAdmin
            SystemAdmin
            9029 Posts
            ACCEPTED ANSWER

            Re: WAR file generation: Multiple root elements detected

            ‏2012-12-06T21:26:35Z  in response to kevintap
            Hi Kevin,

            I think that I have found the solution to this bug.

            I had modified the log4.properties file to utilize Rolling console appenders,
            because our production logs were getting too big (see attachment).

            And after putting back the original logger configuration the bug seems to
            have gone away.

            Thank you for your help.
            • SystemAdmin
              SystemAdmin
              9029 Posts
              ACCEPTED ANSWER

              Re: WAR file generation: Multiple root elements detected

              ‏2012-12-06T21:28:19Z  in response to SystemAdmin
              Oh and if you see anything odd in my custom logger configuration
              please don't hesitate to point it out.

              Thank you,
              • kevintap
                kevintap
                742 Posts
                ACCEPTED ANSWER

                Re: WAR file generation: Multiple root elements detected

                ‏2012-12-07T15:46:05Z  in response to SystemAdmin
                Hi Juan,

                I really can't explain why changing your log4j.properties file would cause any problems with the WAR file generation to go away. That doesn't really make much sense to me. The error during the WAR file generation is describing a problem parsing an XML file, likely the template for portlet.xml.

                I don't notice anything necessarily wrong with your log4j.properties file, however, it does concern me that you have the DEBUG and ALL levels enabled for all loggers in this configuration file in a production environment. This will cause a significant performance overhead on your portal server.
                The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM.
                • SystemAdmin
                  SystemAdmin
                  9029 Posts
                  ACCEPTED ANSWER

                  Re: WAR file generation: Multiple root elements detected

                  ‏2012-12-07T20:35:32Z  in response to kevintap
                  Yeah I doesn't really make much sense to me either, but I hadn't happened before, and it hasn't happened since (for now).

                  Oh yeah and it says prod, but I'll be tweaking the debug level before actual production deployment. The name it's just there to remind me that I have to used a different file one I deploy to production.
                  • SystemAdmin
                    SystemAdmin
                    9029 Posts
                    ACCEPTED ANSWER

                    Re: WAR file generation: Multiple root elements detected

                    ‏2012-12-12T19:37:13Z  in response to SystemAdmin
                    Never mind My previous comments about the logger it was just a coincidence.
                    It seams to be a resources issue. If I close everything in my computer I can
                    generate the war. I'm also able to generate a war If I close some of the
                    heaviest models.

                    Good luck to everyone else.