I am instantiating the CND parser, i.e.
org.apache.jackrabbit.core.nodetype.compact.CompactNodeTypeDefReader
directly, like this...
InputStream in =
Thread.currentThread().getContextClassLoader().getResourceAsStream("repro.cnd");
Reader reader = new InputStreamReader(in);
CompactNodeTypeDefReader cndReader = new CompactNodeTypeDefReader(reader,
"repro.cnd");
As you said that I need to explicitly add the namespace I use, I added my
custom namespace declarations at the beginning of the CND file, but now
parse fails because the parser doesn't recognise default namespaces like
'nt', 'mix' etc.
Actually I am deploying Jackrabbit on JBoss in Deployment Model 2, using the
jackrabbit-jca-1.3.rar as mentioned in the wiki. Now what I am doing is I am
registering the custom namespaces and nodetypes on JBoss statup. I am doing
all the registering stuff within a ServletContextListener. Now each time I
want to check whether a particular namespace or nodetype is already
registered, so that I won't register it again.
Jukka Zitting wrote:
>
> Hi,
>
> On 5/2/07, Kalyan Sarkar <[EMAIL PROTECTED]> wrote:
>> I have programmatically registered the namespace 'repro' before this code
>> fragment.
>>
>> The interesting part is that when I register the nodetypes through
>> JackrabbitNodetypeManager I dont get the exception. For e.g.
>>
>> NodeTypeManagerImpl manager = (NodeTypeManagerImpl)
>> ws.getNodeTypeManager();
>> manager.registerNodeTypes(in, NodeTypeManagerImpl.TEXT_X_JCR_CND);
>>
>> Can anybody tell me what am I missing.
>
> The NodeTypeManagerImpl class automatically makes all the registered
> namespaces available to the CND parsers. If you instantiate the parser
> directly, you need to explicitly add the namespaces you use. In any
> case it's a good idea to include all namespace mappings in the CND
> file.
>
> BR,
>
> Jukka Zitting
>
>
--
View this message in context:
http://www.nabble.com/Parse-Exception-while-registering-node-types-tf3679606.html#a10301396
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.