Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Workspace closed...
Workspace closed... [message #311958] Fri, 26 January 2007 12:35 Go to next message
Eclipse UserFriend
Originally posted by: s0347354.sms.ed.ac.uk

Hey All,

I've read all the previous threads on this topic, but they do not help
my situation. I am using equinox and am running Jetty within eclipse to
serve web pages that are generated by servlets. The servlets need to
interact with the eclipse runtime and the workspace (I had this all
working previously, but I have since broken it and can't work out what
is wrong). The program stalls at line:

ResourcesPlugin.getWorkspace()

with error:

java.lang.NoClassDefFoundError: org/eclipse/core/resources/ResourcesPlugin

I have org.eclipse.core.resources as one of my plug-in dependencies, so
I do not see why it cannot find the class. I can get round this problem
by extracting the files from the plugin, and then placing them in my
"classes" folder, but then i get a "workspace is closed" error, which I
think is because it is a different copy of the IResource class, so
cannot interact with the Eclipse runtime.

I am very stuck on this, and any help is much appreciated.

Will
Re: Workspace closed... [message #311964 is a reply to message #311958] Fri, 26 January 2007 13:49 Go to previous messageGo to next message
Eclipse UserFriend
Will, as I understand it you have code that compiles (classes found)
but fails at runtime with class not found. If true then you have a
common problem caused by the confusing classpath set up in eclipse.
There are at least three different classpaths:
1) compile time
2) runtime
3) source code at debug
There are at least four different places these are controlled:
1) MANIFEST.MF
2) Preferences PDE Target Platform
3) Project Right click Build Path Configure Build Path
4) Launch Configuration.
Unless you know what you are doing, the first thing to do is make
sure that you only use MANIFEST.MF. In particular the Configure Build
Path has to be cleared out of anything you put in there because it is
only seen at compile time.

In the MANIFEST.MF systematically try to use
Dependencies->RequiredPlugins and avoid Runtime->Classpath for anything
other than classes for your plugin. The theoretical best solution is
to use "ImportedPackages" but its not clear to me what this thing does
in practice.

If you still have trouble, go in to the source at the line
ResourcesPlugin.getWorkspace()
and "Open Declaration" on the method. Then use the little double arrow
thingy on Package Explorer to sync the package view to the method. That
will tell you what lib/plugin is bound at compile time. Then you need
to run the debugger to the line and figure out why that lib/plugin is
not on the path.

I eventually got jetty to work after a few rounds of this kind of thing.

Hope this helps,
John.

