You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2012/05/05 11:43:22 UTC

svn commit: r1334367 - in /camel/trunk: components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/CamelBlueprintHelper.java tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/RunMojo.java

Author: davsclaus
Date: Sat May  5 09:43:21 2012
New Revision: 1334367

URL: http://svn.apache.org/viewvc?rev=1334367&view=rev
Log:
CAMEL-5248: Running camel:run with blueprint gets a java.lang.NoClassDefFoundError: org.osgi.vendor.framework property not set

Modified:
    camel/trunk/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/CamelBlueprintHelper.java
    camel/trunk/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/RunMojo.java

Modified: camel/trunk/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/CamelBlueprintHelper.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/CamelBlueprintHelper.java?rev=1334367&r1=1334366&r2=1334367&view=diff
==============================================================================
--- camel/trunk/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/CamelBlueprintHelper.java (original)
+++ camel/trunk/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/CamelBlueprintHelper.java Sat May  5 09:43:21 2012
@@ -96,6 +96,13 @@ public final class CamelBlueprintHelper 
             bundles.add(getBundleDescriptor("target/bundles/" + jarName + ".jar", bundle));
         }
 
+        if (LOG.isDebugEnabled()) {
+            for (int i = 0; i < bundles.size(); i++) {
+                BundleDescriptor desc = bundles.get(i);
+                LOG.debug("Bundle #{} -> {}", i, desc);
+            }
+        }
+
         // setup pojosr to use our bundles
         Map<String, List<BundleDescriptor>> config = new HashMap<String, List<BundleDescriptor>>();
         config.put(PojoServiceRegistryFactory.BUNDLE_DESCRIPTORS, bundles);

Modified: camel/trunk/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/RunMojo.java
URL: http://svn.apache.org/viewvc/camel/trunk/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/RunMojo.java?rev=1334367&r1=1334366&r2=1334367&view=diff
==============================================================================
--- camel/trunk/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/RunMojo.java (original)
+++ camel/trunk/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/RunMojo.java Sat May  5 09:43:21 2012
@@ -639,8 +639,10 @@ public class RunMojo extends AbstractExe
      */
     private ClassLoader getClassLoader() throws MojoExecutionException {
         List<URL> classpathURLs = new ArrayList<URL>();
-        this.addRelevantPluginDependenciesToClasspath(classpathURLs);
+        // project classpath must be first
         this.addRelevantProjectDependenciesToClasspath(classpathURLs);
+        // and plugin classpath last
+        this.addRelevantPluginDependenciesToClasspath(classpathURLs);
 
         if (logClasspath) {
             getLog().info("Classpath = " + classpathURLs);
@@ -664,6 +666,14 @@ public class RunMojo extends AbstractExe
             Iterator<Artifact> iter = this.determineRelevantPluginDependencies().iterator();
             while (iter.hasNext()) {
                 Artifact classPathElement = iter.next();
+
+                // we must skip org.osgi.core, otherwise we get a
+                // java.lang.NoClassDefFoundError: org.osgi.vendor.framework property not set
+                if (classPathElement.getArtifactId().equals("org.osgi.core")) {
+                    getLog().debug("Skipping org.osgi.core -> " + classPathElement.getGroupId() + "/" + classPathElement.getArtifactId() + "/" + classPathElement.getVersion());
+                    continue;
+                }
+
                 getLog().debug("Adding plugin dependency artifact: " + classPathElement.getArtifactId()
                                    + " to classpath");
                 path.add(classPathElement.getFile().toURI().toURL());