Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Problem using Saxon in a Plugin project
Problem using Saxon in a Plugin project [message #267325] Tue, 17 August 2004 10:42 Go to next message
Eclipse UserFriend
Hi,

I'm using Saxon in one of my plugins and have a problem with closing
Eclipse. I get the following error:
javax.xml.transform.TransformerFactoryConfigurationError: Provider
net.sf.saxon.TransformerFactoryImpl could not be instantiated:
java.lang.NullPointerException
at javax.xml.transform.TransformerFactory.newInstance(Unknown Source)
at org.eclipse.ui.XMLMemento.save(XMLMemento.java:410)
at org.eclipse.ui.internal.Workbench.saveMementoToFile(Workbenc h.java:1415)
at org.eclipse.ui.internal.Workbench.access$6(Workbench.java:14 09)

It seems that Eclipse is using Saxon for transforming the XML memento of its
workspace. If I don't export the saxon JAR in my project, the shutdown of
Eclipse works, but my plugin not ;)
If I add saxon as a plugin dependency, I get the error above. Any idea if
such library conflicts are possible and how to resolve them?

TIA,

Thorsten
Re: Problem using Saxon in a Plugin project [message #267396 is a reply to message #267325] Tue, 17 August 2004 16:43 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: chaves.nospam.inf.ufsc.br.ok

The following link states that the javax.xml.transform.TransformerFactory
property defines which implementation is to be used. If the property is
not specified, the one provided by the platform (Xalan on Sun's JRE) will
be used.

http://java.sun.com/j2se/1.4.2/docs/api/javax/xml/transform/ TransformerFactory.html

Saxon sets itself as being "the" transformer factory implementation, and
this is why Eclipse ends up using it.

Class loading causes plug-ins to be automatically activated. During
shutdown, all plug-ins are automatically stopped by pre-requisite order.
After a plug-in has been automatically stopped, it it cannot be restarted
by this mechanism, and classloading fails.

We suggest the following workaround (which does not work on 2.1):
- provide the Saxon code as a completely separate plug-in, with an OSGi
manifest (first page of the plug-in creation wizard)
- in the PDE plug-in manifest editor, Runtime tab, set the activation rule
to not activate the plug-in. This will disable auto-activation for Saxon
plug-in, which is not needed anyway (since it is not an actual Eclipse
plug-in, just a wrapper)

If you need to run on 2.1 (do you?), the workaround is slightly different.

We will be curious whether this solves your problem.

Rafael
Re: Problem using Saxon in a Plugin project [message #267483 is a reply to message #267396] Wed, 18 August 2004 05:22 Go to previous messageGo to next message
Eclipse UserFriend
Hi Rafael,

> We suggest the following workaround (which does not work on 2.1):
> - provide the Saxon code as a completely separate plug-in, with an OSGi
> manifest (first page of the plug-in creation wizard)
> - in the PDE plug-in manifest editor, Runtime tab, set the activation rule
> to not activate the plug-in. This will disable auto-activation for Saxon
> plug-in, which is not needed anyway (since it is not an actual Eclipse
> plug-in, just a wrapper)

I tried this solution, but the plugin which depends on the newly created
Saxon plugin cannot find the Saxon classes. I changed the following things:
1. Created a Saxon-Plugin
2. Updated my plugin to use only 3.0 functionality, removed JARs from my
plugin and added plugin dependency to Saxon plugin

The Saxon-Plugin-Manifest looks like this:
Manifest-Version: 1.0
Bundle-Name: Saxon Plug-in
Bundle-SymbolicName: Saxon
Bundle-Version: 1.0.0
Bundle-Vendor: Darmstadt University of Technology
Bundle-Localization: plugin
Eclipse-AutoStart: false
Bundle-ClassPath: saxon8.jar,saxon8-jdom.jar,saxon8-sql.jar,saxpath.jar

The Saxon-Plugin-Plugin.xml is quite empty:
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>
<plugin>
</plugin>

However, the first time I use a Saxon in my plugin, I get the following
error:
java.lang.NoClassDefFoundError: net/sf/saxon/xpath/XPathException
at de.tud.xirc.db.ResourceManager.<init>(ResourceManager.java:102)
at ...

Any ideas what's going wrong?

Thanks,

Thorsten
Re: Problem using Saxon in a Plugin project [message #267606 is a reply to message #267483] Wed, 18 August 2004 13:11 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: chaves.nospam.inf.ufsc.br.ok

Thorsten, you need to explicitly provide every package that is to be
accessed by other plug-ins (you don't need to worry about those starting
with provided by the JRE (javax.*), though). In the PDE editor's "Runtime"
tab, you can add packages that appear in the JARs specified in the runtime
libraries (the Bundle-Classpath header).

HTH,

Rafael

> The Saxon-Plugin-Manifest looks like this:
> Manifest-Version: 1.0
> Bundle-Name: Saxon Plug-in
> Bundle-SymbolicName: Saxon
> Bundle-Version: 1.0.0
> Bundle-Vendor: Darmstadt University of Technology
> Bundle-Localization: plugin
> Eclipse-AutoStart: false
> Bundle-ClassPath: saxon8.jar,saxon8-jdom.jar,saxon8-sql.jar,saxpath.jar
Re: Problem using Saxon in a Plugin project [message #268143 is a reply to message #267606] Sun, 22 August 2004 09:53 Go to previous message
Eclipse UserFriend
Hi,

> you need to explicitly provide every package that is to be
> accessed by other plug-ins (you don't need to worry about those starting
> with provided by the JRE (javax.*), though).

Thanks, that helped.

Greetings,

Thorsten
Previous Topic:maintaining two differing views of same source code
Next Topic:Feature not shown?
Goto Forum:
  


Current Time: Wed May 28 23:14:09 EDT 2025

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

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

Back to the top