jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dan Connelly <dsconne...@adelphia.net>
Subject Re: NoPrefixDeclaredException
Date Sun, 05 Nov 2006 01:52:55 GMT
Okay, Marcel:

I reworked the test without introducing the XMI document.    The most 
recent attachment in the JIRA produces the problem.    
(DocumentViewDOMSourceImportTest)

I demonstrate the NoPrefixDeclaredException using an override for 
"importWithHandler" from DocumentViewImportTest. 

It seems that different parsers create different DOM events to be 
handled.   The default DOMSource of my Sun jdk1.5.0_09 JRE  (Xalan, I 
think) produces different events from 
org.apache.xerces.parsers.SAXParser, which is the hard-coded parser in 
the standard test for the handler.

Is Sun's DOMSource implementation known to be faulty such that 
hardcoding the Xerces parser is a requirement?   If not, then the new 
JUnit test using Sun's default parser is valid and Jackrabbit's Document 
View XML import should allow Sun's DOMSource.

If DOMSource cannot be used, this needs to be documented somewhere.

       -- Dan


Dan Connelly wrote:

> Marcel:
>
> I created the JIRA and attached a JUnit test to demonstrate the problem.
>
> https://issues.apache.org/jira/secure/ManageAttachments.jspa?id=12354733
>
>
> Marcel Reutegger wrote:
>
>> Hi Dan,
>>
>> can you please create a jira issue with exact information how to 
>> reproduce this
>> issue.
>>
>> regards
>>  marcel
>>
>> Dan Connelly wrote:
>>
>>> I do not define any structured nodes:  nt:unstructured is good 
>>> enough for this UC.
>>>
>>> I import the following (legitimate) XML file into a Workspace:
>>>
>>> <?xml version="1.0" encoding="ASCII"?>
>>> <library:Library xmi:version="2.0"
>>>    xmlns:xmi="http://www.omg.org/XMI"
>>>    xmlns:library="http://www.example.eclipse.org/Library"
>>>    name="My Library">
>>>  <writers href="resource/resWriter.xml#/0"/>
>>>  <writers href="resource/resWriter.xml#/1"/>
>>>  <writers href="resource/resWriter.xml#/2"/>
>>>  <books href="resource/resBook.xml#/0"/>
>>>  <books href="resource/resBook.xml#/1"/>
>>>  <books href="resource/resBook.xml#/2"/>
>>> </library:Library>
>>>
>>> In fact, the import succeeds in this (simple) case.   The workspace 
>>> has 6  sub-nodes, two triples of SNS nt:unstructured nodes.  The 
>>> attributes appear as String properties.
>>>
>>> However NoPrefixDeclaredException gets thrown  during the import and 
>>> clutters up the log (see below).   The XML file is outside of my 
>>> control.  It must be imported as is.
>>>
>>> It looks like the built-in "xmlns" prefix is being stepped on.    
>>> This does not give me confidence that complex XML files would import 
>>> correctly.    How serious is this "internal error"?
>>>
>>>       -- Dan
>>>
>>>
>>> ERROR: Error filtering events.
>>> javax.jcr.RepositoryException: internal error: encountered 
>>> unregistered namespace in path: no prefix declared for URI: 
>>> http://www.w3.org/2000/xmlns/: no prefix declared for URI: 
>>> http://www.w3.org/2000/xmlns/
>>>    at 
>>> org.apache.jackrabbit.core.observation.EventImpl.getPath(EventImpl.java:100)

>>>
>>>    at 
>>> org.apache.jackrabbit.core.SearchManager.onEvent(SearchManager.java:388) 
>>>
>>>    at 
>>> org.apache.jackrabbit.core.observation.EventConsumer.consumeEvents(EventConsumer.java:230)

>>>
>>>    at 
>>> org.apache.jackrabbit.core.observation.ObservationManagerFactory.dispatchEvents(ObservationManagerFactory.java:218)

>>>
>>>    at 
>>> org.apache.jackrabbit.core.observation.EventStateCollection.dispatch(EventStateCollection.java:430)

>>>
>>>    at 
>>> org.apache.jackrabbit.core.state.SharedItemStateManager$Update.end(SharedItemStateManager.java:607)

>>>
>>>    at 
>>> org.apache.jackrabbit.core.state.SharedItemStateManager.update(SharedItemStateManager.java:697)

