From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9508 invoked by alias); 22 Jun 2009 11:13:56 -0000 Received: (qmail 9497 invoked by uid 22791); 22 Jun 2009 11:13:55 -0000 X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_53,ZMIde_GENERICSPAM1 X-Spam-Check-By: sourceware.org Received: from cdptpa-omtalb.mail.rr.com (HELO cdptpa-omtalb.mail.rr.com) (75.180.132.121) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 22 Jun 2009 11:13:48 +0000 Received: from [192.168.1.121] (really [75.182.92.38]) by cdptpa-omta04.mail.rr.com with ESMTP id <20090622111346428.PPRX4077@cdptpa-omta04.mail.rr.com>; Mon, 22 Jun 2009 11:13:46 +0000 Message-ID: <4A3F6769.8030203@intertwingly.net> Date: Mon, 22 Jun 2009 11:13:00 -0000 From: Sam Ruby User-Agent: Thunderbird 2.0.0.21 (X11/20090409) MIME-Version: 1.0 To: Andrew Haley CC: Mark Wielaard , java@gcc.gnu.org Subject: Re: NPE in parser->getDOMImplementation() with CNI References: <4A3D95F1.6040803@intertwingly.net> <4A3E55E1.6010705@redhat.com> <1245616012.4936.22.camel@hermans.wildebeest.org> <4A3F3EA2.5070203@redhat.com> In-Reply-To: <4A3F3EA2.5070203@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact java-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-owner@gcc.gnu.org X-SW-Source: 2009-06/txt/msg00052.txt.bz2 Andrew Haley wrote: > Mark Wielaard wrote: >> On Sun, 2009-06-21 at 16:46 +0100, Andrew Haley wrote: >>> Sam Ruby wrote: >>>> I'm trying to develop a JAXP implementation using CNI, but I get a >>>> NullPointerException when I try to get a DOMImplementation. I've >>>> attached a small script (tested on Ubuntu 9.04) which demonstrates the >>>> problem. >>>> >>>> Any help would be appreciated. >>> Congratulations on this excellent test case. Next time I want to tell >>> people how to do it right, I'll point them at your posting. >>> >>> However, I get >>> >>> $ sh ~/testdomimpl.sh >>> gnu.xml.dom.DomDocumentBuilderFactory@160ecdad >>> gnu.xml.dom.DomDocumentBuilder@15ffbc45 >>> gnu.xml.dom.DomImpl@15ef0ee5 >>> >>> gnu.xml.dom.DomDocumentBuilderFactory@2df0bea7 >>> gnu.xml.dom.DomDocumentBuilder@2de03d5f >>> gnu.xml.dom.DomImpl@2dd0bfdf >>> $ gcj --version >>> gcj (GCC) 4.4.0 20090307 (Red Hat 4.4.0-0.23) >> I get the same with that version of gcj. >> But on an older gcj installation: >> gcj (Debian 4.3.2-2) 4.3.2 >> >> gnu.xml.dom.DomDocumentBuilderFactory@6992f029 >> gnu.xml.dom.DomDocumentBuilder@647a3539 >> gnu.xml.dom.DomImpl@64826fa9 >> >> gnu.xml.dom.DomDocumentBuilderFactory@17d5dffb >> gnu.xml.dom.DomDocumentBuilder@12bcf52b >> java.lang.NullPointerException >> at java.io.PrintStream.println(PrintStream.java:473) >> >> That is somewhat strange since that method seems fine: >> public void println (Object obj) >> { >> print(obj == null ? "null" : obj.toString(), true); >> } >> >> So maybe just upgrading to a newer Fedora and gcc 4.4 will be the >> solution, although I don't completely get what goes wrong on the old >> install. > > I have no problem with 4.3 either. I think this may be an install > problem or some sort of library path problem. > > If you can point me to a failure I can debug I'll have a look. The script I provided fails with Ubuntu 9.04. The only things one needs to add to a fresh install get to the failure is: apt-get install gcj libjaxp1.3-java-gcj gcj -v reports "gcc version 4.3.3 (Ubuntu 4.3.3-5ubuntu4)" Downloading the latest Fedora-11-i686-Live.iso, the script passes after I change the gcjh line to point to /usr/share/java/jaxp_parser_impl.jar. gcj -v there reports "gcc version 4.4.0 20090506 (Red Hat 4.4.0-4) (GCC)". Testing on an older version of Ubuntu (Hardy/8.04.2) also works. Gcj -v there reports "gcc version 4.2.4 (Ubuntu 4.2.4-1ubuntu3)". > Andrew. - Sam Ruby