You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by Simon Gash <Si...@gossinteractive.com> on 2005/05/05 11:03:37 UTC
builtin_nodetypes.xml Invalid
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
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.
Thanks
Simon
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.
Re: builtin_nodetypes.xml Invalid
Posted by Sean Radford <sr...@bladesystems.co.uk>.
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
>
>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.
>
>
>
I get this error when I run my Jackrabbit in JBoss as a standalone
server. But when I run the same JBoss from within Eclipse (to debug) all
is fine. A classloader issue?
Sean
--
Dr. Sean Radford, MBBS, MSc
sradford@bladesystems.co.uk
http://bladesys.demon.co.uk/
Re: builtin_nodetypes.xml Invalid
Posted by Sylvain Wallez <sy...@apache.org>.
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
Re: builtin_nodetypes.xml Invalid
Posted by Jukka Zitting <jz...@yukatan.fi>.
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
Re: builtin_nodetypes.xml Invalid
Posted by Sylvain Wallez <sy...@apache.org>.
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
Re: builtin_nodetypes.xml Invalid
Posted by Sean Radford <sr...@bladesystems.co.uk>.
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
sradford@bladesystems.co.uk
http://bladesys.demon.co.uk/
Re: builtin_nodetypes.xml Invalid
Posted by Sylvain Wallez <sy...@apache.org>.
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
Re: builtin_nodetypes.xml Invalid
Posted by Jukka Zitting <jz...@yukatan.fi>.
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