>>>
>>>    at 
>>> org.apache.jackrabbit.core.state.LocalItemStateManager.update(LocalItemStateManager.java:315)

>>>
>>>    at 
>>> org.apache.jackrabbit.core.state.XAItemStateManager.update(XAItemStateManager.java:322)

>>>
>>>    at 
>>> org.apache.jackrabbit.core.state.LocalItemStateManager.update(LocalItemStateManager.java:291)

>>>
>>>    at 
>>> org.apache.jackrabbit.core.BatchedItemOperations.update(BatchedItemOperations.java:184)

>>>
>>>    at 
>>> org.apache.jackrabbit.core.xml.WorkspaceImporter.end(WorkspaceImporter.java:757)

>>>
>>>    at 
>>> org.apache.jackrabbit.core.xml.DocViewImportHandler.endDocument(DocViewImportHandler.java:309)

>>>
>>>    at 
>>> org.apache.jackrabbit.core.xml.ImportHandler.endDocument(ImportHandler.java:149)

>>>
>>>    at 
>>> com.sun.org.apache.xml.internal.serializer.ToXMLSAXHandler.endDocument(ToXMLSAXHandler.java:182)

>>>
>>>    at 
>>> com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(DOM2TO.java:124) 
>>>
>>>    at 
>>> com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(DOM2TO.java:85) 
>>>
>>>    at 
>>> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transformIdentity(TransformerImpl.java:596)

>>>
>>>    at 
>>> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:642)

>>>
>>>    at 
>>> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:281)

>>>
>>>    at 
>>> org.eclipse.emf.teneo.jcr.emf.test.LibraryContainmentProxyTest.updateRepository(LibraryContainmentProxyTest.java:306)

>>>
>>>    at 
>>> org.eclipse.emf.teneo.jcr.emf.test.LibraryContainmentProxyTest.testQuickStart(LibraryContainmentProxyTest.java:211)

>>>
>>>    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>    at 
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

>>>
>>>    at 
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

>>>
>>>    at java.lang.reflect.Method.invoke(Method.java:585)
>>>    at junit.framework.TestCase.runTest(TestCase.java:154)
>>>    at junit.framework.TestCase.runBare(TestCase.java:127)
>>>    at junit.framework.TestResult$1.protect(TestResult.java:106)
>>>    at junit.framework.TestResult.runProtected(TestResult.java:124)
>>>    at junit.framework.TestResult.run(TestResult.java:109)
>>>    at junit.framework.TestCase.run(TestCase.java:118)
>>>    at junit.framework.TestSuite.runTest(TestSuite.java:208)
>>>    at junit.framework.TestSuite.run(TestSuite.java:203)
>>>    at junit.textui.TestRunner.doRun(TestRunner.java:116)
>>>    at junit.textui.TestRunner.doRun(TestRunner.java:109)
>>>    at junit.textui.TestRunner.run(TestRunner.java:72)
>>>    at junit.textui.TestRunner.run(TestRunner.java:57)
>>>    at 
>>> org.eclipse.emf.teneo.jcr.emf.test.LibraryContainmentProxyTest.main(LibraryContainmentProxyTest.java:84)

>>>
>>> Caused by: org.apache.jackrabbit.name.NoPrefixDeclaredException: no 
>>> prefix declared for URI: http://www.w3.org/2000/xmlns/
>>>    at org.apache.jackrabbit.name.QName.toJCRName(QName.java:757)
>>>    at 
>>> org.apache.jackrabbit.name.Path$PathElement.toJCRName(Path.java:1391)
>>>    at org.apache.jackrabbit.name.Path.toJCRPath(Path.java:847)
>>>    at 
>>> org.apache.jackrabbit.core.observation.EventImpl.getPath(EventImpl.java:92) 
>>>
>>>    ... 38 more
>>> org.apache.jackrabbit.name.NoPrefixDeclaredException: no prefix 
>>> declared for URI: http://www.w3.org/2000/xmlns/
>>>    at org.apache.jackrabbit.name.QName.toJCRName(QName.java:757)
>>>    at 
>>> org.apache.jackrabbit.name.Path$PathElement.toJCRName(Path.java:1391)
>>>    at org.apache.jackrabbit.name.Path.toJCRPath(Path.java:847)
>>>    at 
>>> org.apache.jackrabbit.core.observation.EventImpl.getPath(EventImpl.java:92) 
>>>
>>>    at 
>>> org.apache.jackrabbit.core.SearchManager.onEvent(SearchManager.java:388) 
>>>
>>>    at 
>>> org.apache.jackrabbit.core.observation.EventConsumer.consumeEvents(EventConsumer.java:230)

