Announcement Announcement Module
Collapse
No announcement yet.
ROO XML issue Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • ROO XML issue

    Hi, i'm new with ROO and i'm having some troubles with the "pizzashop" example. It worked so far but when i tried to to list some item, firefox 3.5.8 shows me:

    "Error de lectura XML: mal formado
    Ubicación: http://localhost:8080/RooProject/loc...page=1&size=10
    Número de línea 6, columna 20:

    for(var i=0;i < ca.length;i++) { ..."


    So in the xml source code it seems to be an issue with a "<" simbol from the above FOR loop. I mean it's a less than, not a tag one. Is there any way to modify this file?? i don't fin it anywhere in my project...this file seems to be dinamic generated??

    This is the source code:
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <html>
    	<head>
    		<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
    		<link href="/RooProject/static/styles/standard.css" media="screen"
    			type="text/css" rel="stylesheet"></link>
    		<link href="/RooProject/resources/dijit/themes/tundra/tundra.css"
    			type="text/css" rel="stylesheet"></link>
    		<link href="/RooProject/static/images/favicon.ico" rel="SHORTCUT ICON" />
    		<script type="text/javascript">
    			function readCookie(name) {
    				var nameEQ = name + '=';
    				var ca = document.cookie.split(';');
    				for(var i=0;i < ca.length;i++) {
    					var c = ca[i];
    					while (c.charAt(0)==' ') {
    						c = c.substring(1,c.length);
    					}
    					if (c.indexOf(nameEQ) == 0) {
    						return c.substring(nameEQ.length,c.length);
    					}
    				}
    			return null;
    			}
    			var djConfig={locale:readCookie('locale')}; 
    		</script>
    		<script type="text/javascript" src="/RooProject/resources/dojo/dojo.js"></script>
    		<script type="text/javascript" src="/RooProject/resources/spring/Spring.js"></script>
    		<script type="text/javascript" src="/RooProject/resources/spring/Spring-Dojo.js"></script>
    		<script type="text/javascript" language="JavaScript">dojo.require("dojo.parser");
    		</script>
    		<title>Bienvenido a RooProject</title>
    	</head>
    	<body class="tundra spring">
    		<div id="main">
    			<div version="2.0">
    				<script type="text/javascript">dojo.require("dijit.TitlePane")</script>
    				<div id="_title">
    					<script type="text/javascript">Spring.addDecoration(new
    						Spring.ElementDecoration({elementId : '_title', widgetType :
    						'dijit.TitlePane', widgetAttrs : {title: 'Error Interno'}}));
    					</script>
    					<h2>Error Interno</h2>
    					<p>Lo sentimos, ha ocurrido un error interno.</p>
    				</div>
    			</div>
    			<div class="footer">
    				<span>
    					<a href="/RooProject/">Inicio</a>
    				</span>
    				<span>
    					| Idioma:
    					<a title="Cambiar idioma a English" href="?lang=en&page=1&size=10">
    						<img alt="Cambiar idioma a English" src="/RooProject/static/images/gb.png" />
    					</a>
    					<a title="Cambiar idioma a Deutsch" href="?lang=de&page=1&size=10">
    						<img alt="Cambiar idioma a Deutsch" src="/RooProject/static/images/de.png" />
    					</a>
    					<a title="Cambiar idioma a Svenska" href="?lang=sv&page=1&size=10">
    						<img alt="Cambiar idioma a Svenska" src="/RooProject/static/images/sv.png" />
    					</a>
    					<a title="Cambiar idioma a Espanol" href="?lang=es&page=1&size=10">
    						<img alt="Cambiar idioma a Espanol" src="/RooProject/static/images/es.png" />
    					</a>
    					<a title="Cambiar idioma a Italiano" href="?lang=it&page=1&size=10">
    						<img alt="Cambiar idioma a Italiano" src="/RooProject/static/images/it.png" />
    					</a>
    				</span>
    				<span>
    					| Tema:
    					<a title="estandarte" href="?theme=standard&page=1&size=10">estandarte</a>
    					|
    					<a title="alt" href="?theme=alt&page=1&size=10">alt</a>
    				</span>
    				<span>
    					<a title="Sponsored by SpringSource" href="http://springsource.com">
    						<img align="right" alt="Sponsored by SpringSource"
    							src="/RooProject/static/images/springsource-logo.png" />
    					</a>
    				</span>
    			</div>
    		</div>
    	</body>
    </html>
    I'm using STS 2.3.0
    and ROO 1.0.0.RC4

    Please help me, i'm working with this, thank you very much, this forum helped me a lot.

  • #2
    Is there any way to modify this file?? i don't fin it anywhere in my project...this file seems to be dinamic generated??
    That chunk of JavaScript appears in src/main/webapp/WEB-INF/layouts/default.jspx.

    Comment


    • #3
      chino_salta,

      I remember something like this happening to me. Check both your log file and your console. If you don't find any errors there, look carefully at the source of your page. I think it will be a page that reports an error, and it's the error report that actually breaks the page and causes the invalid xml.

      Comment


      • #4
        Also...wrap the cookie function in <![CDATA[]]> in your default.jspx.

        Comment


        • #5
          Originally posted by mikej View Post
          chino_salta,

          I remember something like this happening to me. Check both your log file and your console. If you don't find any errors there, look carefully at the source of your page. I think it will be a page that reports an error, and it's the error report that actually breaks the page and causes the invalid xml.
          You're absolutely right Mike, this happens every time there's a page error (e.g. a malformed JSP document or a missing translation of an i18n message code). I don't know what I was thinking pointing the poor guy to default.jspx, even though that's where the incorrectly blamed JavaScript is actually located.

          Comment


          • #6
            how do i check the log file and console??...sorry i'm a newby...

            Comment


            • #7
              If you set up logging, the log file will be specified in log4j.properties.

              Your console will depend on your development environment. If you are using Eclipse/STS, select Window->Show View->Console.

              Comment


              • #8
                mikej
                I performed a "loggign setup" in Roo shell and the log4j.properties is this:
                Code:
                #Updated at Tue Mar 02 23:21:24 GMT 2010
                #Tue Mar 02 23:21:24 GMT 2010
                log4j.appender.stdout=org.apache.log4j.ConsoleAppender
                log4j.appender.R.File=application.log
                log4j.rootLogger=info, stdout, R
                log4j.appender.R.MaxFileSize=100KB
                log4j.appender.R.layout=org.apache.log4j.PatternLayout
                log4j.appender.R.MaxBackupIndex=1
                log4j.logger.org.springframework.web=DEBUG
                log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n
                log4j.appender.stdout.layout.ConversionPattern=%d [%t] %-5p %c - %m%n
                log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
                log4j.appender.R=org.apache.log4j.RollingFileAppender
                then i run it on dm server and it says:

                HTTP Status 404 - /pizza
                type: Status report
                message: /pizza
                description: The requested resource (/pizza) is not available.

                i tried on tomcat and in the console it says:

                "org.springframework.beans.factory.NoSuchBeanDefin itionException: No bean named 'springSecurityFilterChain' is defined"

                and also "The requested resource (/pizza) is not available." on the browser.

                And i have two errors:
                1 - "classpath error: unable to find org.aspectj.lang.JoinPoint (check that aspectjrt.jar is in your classpath)"
                2 - "Unexpected exception parsing XML document from file [C:/Documents and Settings/Administrador/Documents/workspace-sts-2.3.0.RELEASE/pizza/src/main/webapp/WEB-INF/spring/webmvc-config.xml]; nested exception is org.springframework.beans.factory.NoSuchBeanDefini tionException: No bean named 'org.springframework.web.servlet.handler.SimpleUrl HandlerMapping#pizza#src/main/webapp/WEB-INF/spring/webmvc-config.xml#20' is defined"

                In the wedding example is the same, but in tomcat console i get:
                "java.lang.IllegalArgumentException: Invalid 'log4jConfigLocation' parameter: class path resource [META-INF/spring/log4j.properties] cannot be resolved to URL because it does not exist"

                I'm following step by step th documentation examples, i don't know what's happening...i tried reinstalling STS but i get the same thing...

                Comment


                • #9
                  It looks like you have made some changes in your application configs (web.xml, app contexts, etc). Make sure that you have run 'security setup' which installs the applicationContext-security.xml config and registers the springSecurityFilterChain in web.xml. Maybe you run the tutorial again from scratch.

                  Also Roo ships a sample script called 'vote.roo' which installs security by default. You could take a look there to see how those configs are different to yours at the moment.

                  HTH,
                  Stefan

                  Comment


                  • #10
                    Stefan
                    I've just executed the script vote.roo and i get the same thing starting tomcat:

                    "java.lang.IllegalArgumentException: Invalid 'log4jConfigLocation' parameter: class path resource [META-INF/spring/log4j.properties] cannot be resolved to URL because it does not exist"

                    And in the browser i get the same HTTP Status 404...

                    I didn't change any application configs...i just followed the instructions...can`t believe it isn't working...

                    Comment


                    • #11
                      and still getting:
                      "[ERROR] classpath error: unable to find org.aspectj.lang.JoinPoint (check that aspectjrt.jar is in your classpath)"

                      Comment


                      • #12
                        Managed to make it work...again.
                        Now i'm at the beggining, firefox says:

                        Error de lectura XML: mal formado
                        Ubicación: http://localhost:8080/RooProject/loc...page=1&size=10
                        Número de línea 6, columna 20:

                        for(var i=0;i < ca.length;i++) { ...
                        ^
                        _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|

                        Problems with the "<" simbol...again, this is the only problem, everything else works fine. The cookie function was wraped in <![CDATA[]]> like mikej said.

                        Oh and i'm getting the error in the webmvc-config.xml (Unexpected parsing XML...) but i remember reading that this is a bug????...

                        anyone??...anything??...please??...

                        Comment


                        • #13
                          it's me again, i've been trying to fix the "Error de lectura XML...", and i found that Internet Explorer doesn't show that thing, it shows me the Roo's "Internal Error" view...don't know anything else to do...

                          Comment


                          • #14
                            The xml error is a symptom of the way the internal error is handled. So forget about the xml error for now - you need to diagnose the internal error. As Andrews pointed out, this can be caused by a missing i18n translation, or by bad xml in a jspx file. (I notice your language is "es" - maybe there is a missing message code in messages_es.properties?)

                            I'm genuinely surprised that there is nothing reported in your log file or your Tomcat console.

                            Beyond that, unless Roo is generating a bad messages_es.properties file (it works for me), it's not a Roo issue. You'll just to debug it like you would debug any other web application.

                            Comment


                            • #15
                              chino_salta,

                              I just got that same error again this morning. If you look into your application server's log file you'll find a more detailed description of what initially went wrong!

                              For me it was a UTF-8 bug as the default.jspx is stored in UTF-8 encoding but all the other jspx files are most likely ISO-8859-1. So if you put a "special char" inside the latter ones you recieve the error message you named above. (I think it was something like "Invalid byte 1 of 1-byte UTF-8 sequence" in the log file)

                              The solution for me is to change the jspx files to UTF-8 which I did by adding the following as the second line to every file:

                              <jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/>

                              Is this the same for you?

                              Cheers
                              Alex

                              Comment

                              Working...
                              X