Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Using Saxon 6.5 in Eclipse 3.4
Using Saxon 6.5 in Eclipse 3.4 [message #331127] Tue, 26 August 2008 13:01 Go to next message
Jan Kohnert is currently offline Jan KohnertFriend
Messages: 196
Registered: July 2009
Senior Member
Hello,

I want to write an plugin that uses Saxon 6.5 (for historical reasons) to
perform XML transformations.
That for I've includes saxon.jar into my plugin classpath and added the
following VM argument inside my product.configuration file. (RCP App)
-Djavax.xml.transform.TransformerFactory=com.icl.saxon.Trans formerFactoryImpl

When creating the fransformer factory:
TransformerFactory transFact = TransformerFactory.newInstance();

I get a exception:
java.lang.ClassCastException: com.icl.saxon.TransformerFactoryImpl cannot
be cast to javax.xml.transform.TransformerFactory
at javax.xml.transform.TransformerFactory.newInstance(Unknown Source)

This it good for some point because it tells me that the system tries to
use saxon, but bad for another because it does not work :(

When trying:
TransformerFactoryImpl transFact =
(TransformerFactoryImpl)TransformerFactory.newInstance();

I get the following exception:
java.lang.ClassCastException: com.icl.saxon.TransformerFactoryImpl cannot
be cast to javax.xml.transform.TransformerFactory
at javax.xml.transform.TransformerFactory.newInstance(Unknown Source)

The 'normal' way is the first approach (TransformerFactory transFact =
TransformerFactory.newInstance();). This one works perfectly fine when
ever not beeing executed inside an eclipse plugin!

Any suggestions regarding this strange behaviour?

Thank,
Jan


This
Re: Using Saxon 6.5 in Eclipse 3.4 [message #331140 is a reply to message #331127] Tue, 26 August 2008 15:04 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: subs._nospam_consertum.com

Jan Kohnert wrote:
> Hello,
>
> I want to write an plugin that uses Saxon 6.5 (for historical reasons)
> to perform XML transformations. That for I've includes saxon.jar into my
> plugin classpath and added the following VM argument inside my
> product.configuration file. (RCP App)
> -Djavax.xml.transform.TransformerFactory=com.icl.saxon.Trans formerFactoryImpl
>
>
> When creating the fransformer factory:
> TransformerFactory transFact = TransformerFactory.newInstance();
>
> I get a exception:
> java.lang.ClassCastException: com.icl.saxon.TransformerFactoryImpl
> cannot be cast to javax.xml.transform.TransformerFactory
> at javax.xml.transform.TransformerFactory.newInstance(Unknown Source)
>
> This it good for some point because it tells me that the system tries to
> use saxon, but bad for another because it does not work :(
>
> When trying:
> TransformerFactoryImpl transFact =
> (TransformerFactoryImpl)TransformerFactory.newInstance();
>
> I get the following exception:
> java.lang.ClassCastException: com.icl.saxon.TransformerFactoryImpl
> cannot be cast to javax.xml.transform.TransformerFactory
> at javax.xml.transform.TransformerFactory.newInstance(Unknown Source)
>
> The 'normal' way is the first approach (TransformerFactory transFact =
> TransformerFactory.newInstance();). This one works perfectly fine when
> ever not beeing executed inside an eclipse plugin!
> Any suggestions regarding this strange behaviour?
>
> Thank,
> Jan
>
>
> This
Have you tried using a fully qualified name for TransformerFactory? It
looks like it is picking up a class of the same name from a different
package.


--
Derek
Re: Using Saxon 6.5 in Eclipse 3.4 [message #331160 is a reply to message #331127] Wed, 27 August 2008 06:00 Go to previous message
Jan Kohnert is currently offline Jan KohnertFriend
Messages: 196
Registered: July 2009
Senior Member
Hello,

Researching for quite some time brought up that I suffer from a
Classloader problem that occurs in combination witch Eclipse and third
party library.

I found a solution in the Eclipse Wiki that shows how to change the
Classloader at runtime for e sequence of code.
http://wiki.eclipse.org/FAQ_How_do_I_use_the_context_class_l oader_in_Eclipse%3F

I changed that by using java.lang.ClassLoader.getSystemClassLoader().
Unfortunately the SystemClassLoader does knowe little about by plugin's
classpath and so I had to use a hack that I found here:
http://forums.sun.com/thread.jspa?threadID=300557&start= 0&tstart=0

That seems to work for the moment although its the most 'dirty' solution I
can think of!

Right now I experiance problems with Factoryclasses inside the librarys.
I've no clue how to fix that yet.

Jan
Previous Topic:passing view reference into actions
Next Topic:Resource Marker to open custom editor with custom EditorInput
Goto Forum:
  


Current Time: Wed Jul 17 15:55:10 GMT 2024

Powered by FUDForum. Page generated in 0.03520 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top