On 11/24/09 14:09, André Lage wrote:
Hello!

I've tried to run a bundle on Felix with no success. This bundle needs to tell Java some details about it. For instance, as a simple Java class, I run it like this:

java \
    -cp "$SAGA_CLASSPATH:$CLASSPATH" \

-Djava.endorsed.dirs=$JAVA_SAGA_LOCATION/lib/adaptors/GridsamAdaptor/endorsed:$JAVA_SAGA_LOCATION/lib/endorsed \
    -Dlog4j.configuration="file:$JAVA_SAGA_LOCATION/log4j.properties" \
    -Dsaga.factory="eu.xtreemos.xosaga.bootstrap.MetaFactory" \
    -Dsaga.location="$JAVA_SAGA_LOCATION" \
    MyClassIWannaRun

In Felix, I don't know how to "put" this information. I've tried to add it in the config.properties file further packages but it didn't solve the issue. I've also done a bunch of bundles from all jars that my app/bundle needs by using the bnd tool (http://www.aqute.biz/Code/Bnd).

So that's what *I think* it is happening. I have no classpath problems since the libs are now bundles that export their packages. However, I don't tell Felix about the configuration I need (java.endorsed.dirs, log4j.configuration, saga.factory and saga.location).

Finally, I had the "great" idea of running Felix as follows:

 java \
    -cp "$SAGA_CLASSPATH:$CLASSPATH" \

-Djava.endorsed.dirs=$JAVA_SAGA_LOCATION/lib/adaptors/GridsamAdaptor/endorsed:$JAVA_SAGA_LOCATION/lib/endorsed \
    -Dlog4j.configuration="file:$JAVA_SAGA_LOCATION/log4j.properties" \
    -Dsaga.factory="eu.xtreemos.xosaga.bootstrap.MetaFactory" \
    -Dsaga.location="$JAVA_SAGA_LOCATION" \
    -jar bin/felix.jar

Even though Felix runs, I think it ignores those parameters -- actually Felix behaves the same with or without those parameters.

If you use "-jar" then "-cp" is ignored. If you want to set the class path, then you will need to do something like:

    java -cp felix.jar;stuff.jar org.apache.felix.main.Main

This should start the framework with the specified class path.

Does anybody have any idea of how to tell Felix about those parameters?

Felix would never do anything with the "-D" arguments, since they are used by the JVM to set system properties. The above command should set them correctly, though, so your bundles should be able to see them using System.getProperty().

You can also set system properties in conf/system.properties as a convenience.

-> richard


Thanks in advance,


André Lage.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to