rcp and external jars [message #394704] |
Sat, 20 November 2004 15:03  |
Eclipse User |
|
|
|
Originally posted by: k.oriordan.oceanfree.net
My program needs extra JARs in its classpath (I'm using XML Stax
parser). Tester methods run fine, I have the jar files in my project
build path. However even when I add the jars to the runtime dependancies
section of my plugin.xml, running my program as an RCP application still
complains of (provider com.bea.xml.stream.MXParserFactory not found)
even though it's in one of the JARs I provided as a dependancy?
Anyone got any ideas?
Kevin.
|
|
|
|
|
Re: rcp and external jars [message #394710 is a reply to message #394709] |
Sun, 21 November 2004 11:38   |
Eclipse User |
|
|
|
Originally posted by: Lamont_Gilbert.rigidsoftware.com
Did you select the jars for the Source or Binary build? I would suspect
they should be selected for the Binary build.
Also, how can you use classes at runtime that you dont at compile time?
Only way I can think of is to use the class name and instantiate it?
Kevin O'Riordan wrote:
> That didn't work unfortunately. The files are only needed at runtime
> anyway (they get picked up by a Factory class).
>
> Kevin.
>
> Alejandro Narancio wrote:
>
>> You select the jar files in the build tab of the plugin.xml?
>>
>> Regards,
>>
>> Alejandro
>>
>> Kevin O'Riordan wrote:
>>
>>> My program needs extra JARs in its classpath (I'm using XML Stax
>>> parser). Tester methods run fine, I have the jar files in my project
>>> build path. However even when I add the jars to the runtime
>>> dependancies section of my plugin.xml, running my program as an RCP
>>> application still complains of (provider
>>> com.bea.xml.stream.MXParserFactory not found) even though it's in one
>>> of the JARs I provided as a dependancy?
>>
>>
>>
>>> Anyone got any ideas?
>>
>>
>>
>>> Kevin.
>>
>>
>>
>>
--
Respectfully,
CL Gilbert
"Verily, verily, I say unto you, He that entereth not by the door() into
the sheepfold{}, but climbeth up some other *way, the same is a thief
and a robber."
GnuPG Key Fingerprint:
82A6 8893 C2A1 F64E A9AD 19AE 55B2 4CD7 80D2 0A2D
For a free Java interface to Freechess.org see
http://www.rigidsoftware.com/Chess/chess.html
|
|
|
|
|
|
|
|
|
Re: rcp and external jars [message #395612 is a reply to message #395602] |
Wed, 24 November 2004 12:17   |
Eclipse User |
|
|
|
Hmmm, can you enter a bug report in Platform>Runtime with this info. Also,
if you would, include the manifest file that we generate for your plugin.
It should be in
<install
location> /eclipse/configuration/org.eclipse.osgi/manifests/GraphEdit_ 0.0.0.m
f
or some such. If you want do some inspection there, all the packages that
you are looking for should be "provided" in the manifest.
Also, I am a little unclear what you mean by "tester methods" and "running
your RCP application". When you are "testing" are you running an Eclipse
instance or just a Java program?
Please ensure that you are using -clean on the command line when launching
your RCP application. This will toss and regen any cached info (e.g.,
generated manifest files).
Jeff
"Kevin O'Riordan" <k.oriordan@oceanfree.net> wrote in message
news:co03op$gt1$1@www.eclipse.org...
> Jeff McAffer wrote:
> > Now I was all keen to help you until I read the last line of your
post...
> > ;-)
> >
> > I suspect the problem lies somewhere around your statement "I add the
jars
> > to the runtime dependancies
> > section of my plugin.xml". What exactly does that mean?
> >
> > In the plugin.xml you can either state that you depend on some other
> > *plugin* or that you include some jars on your classpath. If you define
a
> > plugin for your "external jars" (and export their code in the
plugin.xml)
> > then you should simply list them in the <requires> statement of your
> > consuming plugin.xml. If you want to put the external jars directly in
your
> > plugin then put them in there and list them in <library> statements.
> >
> > What are you doing that is different from this?
> >
> > Jeff
>
> I'm definitely adding those jars using <library> tags
>
> Here's my plugin.xml:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <?eclipse version="3.0"?>
> <plugin
> id="GraphEdit"
> name="%pluginName"
> version="0.0.0"
> provider-name="%providerName">
>
> <runtime>
> <library name="jsr173_1.0_ri.jar">
> <export name="*"/>
> </library>
> <library name="jsr173_1.0_api.jar">
> <export name="*"/>
> </library>
> <library name="GraphEdit.jar">
> <export name="*"/>
> </library>
> </runtime>
> <requires>
> <import plugin="org.eclipse.core.runtime"/>
> <import plugin="org.eclipse.ui"/>
> <import plugin="org.eclipse.core.resources"/>
> <import plugin="org.eclipse.gef"/>
> <import plugin="org.eclipse.ui.ide"/>
> </requires>
>
> <extension point="org.eclipse.ui.editors">
> <editor name="%editor.name" icon="icons/alt16.gif" extensions="xml"
> class="GraphEdit.editor.MyEditor"
> contributorClass="GraphEdit.action.MyActionBarContributor"
> id="GraphEdit.editor.MyEditor">
> </editor>
> </extension>
>
> <extension
> id="RcpApplication"
> point="org.eclipse.core.runtime.applications">
> <application>
> <run
> class="GraphEdit.rcp.RcpApplication">
> </run>
> </application>
> </extension>
> <extension
> point="org.eclipse.ui.perspectives">
> <perspective
> name="%perspectiveName"
> class="GraphEdit.rcp.RcpPerspective"
> id="GraphEdit.rcp.RcpPerspective">
> </perspective>
> </extension>
>
> <extension
> point="org.eclipse.ui.views">
> <category
> name="SampleCategory"
> id="GraphEdit.viewCategory">
> </category>
> <view
> name="Sample"
> icon="icons/alt16.gif"
> category="GraphEdit.viewCategory"
> class="GraphEdit.views.SampleView"
> id="GraphEdit.views.SampleView">
> </view>
> </extension>
> </plugin>
>
> My tester methods pick up those jar files fine, but when I run my RCP
> application I get:
>
> Unhandled event loop exception
> Reason:
> Provider com.bea.xml.stream.MXParserFactory not found
>
> MXParserFactory being a class file inside jsr173_1.0_ri.jar
>
>
> >
> > p.s., I doubt that it is relevant here but will mention for
completeness.
> > XML stuff is a bit strange wiht JDK1.4 because it includes an XML parser
> > directly in the "endorsed dirs" which are added to the boot classpath.
As a
> > result, you always get various XML bits from there and no matter what
you
> > do, you will not be able to override types found there. You have to
disable
> > the endorsed XML parser (Crimson on a Sun VM or Xerces on a IBM VM) if
you
> > want to use your own. There may be some random interaction like that
going
> > on.
> >
>
> I think this part of the equation is fine as my tester methods run
> perfectly.
>
> :(
|
|
|
Re: rcp and external jars [message #395814 is a reply to message #395605] |
Wed, 24 November 2004 16:23  |
Eclipse User |
|
|
|
Originally posted by: k.oriordan.oceanfree.net
Don McKee wrote:
>> My tester methods pick up those jar files fine, but when I run my RCP
>> application I get:
>>
>> Unhandled event loop exception
>> Reason:
>> Provider com.bea.xml.stream.MXParserFactory not found
>>
>> MXParserFactory being a class file inside jsr173_1.0_ri.jar
>
>
> Have you tried the trick of:
>
> Thread current = Thread.currentThread();
> ClassLoader old = current.getContextClassLoader();
> try{
> current.setContextClassLoader( getClass().getClassLoader() );
> // do stuff that's trying to find MXParserFactory
> } finally {
> current.setContetClassLoader( old );
> }
>
> I've often had to do this when using factory classes, though I don't
> know if it applies here.
>
> -Don
Finally, a solution that worked. Thank you so much :)
Kevin.
|
|
|
Powered by
FUDForum. Page generated in 0.05896 seconds