>>>
>>>    at 
>>> org.apache.jackrabbit.core.observation.ObservationManagerFactory.dispatchEvents(ObservationManagerFactory.java:218)

>>>
>>>    at 
>>> org.apache.jackrabbit.core.observation.EventStateCollection.dispatch(EventStateCollection.java:430)

>>>
>>>    at 
>>> org.apache.jackrabbit.core.state.SharedItemStateManager$Update.end(SharedItemStateManager.java:607)

>>>
>>>    at 
>>> org.apache.jackrabbit.core.state.SharedItemStateManager.update(SharedItemStateManager.java:697)

>>>
>>>    at 
>>> org.apache.jackrabbit.core.state.LocalItemStateManager.update(LocalItemStateManager.java:315)

>>>
>>>    at 
>>> org.apache.jackrabbit.core.state.XAItemStateManager.update(XAItemStateManager.java:322)

>>>
>>>    at 
>>> org.apache.jackrabbit.core.state.LocalItemStateManager.update(LocalItemStateManager.java:291)

>>>
>>>    at 
>>> org.apache.jackrabbit.core.BatchedItemOperations.update(BatchedItemOperations.java:184)

>>>
>>>    at 
>>> org.apache.jackrabbit.core.xml.WorkspaceImporter.end(WorkspaceImporter.java:757)

>>>
>>>    at 
>>> org.apache.jackrabbit.core.xml.DocViewImportHandler.endDocument(DocViewImportHandler.java:309)

>>>
>>>    at 
>>> org.apache.jackrabbit.core.xml.ImportHandler.endDocument(ImportHandler.java:149)

>>>
>>>    at 
>>> com.sun.org.apache.xml.internal.serializer.ToXMLSAXHandler.endDocument(ToXMLSAXHandler.java:182)

>>>
>>>    at 
>>> com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(DOM2TO.java:124) 
>>>
>>>    at 
>>> com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(DOM2TO.java:85) 
>>>
>>>    at 
>>> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transformIdentity(TransformerImpl.java:596)

>>>
>>>    at 
>>> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:642)

>>>
>>>    at 
>>> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:281)

>>>
>>>    at 
>>> org.eclipse.emf.teneo.jcr.emf.test.LibraryContainmentProxyTest.updateRepository(LibraryContainmentProxyTest.java:306)

>>>
>>>    at 
>>> org.eclipse.emf.teneo.jcr.emf.test.LibraryContainmentProxyTest.testQuickStart(LibraryContainmentProxyTest.java:211)

>>>
>>>    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>    at 
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

>>>
>>>    at 
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

>>>
>>>    at java.lang.reflect.Method.invoke(Method.java:585)
>>>    at junit.framework.TestCase.runTest(TestCase.java:154)
>>>    at junit.framework.TestCase.runBare(TestCase.java:127)
>>>    at junit.framework.TestResult$1.protect(TestResult.java:106)
>>>    at junit.framework.TestResult.runProtected(TestResult.java:124)
>>>    at junit.framework.TestResult.run(TestResult.java:109)
>>>    at junit.framework.TestCase.run(TestCase.java:118)
>>>    at junit.framework.TestSuite.runTest(TestSuite.java:208)
>>>    at junit.framework.TestSuite.run(TestSuite.java:203)
>>>    at junit.textui.TestRunner.doRun(TestRunner.java:116)
>>>    at junit.textui.TestRunner.doRun(TestRunner.java:109)
>>>    at junit.textui.TestRunner.run(TestRunner.java:72)
>>>    at junit.textui.TestRunner.run(TestRunner.java:57)
>>>    at 
>>> org.eclipse.emf.teneo.jcr.emf.test.LibraryContainmentProxyTest.main(LibraryContainmentProxyTest.java:84)

>>>
>>>
>>
>>
>>
>
>


Mime
View raw message