From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 975 invoked by alias); 21 Jun 2009 02:07:59 -0000 Received: (qmail 965 invoked by uid 22791); 21 Jun 2009 02:07:58 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00 X-Spam-Check-By: sourceware.org Received: from cdptpa-omtalb.mail.rr.com (HELO cdptpa-omtalb.mail.rr.com) (75.180.132.123) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 21 Jun 2009 02:07:50 +0000 Received: from [192.168.1.121] (really [75.182.92.38]) by cdptpa-omta04.mail.rr.com with ESMTP id <20090621020748231.RHSL4077@cdptpa-omta04.mail.rr.com> for ; Sun, 21 Jun 2009 02:07:48 +0000 Message-ID: <4A3D95F1.6040803@intertwingly.net> Date: Sun, 21 Jun 2009 02:07:00 -0000 From: Sam Ruby User-Agent: Thunderbird 2.0.0.21 (X11/20090409) MIME-Version: 1.0 To: java@gcc.gnu.org Subject: NPE in parser->getDOMImplementation() with CNI Content-Type: multipart/mixed; boundary="------------090909090103080404070706" 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/msg00047.txt.bz2 This is a multi-part message in MIME format. --------------090909090103080404070706 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 260 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. - Sam Ruby --------------090909090103080404070706 Content-Type: application/x-sh; name="testdomimpl.sh" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="testdomimpl.sh" Content-length: 1959 #!/bin/sh cat >testdomimpl.java <testdomimpl.cpp < #include #include #include #include #include #include #include using namespace java::lang; using namespace javax::xml::parsers; int main(int argc, char** argv) { JvCreateJavaVM(NULL); JvAttachCurrentThread(NULL, NULL); JvInitClass(&System::class$); JvInitClass(&DocumentBuilderFactory::class$); DocumentBuilderFactory *factory = DocumentBuilderFactory::newInstance(); System::out->println(factory); try { DocumentBuilder *parser = factory->newDocumentBuilder(); System::out->println(parser); if (parser->getDOMImplementation()) { System::out->println(parser->getDOMImplementation()); } } catch (java::lang::Throwable *ex) { ex->printStackTrace(); } return 0; } EOF echo g++ -c -Iheaders -o testdomimpl.o testdomimpl.cpp gcj -o testdomimpl2 testdomimpl.o ./testdomimpl2 --------------090909090103080404070706--