Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Beginners Help with Plugin Paths
Beginners Help with Plugin Paths [message #279337] Sun, 16 January 2005 09:26 Go to next message
Eclipse UserFriend
Originally posted by: alan.battersby.ntlworld.com

Hi can anyone tell me what is going wrong?

I am working through the book 'Contributing to eclipse by Erich Gamma &
Kent Beck'. Nothing wrong with chapter 1 example - hello world.

Chapters 4-11 introduce a JUnit testing plugin to add a menu item to a
JUnit project to run a test. This is where my problems start I copied the
code from the book for chapters 4-6. Code comples ok but when I try to run
it in the runtime workbench I get a message that jar file cannot be found.

So I went to books site (http://www.awprofessional.com/titles/0321205758#)
and downloaded example code from there. Same problems occur, on loading
their source project code I get errors such as

"Project org.eclipse.contribution.junit is missing required Java project:
'org.eclipse.core.boot' "

Also the plug-in dependencies did not appear in package explorer.

To remove these errors I ran PDE Tools > Migrate to 3.0 which seemed to
update the paths etc so the code compiled ok. However when I run the
runtime workbench, create a junit project and try to run the menu item
created by the plugin I keep getting

org.eclipse.core.runtime.CoreException[0]: java.io.FileNotFoundException:
/contribjunit.jar

Which I assume means that the plugin cannot find the jar file and there is
a path problem but I dont know how to fix it.

I ve looked at this for several hours now can anyone help? Ive tried both
eclipse 3.01 and 3.1 and get the same results.


The plugin.xml file is

<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>
<plugin
id="org.eclipse.contribution.junit"
name="JUnit Plug-in"
version="1.0.0"
provider-name=""
class="org.eclipse.contribution.junit.JUnitPlugin">

<runtime>
<library name="contribjunit.jar">
<export name = "*"/>
</library>
</runtime>

<requires>
<import plugin="org.eclipse.core.runtime.compatibility"/>
<import plugin="org.eclipse.ui.ide"/>
<import plugin="org.eclipse.ui.views"/>
<import plugin="org.eclipse.jface.text"/>
<import plugin="org.eclipse.ui.workbench.texteditor"/>
<import plugin="org.eclipse.ui.editors"/>
<import plugin="org.eclipse.core.resources"/>
<import plugin="org.eclipse.ui"/>
<import plugin="org.eclipse.jdt.core"/>
<import plugin="org.junit"/>
<import plugin="org.eclipse.debug.core"/>
<import plugin="org.eclipse.jdt.launching"/>
</requires>

<extension-point id="listeners" name="Test Listeners"/>

<extension point="org.eclipse.ui.popupMenus">
<objectContribution
objectClass="org.eclipse.jdt.core.IType"
id="org.eclipse.contribution.junit.runtest">
<action
label="Run Test"
class="org.eclipse.contribution.junit.RunTestAction"
enablesFor="1"
id="org.eclipse.contribution.junit.runtest.action">
</action>
</objectContribution>
</extension>

<extension point="org.eclipse.contribution.junit.listeners">
<listener
class="org.eclipse.contribution.junit.RunTestAction$Listener ">
</listener>
</extension>

</plugin>
Re: Beginners Help with Plugin Paths [message #279338 is a reply to message #279337] Sun, 16 January 2005 10:00 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Chris_Laffra.ca.ibm.com

Normally, PDE will create a classpath to load your classes from your
workspace, and not the JAR.
Not seeing the entire stack dump in the exception, I am guessing here that
someone parses the plugin.xml and tries to find the jar.
If you examine your workspace, you will notice there is no jar (yet).

To get your plugin to work, you could right mouse click on plugin.xml and
generate a build.xml from the PDE sub menu.
Once you have the build.xml, right mouse click and run it.
Then, you should have the jar file.

However, this means you have to recreate the jar, each time before you
launch the runtime workbench.

--
Chris Laffra, http://eclipsefaq.org


"alan.battersby" <alan.battersby@ntlworld.com> wrote in message
news:csdthq$8d5$1@www.eclipse.org...
> Hi can anyone tell me what is going wrong?
>
> I am working through the book 'Contributing to eclipse by Erich Gamma &
> Kent Beck'. Nothing wrong with chapter 1 example - hello world.
>
> Chapters 4-11 introduce a JUnit testing plugin to add a menu item to a
> JUnit project to run a test. This is where my problems start I copied the
> code from the book for chapters 4-6. Code comples ok but when I try to run
> it in the runtime workbench I get a message that jar file cannot be found.
>
> So I went to books site (http://www.awprofessional.com/titles/0321205758#)
> and downloaded example code from there. Same problems occur, on loading
> their source project code I get errors such as
>
> "Project org.eclipse.contribution.junit is missing required Java project:
> 'org.eclipse.core.boot' "
>
> Also the plug-in dependencies did not appear in package explorer.
>
> To remove these errors I ran PDE Tools > Migrate to 3.0 which seemed to
> update the paths etc so the code compiled ok. However when I run the
> runtime workbench, create a junit project and try to run the menu item
> created by the plugin I keep getting
>
> org.eclipse.core.runtime.CoreException[0]: java.io.FileNotFoundException:
> /contribjunit.jar
>
> Which I assume means that the plugin cannot find the jar file and there is
> a path problem but I dont know how to fix it.
>
> I ve looked at this for several hours now can anyone help? Ive tried both
> eclipse 3.01 and 3.1 and get the same results.
>
>
> The plugin.xml file is
>
> <?xml version="1.0" encoding="UTF-8"?>
> <?eclipse version="3.0"?>
> <plugin
> id="org.eclipse.contribution.junit"
> name="JUnit Plug-in"
> version="1.0.0"
> provider-name=""
> class="org.eclipse.contribution.junit.JUnitPlugin">
>
> <runtime>
> <library name="contribjunit.jar">
> <export name = "*"/>
> </library>
> </runtime>
>
> <requires>
> <import plugin="org.eclipse.core.runtime.compatibility"/>
> <import plugin="org.eclipse.ui.ide"/>
> <import plugin="org.eclipse.ui.views"/>
> <import plugin="org.eclipse.jface.text"/>
> <import plugin="org.eclipse.ui.workbench.texteditor"/>
> <import plugin="org.eclipse.ui.editors"/>
> <import plugin="org.eclipse.core.resources"/>
> <import plugin="org.eclipse.ui"/>
> <import plugin="org.eclipse.jdt.core"/>
> <import plugin="org.junit"/>
> <import plugin="org.eclipse.debug.core"/>
> <import plugin="org.eclipse.jdt.launching"/>
> </requires>
>
> <extension-point id="listeners" name="Test Listeners"/>
>
> <extension point="org.eclipse.ui.popupMenus">
> <objectContribution
> objectClass="org.eclipse.jdt.core.IType"
> id="org.eclipse.contribution.junit.runtest">
> <action
> label="Run Test"
> class="org.eclipse.contribution.junit.RunTestAction"
> enablesFor="1"
> id="org.eclipse.contribution.junit.runtest.action">
> </action>
> </objectContribution>
> </extension>
>
> <extension point="org.eclipse.contribution.junit.listeners">
> <listener
> class="org.eclipse.contribution.junit.RunTestAction$Listener ">
> </listener>
> </extension>
>
> </plugin>
>
>
>
>
>
Re: Beginners Help with Plugin Paths [message #279342 is a reply to message #279338] Sun, 16 January 2005 13:31 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: alan.battersby.ntlworld.com

Chris Laffra wrote:

> Normally, PDE will create a classpath to load your classes from your
> workspace, and not the JAR.
> Not seeing the entire stack dump in the exception, I am guessing here that
> someone parses the plugin.xml and tries to find the jar.
> If you examine your workspace, you will notice there is no jar (yet).

> To get your plugin to work, you could right mouse click on plugin.xml and
> generate a build.xml from the PDE sub menu.
> Once you have the build.xml, right mouse click and run it.
> Then, you should have the jar file.

> However, this means you have to recreate the jar, each time before you
> launch the runtime workbench.

Thanks for the information Chris. I followed your instructions and
everything worked ok.

Alan
Re: Beginners Help with Plugin Paths [message #291849 is a reply to message #279342] Sun, 25 September 2005 02:22 Go to previous message
Eclipse UserFriend
Originally posted by: evandor.gmx.de

alan.battersby wrote:
> Chris Laffra wrote:
>
>> Normally, PDE will create a classpath to load your classes from your
>> workspace, and not the JAR.
>> Not seeing the entire stack dump in the exception, I am guessing here
>> that
>> someone parses the plugin.xml and tries to find the jar.
>> If you examine your workspace, you will notice there is no jar (yet).
>
>
>> To get your plugin to work, you could right mouse click on plugin.xml and
>> generate a build.xml from the PDE sub menu.
>> Once you have the build.xml, right mouse click and run it.
>> Then, you should have the jar file.
>
>
>> However, this means you have to recreate the jar, each time before you
>> launch the runtime workbench.
>
>
> Thanks for the information Chris. I followed your instructions and
> everything worked ok.
> Alan
>

maybe this is useful to someone: I had the same problem, and (as a quick
fix, I'm not yet sure if this doesn't bring up another problem) simply
did the following (after a couple of hours trying to get it work another
way):

I uncommented the following lines in TestRunner.java:

//classPath[1]=
// Platform.asLocalURL(new URL(url, "contribjunit.jar")).getFile();

as this is the above mentioned piece of code that tries to load the jar.

After that, the JUnit Plugin Test ran without errors and I didn't get
the IOException for /contribjunit.jar any more.

Carsten
Previous Topic:Deleting files...
Next Topic:FontRegistry doesn't use ClassLoader (Eclipse 3.1)
Goto Forum:
  


Current Time: Sat Jul 19 21:11:32 EDT 2025

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

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

Back to the top