Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Environment problem in plugin(Environment problem in plugin)
Environment problem in plugin [message #502660] Wed, 09 December 2009 10:35 Go to next message
Rosa Mising name is currently offline Rosa Mising nameFriend
Messages: 16
Registered: December 2009
Junior Member

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 #502916 is a reply to message #502660] Thu, 10 December 2009 10:16 Go to previous messageGo to next message
Rosa Mising name is currently offline Rosa Mising nameFriend
Messages: 16
Registered: December 2009
Junior Member
Hi again,
I decided not to use System.setProperty method and specify VM arguments instead. My Java program works fine,
but again I'm experiencing some problems when using my plugin:
I run my application that is defined as a "Client Service" in "Run Configurations...". The default VM it has
are the following ones:

-Djava.protocol.handler.pkgs=com.ibm.net.ssl.www.protocol
-Declipse.registry.nulltoken=true
-Drcp.install.config=user
-Dorg.osgi.service.http.port=0
-Dautopd.logfile.generations=3
"-Dautopd.instance.area=${rcp_data}/autopd"
-Djava.util.logging.config.class=com.ibm.rcp.core.internal.l ogger.boot.LoggerConfig
-Dcom.ibm.pvc.webcontainer.port=0
"-Xbootclasspath/a:${rcp_base}/rcpbootcp.jar"
"-Drcp.home=${rcp_target}/.."
-Dosgi.hook.configurators.exclude=org.eclipse.core.runtime.i nternal.adaptor.EclipseLogHook
-Dosgi.framework.extensions=com.ibm.rcp.core.logger.framewor khook
-Xss512K
"-Drcp.data=${rcp_data}"

I can add the following ones:

-Dcom.ibm.CORBA.ConfigURL=" file:${WS6_HOME}\profiles\AppSrv01\properties\sas.client.pro ps "
-Djava.naming.factory.initial=com.ibm.websphere.naming.WsnIn itialContextFactory
-Djava.naming.provider.url=iiop://hqdemo1:2809

BUT when I add the following one:
-Djava.ext.dirs=" ${WS6_JAVA_HOME}\lib\ext;${WS6_JAVA_HOME}\lib;${WS6_HOME}\cl asses;${WS6_HOME}\lib;${WS6_HOME}\lib\ext;${WS6_HOME}\plugin s "
I can't even run my application and it says something like "Could not install bundle", and "No Bundle-NativeCode
match"... Any idea ???

Thanks.
Re: Environment problem in plugin [message #503748 is a reply to message #502916] Tue, 15 December 2009 15:45 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

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


Previous Topic:Timingproblem with IResourceChangeListener
Next Topic:Duplicate Extension Element IDs
Goto Forum:
  


Current Time: Tue Mar 19 04:23:45 GMT 2024

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

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

Back to the top