[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: RE: LuaJava and JAXP
- From: "Joao Machado" <joaocm2@...>
- Date: Thu, 19 Feb 2004 15:18:41 -0300
Hi,
This is a Java reflection problem. If you call this method by
reflection, even directly in Java, you get the same error.
This google cached page shows it :
http://216.239.51.104/search?q=cache:UHFpr_aInjEJ:forum.java.sun.com/thr
ead.jsp%3Fforum%3D34%26thread%3D482916%26tstart%3D0%26trange%3D15+crimso
n.tree.ParentNode&hl=pt&ie=UTF-8
I don't know exactly what causes it.
I have tried the same code with Xerces and GNUJAXP. With GNUJAXP I got
the same error, but in another method.
With Xerces it worked as expected.
So, I think that is a Java reflection problem and a specific
implementation problem (with crimson and GNUJAXP), and not a LuaJava
issue.
Regards,
João Machado
Tecnologia
Ideais
Tel.: 55 21 3114-1794
Cel.: 55 21 8124-3531
joaocm@ideais.com.br
http://www.ideais.com.br
> -----Original Message-----
> From: lua-bounces@bazar2.conectiva.com.br
> [mailto:lua-bounces@bazar2.conectiva.com.br] On Behalf Of
> Martin Kendall
> Sent: quarta-feira, 18 de fevereiro de 2004 08:21
> To: lua@bazar2.conectiva.com.br
> Subject: LuaJava and JAXP
>
>
> Hello,
>
>
>
> I was very excited to see LuaJava - A very good way to have
> the power and beauty of Lua combined with libraries and
> ubiquity of Java.
>
>
>
> I thought I would try a short program to see how it operated:
>
>
>
> documentBuilderFactory =
> luajava.bindClass("javax.xml.parsers.DocumentBuilderFactory")
>
> factory = documentBuilderFactory:newInstance()
>
> builder = factory:newDocumentBuilder()
>
> document = builder:parse("labels.xml")
>
> root = document:getDocumentElement()
>
> print(root:toString())
>
>
>
> This worked beautifully (I'm using Java 1.4.1 on Windows XP)
> with the file
> labels.xml:
>
> <?xml version="1.0" encoding="iso-8859-1"?>
>
> <labels>
>
> <label added="2003-06-20">
>
> <quote>
>
> <!-- Mixed content -->
>
> <emph>Midwinter Spring</emph> is its own season…
>
> </quote>
>
> <name>Thomas Eliot</name>
>
> <address>
>
> <street>3 Prufrock Lane</street>
>
> <city>Stamford</city>
>
> <state>CT</state>
>
> </address>
>
> </label>
>
> <label added="2003-06-10">
>
> <name>Ezra Pound</name>
>
> <address>
>
> <street>45 Usura Place</street>
>
> <city>Hailey</city>
>
> <state>ID</state>
>
> </address>
>
> </label>
>
> </labels>
>
>
>
> However, when I added the following line to the program:
>
> nodelist = root:getElementsByTagName("label")
>
>
>
> I get this error:
>
> xmltest.lua:7: Class luajava.LuaJavaAPI can not access a
> member of class org.apache.crimson.tree.ParentNode with
> modifiers "public"
>
> luajava.LuaException: Error on file xmltest.lua
>
> at luajava.Console.main(Console.java:24)
>
>
>
> I would really appreciate it if anyone could tell me what I
> am doing wrong.
>
>
>
> Thanks,
>
>
>
> Martin
>
>
>
>
>
> Esta mensagem foi verificada pelo E-mail Protegido Terra.
> Scan engine: VirusScan / Atualizado em 17/02/2004 / Versão:
> 1.4.1 Proteja o seu e-mail Terra:
> http://www.emailprotegido.terra.com.br/
>
> ---
> Incoming mail is
> certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.574 / Virus Database: 364 - Release Date: 29/01/2004
>
>
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.574 / Virus Database: 364 - Release Date: 29/01/2004