[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [equinox-dev] Problems starting Equinox Aspects on the command line

Hi Thorsten!

I think I have solved your issue. If you start equinox aspects from the command line you need to add the o.e.e.weaving.hook bundle jar to the classpath of the JVM when starting osgi. Otherwise the equinox aspects framework extension cannot be configured during startup.

There is another thing you need to take care of: set the system property osgi.compatibility.bootdelegation=true to let the weaving service find the xml parsers from the JDK. Equinox operates at a more strict mode when started from command line.

My config.ini file looks like this:

osgi.bundles=org.aspectj.runtime, org.aspectj.weaver, org.eclipse.equinox.weaving.aspectj@1\:start, org.eclipse.equinox.weaving.demo.hello.aspects, org.eclipse.equinox.weaving.demo.hello
osgi.bundles.defaultStartLevel=5
osgi.framework=org.eclipse.osgi
osgi.configuration.cascaded=false


# Equinox Aspects
osgi.framework.extensions=org.eclipse.equinox.weaving.hook
org.aspectj.osgi.verbose=true


My command line looks like this:

java -Dosgi.compatibility.bootdelegation=true -cp org.eclipse.osgi_3.4.0.v20080605-1900.jar;org.eclipse.equinox.weaving.hook_1.0.0.200808202116.jar org.eclipse.core.runtime.adaptor.EclipseStarter -console


HTH, -Martin




Thorsten Harbig wrote:
Hello Mr Lippert,

would it be possible to get a ready to go example of aspects equinox for
the command line? Similar to the one from the EquinoxAspects page for
Eclipse?

Becuase I was not able to start it from the command line. I thought it
shouldn't be any difference whether we start it from within eclipse or
just standalone.

Actually I downloaded already the target runtime, so I would only need an
adjusted config.ini plus the command line instructions to start the osgi
bundles.

bye
thorsten

Hi Thorsten!

What happens if you start the aspectj weaving service bundle directly at
start level 1 from the config.ini? Does it make any difference or do you
get the same ClassNotFoundException?

-Martin




tharbig@xxxxxxxxxxxx wrote:
Looking at this I have got one question: Are the system bundle
(org.eclipse.osgi) and the framework extension fragment
(org.eclipse.equinox.weaving.hook) colocated, i.e. in the same
directory? That is neccessary for Equinox to recognize the framework
extension (see http://wiki.eclipse.org/index.php/Adaptor_Hooks for
details) => Equinox Aspects will not work if the both bundles are not
colocated.
Yes, I have all bundles within the same directory.

- org.eclipse.equinox.weaving.aspectj_1.0.0.200808061839.jar (file)
- org.eclipse.equinox.weaving.hook_1.0.0.200808061839.jar (file)
- org.eclipse.osgi_3.4.0.v20080605-1900.jar (file)
- org.aspectj.weaver_1.6.1.20080703120000 (dir)
- org.aspectj.runtime_1.6.1.20080703120000 (dir)
(like it is delivered with the equinox-aspects-demo-hello.zip)

Additionally I copied the two exported bundles
- org.eclipse.equinox.weaving.demo.hello.aspects
- org.eclipse.equinox.weaving.demo.hello
into the same directory.

Than I created a configuration directory where I added the config.ini
with
the necessary bundles and the hook information
osgi.framework.extensions=org.eclipse.equinox.weaving.hook

now I start it from the command line in the directory where all the
bundles are located.


Actually the org.eclipse.equinox.weaving.demo.hello just works fine for me, but without the augmentation through the aspect of course.

_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev



_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev