RE: builtin_nodetypes.xml Invalid

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

RE: builtin_nodetypes.xml Invalid

wildPengiun
Thanks for the reply. Sadly I can't remember the XML parser version, I
was too eager to get the repository working again.

I did debug it and you are right the were no namespace declaration
attributes at all. At this point I e-mailed the forum.

Anyway thanks for looking at the DTD, although it clearly wasn't the
problem it did add some confusion.

Thanks

Simon

-----Original Message-----
From: Jukka Zitting [mailto:[hidden email]]
Sent: 05 May 2005 19:59
To: Jackrabbit
Subject: Re: builtin_nodetypes.xml Invalid

Hi,

Good to know that you already found a workaround to this problem. Here's
some thoughts of what might be the cause.

Simon Gash wrote:
> I'm having a problem with a particular installation of jackrabbit
> running in Eclipse 3.1. I keep getting an exception.
>  
> javax.jcr.RepositoryException: internal error: invalid built-in node
> type definition stored in
> org/apache/jackrabbit/core/nodetype/builtin_nodetypes.xml: Invalid
> namespace reference in a node type definition: nt: Invalid namespace
> reference in a node type definition: nt

It seems as if the xmlns:nt namespace setting is not being read by the
nodetype reader. The reader code reads all xmlns:* attributes from the
root element of the nodetype configuration file and uses them to set up
the namespace mappings.

I recall a problem in some XML parser implementation that loses the
namespace declaration attributes when using the standard DOM access
methods. This was a somewhat controversial issue (should the namespace
attributes be visible?), but I think the correct answer was that they
should be for standard DOM-level access.

I suspect that this is the cause of your problem, especially as you were
able to fix it by cleaning up the classpath. Can you recall if you had
any specific XML parser implementations on the classpath?

> On investigation I tried to load builtin_nodetypes.xml into xml spy
> but it fails to validate. Is there something wrong or am I missing
> something.

It could well be that the XML file no longer conforms with the inline
DTD included at the beginning of the file. The file is never validated
against the DTD when it is accessed by Jackrabbit. I'll investigate this
and commit a fix if I find the problem.

BR,

Jukka Zitting



Come visit us at:
 
Internet World 2005. June 14 - 16, Earls Court, Stand # A60

Government Computing Expo. June 21 & 22, Earls Court, Stand # 804

SOCITM Annual Event. October 16 - 18 Brighton Hotel, Stand # 28
GOSS - Ranked 4th in the Deloitte Technology Fast 50 Awards 2004 and 88th in the Deloitte Technology Fast 500 EMEA.

This email contains proprietary information, some or all of which may be legally privileged. It is for the intended recipient only. If an addressing or transmission error has misdirected this email, please notify the author by replying to this email. If you are not the intended recipient you may not use, disclose, distribute, copy, print or rely on this email.

 

Email transmission cannot be guaranteed to be secure or error free, as information may be intercepted, corrupted, lost, destroyed, arrive late or incomplete or contain viruses. This email and any files attached to it have been checked with virus detection software before transmission. You should nonetheless carry out your own virus check before opening any attachment. GOSS Interactive Ltd accepts no liability for any loss or damage that may be caused by software viruses.
 

Reply | Threaded
Open this post in threaded view
|

Re: builtin_nodetypes.xml Invalid

Sylvain Wallez
Jukka Zitting wrote:

>Hi,
>
>Good to know that you already found a workaround to this problem. Here's
>some thoughts of what might be the cause.
>
>Simon Gash wrote:
>  
>
>>I'm having a problem with a particular installation of jackrabbit
>>running in Eclipse 3.1. I keep getting an exception.
>>
>>javax.jcr.RepositoryException: internal error: invalid built-in node
>>type definition stored in
>>org/apache/jackrabbit/core/nodetype/builtin_nodetypes.xml: Invalid
>>namespace reference in a node type definition: nt: Invalid namespace
>>reference in a node type definition: nt
>>    
>>
>
>It seems as if the xmlns:nt namespace setting is not being read by the
>nodetype reader. The reader code reads all xmlns:* attributes from the
>root element of the nodetype configuration file and uses them to set up
>the namespace mappings.
>
>I recall a problem in some XML parser implementation that loses the
>namespace declaration attributes when using the standard DOM access
>methods. This was a somewhat controversial issue (should the namespace
>attributes be visible?), but I think the correct answer was that they
>should be for standard DOM-level access.
>

