commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William Evans" <william.ev...@ronin-capital.com>
Subject RE: XMLConfiguration load problem - External Entity not found
Date Tue, 20 Dec 2005 16:00:11 GMT
Whoops, forgot stack trace:

org.apache.commons.configuration.ConfigurationException: Relative URI
"../../../yyyy.dtd"; can not be resolved without a base URI.
	at
org.apache.commons.configuration.AbstractFileConfiguration.load(Abstract
FileConfiguration.java:128)
	at
org.apache.commons.configuration.AbstractFileConfiguration.load(Abstract
FileConfiguration.java:63)
	at
oakland.btrade.tactic.config.test.ReadingTest.testOneAssistant(ReadingTe
st.java:42)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.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
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTe
stRunner.java:478)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRun
ner.java:344)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRu
nner.java:196)
Caused by: org.apache.commons.configuration.ConfigurationException:
Relative URI "../../../BTradeDirectorAll.dtd"; can not be resolved
without a base URI.
	at
org.apache.commons.configuration.XMLConfiguration.load(XMLConfiguration.
java:161)
	at
org.apache.commons.configuration.AbstractFileConfiguration.load(Abstract
FileConfiguration.java:190)
	at
org.apache.commons.configuration.AbstractFileConfiguration.load(Abstract
FileConfiguration.java:157)
	at
org.apache.commons.configuration.AbstractFileConfiguration.load(Abstract
FileConfiguration.java:124)
	... 17 more
Caused by: org.xml.sax.SAXParseException: Relative URI
"../../../yyyy.dtd"; can not be resolved without a base URI.
	at org.apache.crimson.parser.Parser2.fatal(Parser2.java:3182)
	at org.apache.crimson.parser.Parser2.fatal(Parser2.java:3176)
	at
org.apache.crimson.parser.Parser2.resolveURI(Parser2.java:2758)
	at
org.apache.crimson.parser.Parser2.maybeExternalID(Parser2.java:2730)
	at
org.apache.crimson.parser.Parser2.maybeDoctypeDecl(Parser2.java:1129)
	at
org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:489)
	at org.apache.crimson.parser.Parser2.parse(Parser2.java:305)
	at
org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:442)
	at
org.apache.crimson.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.ja
va:185)
	at
org.apache.commons.configuration.XMLConfiguration.load(XMLConfiguration.
java:157)
	... 20 more

Cause:
org.apache.commons.configuration.ConfigurationException: Relative URI
"../../../yyyy.dtd"; can not be resolved without a base URI.
	at
org.apache.commons.configuration.XMLConfiguration.load(XMLConfiguration.
java:161)
	at
org.apache.commons.configuration.AbstractFileConfiguration.load(Abstract
FileConfiguration.java:190)
	at
org.apache.commons.configuration.AbstractFileConfiguration.load(Abstract
FileConfiguration.java:157)
	at
org.apache.commons.configuration.AbstractFileConfiguration.load(Abstract
FileConfiguration.java:124)
	at
org.apache.commons.configuration.AbstractFileConfiguration.load(Abstract
FileConfiguration.java:63)
	at
oakland.btrade.tactic.config.test.ReadingTest.testOneAssistant(ReadingTe
st.java:42)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.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
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTe
stRunner.java:478)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRun
ner.java:344)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRu
nner.java:196)
Caused by: org.xml.sax.SAXParseException: Relative URI
"../../../yyyy.dtd"; can not be resolved without a base URI.
	at org.apache.crimson.parser.Parser2.fatal(Parser2.java:3182)
	at org.apache.crimson.parser.Parser2.fatal(Parser2.java:3176)
	at
org.apache.crimson.parser.Parser2.resolveURI(Parser2.java:2758)
	at
org.apache.crimson.parser.Parser2.maybeExternalID(Parser2.java:2730)
	at
org.apache.crimson.parser.Parser2.maybeDoctypeDecl(Parser2.java:1129)
	at
org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:489)
	at org.apache.crimson.parser.Parser2.parse(Parser2.java:305)
	at
org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:442)
	at
org.apache.crimson.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.ja
va:185)
	at
org.apache.commons.configuration.XMLConfiguration.load(XMLConfiguration.
java:157)
	... 20 more

Cause:
org.xml.sax.SAXParseException: Relative URI "../../../yyyy.dtd"; can not
be resolved without a base URI.
	at org.apache.crimson.parser.Parser2.fatal(Parser2.java:3182)
	at org.apache.crimson.parser.Parser2.fatal(Parser2.java:3176)
	at
org.apache.crimson.parser.Parser2.resolveURI(Parser2.java:2758)
	at
org.apache.crimson.parser.Parser2.maybeExternalID(Parser2.java:2730)
	at
org.apache.crimson.parser.Parser2.maybeDoctypeDecl(Parser2.java:1129)
	at
org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:489)
	at org.apache.crimson.parser.Parser2.parse(Parser2.java:305)
	at
org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:442)
	at
org.apache.crimson.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.ja
va:185)
	at
org.apache.commons.configuration.XMLConfiguration.load(XMLConfiguration.
java:157)
	at
org.apache.commons.configuration.AbstractFileConfiguration.load(Abstract
FileConfiguration.java:190)
	at
org.apache.commons.configuration.AbstractFileConfiguration.load(Abstract
FileConfiguration.java:157)
	at
org.apache.commons.configuration.AbstractFileConfiguration.load(Abstract
FileConfiguration.java:124)
	at
org.apache.commons.configuration.AbstractFileConfiguration.load(Abstract
FileConfiguration.java:63)
	at
oakland.btrade.tactic.config.test.ReadingTest.testOneAssistant(ReadingTe
st.java:42)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.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
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTe
stRunner.java:478)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRun
ner.java:344)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRu
nner.java:196)





-----Original Message-----
From: Oliver Heger [mailto:oliver.heger@t-online.de] 
Sent: Tuesday, December 20, 2005 7:44 AM
To: Jakarta Commons Users List
Subject: Re: XMLConfiguration load problem - External Entity not found

William Evans wrote:

>I am using 'commons-configuration-1.2.jar' to make it easier to read
XML
>configuration files.
>
> 
>
>The files are not terribly complex but do have associated DTDs. Ideally
>I would like to specify the DTD location using a local, relative path.
>The problem is that when I try and load the file, I get:
>
> 
>
>Relative URI "../../../yyyy.dtd"; can not be resolved without a base
>URI.
>
> 
>
>So, after reading about a similar problem with solution posted by
>Oliver, I tried specifying the full path. Now I get:
>
> 
>
>External entity not found:
>"file://C:/eclipse/workspace/xxxx/dtds/yyyyy.dtd". 
>
> 
>
>Or...
>
> 
>
>External entity not found: "C:/eclipse/workspace/xxxx/dtds/yyyyy.dtd".
>
> 
>
>What is up here? Is the use of DTDs not really supported? In the
article
>I found, Oliver said that he had fixed the relative path problem. Is
>there some other issue going on?
>
> 
>
>Any help much appreciated...
>
> 
>
>Bill
>
>  
>
Could you please provide a code fragment how you setup and load your
XMLConfiguration instance? And full stack traces of exceptions might be
useful, too.

The mentioned fix should be in 1.2. There is a unit test that tests
loading a document that refers to a local DTD. But maybe not all
posibilities are covered?

Oliver

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message