1 2 Previous Next 18 Replies Latest reply on Jul 13, 2009 8:39 AM by nico

    XML Parsing Error

    nathandennis

      working with seam 2.0.2.sp1 and jboss 4.2.2.ga.


      i am getting a sporadic xml parsing error. i can see no way to predict when or where this will happened. it has happened at least once on almost all my pages.


      XML Parsing Error: mismatched tag. Expected: </head>.
      Location: http://192.168.100.47:8080/foo/foo/profilelist.dcg?mid=90&from=memorial+list+workspace&fromURL=%2Fepigraph%2Fepilist.xhtml&conversationPropagation=end&cid=137
      Line Number 16, Column 3:</head>
      --^
      



      seems like it would be real simple to fix but.. here is the header.


      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
                            "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml"
            xmlns:ui="http://java.sun.com/jsf/facelets"
            xmlns:h="http://java.sun.com/jsf/html"
            xmlns:f="http://java.sun.com/jsf/core"
            xmlns:s="http://jboss.com/products/seam/taglib">
      <head>    
          <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
         <title>Project</title>
      <script language="JavaScript1.2" type="text/javascript" src="#{facesContext.externalContext.requestContextPath}/js/mm_css_menu.js"></script>
      <script language="JavaScript1.2" type="text/javascript" src="#{facesContext.externalContext.requestContextPath}/js/mm_navbar_cache.js"></script>
      <link href="#{facesContext.externalContext.requestContextPath}/stylesheet/merge.css" rel="stylesheet" type="text/css" />
      <s:remote include="httpSessionChecker"/>
      <script language="JavaScript1.2" type="text/javascript" src="#{facesContext.externalContext.requestContextPath}/js/timeout.js"></script>
      </head>
      <body onload="MM_preloadImages('#{facesContext.externalContext.requestContextPath}/img/mainImages/homeBtn_f2.jpg','#{facesContext.externalContext.requestContextPath}/img/mainImages/homeBtn_f3.jpg','#{facesContext.externalContext.requestContextPath}/img/mainImages/prodBtn_f2.jpg','#{facesContext.externalContext.requestContextPath}/img/mainImages/prodBtn_f3.jpg','#{facesContext.externalContext.requestContextPath}/img/mainImages/howBtn_f2.jpg','#{facesContext.externalContext.requestContextPath}/img/mainImages/howBtn_f3.jpg','#{facesContext.externalContext.requestContextPath}/img/mainImages/memberBtn_f2.jpg','mainImages/memberBtn_f3.jpg','#{facesContext.externalContext.requestContextPath}/img/mainImages/faq.php_f2.jpg','#{facesContext.externalContext.requestContextPath}/img/mainImages/faq.php_f3.jpg','#{facesContext.externalContext.requestContextPath}/img/mainImages/newsBtn_f2.jpg','#{facesContext.externalContext.requestContextPath}/img/mainImages/newsBtn_f3.jpg','#{facesContext.externalContext.requestContextPath}/img/mainImages/contactBtn_f2.jpg');">
      
      <div id="secondaryNavWrapper">
           <div id="topSpacer"></div>
                      <div id="mainWrapper">
      
                      <ui:insert name="body"/>
              
              </div>
              
              <ui:include src="footer.xhtml"></ui:include>
              
      </div>
      <script type="text/javascript">startSessionTimeoutCheck();</script>
      </body>
      </html>
      



      any ideas???

        • 1. Re: XML Parsing Error
          nathandennis

          this seems to be more frequent on jdk1.5 than jdk 1.6..

          • 2. Re: XML Parsing Error
            nathandennis

            bump.. any ideas???

            • 3. Re: XML Parsing Error
              nathandennis

              also in seam 2.1.0.sp1



              any clues would be very helpful.

              • 4. Re: XML Parsing Error
                nathandennis

                a discussion of a similar problem here
                https://software.cnx.rice.edu/trac/rhaptos/ticket/3944


                would changing


                <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
                


                to


                <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
                


                fix this problem????

                • 5. Re: XML Parsing Error
                  nathandennis

                  how about a comment to confirm this or something??? come one seams guys... this thread is two months old with no input.

                  • 6. Re: XML Parsing Error
                    norman

                    Maybe someone would respond if you actually provided some details or some way to reproduce the problem.  I've never seen the problem, and since nobody else is popping in here saying they have seen this problem, my guess is it's something specific to your app.


                    I'd guess that maybe something strange is happening on certain requests and maybe the whole document isn't being rendered?  Have you tried looking at the server response to see?  Did you check the logs for anything unusual? 


                    Good luck tracking down your problem.  If you get something more concrete and post the details, I'm sure someone will be able to help you out.  But, we can't remote debug your app for you.

                    • 7. Re: XML Parsing Error
                      swd847

                      try using a



                      <f:view contentType="text/html"/>



                      • 8. Re: XML Parsing Error
                        nathandennis

                        thanks for the response stuart. do you mean surround the content of the header section with this? i have used this in other places where the xhtml validated. example... rewriting a layer to included a flash movie using swfoject.


                        norman... as i said before this happens sporadically. there is nothing in the logs that isnt already shown in the above error. hit f5 and it renders correctly. i have no doubt that it is something with this app... but unfortunately i have a completely separate app with the same thing happening. two different versions of seam.  i coded both of them almost identically. if i could recreate the problem consistently and isolate it i wouldnt have requested help.


                        stuart,, do you think this might be caused by the upper case within the content field of the meta tag? at other times with the same header the parse would break on that line according to the error message.

                        • 9. Re: XML Parsing Error
                          rgorosito

                          We have the same problem (seamonkey, but not with firefox 3). The problem start today when we update Richfaces 3.3.0.GA). Rollbacking to seam's version (2.1.1.GA) appear to solve the problem. Because it is sporadic, can't be 100% sure about it

                          • 10. Re: XML Parsing Error
                            repadit

                            I've same problem. But I require Richfaces 3.3.0.GA... I've no Seam only simple tomcat...

                            • 11. Re: XML Parsing Error
                              nathandennis

                              use Stuart's suggestion... it seems to works.

                              • 12. Re: XML Parsing Error
                                swd847

                                If you want to get a proper solution post the generated html next time you get this error. Firefox is really strict with text/xhtml pages, if you have 1 unescaped special character it can just refuse to display the page.

                                • 13. Re: XML Parsing Error
                                  swd847

                                  I just realised that no one had pointed this out explicitly yet.
                                  That error message is a firefox error message that occurs when an xhtml page is not well formed, if you are windows it will probably work in ie. Changing the doucment type makes firefox a lot less strict, which is the easiest solution.

                                  • 14. Re: XML Parsing Error
                                    repadit
                                    1 2 Previous Next