I encountered the same problem and tracked it up to finding that
DOMWalker uses an identity transformation from a StreamSource to a
DOMResult to parse builtin_nodetypes.xml. Creative use of JAXP :-)

I changed this rather unusual way of parsing files to a more traditional
one using DocumentBuilder, and problems vanished, at least in my
environment.

Would others please cross-check?

Sylvain

--
Sylvain Wallez                        Anyware Technologies
http://apache.org/~sylvain            http://anyware-tech.com
Apache Software Foundation Member     Research & Technology Director

Reply | Threaded
Open this post in threaded view
|

Re: builtin_nodetypes.xml Invalid

Jukka Zitting-5
Hi,

Sylvain Wallez wrote:
> I encountered the same problem and tracked it up to finding that
> DOMWalker uses an identity transformation from a StreamSource to a
> DOMResult to parse builtin_nodetypes.xml. Creative use of JAXP :-)

You are probably right about this being the problem.

I'm a big fan of the Transformer interface, but then again I usually
work with non-namespaced documents. I didn't realize that this might
cause problems with namespaces, but now that you mentioned it this seems
like a good explanation for the problems.

> I changed this rather unusual way of parsing files to a more traditional
> one using DocumentBuilder, and problems vanished, at least in my
> environment.
>
> Would others please cross-check?

The change seems to be fine at least for me, although I haven't
experienced the lost namespaces bug.

BR,

Jukka Zitting
Reply | Threaded
Open this post in threaded view
|

Re: builtin_nodetypes.xml Invalid

Sean Radford
In reply to this post by Sylvain Wallez
Sylvain Wallez wrote:

>
> I encountered the same problem and tracked it up to finding that
> DOMWalker uses an identity transformation from a StreamSource to a
> DOMResult to parse builtin_nodetypes.xml. Creative use of JAXP :-)
>
> I changed this rather unusual way of parsing files to a more
> traditional one using DocumentBuilder, and problems vanished, at least
> in my environment.
>
> Would others please cross-check?
>
> Sylvain
>
Is this a change within svn?

--
Dr. Sean Radford, MBBS, MSc
[hidden email]
http://bladesys.demon.co.uk/ 

Reply | Threaded
Open this post in threaded view
|

Re: builtin_nodetypes.xml Invalid

Sylvain Wallez
In reply to this post by Jukka Zitting-5
Jukka Zitting wrote:

> Hi,
>
> Sylvain Wallez wrote:
>
>> I encountered the same problem and tracked it up to finding that
>> DOMWalker uses an identity transformation from a StreamSource to a
>> DOMResult to parse builtin_nodetypes.xml. Creative use of JAXP :-)
>
>
> You are probably right about this being the problem.
>
> I'm a big fan of the Transformer interface, but then again I usually
> work with non-namespaced documents. I didn't realize that this might
> cause problems with namespaces, but now that you mentioned it this
> seems like a good explanation for the problems.


I suspect some implementations of the StreamSource -> DomResult identity
transform to use a SAX parser piped to a DOM builder. And a SAX parser
doesn't report namespace declarations as attributes unless the
"http://xml.org/sax/features/namespace-prefixes" property is true,
whereas its default value is false (see ContentHandler's javadoc). So in
such cases, the DOM builder receives all start/endPrefixMapping events,
but not xmlns: attributes.

Sylvain||

--
Sylvain Wallez                        Anyware Technologies
http://apache.org/~sylvain            http://anyware-tech.com
Apache Software Foundation Member     Research & Technology Director

Reply | Threaded
Open this post in threaded view
|

Re: builtin_nodetypes.xml Invalid

Sylvain Wallez
In reply to this post by Sean Radford
Sean Radford wrote:

> Sylvain Wallez wrote:
>
>>
>> I encountered the same problem and tracked it up to finding that
>> DOMWalker uses an identity transformation from a StreamSource to a
>> DOMResult to parse builtin_nodetypes.xml. Creative use of JAXP :-)
>>
>> I changed this rather unusual way of parsing files to a more
>> traditional one using DocumentBuilder, and problems vanished, at
>> least in my environment.
>>
>> Would others please cross-check?
>>
>> Sylvain
>>
> Is this a change within svn?


Yes, committed less than one hour ago ;-)

Sylvain

--
Sylvain Wallez                        Anyware Technologies
http://apache.org/~sylvain            http://anyware-tech.com
Apache Software Foundation Member     Research & Technology Director