Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Problems using the org.eclipse.wst.ws.internal.explorer package
Problems using the org.eclipse.wst.ws.internal.explorer package [message #484591] Tue, 08 September 2009 12:13 Go to next message
Eclipse UserFriend
Originally posted by: derbeatle.gmx.de

Hi,

in my own plugin I open a web services explorer window via the
WSExplorerLauncherCommand class.
Therefore I added the org.eclipse.wst.ws.internal.explorer package to my
plugin dependencies.
My code looks as follows:

WSExplorerLauncherCommand wsec = new WSExplorerLauncherCommand();
LaunchOption lo = new LaunchOption(LaunchOptions.WSDL_URL,location);
wsec.setLaunchOptions(new LaunchOption[]{lo});
wsec.execute();

Now the surprising fact: Everything works fine, so the reason why I'm
bugging you is, that eclipse shows up warnings like "Discouraged access:
The type WSExplorerLauncherCommand is not accessible due to restriction on
required library..."
Since the org.eclipse.wst.ws.internal.explorer package exports those
classes to ohter plugins, I don't understand these warnings.
Is there any better, any correct way to access the mentioned classes? (I
dislike the solution with @SuppressWarnings("restriction"))

Thanks,
Bernd
Re: Problems using the org.eclipse.wst.ws.internal.explorer package [message #484723 is a reply to message #484591] Tue, 08 September 2009 21:43 Go to previous messageGo to next message
Mark Hutchinson is currently offline Mark HutchinsonFriend
Messages: 53
Registered: July 2009
Member
Hi Bernd,

The WSExplorerLauncherCommand is exported to other plugins so it can be
used by other plugins within WTP, but it is not API. Specifically the
manifest.mf of the web services explorer has this line:
org.eclipse.wst.ws.internal.explorer;x-internal:=true which indicates
that it's not API.

You're getting the discouraged access warnings to warn you that what you
are using is not officially API. You can open an enhancement request in
bugzilla asking for this to be made public API for the WTP web services
team to consider.

That said, that class hasn't changed since 2005, and there are no plans
to change it anytime soon. You should be safe to use it

I found this document on the eclipse wiki which might be useful for you:
http://wiki.eclipse.org/WTP:_Consumer_Control_of_Access_Rule s

Bernd W. wrote:
> Hi,
>
> in my own plugin I open a web services explorer window via the
> WSExplorerLauncherCommand class.
> Therefore I added the org.eclipse.wst.ws.internal.explorer package to my
> plugin dependencies.
> My code looks as follows:
>
> WSExplorerLauncherCommand wsec = new WSExplorerLauncherCommand();
> LaunchOption lo = new LaunchOption(LaunchOptions.WSDL_URL,location);
> wsec.setLaunchOptions(new LaunchOption[]{lo});
> wsec.execute();
>
> Now the surprising fact: Everything works fine, so the reason why I'm
> bugging you is, that eclipse shows up warnings like "Discouraged access:
> The type WSExplorerLauncherCommand is not accessible due to restriction
> on required library..."
> Since the org.eclipse.wst.ws.internal.explorer package exports those
> classes to ohter plugins, I don't understand these warnings.
> Is there any better, any correct way to access the mentioned classes? (I
> dislike the solution with @SuppressWarnings("restriction"))
>
> Thanks,
> Bernd
>
Re: Problems using the org.eclipse.wst.ws.internal.explorer package [message #503861 is a reply to message #484591] Wed, 16 December 2009 07:11 Go to previous message
vishnu  is currently offline vishnu Friend
Messages: 1
Registered: December 2009
Junior Member
Hi ,
I am trying to invoke web service explorer in my plugin. I am getting NullPointerException on stateLocation defaultFavoritesLocation...
If i hard code those values i do get nullpointer on
wsec.execute();



as

java.lang.NullPointerException
at org.eclipse.wst.ws.internal.explorer.plugin.ExplorerPlugin.g etBundleContext(ExplorerPlugin.java:192)
at org.eclipse.wst.ws.internal.explorer.WebappManager.getHost(W ebappManager.java:93)
at org.eclipse.wst.ws.internal.explorer.JettyRunnable.getJettyH ost(JettyRunnable.java:45)
at org.eclipse.wst.ws.internal.explorer.WSExplorer.getBaseURL(W SExplorer.java:80)
at org.eclipse.wst.ws.internal.explorer.WSExplorer.launch(WSExp lorer.java:103)
at org.eclipse.wst.ws.internal.explorer.WSExplorerLauncherComma nd.execute(WSExplorerLauncherCommand.java:61)
at Test.main(Test.java:31)

Kindly help me out with this as am not an expert in Web services.

Desperately need to sort this out.
Kind Regards,
Vishnu

public class Test {

public static void main(String[] args) throws Exception {

try{

String stateLocation = ExplorerPlugin.getInstance().getPluginStateLocation();
String defaultFavoritesLocation = ExplorerPlugin.getInstance().getDefaultFavoritesLocation();
WSExplorerLauncherCommand wsec = new WSExplorerLauncherCommand();
wsec.setForceLaunchOutsideIDE(true);
LaunchOption lo = new LaunchOption(LaunchOptions.STATE_LOCATION,"stateLocation");
LaunchOption[] launchOptions= new LaunchOption[] {
new LaunchOption(LaunchOptions.STATE_LOCATION,stateLocation),
new LaunchOption(LaunchOptions.DEFAULT_FAVORITES_LOCATION,defaul tFavoritesLocation)
};
wsec.setLaunchOptions(launchOptions);

wsec.execute();
}
catch (NullPointerException e)
{
e.printStackTrace();
}
}

}

Previous Topic:'wsgen' Ant task not generating all expected Web Services artifacts
Next Topic:Could not initialize class org.eclipse.wst.wsdl.WSDLPackage$Literals
Goto Forum:
  


Current Time: Thu Apr 18 23:17:31 GMT 2024

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

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

Back to the top