Home » Eclipse Projects » Eclipse Platform » can't find class IFile
can't find class IFile [message #261193] |
Tue, 13 July 2004 11:39  |
Eclipse User |
|
|
|
I'm encountering an odd problem. I'm running our application in the
debugger. When I go to load my wizard, I get an error stating
org/eclipse/core/resources/IFile can not be found.
I made sure that org.eclipse.core.resource was a required plugin in my
plugin file:
<requires>
<import plugin="org.eclipse.core.boot"/>
<import plugin="org.eclipse.core.resources"/>
<import plugin="org.eclipse.core.runtime"/>
...
I also have org.eclipse.core.resources checked as a visible plugin from
the debug wizard menu, so it should load it fine.
Other than that, I don't see why it can't find it.
Here is a snippet of the log:
!SESSION Jul 13, 2004 11:33:35.609
---------------------------------------------
java.version=1.4.1_02
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Command-line arguments: -pdelaunch -dev bin,runtime -feature
org.eclipse.platform -data C:\ADE\runtime-workspace -os win32 -ws win32
-arch x86 -nl en_US -configuration
file:C:/ADE/workspace/.metadata/.plugins/org.eclipse.pde.cor e/C__ADE_runtime-workspace/platform.cfg
-install file:C:/ADE/
!ENTRY org.eclipse.ui.workbench 4 2 Jul 13, 2004 11:33:35.609
!MESSAGE Problems occurred when invoking code from plug-in:
"org.eclipse.ui.workbench".
!STACK 0
java.lang.NoClassDefFoundError: org/eclipse/core/resources/IFile
at
com.avaya.ade.core.ui.wizards.ADEProjectWizard.<init>(ADEProjectWizard.java:93)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Nativ e Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(Native ConstructorAccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(De legatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:2 74)
at java.lang.Class.newInstance0(Class.java:306)
|
|
|
Re: can't find class IFile [message #261206 is a reply to message #261193] |
Tue, 13 July 2004 12:04   |
Eclipse User |
|
|
|
Originally posted by: ddmonner.rockwellcollins.com
It looks like you're trying to create an IFile, which is an interface, not a
class. To get an IFile (representing a file in the Eclipse workspace), you
have to get the workspace root and then call getFile("filename") on it:
IFile myIFile =
ResourcesPlugin.getWorkspace().getRoot().getFile("myFileName ");
Then, you can create it (if it doesn't exist) or open it:
if(myIFile.exists())
... = myIFile.getContents();
else
myIFile.create(...);
Hope that helps.
Derek Monner
"NG" <neilg@avaya.com> wrote in message news:cd0vna$1ub$1@eclipse.org...
> I'm encountering an odd problem. I'm running our application in the
> debugger. When I go to load my wizard, I get an error stating
> org/eclipse/core/resources/IFile can not be found.
>
> I made sure that org.eclipse.core.resource was a required plugin in my
> plugin file:
> <requires>
> <import plugin="org.eclipse.core.boot"/>
> <import plugin="org.eclipse.core.resources"/>
> <import plugin="org.eclipse.core.runtime"/>
> ...
>
> I also have org.eclipse.core.resources checked as a visible plugin from
> the debug wizard menu, so it should load it fine.
>
> Other than that, I don't see why it can't find it.
>
>
> Here is a snippet of the log:
> !SESSION Jul 13, 2004 11:33:35.609
> ---------------------------------------------
> java.version=1.4.1_02
> java.vendor=Sun Microsystems Inc.
> BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
> Command-line arguments: -pdelaunch -dev bin,runtime -feature
> org.eclipse.platform -data C:\ADE\runtime-workspace -os win32 -ws win32
> -arch x86 -nl en_US -configuration
>
file:C:/ADE/workspace/.metadata/.plugins/org.eclipse.pde.cor e/C__ADE_runtime-workspace/platform.cfg
> -install file:C:/ADE/
> !ENTRY org.eclipse.ui.workbench 4 2 Jul 13, 2004 11:33:35.609
> !MESSAGE Problems occurred when invoking code from plug-in:
> "org.eclipse.ui.workbench".
> !STACK 0
> java.lang.NoClassDefFoundError: org/eclipse/core/resources/IFile
> at
>
com.avaya.ade.core.ui.wizards.ADEProjectWizard.<init>(ADEProjectWizard.java:
93)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Nativ e Method)
> at
>
sun.reflect.NativeConstructorAccessorImpl.newInstance(Native ConstructorAcces
sorImpl.java:39)
> at
>
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(De legatingConstruc
torAccessorImpl.java:27)
> at java.lang.reflect.Constructor.newInstance(Constructor.java:2 74)
> at java.lang.Class.newInstance0(Class.java:306)
>
|
|
|
Re: can't find class IFile [message #261252 is a reply to message #261206] |
Tue, 13 July 2004 13:38   |
Eclipse User |
|
|
|
Thanks for the reply.
I am using it as you mentioned:
modelFile =
ResourcesPlugin.getWorkspace().getRoot().getFile(projpath.ap pend(ADE.NAVIGATOR_FILE_NAME));
The problem stems from the fact it doesn't even find the definition of
IFile. It gives a noclassdef error even though I have the resources
plugin available.
Is there anyplace else I might have to setup something up to find that
plugin?
Derek Monner wrote:
> It looks like you're trying to create an IFile, which is an interface, not a
> class. To get an IFile (representing a file in the Eclipse workspace), you
> have to get the workspace root and then call getFile("filename") on it:
> IFile myIFile =
> ResourcesPlugin.getWorkspace().getRoot().getFile("myFileName ");
> Then, you can create it (if it doesn't exist) or open it:
> if(myIFile.exists())
> ... = myIFile.getContents();
> else
> myIFile.create(...);
> Hope that helps.
> Derek Monner
> "NG" <neilg@avaya.com> wrote in message news:cd0vna$1ub$1@eclipse.org...
> > I'm encountering an odd problem. I'm running our application in the
> > debugger. When I go to load my wizard, I get an error stating
> > org/eclipse/core/resources/IFile can not be found.
> >
> > I made sure that org.eclipse.core.resource was a required plugin in my
> > plugin file:
> > <requires>
> > <import plugin="org.eclipse.core.boot"/>
> > <import plugin="org.eclipse.core.resources"/>
> > <import plugin="org.eclipse.core.runtime"/>
> > ...
> >
> > I also have org.eclipse.core.resources checked as a visible plugin from
> > the debug wizard menu, so it should load it fine.
> >
> > Other than that, I don't see why it can't find it.
> >
> >
> > Here is a snippet of the log:
> > !SESSION Jul 13, 2004 11:33:35.609
> > ---------------------------------------------
> > java.version=1.4.1_02
> > java.vendor=Sun Microsystems Inc.
> > BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
> > Command-line arguments: -pdelaunch -dev bin,runtime -feature
> > org.eclipse.platform -data C:ADEruntime-workspace -os win32 -ws win32
> > -arch x86 -nl en_US -configuration
> >
>
file:C:/ADE/workspace/.metadata/.plugins/org.eclipse.pde.cor e/C__ADE_runtime-workspace/platform.cfg
> > -install file:C:/ADE/
> > !ENTRY org.eclipse.ui.workbench 4 2 Jul 13, 2004 11:33:35.609
> > !MESSAGE Problems occurred when invoking code from plug-in:
> > "org.eclipse.ui.workbench".
> > !STACK 0
> > java.lang.NoClassDefFoundError: org/eclipse/core/resources/IFile
> > at
> >
> com.avaya.ade.core.ui.wizards.ADEProjectWizard.<init>(ADEProjectWizard.java:
> 93)
> > at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Nativ e Method)
> > at
> >
> sun.reflect.NativeConstructorAccessorImpl.newInstance(Native ConstructorAcces
> sorImpl.java:39)
> > at
> >
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(De legatingConstruc
> torAccessorImpl.java:27)
> > at java.lang.reflect.Constructor.newInstance(Constructor.java:2 74)
> > at java.lang.Class.newInstance0(Class.java:306)
> >
|
|
|
Re: can't find class IFile [message #261260 is a reply to message #261252] |
Tue, 13 July 2004 13:56  |
Eclipse User |
|
|
|
Ah, looks like I solved it. There was another plugin that was loaded by
this one that required the resources plugin and it wasn't in that plugins
list of required.
NG wrote:
> Thanks for the reply.
> I am using it as you mentioned:
> modelFile =
>
ResourcesPlugin.getWorkspace().getRoot().getFile(projpath.ap pend(ADE.NAVIGATOR_FILE_NAME));
> The problem stems from the fact it doesn't even find the definition of
> IFile. It gives a noclassdef error even though I have the resources
> plugin available.
> Is there anyplace else I might have to setup something up to find that
> plugin?
> Derek Monner wrote:
> > It looks like you're trying to create an IFile, which is an interface, not
a
> > class. To get an IFile (representing a file in the Eclipse workspace), you
> > have to get the workspace root and then call getFile("filename") on it:
> > IFile myIFile =
> > ResourcesPlugin.getWorkspace().getRoot().getFile("myFileName ");
> > Then, you can create it (if it doesn't exist) or open it:
> > if(myIFile.exists())
> > ... = myIFile.getContents();
> > else
> > myIFile.create(...);
> > Hope that helps.
> > Derek Monner
> > "NG" <neilg@avaya.com> wrote in message news:cd0vna$1ub$1@eclipse.org...
> > > I'm encountering an odd problem. I'm running our application in the
> > > debugger. When I go to load my wizard, I get an error stating
> > > org/eclipse/core/resources/IFile can not be found.
> > >
> > > I made sure that org.eclipse.core.resource was a required plugin in my
> > > plugin file:
> > > <requires>
> > > <import plugin="org.eclipse.core.boot"/>
> > > <import plugin="org.eclipse.core.resources"/>
> > > <import plugin="org.eclipse.core.runtime"/>
> > > ...
> > >
> > > I also have org.eclipse.core.resources checked as a visible plugin from
> > > the debug wizard menu, so it should load it fine.
> > >
> > > Other than that, I don't see why it can't find it.
> > >
> > >
> > > Here is a snippet of the log:
> > > !SESSION Jul 13, 2004 11:33:35.609
> > > ---------------------------------------------
> > > java.version=1.4.1_02
> > > java.vendor=Sun Microsystems Inc.
> > > BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
> > > Command-line arguments: -pdelaunch -dev bin,runtime -feature
> > > org.eclipse.platform -data C:ADEruntime-workspace -os win32 -ws win32
> > > -arch x86 -nl en_US -configuration
> > >
> >
>
file:C:/ADE/workspace/.metadata/.plugins/org.eclipse.pde.cor e/C__ADE_runtime-workspace/platform.cfg
> > > -install file:C:/ADE/
> > > !ENTRY org.eclipse.ui.workbench 4 2 Jul 13, 2004 11:33:35.609
> > > !MESSAGE Problems occurred when invoking code from plug-in:
> > > "org.eclipse.ui.workbench".
> > > !STACK 0
> > > java.lang.NoClassDefFoundError: org/eclipse/core/resources/IFile
> > > at
> > >
> >
com.avaya.ade.core.ui.wizards.ADEProjectWizard.<init>(ADEProjectWizard.java:
> > 93)
> > > at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Nativ e Method)
> > > at
> > >
> >
sun.reflect.NativeConstructorAccessorImpl.newInstance(Native ConstructorAcces
> > sorImpl.java:39)
> > > at
> > >
> >
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(De legatingConstruc
> > torAccessorImpl.java:27)
> > > at java.lang.reflect.Constructor.newInstance(Constructor.java:2 74)
> > > at java.lang.Class.newInstance0(Class.java:306)
> > >
|
|
|
Goto Forum:
Current Time: Fri Jul 25 15:32:06 EDT 2025
Powered by FUDForum. Page generated in 0.05478 seconds
|