Closed rawlingsj closed 8 years ago
Sounds like some classpath issue with wrong or missing spring JARs. That API is from spring 4.x something.
Ah you mean that integration in the project-new that James added, that really is just a Camel project?
Yep I got that error too with latest code
davsclaus:/workspace/fabric8-installer/vagrant (master)/$ oc logs -f mydemo-7f8vg
Executing /deployments/bin/run ...
Launching application in folder: /deployments
Running java -javaagent:/opt/jolokia/jolokia.jar=config=/opt/jolokia/jolokia.properties,useSslClientAuthentication=true,extraClientCheck=true,protocol=https,caCert=/var/run/secrets/kubernetes.io/serviceaccount/ca.crt,clientPrincipal=cn=system:master-proxy -classpath :/deployments/lib/mydemo-1.0.0-SNAPSHOT.jar:/deployments/lib/camel-core-2.16.2.jar:/deployments/lib/slf4j-api-1.6.6.jar:/deployments/lib/jaxb-core-2.2.11.jar:/deployments/lib/jaxb-impl-2.2.11.jar:/deployments/lib/camel-spring-2.16.2.jar:/deployments/lib/spring-context-4.1.9.RELEASE.jar:/deployments/lib/spring-aop-4.1.9.RELEASE.jar:/deployments/lib/aopalliance-1.0.jar:/deployments/lib/spring-tx-4.1.9.RELEASE.jar:/deployments/lib/commons-lang3-3.4.jar:/deployments/lib/slf4j-log4j12-1.7.12.jar:/deployments/lib/log4j-1.2.17.jar org.apache.camel.spring.Main
I> No access restrictor found, access to all MBean is allowed
Jolokia: Agent started with URL https://172.17.0.3:8778/jolokia/
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/core/env/EnvironmentCapable
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
at java.lang.Class.getMethod0(Class.java:3018)
at java.lang.Class.getMethod(Class.java:1784)
at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
Caused by: java.lang.ClassNotFoundException: org.springframework.core.env.EnvironmentCapable
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 43 more
I think its hawt-app that builds the app wrong
The example works fine with mvn exec:java
Ah its this maven issue. Notice how some of the spring deps are marked as test but should be compile
[INFO] org.mydemo:mydemo:jar:1.0.0-SNAPSHOT
[INFO] +- org.apache.camel:camel-core:jar:2.16.2:compile
[INFO] | +- org.slf4j:slf4j-api:jar:1.6.6:compile
[INFO] | +- com.sun.xml.bind:jaxb-core:jar:2.2.11:compile
[INFO] | \- com.sun.xml.bind:jaxb-impl:jar:2.2.11:compile
[INFO] +- org.apache.camel:camel-spring:jar:2.16.2:compile
[INFO] | +- org.springframework:spring-context:jar:4.1.9.RELEASE:compile
[INFO] | +- org.springframework:spring-aop:jar:4.1.9.RELEASE:compile
[INFO] | | \- aopalliance:aopalliance:jar:1.0:compile
[INFO] | \- org.springframework:spring-tx:jar:4.1.9.RELEASE:compile
[INFO] +- org.apache.commons:commons-lang3:jar:3.4:compile
[INFO] +- org.slf4j:slf4j-log4j12:jar:1.7.12:compile
[INFO] +- log4j:log4j:jar:1.2.17:compile
[INFO] +- org.apache.camel:camel-test-spring:jar:2.16.2:test
[INFO] | +- org.apache.camel:camel-test:jar:2.16.2:test
[INFO] | +- org.springframework:spring-test:jar:4.1.9.RELEASE:test
[INFO] | +- org.springframework:spring-beans:jar:4.1.9.RELEASE:compile
[INFO] | +- org.springframework:spring-expression:jar:4.1.9.RELEASE:compile
[INFO] | \- org.springframework:spring-core:jar:4.1.9.RELEASE:compile
[INFO] | \- commons-logging:commons-logging:jar:1.2:compile
Have made this commit to improve this in camel so camel-spring explicit have some of these core spring jars as dep (why mvn dont put them as dep in spring-context is weird)
https://github.com/apache/camel/commit/0c7a14be564616e23c95dd099d6f1a98a9bf094b
Pushed the same fix to the 2.16 branch of Camel so will be fixed in next release.
We can add workaround in our quickstarts until then.
I have fixed in the quickstart already, @rawlingsj would be nice with a release of the ipaas-quickstarts. Then we can upgrade forge to use that new release and this one should work again.
Ah we also need a new release of the forge. Darn we just did that yesterday. Well anyways its not like a blocker issue but we have a fix when all new releases are around.
Should be fixed now
when running the integration wizard the pod fails to start with this error...