On Tue, Nov 18, 2008 at 11:54 AM, Aleksei Lukin <[EMAIL PROTECTED]> wrote:
> Hello, Alessandro! Hello, colleagues!
>
> I checked sources and saw that data[] in 
> org.xml.sax.helpers.AttributesImpl.getIndex(AttributesImpl.java:203) 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 handler 
> and found strange thing: there is namespace with empty prefix and empy uri!
> My namesapce and Jackrabbit's namespaces are presend and OK, but this "empty" 
> namespace is one candidate for NPE. It does not affect 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 = session.getNamespacePrefixes();
>            for (String ns : nsp) {
>                
> Logger.getLogger(AbstractTypeResolver.class.getName()).log(Level.FINE, 
> "namespace: " + ns + " uri: " + ses.getNamespaceURI(ns));
>            }
> ----------- output ----------------
> 18 лист 2008 12:29:27 ua.org.dg.semaril.helpers.AbstractTypeResolver 
> logNamespaces
> FINE: namespace: jcr uri: http://www.jcp.org/jcr/1.0
> 18 лист 2008 12:29:27 ua.org.dg.semaril.helpers.AbstractTypeResolver 
> logNamespaces
> FINE: namespace:  uri:  <<<<<<<<<<<<<<<<<<<<<<<<< THIS NAMESPACE IS VERY 
> STRANGE!!!<<<<<<
> 18 лист 2008 12:29:27 ua.org.dg.semaril.helpers.AbstractTypeResolver 
> logNamespaces
> FINE: namespace: nt uri: http://www.jcp.org/jcr/nt/1.0
> 18 лист 2008 12:29:27 ua.org.dg.semaril.helpers.AbstractTypeResolver 
> logNamespaces
> FINE: namespace: pib uri: http://www.e-ukraine.org/datatypes/pib
> 18 лист 2008 12:29:27 ua.org.dg.semaril.helpers.AbstractTypeResolver 
> logNamespaces
> FINE: namespace: sv uri: http://www.jcp.org/jcr/sv/1.0
> 18 лист 2008 12:29:27 ua.org.dg.semaril.helpers.AbstractTypeResolver 
> logNamespaces
> FINE: namespace: xs uri: http://www.w3.org/2001/XMLSchema
> 18 лист 2008 12:29:27 ua.org.dg.semaril.helpers.AbstractTypeResolver 
> logNamespaces
> FINE: namespace: ocm uri: http://jackrabbit.apache.org/ocm
> 18 лист 2008 12:29:27 ua.org.dg.semaril.helpers.AbstractTypeResolver 
> logNamespaces
> FINE: namespace: xml uri: http://www.w3.org/XML/1998/namespace
> 18 лист 2008 12:29:27 ua.org.dg.semaril.helpers.AbstractTypeResolver 
> logNamespaces
> FINE: namespace: fn_old uri: http://www.w3.org/2004/10/xpath-functions
> 18 лист 2008 12:29:27 ua.org.dg.semaril.helpers.AbstractTypeResolver 
> logNamespaces
> FINE: namespace: fn uri: http://www.w3.org/2005/xpath-functions
> 18 лист 2008 12:29:27 ua.org.dg.semaril.helpers.AbstractTypeResolver 
> logNamespaces
> FINE: namespace: mix uri: http://www.jcp.org/jcr/mix/1.0
> 18 лист 2008 12:29:27 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 sure I 
> do not register it because it exists before I register my namespace or OCM 
> namespace.
> It does exist in empty just inited repository.

the empty namespace URI is a built-in JCR namespace. it is always
mapped to the empty prefix.
for more information, see "6.3.1 Namespace Registry" in the JSR 170
specification.

cheers
stefan

>
> Jukka, if you are reding this, please point me to source where namespaces get 
> registered in Jackrabbit. Sope piece of code 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/src
>>/main/java/org/apache/jackrabbit/commons/xml/Exporter.java and here:
>> http://www.docjar.com/html/api/org/xml/sax/helpers/AttributesImpl.java.html
>> I feel inclined to think that the problem is caused by your attributes to
>> be in no namespace. Would it be complicated (just to test) for you to try
>> to see what happens if you set all your attributes (archiveDAte, creator
>> etc) in some namespace (for instance, pib)?
>>
>> Alessandro
>
> --
> SY, Alex Lukin
> RIPE NIC HDL: LEXA1-RIPE
>

Reply via email to