Return-Path: Delivered-To: apmail-jackrabbit-users-archive@locus.apache.org Received: (qmail 57976 invoked from network); 18 Nov 2008 15:10:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 18 Nov 2008 15:10:37 -0000 Received: (qmail 91543 invoked by uid 500); 18 Nov 2008 15:10:43 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 91529 invoked by uid 500); 18 Nov 2008 15:10:43 -0000 Mailing-List: contact users-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@jackrabbit.apache.org Delivered-To: mailing list users@jackrabbit.apache.org Received: (qmail 91518 invoked by uid 99); 18 Nov 2008 15:10:43 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Nov 2008 07:10:43 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of alessandro.bologna@gmail.com designates 209.85.221.18 as permitted sender) Received: from [209.85.221.18] (HELO mail-qy0-f18.google.com) (209.85.221.18) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Nov 2008 15:09:18 +0000 Received: by qyk11 with SMTP id 11so931963qyk.19 for ; Tue, 18 Nov 2008 07:09:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=VyhODZwqEiHX09bDwKV0kWp7W0Z4ehFdiGGZmQDQRMM=; b=ODq7yYR2TYxTH7ToJEiAyRq8L780aI0x+kuTvmQVf/VmGCqBiOJkVA4mkeaHMsINKQ gX0YegF2LH/ZGXxMdMLqtiyA+tZBMmANMPwMytuQIThFQehLHhFOpSV8ZtohCi7ka3RG j4xccr0hkQ54wF10bdh1VzACueGJWLMcpmPAQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=tVMWgLx3l8DwxZ8X8CW1M8rFVKSUX2XenFZMmxElM+iuUzAdurg+aKeXZqNIwT1xDR Zsb/xng8ayKx1AiXIxwm6sf+e8M6TcvGH5WO0CPxV9Fj+DQauwpfohTRPx1dmw5UnTd4 OdZQzWPZje8+04FLjlrfD3QVcw9jfZvLppnCo= Received: by 10.214.243.13 with SMTP id q13mr3962447qah.34.1227020941039; Tue, 18 Nov 2008 07:09:01 -0800 (PST) Received: from ?192.168.128.105? (cpe-69-203-109-251.nyc.res.rr.com [69.203.109.251]) by mx.google.com with ESMTPS id 26sm1756568qwa.8.2008.11.18.07.08.59 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 18 Nov 2008 07:09:00 -0800 (PST) Message-Id: <53597A8F-8C91-427E-A325-0D9D111764B5@gmail.com> From: Alessandro Bologna To: users@jackrabbit.apache.org In-Reply-To: <200811181254.34655.lukin@stu.cn.ua> Content-Type: text/plain; charset=UTF-8; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Apple Message framework v929.2) Subject: Re: exportDocumentView() and Jaxb - help needed Date: Tue, 18 Nov 2008 10:08:58 -0500 References: <200811132213.30506.lukin@stu.cn.ua> <200811141123.33186.lukin@stu.cn.ua> <29a095670811170730k7ec3c777g5b0b2bc89f35fa2d@mail.gmail.com> <200811181254.34655.lukin@stu.cn.ua> X-Mailer: Apple Mail (2.929.2) X-Virus-Checked: Checked by ClamAV on apache.org Alex, yes it seems that there's something a bit confusing happening in the =20 Exporter. Probably the easiest thing would be to debug with the source =20= jars and see what happens. In any case, you can try a workaround: Download = http://svn.apache.org/repos/asf/jackrabbit/sandbox/inactive/jcr-ext/src/ma= in/java/org/apache/jackrabbit/xml/DocumentViewExportVisitor.java=20 (yes, it's in the sandbox and inactive, but I believe it should =20 still work in JR 1.5) and create your own =20 Session.exportDocumentView(String, ContentHandler, boolean, boolean) =20 as explained in the comments (look at the beginning). Be sure that in the method private void exportNode(Node node, String prefix, String name) throws IOException, SAXException, RepositoryException { ... you comment out the following test (i.e uri should *not* be set = to =20 null if empty): if (uri.length() =3D=3D 0) { uri =3D null; } ... } I hope it works for you. Alessandro > Hello, Alessandro! Hello, colleagues! > > I checked sources and saw that data[] in =20 > org.xml.sax.helpers.AttributesImpl.getIndex(AttributesImpl.java:203) =20= > can not be null because thre is no NPE in Exporter, be but it is > null anyway. > Then I checked namespaces of ssession before doing export with SAX =20 > handler and found strange thing: there is namespace with empty =20 > prefix and empy uri! > My namesapce and Jackrabbit's namespaces are presend and OK, but =20 > this "empty" namespace is one candidate for NPE. It does not affect =20= > export procedure that uses streams but I > think does affect export procedure using SAX handler. > Below is output of this piece of code: > String[] nsp =3D session.getNamespacePrefixes(); > for (String ns : nsp) { > =20 > Logger=20 > .getLogger(AbstractTypeResolver.class.getName()).log(Level.FINE, =20 > "namespace: " + ns + " uri: " + ses.getNamespaceURI(ns)); > } > ----------- output ---------------- > 18 =D0=BB=D0=B8=D1=81=D1=82 2008 12:29:27 =20 > ua.org.dg.semaril.helpers.AbstractTypeResolver logNamespaces > FINE: namespace: jcr uri: http://www.jcp.org/jcr/1.0 > 18 =D0=BB=D0=B8=D1=81=D1=82 2008 12:29:27 =20 > ua.org.dg.semaril.helpers.AbstractTypeResolver logNamespaces > FINE: namespace: uri: <<<<<<<<<<<<<<<<<<<<<<<<< THIS NAMESPACE IS =20= > VERY STRANGE!!!<<<<<< > 18 =D0=BB=D0=B8=D1=81=D1=82 2008 12:29:27 =20 > ua.org.dg.semaril.helpers.AbstractTypeResolver logNamespaces > FINE: namespace: nt uri: http://www.jcp.org/jcr/nt/1.0 > 18 =D0=BB=D0=B8=D1=81=D1=82 2008 12:29:27 =20 > ua.org.dg.semaril.helpers.AbstractTypeResolver logNamespaces > FINE: namespace: pib uri: http://www.e-ukraine.org/datatypes/pib > 18 =D0=BB=D0=B8=D1=81=D1=82 2008 12:29:27 =20 > ua.org.dg.semaril.helpers.AbstractTypeResolver logNamespaces > FINE: namespace: sv uri: http://www.jcp.org/jcr/sv/1.0 > 18 =D0=BB=D0=B8=D1=81=D1=82 2008 12:29:27 =20 > ua.org.dg.semaril.helpers.AbstractTypeResolver logNamespaces > FINE: namespace: xs uri: http://www.w3.org/2001/XMLSchema > 18 =D0=BB=D0=B8=D1=81=D1=82 2008 12:29:27 =20 > ua.org.dg.semaril.helpers.AbstractTypeResolver logNamespaces > FINE: namespace: ocm uri: http://jackrabbit.apache.org/ocm > 18 =D0=BB=D0=B8=D1=81=D1=82 2008 12:29:27 =20 > ua.org.dg.semaril.helpers.AbstractTypeResolver logNamespaces > FINE: namespace: xml uri: http://www.w3.org/XML/1998/namespace > 18 =D0=BB=D0=B8=D1=81=D1=82 2008 12:29:27 =20 > ua.org.dg.semaril.helpers.AbstractTypeResolver logNamespaces > FINE: namespace: fn_old uri: http://www.w3.org/2004/10/xpath-functions > 18 =D0=BB=D0=B8=D1=81=D1=82 2008 12:29:27 =20 > ua.org.dg.semaril.helpers.AbstractTypeResolver logNamespaces > FINE: namespace: fn uri: http://www.w3.org/2005/xpath-functions > 18 =D0=BB=D0=B8=D1=81=D1=82 2008 12:29:27 =20 > ua.org.dg.semaril.helpers.AbstractTypeResolver logNamespaces > FINE: namespace: mix uri: http://www.jcp.org/jcr/mix/1.0 > 18 =D0=BB=D0=B8=D1=81=D1=82 2008 12:29:27 =20 > ua.org.dg.semaril.helpers.AbstractTypeResolver logNamespaces > FINE: namespace: rep uri: internal > ---------------------- > > I do not have any idea where this empty namespace comes from... I am =20= > sure I do not register it because it exists before I register my =20 > namespace or OCM namespace. > It does exist in empty just inited repository. > > Jukka, if you are reding this, please point me to source where =20 > namespaces get registered in Jackrabbit. Sope piece of code =20 > registers namespace with empty name and empty uri. > > On Monday 17 November 2008 17:30:58 Alessandro Bologna wrote: >> Hi Alex, >> it's a bit of a shot in the dark, but looking at the code here >> = http://svn.apache.org/repos/asf/jackrabbit/trunk/jackrabbit-jcr-commons/sr= c >> /main/java/org/apache/jackrabbit/commons/xml/Exporter.java and here: >> = http://www.docjar.com/html/api/org/xml/sax/helpers/AttributesImpl.java.htm= l >> I feel inclined to think that the problem is caused by your =20 >> attributes to >> be in no namespace. Would it be complicated (just to test) for you =20= >> to try >> to see what happens if you set all your attributes (archiveDAte, =20 >> creator >> etc) in some namespace (for instance, pib)? >> >> Alessandro > > --=20 > SY, Alex Lukin > RIPE NIC HDL: LEXA1-RIPE