Hi Vadim,

On Thu, 5 Jul 2001, Vadim Gritsenko wrote:

> Done. 
> 
> Marcus, would you mind testing it one more time?
        
        No problem. We'll get there eventually! :-)

ERROR   14921   [cocoon  ] (Thread-25): Error compiling sitemap
java.util.NoSuchElementException
        at java.util.StringTokenizer.nextToken(StringTokenizer.java:235)
        at 
org.apache.cocoon.components.language.programming.java.Jikes.parseError(Jikes.java:201)
        at 
org.apache.cocoon.components.language.programming.java.Jikes.parseStream(Jikes.java:189)
        at 
org.apache.cocoon.components.language.programming.java.AbstractJavaCompiler.getErrors(AbstractJavaCompiler.java:114)
        at 
org.apache.cocoon.components.language.programming.java.JavaLanguage.compile(JavaLanguage.java:191)
        at 
org.apache.cocoon.components.language.programming.CompiledProgrammingLanguage.load(CompiledProgrammingLanguage.java:131)

        From my observations, I think the problem lies in fact that 'line' is
        not set to null, when encountering the end of the first message.

        This causes the first readline to be skipped, on my system pushing
        an empty (non-null) string onto the buffer. The second set of readlines
        immediately breaks because it actually reads the first line of the
        next error, not the rest of the error (which contain leading spaces).

        This results in parseError being called with an empty string - and
        hence causing the exception above.

        I had explicitly set 'line' to null so the first readline would always
        be executed (check the attached patch).

        I also noticed that parseError does not build a complete error message
        on my system as nextToken() is only called once (delimited by newline).
        I've also added a test and loop to get all of the message in the
        attached patch.

        Could it be that jikes is behaving differently between our systems ?
        Sounds like it.

        I've also attached how my logfile, to compare against how it looks
        against your system.

        Hope that helps.

        Cheers,

        Marcus
        
-- 
        .....
     ,,$$$$$$$$$,      Marcus Crafter
    ;$'      '$$$$:    Computer Systems Engineer
    $:         $$$$:   Open Software Associates GmbH
     $       o_)$$$:   82-84 Mainzer Landstrasse
     ;$,    _/\ &&:'   60327 Frankfurt Germany
       '     /( &&&
           \_&&&&'     Email : [EMAIL PROTECTED]
          &&&&.        Business Hours : +49 69 9757 200
    &&&&&&&:           After Hours    : +49 69 49086750
Index: Jikes.java
===================================================================
RCS file: 
/home/cvspublic/xml-cocoon2/src/org/apache/cocoon/components/language/programming/java/Jikes.java,v

retrieving revision 1.3
diff -u -r1.3 Jikes.java
--- Jikes.java  2001/07/05 01:15:46     1.3
+++ Jikes.java  2001/07/05 16:58:28
@@ -177,9 +177,12 @@
             while (true) {
                 line = input.readLine();
                 if (line == null || line.length() == 0 || line.charAt(0) != ' ')
+                {
+                    line = null;
                     break;
-                buffer.append(line);
+                }
                 buffer.append('\n');
+                buffer.append(line);
             }
 
             // if error is found create the vector
@@ -221,6 +224,11 @@
         if ("".equals(message)) {
             type = tokens.nextToken().trim().toLowerCase();
             message = tokens.nextToken("\n").substring(1).trim();
+
+        if (tokens.hasMoreTokens()) {
+           message += "\n";
+            while (tokens.hasMoreTokens())
+                message += tokens.nextToken() + "\n";
         }
 
         return new CompilerError(file, type.equals("error"), startline, startcolumn, 
endline, endcolumn, message);

cocoon.log.gz

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to