Will Ryan wrote:
> Hey All,
>
> I've read all the previous threads on this topic, but they do not help
> my situation. I am using equinox and am running Jetty within eclipse to
> serve web pages that are generated by servlets. The servlets need to
> interact with the eclipse runtime and the workspace (I had this all
> working previously, but I have since broken it and can't work out what
> is wrong). The program stalls at line:
>
> ResourcesPlugin.getWorkspace()
>
> with error:
>
> java.lang.NoClassDefFoundError: org/eclipse/core/resources/ResourcesPlugin
>
> I have org.eclipse.core.resources as one of my plug-in dependencies, so
> I do not see why it cannot find the class. I can get round this problem
> by extracting the files from the plugin, and then placing them in my
> "classes" folder, but then i get a "workspace is closed" error, which I
> think is because it is a different copy of the IResource class, so
> cannot interact with the Eclipse runtime.
>
> I am very stuck on this, and any help is much appreciated.
>
> Will
Re: Workspace closed... [message #311966 is a reply to message #311964] Fri, 26 January 2007 15:21 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: s0347354.sms.ed.ac.uk

Hey John,

Thanks for that- it really helped... Now I have worked out that the
plugins were not being started, so I upped their default start level,
and this fixed that problem... however, the workspace closed thing is
still an issue. I had it working before such that I was using Equinox
and Jetty to interact with the workspace (using servlets). I don't know
how i got it working (it was a bit of a hack job). Now however, it does
not work, and all I am seeing in the newsgroups is that you have to make
a plugin (and run the plugin as a java application) in order to interact
with the Eclipse runtime.

Is there a way of using equinox to interact with the default
workspace... I have cc'd this to the equinox mailing list also.

Thanks for your time. I really appreciate it.

Will

JOHN J. BARTON wrote:
> Will, as I understand it you have code that compiles (classes found)
> but fails at runtime with class not found. If true then you have a
> common problem caused by the confusing classpath set up in eclipse.
> There are at least three different classpaths:
> 1) compile time
> 2) runtime
> 3) source code at debug
> There are at least four different places these are controlled:
> 1) MANIFEST.MF
> 2) Preferences PDE Target Platform
> 3) Project Right click Build Path Configure Build Path
> 4) Launch Configuration.
> Unless you know what you are doing, the first thing to do is make
> sure that you only use MANIFEST.MF. In particular the Configure Build
> Path has to be cleared out of anything you put in there because it is
> only seen at compile time.
>
> In the MANIFEST.MF systematically try to use
> Dependencies->RequiredPlugins and avoid Runtime->Classpath for anything
> other than classes for your plugin. The theoretical best solution is
> to use "ImportedPackages" but its not clear to me what this thing does
> in practice.
>
> If you still have trouble, go in to the source at the line
> ResourcesPlugin.getWorkspace()
> and "Open Declaration" on the method. Then use the little double arrow
> thingy on Package Explorer to sync the package view to the method. That
> will tell you what lib/plugin is bound at compile time. Then you need
> to run the debugger to the line and figure out why that lib/plugin is
> not on the path.
>
> I eventually got jetty to work after a few rounds of this kind of thing.
>
> Hope this helps,
> John.
>
> Will Ryan wrote:
>> Hey All,
>>
>> I've read all the previous threads on this topic, but they do not help
>> my situation. I am using equinox and am running Jetty within eclipse
>> to serve web pages that are generated by servlets. The servlets need
>> to interact with the eclipse runtime and the workspace (I had this all
>> working previously, but I have since broken it and can't work out what
>> is wrong). The program stalls at line:
>>
>> ResourcesPlugin.getWorkspace()
>>
>> with error:
>>
>> java.lang.NoClassDefFoundError:
>> org/eclipse/core/resources/ResourcesPlugin
>>
>> I have org.eclipse.core.resources as one of my plug-in dependencies,
>> so I do not see why it cannot find the class. I can get round this
>> problem by extracting the files from the plugin, and then placing them
>> in my "classes" folder, but then i get a "workspace is closed" error,
>> which I think is because it is a different copy of the IResource
>> class, so cannot interact with the Eclipse runtime.
>>
>> I am very stuck on this, and any help is much appreciated.
>>
>> Will
Re: Workspace closed... [message #311970 is a reply to message #311966] Fri, 26 January 2007 17:55 Go to previous message
Eclipse UserFriend
Good to hear that you made progress.

I don't understand what you mean by "using equinox to interact with the
default workspace". Equinox is the framework that starts the workspace:
Equinox starts all of the plugins that define the workspace. I guess
you mean "using the http plugins in equinox project to run servlets in
other plugins"? If so I recommend:
http://www.knopflerfish.org/osgi_service_tutorial.html#white
I do think the equinox team uses extension points instead to do this
connection.

Rather than tweeking the start level, you might consider a different
strategy: be sure to use Eclipse-LazyStart: true and start the
plugins either by class loading or -- rarely -- by explicit calls to
Bundle.start(). For example my servlet-offering plugin triggers
my server-starting plugin by class loading, ie Plugin.getDefault().
My server-starting plugin start the server explicit by calling
bundle.start() because the plugin does not have LazyStart.

John.

Will Ryan wrote:
> Hey John,
>
> Thanks for that- it really helped... Now I have worked out that the
> plugins were not being started, so I upped their default start level,
> and this fixed that problem... however, the workspace closed thing is
> still an issue. I had it working before such that I was using Equinox
> and Jetty to interact with the workspace (using servlets). I don't know
> how i got it working (it was a bit of a hack job). Now however, it does
> not work, and all I am seeing in the newsgroups is that you have to make
> a plugin (and run the plugin as a java application) in order to interact
> with the Eclipse runtime.
>
> Is there a way of using equinox to interact with the default
> workspace... I have cc'd this to the equinox mailing list also.
>
> Thanks for your time. I really appreciate it.
>
> Will
>
> JOHN J. BARTON wrote:
>
>> Will, as I understand it you have code that compiles (classes found)
>> but fails at runtime with class not found. If true then you have a
>> common problem caused by the confusing classpath set up in eclipse.
>> There are at least three different classpaths:
>> 1) compile time
>> 2) runtime
>> 3) source code at debug
>> There are at least four different places these are controlled:
>> 1) MANIFEST.MF
>> 2) Preferences PDE Target Platform
>> 3) Project Right click Build Path Configure Build Path
>> 4) Launch Configuration.
>> Unless you know what you are doing, the first thing to do is make
>> sure that you only use MANIFEST.MF. In particular the Configure Build
>> Path has to be cleared out of anything you put in there because it is
>> only seen at compile time.
>>
>> In the MANIFEST.MF systematically try to use
>> Dependencies->RequiredPlugins and avoid Runtime->Classpath for anything
>> other than classes for your plugin. The theoretical best solution is
>> to use "ImportedPackages" but its not clear to me what this thing does
>> in practice.
>>
>> If you still have trouble, go in to the source at the line
>> ResourcesPlugin.getWorkspace()
>> and "Open Declaration" on the method. Then use the little double arrow
>> thingy on Package Explorer to sync the package view to the method.
>> That will tell you what lib/plugin is bound at compile time. Then you
>> need
>> to run the debugger to the line and figure out why that lib/plugin is
>> not on the path.
>>
>> I eventually got jetty to work after a few rounds of this kind of thing.
>>
>> Hope this helps,
>> John.
>>
>> Will Ryan wrote:
>>
>>> Hey All,
>>>
>>> I've read all the previous threads on this topic, but they do not
>>> help my situation. I am using equinox and am running Jetty within
>>> eclipse to serve web pages that are generated by servlets. The
>>> servlets need to interact with the eclipse runtime and the workspace
>>> (I had this all working previously, but I have since broken it and
>>> can't work out what is wrong). The program stalls at line:
>>>
>>> ResourcesPlugin.getWorkspace()
>>>
>>> with error:
>>>
>>> java.lang.NoClassDefFoundError:
>>> org/eclipse/core/resources/ResourcesPlugin
>>>
>>> I have org.eclipse.core.resources as one of my plug-in dependencies,
>>> so I do not see why it cannot find the class. I can get round this
>>> problem by extracting the files from the plugin, and then placing
>>> them in my "classes" folder, but then i get a "workspace is closed"
>>> error, which I think is because it is a different copy of the
>>> IResource class, so cannot interact with the Eclipse runtime.
>>>
>>> I am very stuck on this, and any help is much appreciated.
>>>
>>> Will
Previous Topic:Drag and Drop problem in Common Navigator Framework
Next Topic:Eclipse.fetch
Goto Forum:
  


Current Time: Fri Sep 19 02:31:27 EDT 2025

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

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

Back to the top