|
|
Re: Use jaxp with jdk1.3.1 for plugin development [message #117594 is a reply to message #102053] |
Wed, 27 August 2003 19:45 |
Eclipse User |
|
|
|
Originally posted by: gentijo.eyecatching.com
Look at the transclipse project in Sourceforge, the EndorsingClass
Loader does a good job even under JDK 1.4.x. It allows you to load
an external referenced JAR for Xerces & Xalan and override the
bootclass path.
-John G
Gerald Preissler wrote:
> Gerald Preissler wrote:
>
>> Hi folks,
>>
>> maybe someone can help us with this one:
>>
>> We're trying to develop an eclipse plugin that uses Xerces 2.4.0 via
>> the jaxp api to parse an xml file. Due to restrictions from the
>> environment under which the final installation should run, we have to
>> use jre 1.3.1 as runtime environment.
>>
>> The following code works fine in a "normal" java project using jdk
>> 1.3.1_08 :
>>
>> // Get Document Builder Factory
>> DocumentBuilderFactory factory =
>> DocumentBuilderFactory.newInstance();
>>
>> // Turn on validation, and turn off namespaces
>> factory.setValidating(false);
>> factory.setNamespaceAware(true);
>>
>> DocumentBuilder builder = null;
>> builder = factory.newDocumentBuilder();
>> if (builder != null) {
>> this.doc = builder.parse(stream);
>> }
>>
>> When using the same code within a plugin, I can build the project
>> without problems. However, I get a NoClassDefFoundError when getting
>> the DocumentBuilderFactory instance (see end of document for complete
>> stacktrace). This only happens when I specify jre 1.3.1 in the run...
>> dialog. The Xerces jars are include in the source lookup path under
>> Run...->Source. When I use jre 1.4.1 with the vm argument
>> -Djava.endorsed.dirs pointing to the dir where I installed the Xerces
>> jars, everything works fine.
>>
>> Can anyone provide an explanation or (even better :-)) a solution to
>> use the jaxp api in a plugin under jre 1.3.1?
>>
> [..]
>
> Ok, this is solved now. Just in case someone runs into the same problem:
> You can solve it easily by including a dependency on org.apache.xerces
> in your plugin.xml and removing any references to other xerces jars from
> your project and the run... configuration.
>
> Still the question remains if there is a canonical way to use a
> different xerces version from within a plugin. Can anyone give some
> information?
>
> kind regards
> Jerry
>
|
|
|
Powered by
FUDForum. Page generated in 0.03801 seconds