Environment problem in plugin [message #502660] |
Wed, 09 December 2009 05:35  |
Eclipse User |
|
|
|
I am experiencing a problem in a code that is in a plugin. The same code works fine if it is located in a Java
program. The execution, in both cases, is done in the same Eclipse development workspace. Just to summarize,
these are the things I did to run the Java program successfully:
1- Set a specific JRE via Preferences -> Java -> Installed JRE
2- Set specific Java Build Path (to include necessary JARs)
3- Specify several VM arguments. First I did it via "VM arguments", but late I removed them from this place and
I specified them in the code as follows:
String WS6_HOME="R:\\Program Files\\IBM\\WebSphere\\AppServer";
String WS6_JAVA_HOME="R:\\Program Files\\IBM\\WebSphere\\AppServer\\java\\jre";
System.setProperty("com.ibm.CORBA.ConfigURL", "file:"+WS6_HOME+"\\profiles\\AppSrv01\\properties\\sas.client.props ");
System.setProperty("java.ext.dirs",WS6_JAVA_HOME+"\\lib\\ext; "+WS6_JAVA_HOME+"\\lib;"+WS6_HOME+"\\classes;"+WS6_HOME+ "\\lib;"+WS6_HOME+"\\lib\\ext;"+WS6_HOME+"\\plugins");
System.setProperty("java.naming.factory.initial", WS6_JAVA_HOME+"\\lib\\ext;"+WS6_JAVA_HOME+"\\lib;"+WS6_HOME+ "\\classes;"+WS6_HOME+"\\lib;"+WS6_HOME+"\\lib\\ext;"+WS6_HOME+ "\\plugins");
System.setProperty("java.naming.factory.initial", "com.ibm.websphere.naming.WsnInitialContextFactory");
System.setProperty("java.naming.provider.url", "iiop://hqdemo1:2809");
I did the equivalent for the plugin (build path set as appropriate, I think) , but when I execute my code I get
an error that is for sure related to the environment. The problem is that I don't know what it can be. I wonder
if specifying System properties as above can be a problem in a plugin.
Thanks.
|
|
|
|
Re: Environment problem in plugin [message #503748 is a reply to message #502916] |
Tue, 15 December 2009 10:45  |
Eclipse User |
|
|
|
A java program can see everything in its classpath.
A plugin/bundle project can only see other bundles, plus the boot classpath (with some exceptions).
your bundle needs to get its other jars by either 1) including them directly in the project or 2) requiring them as other OSGi bundles. Did you set up either of those? The corollary is you cannot add jars to the classpath of a plugin project, only via the MANIFEST.MF
PW
|
|
|
Powered by
FUDForum. Page generated in 0.03914 seconds