You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by loproman <lo...@gmail.com> on 2007/11/01 08:04:40 UTC
CND Reader Error
Hello, I'm trying to define custom node types using the CND reader example
found at:
http://jackrabbit.apache.org/doc/nodetype/cnd.html
I started out trying my own example, and was receiving a ParseException no
matter how simple I made my input. After reading and re-reading the
documentation, I tried plugging in the example provided in the documentation
to see what happened:
<ns='http://namespace.com/ns'>
[ns:NodeType]>ns:ParentType1, ns:ParentType2 o m
-ex:property='default1','default2' ! m a p * version <'constraint1',
'constraint2'
+ns:node(ns:reqType1,ns:reqType2)=ns:defaultType m a p * version
After doing so, I am still getting a ParseException, "Error while parsing
'ex:property'." I checked the encoding of my file (which is a standard txt
file on Windows XP SP2.) I found it to be encoding type Cp1252, and I also
verified that the file I was trying to open was opening by printing out the
contents. At this point, I don't know what I am doing wrong. I am using the
1.3.3 build. Any ideas?
--
View this message in context: http://www.nabble.com/CND-Reader-Error-tf4729712.html#a13524222
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
Re: CND Reader Error
Posted by Fabián Mandelbaum <fm...@gmail.com>.
Thanks! It worked like a charm.
Brian Thompson escribió:
> On 11/1/07, Fabián Mandelbaum <fm...@gmail.com> wrote:
>
>> I'm trying to extend the nt:file node type to add more properties to it,
>> and am getting similar errors.
>>
>> mynsFile.cnd has, so far:
>>
>> <myns='http://www.myns/1.0'>
>> [myns:file] > nt:file
>>
>> <snip>
>>
>> Do I have to specify the 'inlcuded' nt namespace for nt:file? Where?
>>
>>
>>
>
> Yes; put the nt namespace declaration at the top of the file (see my example
> cnd file below).
>
> ==========================
>
> /* orig.namespaces */
> <mix = 'http://www.jcp.org/jcr/mix/1.0'>
> <nt = 'http://www.jcp.org/jcr/nt/1.0'>
>
> /* My namespaces */
> <exm = 'http://www.example.com/jcr-ns/exm'>
>
> [exm:folder] > nt:folder, mix:referenceable
> orderable
> - exm:active (boolean) = 'true' mandatory autocreated
>
Re: CND Reader Error
Posted by Brian Thompson <el...@gmail.com>.
Absolutely, my custom CND file has a dozen or so definitions in it. From
the snippet you posted, I'd say you just need to adjust your syntax. If I
understand your file correctly, you are trying to define a custom Library
node that will have one child node of type ex:config.
Try
[ex:library] > nt:base
+ config = ex:config a m p
Hope this helps!
-Brian
On 11/1/07, loproman <lo...@gmail.com> wrote:
>
>
> Thanks! That fixed me up as well. I was making the assumption it would
> know
> the default namespaces. However, now I'm having another issue... Can you
> define more than one node type, and reference it in the same file? My
> simple
> example is still failing (but now on the last line at config):
>
> <nt = 'http://www.jcp.org/jcr/nt/1.0'>
> <ex = 'http://example.net/ex/0.1'>
>
> [ex:config]>nt:folder
>
> [ex:library]>nt:base
> +'config' (ex:config) a m p
>
>
>
>
> Brian Thompson-5 wrote:
> >
> > On 11/1/07, Fabián Mandelbaum <fm...@gmail.com> wrote:
> >>
> >> I'm trying to extend the nt:file node type to add more properties to
> it,
> >> and am getting similar errors.
> >>
> >> mynsFile.cnd has, so far:
> >>
> >> <myns='http://www.myns/1.0'>
> >> [myns:file] > nt:file
> >>
> >> <snip>
> >>
> >> Do I have to specify the 'inlcuded' nt namespace for nt:file? Where?
> >>
> >>
> >
> > Yes; put the nt namespace declaration at the top of the file (see my
> > example
> > cnd file below).
> >
> > ==========================
> >
> > /* orig.namespaces */
> > <mix = 'http://www.jcp.org/jcr/mix/1.0'>
> > <nt = 'http://www.jcp.org/jcr/nt/1.0'>
> >
> > /* My namespaces */
> > <exm = 'http://www.example.com/jcr-ns/exm'>
> >
> > [exm:folder] > nt:folder, mix:referenceable
> > orderable
> > - exm:active (boolean) = 'true' mandatory autocreated
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/CND-Reader-Error-tf4729712.html#a13537710
> Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
>
>
Re: CND Reader Error
Posted by loproman <lo...@gmail.com>.
Thanks! That fixed me up as well. I was making the assumption it would know
the default namespaces. However, now I'm having another issue... Can you
define more than one node type, and reference it in the same file? My simple
example is still failing (but now on the last line at config):
<nt = 'http://www.jcp.org/jcr/nt/1.0'>
<ex = 'http://example.net/ex/0.1'>
[ex:config]>nt:folder
[ex:library]>nt:base
+'config' (ex:config) a m p
Brian Thompson-5 wrote:
>
> On 11/1/07, Fabián Mandelbaum <fm...@gmail.com> wrote:
>>
>> I'm trying to extend the nt:file node type to add more properties to it,
>> and am getting similar errors.
>>
>> mynsFile.cnd has, so far:
>>
>> <myns='http://www.myns/1.0'>
>> [myns:file] > nt:file
>>
>> <snip>
>>
>> Do I have to specify the 'inlcuded' nt namespace for nt:file? Where?
>>
>>
>
> Yes; put the nt namespace declaration at the top of the file (see my
> example
> cnd file below).
>
> ==========================
>
> /* orig.namespaces */
> <mix = 'http://www.jcp.org/jcr/mix/1.0'>
> <nt = 'http://www.jcp.org/jcr/nt/1.0'>
>
> /* My namespaces */
> <exm = 'http://www.example.com/jcr-ns/exm'>
>
> [exm:folder] > nt:folder, mix:referenceable
> orderable
> - exm:active (boolean) = 'true' mandatory autocreated
>
>
--
View this message in context: http://www.nabble.com/CND-Reader-Error-tf4729712.html#a13537710
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
Re: CND Reader Error
Posted by Brian Thompson <el...@gmail.com>.
On 11/1/07, Fabián Mandelbaum <fm...@gmail.com> wrote:
>
> I'm trying to extend the nt:file node type to add more properties to it,
> and am getting similar errors.
>
> mynsFile.cnd has, so far:
>
> <myns='http://www.myns/1.0'>
> [myns:file] > nt:file
>
> <snip>
>
> Do I have to specify the 'inlcuded' nt namespace for nt:file? Where?
>
>
Yes; put the nt namespace declaration at the top of the file (see my example
cnd file below).
==========================
/* orig.namespaces */
<mix = 'http://www.jcp.org/jcr/mix/1.0'>
<nt = 'http://www.jcp.org/jcr/nt/1.0'>
/* My namespaces */
<exm = 'http://www.example.com/jcr-ns/exm'>
[exm:folder] > nt:folder, mix:referenceable
orderable
- exm:active (boolean) = 'true' mandatory autocreated
Re: CND Reader Error
Posted by Fabián Mandelbaum <fm...@gmail.com>.
I'm trying to extend the nt:file node type to add more properties to it,
and am getting similar errors.
mynsFile.cnd has, so far:
<myns='http://www.myns/1.0'>
[myns:file] > nt:file
and am getting:
Exception in thread "main" java.lang.RuntimeException:
org.apache.jackrabbit.core.nodetype.compact.ParseException: Error while
parsing 'nt:file' (config/mynsFile.cnd, line 2)
REST_OF_THE_STACK_TRACE_HERE
Caused by: org.apache.jackrabbit.name.UnknownPrefixException: nt
at
org.apache.jackrabbit.name.NameFormat.parseIgnoreCache(NameFormat.java:257)
at org.apache.jackrabbit.name.NameFormat.parse(NameFormat.java:80)
at
org.apache.jackrabbit.core.nodetype.compact.CompactNodeTypeDefReader.toQName(CompactNodeTypeDefReader.java:636)
... 9 more
Do I have to specify the 'inlcuded' nt namespace for nt:file? Where?
Thanks in advance.
Stefan Guggisberg escribió:
> On 11/1/07, loproman <lo...@gmail.com> wrote:
>
>> Hello, I'm trying to define custom node types using the CND reader example
>> found at:
>> http://jackrabbit.apache.org/doc/nodetype/cnd.html
>>
>> I started out trying my own example, and was receiving a ParseException no
>> matter how simple I made my input. After reading and re-reading the
>> documentation, I tried plugging in the example provided in the documentation
>> to see what happened:
>>
>> <ns='http://namespace.com/ns'>
>> [ns:NodeType]>ns:ParentType1, ns:ParentType2 o m
>> -ex:property='default1','default2' ! m a p * version <'constraint1',
>> 'constraint2'
>> +ns:node(ns:reqType1,ns:reqType2)=ns:defaultType m a p * version
>>
>
> that example is unfortunately incomplete. it's missing a namespace declaration
> (prefix 'ex' is undeclared) and definitions of various other
> referenced node types
> (e.g. ns:ParentType1,ns:reqType1 etc).
>
>
>> After doing so, I am still getting a ParseException, "Error while parsing
>> 'ex:property'." I checked the encoding of my file (which is a standard txt
>> file on Windows XP SP2.) I found it to be encoding type Cp1252, and I also
>> verified that the file I was trying to open was opening by printing out the
>> contents. At this point, I don't know what I am doing wrong. I am using the
>> 1.3.3 build. Any ideas?
>>
>
> the nested exception of the parse exception should provide a detailed
> error description (such as 'unknown prefix' etc).
>
> if you post your cnd that produces errors i'll have a look at it.
>
> cheers
> stefan
>
>
>> --
>> View this message in context: http://www.nabble.com/CND-Reader-Error-tf4729712.html#a13524222
>> Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
>>
>>
>>
Re: CND Reader Error
Posted by Stefan Guggisberg <st...@gmail.com>.
On 11/1/07, loproman <lo...@gmail.com> wrote:
>
> Hello, I'm trying to define custom node types using the CND reader example
> found at:
> http://jackrabbit.apache.org/doc/nodetype/cnd.html
>
> I started out trying my own example, and was receiving a ParseException no
> matter how simple I made my input. After reading and re-reading the
> documentation, I tried plugging in the example provided in the documentation
> to see what happened:
>
> <ns='http://namespace.com/ns'>
> [ns:NodeType]>ns:ParentType1, ns:ParentType2 o m
> -ex:property='default1','default2' ! m a p * version <'constraint1',
> 'constraint2'
> +ns:node(ns:reqType1,ns:reqType2)=ns:defaultType m a p * version
that example is unfortunately incomplete. it's missing a namespace declaration
(prefix 'ex' is undeclared) and definitions of various other
referenced node types
(e.g. ns:ParentType1,ns:reqType1 etc).
>
> After doing so, I am still getting a ParseException, "Error while parsing
> 'ex:property'." I checked the encoding of my file (which is a standard txt
> file on Windows XP SP2.) I found it to be encoding type Cp1252, and I also
> verified that the file I was trying to open was opening by printing out the
> contents. At this point, I don't know what I am doing wrong. I am using the
> 1.3.3 build. Any ideas?
the nested exception of the parse exception should provide a detailed
error description (such as 'unknown prefix' etc).
if you post your cnd that produces errors i'll have a look at it.
cheers
stefan
> --
> View this message in context: http://www.nabble.com/CND-Reader-Error-tf4729712.html#a13524222
> Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
>
>