Hi Stuart,

I have added the a line with "--log=DEBUG" and I found out that the
classpath option is not applied, in fact the resulting command line
taken from the mvn max:run ouput is:
Start command line [[/usr/lib/jvm/java-6-openjdk//bin/java,
-Dfelix.config.properties=file:/home/kismet/Projects/isti.cnr.it/proximity/sail.driver.sad/runner//felix/config.ini,
-Dfelix.cache.dir=/home/kismet/Projects/isti.cnr.it/proximity/sail.driver.sad/runner/felix/cache,
-Dorg.osgi.framework.bootdelegation=org.apache.commons.*,org.apache.log4j.*,com.martiansoftware.*,com.thoughtworks.*,edu.uci.ics.*,
-cp, 
/home/kismet/Projects/isti.cnr.it/proximity/sail.driver.sad/runner/bundles/org.apache.felix.org.apache.felix.main_1.2.1.jar,
org.apache.felix.main.Main]]

I wonder way that happens, could it be a problem with pax-runner
classpath option handling itself? In fact I have tried to run the
SNAPSHOT version of pax-runner from command line and if start it with
--log=DEBUG and --classpath=<something> I get a "Start command line"
with the wrong classpath.

I further investigate and it seems that the classpath acquired by the
OptionResolverImpl class but it never copied to PlatformImpl which is
the class in charge of starting the new JVM. I have created a patch
which doesn't pass the TestSuite but it actually works (I have tested
by disabling the test in mvn).

I hope that we can help you to fix the problem.


On Fri, Oct 10, 2008 at 17:55, Stuart McCulloch <[EMAIL PROTECTED]> wrote:
> 2008/10/10 Stefano Kismet Lenzi <[EMAIL PROTECTED]>
>>
>> Hi All,
>>
>> I was trying to add bootDelegation and classpath options to pax-runner
>> from the maven-pax-plugin. I have tried by adding this line in the
>> following plugin configuration:
>> <args>file:src/test/resources/pax.args</args>
>> and the file pax.args contains the following lines:
>>
>> --bootDelegation=org.apache.commons.*,org.apache.log4j.*,com.martiansoftware.*,com.thoughtworks.*,edu.uci.ics.*
>> --classpath=src/test/resources/dependencies.jar
>>
>> (I have tried also with full-qualified-pathname but the result is the
>> same)
>>
>> When I lunch pax:run the plugin is able to let pax-runner start but my
>> bundle fail to load because either bootDelegation or the classpath is
>> not correct.
>> Do you have any suggestions?
>
> well, with the following line in src/test/resources/pax.args:
>
>   --log=DEBUG
>
> and the following pom configuration:
>
>       <plugin>
>         <groupId>org.ops4j</groupId>
>         <artifactId>maven-pax-plugin</artifactId>
>         <configuration>
>           <args>file:src/test/resources/pax.args</args>
>         </configuration>
>       </plugin>
>
> I can see debug output, so the file is reaching pax-runner... perhaps you
> could try
> with debug on to see why pax-runner doesn't seem to be applying these
> settings
>
>>
>> Ciao,
>> Stefano "Kismet" Lenzi
>>
>> _______________________________________________
>> general mailing list
>> general@lists.ops4j.org
>> http://lists.ops4j.org/mailman/listinfo/general
>
> --
> Cheers, Stuart
>
> _______________________________________________
> general mailing list
> general@lists.ops4j.org
> http://lists.ops4j.org/mailman/listinfo/general
>
>
Index: pax-runner-platform/src/main/java/org/ops4j/pax/runner/platform/internal/PlatformImpl.java
===================================================================
--- pax-runner-platform/src/main/java/org/ops4j/pax/runner/platform/internal/PlatformImpl.java	(revision 12949)
+++ pax-runner-platform/src/main/java/org/ops4j/pax/runner/platform/internal/PlatformImpl.java	(working copy)
@@ -205,7 +205,7 @@
 
         // and then ask the platform builder to prepare platform for start up (e.g. create configuration file)
         m_platformBuilder.prepare( context );
-
+        
         // and finally start it up.
         if( null == runner )
         {
Index: pax-runner/src/main/java/org/ops4j/pax/runner/Run.java
===================================================================
--- pax-runner/src/main/java/org/ops4j/pax/runner/Run.java	(revision 12949)
+++ pax-runner/src/main/java/org/ops4j/pax/runner/Run.java	(working copy)
@@ -21,6 +21,7 @@
 
 import java.io.InputStream;
 import java.util.ArrayList;
+import java.util.Dictionary;
 import java.util.List;
 import java.util.Properties;
 import org.apache.commons.logging.Log;
@@ -46,6 +47,7 @@
 import org.ops4j.pax.runner.platform.JavaRunner;
 import org.ops4j.pax.runner.platform.Platform;
 import org.ops4j.pax.runner.platform.PlatformException;
+import org.ops4j.pax.runner.platform.ServiceConstants;
 import org.ops4j.pax.runner.provision.MalformedSpecificationException;
 import org.ops4j.pax.runner.provision.ProvisionService;
 import org.ops4j.pax.runner.provision.ScannerException;
@@ -428,8 +430,9 @@
      * @param runner   Java runner service
      */
     private void startPlatform( final Platform platform, final Context context, final JavaRunner runner )
-    {
-        LOGGER.debug( "Starting platform" );
+    {
+        LOGGER.debug( "Starting platform" );
+        
         if( platform == null )
         {
             throw new RuntimeException( "Could not resolve a platform" );
@@ -453,7 +456,14 @@
         }
         try
         {
-            platform.start( references, context.getSystemProperties(), null, runner );
+        	final String classpath = context.getOptionResolver().get("classpath");
+        	Properties config = null;
+        	if( classpath != null )
+        	{
+	        	config = new Properties();
+	        	config.put( ServiceConstants.CONFIG_CLASSPATH, classpath );
+        	}
+            platform.start( references, context.getSystemProperties(), config, runner );
         }
         catch( PlatformException e )
         {
_______________________________________________
general mailing list
general@lists.ops4j.org
http://lists.ops4j.org/mailman/listinfo/general

Reply via email to