Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Access restriction

 
deepa anandan
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am using a class BasicNewProjectResourceWizard but the following error is being reflected:

Access restriction: the type BasicNewProjectResourceWizard is not accessible due to restriction
on required library D:\Middleware SDK\eclipse\plugins\org.eclipse.ui.ide_3.1.1.jar


Please let me know how to solve this error??
 
deepa anandan
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Included the package name under Imported Package in Dependencies.
As a result the error is not there but once the application is run...the following error are generated:

java.lang.NoClassDefFoundError: org/eclipse/ui/wizards/newresource/BasicNewProjectResourceWizard
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at org.eclipse.osgi.framework.adaptor.core.DefaultClassLoader.defineClass(DefaultClassLoader.java:370)
at org.eclipse.core.runtime.adaptor.EclipseClassLoader.defineClass(EclipseClassLoader.java:233)
at org.eclipse.osgi.framework.adaptor.core.DefaultClassLoader.findClassImpl(DefaultClassLoader.java:343)
at org.eclipse.osgi.framework.adaptor.core.DefaultClassLoader.findClass(DefaultClassLoader.java:235)
at org.eclipse.osgi.framework.adaptor.core.AbstractClassLoader.findLocalClass(AbstractClassLoader.java:183)
at org.eclipse.core.runtime.adaptor.EclipseClassLoader.basicFindLocalClass(EclipseClassLoader.java:141)
at org.eclipse.core.runtime.adaptor.EclipseClassLoader.findLocalClass(EclipseClassLoader.java:68)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findLocalClass(BundleLoader.java:337)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:389)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:350)
at org.eclipse.osgi.framework.adaptor.core.AbstractClassLoader.loadClass(AbstractClassLoader.java:78)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at mPlugin.actions.SampleAction.run(SampleAction.java:55)
at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:246)
at org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:223)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:538)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488)
at org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:441)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:843)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3125)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2758)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1699)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:367)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334)
at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
at org.eclipse.core.launcher.Main.run(Main.java:973)
at org.eclipse.core.launcher.Main.main(Main.java:948)
 
deepa anandan
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have added the jar org.eclipse.ui.ide_3.1.1.jar [ which contains the class org/eclipse/ui/wizards/newresource/BasicNewProjectResourceWizard ] under plugn.xml-> Dependencies -> Required Plugins.
Added org.eclipse.ui.wizards.newresouce under plugin.xml-> Dependencies -> Imported Packages.

Please do reply why inspite of adding these jars to the path where the classpath setting has to be done???
To get rid of the error.
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24208
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to our "IDEs" forum; plugin dependencies are an Eclipse-specific black art.
 
deepa anandan
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it because its given that BasicNewProjectResourceWizard is not intended to be subclassed???
 
Mr. C Lamont Gilbert
Ranch Hand
Posts: 1170
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by deepa anandan:
Is it because its given that BasicNewProjectResourceWizard is not intended to be subclassed???


Exactly right. You can probably get around this if you set certain properties on your runtime that wont do strict package checking. Off hand I don't know what they are, but you are correct that this is internal class not meant to be subclassed.

Its EPL so you can copy and paste the whole code so long as you make the result EPL. It would have had to be EPL anyway since you are extending it.
 
deepa anandan
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But I m reported with the same error for another set of classes if I am accessing them.

I am trying to use a plugin within my plugin.
When ever i try using the class present in another plugin i am reported with access restriction error.
In Java build path under plugin dependencies - access restriction forbidden is **/*.
Is there any way I can change the access restrictions???

Tried another method too deleted the plugin dependencies and imported all the jars but still 4 build path entries are missing. couldnt trace what exactly is the problem???
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic