Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [equinox-dev] How to use exttension bundle and adaptor hooks?


When you launch from PDE it is using the launcher jar (org.eclipse.equinox.launcher_1.0.0.jar) to start the framework.  The launcher jar is responsible for finding the org.eclipse.osgi jar and any extensions jars that are configured (from the osgi.framework.extensions property).  To do this outside of PDE you must place all three jars (org.eclipse.osgi, org.eclipse.equinox.launcher and org.eclipse.equinox.examples.simpleloaderhook) in the same directory and use the following command:

java -Dosgi.framework.extensions=org.eclipse.equinox.examples.simpleloaderhook -jar org.eclipse.equinox.launcher_1.0.0.v20070208.jar -noExit -console

org.eclipse.equinox.launcher is the replacement for the old startup.jar in 3.2.  If using the old startup.jar then you would have to place your jars in a "plugins" directory and have the startup.jar in the parent directory of the "plugins" directory.  For example:

/equinox/startup.jar
/equinox/plugins/org.eclipse.osgi_3.3.0.jar
/equinox/plugins/org.eclipse.equinox.examples.simpleloaderhook_1.0.0.jar

Then you would launch with this command

java -Dosgi.framework.extensions=org.eclipse.equinox.examples.simpleloaderhook -jar startup.jar -noExit -console

If you do not use the launcher jar or statup.jar then you must place your extension jars on the classpath of the framework yourself.  This would be done with the following command

java -Dosgi.framework.extensions=com.ibm.cds -cp org.eclipse.osgi_3.3.0.v20070208.jar;com.ibm.cds_2.0.2.200702090919.jar org.eclipse.core.runtime.adaptor.EclipseStarter -noExit -console -debug

HTH

Tom




Tony Wang <w19995@xxxxxxxxxxxx>
Sent by: equinox-dev-bounces@xxxxxxxxxxx

02/09/2007 02:30 AM

Please respond to
Equinox development mailing list <equinox-dev@xxxxxxxxxxx>

To
equinox-dev@xxxxxxxxxxx
cc
Subject
[equinox-dev] How to use exttension bundle and adaptor hooks?





Hi,
I have make an extension bundle to hook the process of OSGi classloading. I have read the article at http://wiki.eclipse.org/index.php/Adaptor_Hooks and do a demo following the guide step by step. It works fine in eclipse ide, but doesn't work out of ide. I can't understand why?
 
The command line used out of ide is
"java -Dosgi.framework.extensions=org.eclipse.equinox.examples.simpleloaderhook -jar org.eclipse.osgi_3.3.0.jar -console -clean"
 
And in eclipse ide, no special arguments are set.
" -Dosgi.framework.extensions=org.eclipse.equinox.examples.simpleloaderhook".
 
I have traced the code of org.eclipse.osgi, and found the classloader of system bundle can't load the resource of org.eclipse.equinox.examples.simpleloaderhook. But in IDE, it works.
 
The code in org.eclipse.osgi.
hookConfigurators = cl != null ? cl.getResources(HookRegistry.HOOK_CONFIGURATORS_FILE) : ClassLoader.getSystemResources(HookRegistry.HOOK_CONFIGURATORS_FILE);
 
Can any one help me?
 
thanks,
Tony Wang
 
 
 

 


雅虎免费邮箱-3.5G容量,20M附件 _______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev


Back to the top