Fwd: [kaffe] Problem with Strings/Xml Parsing while trying to run an embedded Jetty

Rafael Teixeira monoman at gmail.com
Tue Oct 18 05:45:06 PDT 2005


Oops, forgot to reply to the list

---------- Forwarded message ----------
From: Rafael Teixeira <monoman at gmail.com>
Date: Oct 17, 2005 2:39 PM
Subject: Re: [kaffe] Problem with Strings/Xml Parsing while trying to
run an embedded Jetty
To: Ito Kazumitsu <kaz at maczuka.gcd.org>


Hi Ito and other folks,  inline

On 10/17/05, Ito Kazumitsu <kaz at maczuka.gcd.org> wrote:
> Hi,
>
> From: Rafael Teixeira <monoman at gmail.com>
> Date: Mon, 17 Oct 2005 11:28:01 -0200
>
> > I think that to make things clearer I need to post here my configure
> > parameters to be able to pinpoint why my three compilations of Kaffe
> > (1.1.5, 1.1.6 and cvs HEAD) exhibit this strange behaviour.
>
> > Is there something I should be looking for at config.log to see why
> > these compilations on Fedora Core 3, doesn't work right?
>
> I do not think seeing the configure parameters and config.log helps
> so much in this case.
>
> > On 10/15/05, Ito Kazumitsu <kaz at maczuka.gcd.org> wrote:
> > > > usr/bin/kaffe -jar ../../../java/inteligenciafiscal/inteligenciafiscal.jar
> > > > Software B\uffffsico do M\uffffdulo Fiscal de Seguran
> > > > Vers\uffffo: 01.00.00
> > >
> > > Would you please show the source code printing this text?
>
> Seeing the source code which prints "Software B\uffffsico do M\uffffdulo
> Fiscal de Seguran" will help.

The problem is that exactly the same jar file runs fine on Sun JRE
5.0, in my machine.

But alas if you want the code:

        private void _Iniciar(String[] args)
        {
                System.out.println("Software Básico do Módulo Fiscal
de Segurança");
                System.out.print("Versão: ");
                System.out.println(VersãoDesteSoftwareBásico);
...

It is on a utf-8 encoded source, edited and compiled with Eclipse 3.0
(what I think it means it is compiled with Sun's Javac).

I compile it into a fatjar(with onejar). And start with:

java -jar myfatjar.jar

or

kaffe -jar myfatjar.jar

>
> > > > Also when Jetty is trying to read the configuration xmls, DTD aren't
> > > > being correctly loaded in the sax validator:
> > > >
> > > > INFO: Version Jetty/5.1.x
> > > >
> > > > org.xml.sax.SAXParseException: Element type 'web-app' was not declared
> > >
> > > Would you please show the configuration file?  I am running Jetty 5.1.4
> > > with kaffe without problem.
>
> The configuration file here is the Jetty configuration file.
> The DTD for Jetty configuration file:
>
>    "-//Mort Bay Consulting//DTD Configure 1.2//EN"
>    "dtd/configure_1_2.dtd"
>
> does not define an element named 'web-app', so you cannot put
> a web-app element in it.
>
>

Again the same configuration files embedded in the jar run fine in
Sun's VM and Jetty gets started and runs my web-app...

The web-app not being accepted is the one in my WEB-INF/web.xml that
uses another DTD, that indeed should accept 'web-app'

<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web
Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">


I've put some diagnostic printlns inside the
gnu.xml.pipeline.ValidationConsumer.startElement method that is
raising the error, and surely it looks like the DTDs isn't being
loaded as it list of valid elements is empty at start (it adds the
offending item to the list so that it can continue to validate without
reissuing the same error for similar itens, so the list grows during
the execution).

So again looks like some other problem (I guess again with string
manipulation) may be precluding the DTDs from being parsed/loaded and
so the other errors appear.

I'm quite sure Kaffe works for many people so that's why I think mine
got configured/compiled in some twisted way.

Thanks for any clues,

--
Rafael Teixeira
---------------------------------------
I'm trying to become a "Rosh Gadol" before my own eyes.
See http://www.joelonsoftware.com/items/2004/12/06.html for enlightment.
It hurts!


--
Rafael "Monoman" Teixeira
---------------------------------------
I'm trying to become a "Rosh Gadol" before my own eyes.
See http://www.joelonsoftware.com/items/2004/12/06.html for enlightment.
It hurts!




More information about the kaffe mailing list