How do I resolve a dependency in an Eclipse plug-in I didn't write?

I am trying to use a relatively new Eclipse plugin ( http://uqbar-tomcat-xt.sourceforge.net/download.html ). It doesn't have an update site, so I can't install it through the interface in Eclipse, which usually resolves dependencies. All that is available for download is one .jar and the instructions on the website say to just drop it into eclipse / plugins. When I do this, it works, in the sense that I get new options in Window โ†’ Show View that the plugin has to add. However, when I try to use any of these views, I get the following error:

org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter$TerminatingClassNotFoundException: An error occurred while automatically activating bundle org.uqbar.eclipse.tomcat.xt (304).
    at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:125)
    at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:449)
    at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:211)
...snip...
Caused by: org.osgi.framework.BundleException: The activator org.uqbar.eclipse.tomcat.xt.UqbarSydeoXtActivator for bundle org.uqbar.eclipse.tomcat.xt is invalid
    at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadBundleActivator(AbstractBundle.java:157)
...snip...
Caused by: java.lang.Error: Unresolved compilation problems: 
    The import com.thoughtworks cannot be resolved
    XStream cannot be resolved to a type
    XStream cannot be resolved to a type
    XStream cannot be resolved to a type

      

The dependencies page of the above site contains several dependencies including an XStream. I tried downloading these .jars separately and dropping them into the eclipse / plugins directory, but that did not resolve the error. When I look at the manifesto in the bank I see:

Bundle-ClassPath: .,commons-logging-1.0.4.jar,xpp3_min-1.1.4c.jar,xstr
 eam-1.3.jar,xstream-benchmark-1.3.jar

      

But obviously xstream jars are not available in the classpath (which is where?). I'm not sure where I can put them so that they are recognized by the plugin.

I tried to contact the developers and got no response, so I turn to SO. Is there anything I can do, or is the plugin packaged incorrectly?

Update: Apparently the error is happening in the activator and not in the plugin itself. I tried to import the plugin as a source project, but the src / directory is empty. The plugin does not appear in the list of available deployable plugins when I try to export it. So it's not decided yet.

+2


source to share


2 answers


You can define an Eclipse snippet with a missing dependency on its classpath (usually in the snippet's lib directory and specified in the classpath in the manifest).

Fragment is a special type of plugin that is tied to the target plugin. The snippet is merged into the target plugin at runtime, so the classes in the plugin will have access to the jar.



See this question for some pointers to snippet creation.

+2


source


Many fixes for Vendor have been fixed, although the real issue is a crappy plugin that defines a bunch of 3rd party libraries on Bundle-ClassPath

but doesn't actually include them! Bundle-ClassPath

is the classpath associated with the package, so any associated libraries must be inside the package.



Since the source code is included, you can rebuild the plugin with missing dependencies (license permission), although I think all these third party dependencies should be external, but this is a completely different discussion on how to write OSGi / Eclipse plugins.

+1


source







All Articles