Camel Deployment to JBoss Fuse 6.1 Server Errors
schellinger Apr 10, 2014 1:13 PMFirst post - excuse the length of this post - it includes part of POM, a Camel context, and 2 call stacks from deployment!
I am trying to deploy Camel projects (including the Chapter 7 JMS project) from the JBoss Dev Studio into the JBoss Fuse 6.1 Server. When I initially deploy, I get one error, and when I then restart the server, I see a second error - sometimes! It's a mess! On top of it all, the route runs perfectly inside the IDE via the JUnit run as well as via command line Maven builds. Please let me know if anyone has any thoughts on these issues.
First, I copied the Camel in Action's Chapter 7 CXF Contract First project and added some ActiveMQ processing to it. So the POM I use references the parent CXF POM which references the parent Chapter 7 POM, etc. Not sure if I need to include the entire POM or any of the parents, but here's the top of it so you see the parent POM reference:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.camelinaction</groupId>
<artifactId>cxf</artifactId>
<version>1.0.0</version>
</parent>
<artifactId>cxf-to-jms-queue</artifactId>
<name>Camel in Action :: Chapter 7 :: CXF To JMS Queue</name>
<dependencies>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-cxf</artifactId>
</dependency>
...
When I deploy to the Fuse 6.1 Server in the IDE, I see this call stack (I'll highlight the part that caught my eyes):
java.io.IOException: Failed to read artifact descriptor for com.camelinaction:cxf-to-jms-queue:pom:1.0.0 at io.fabric8.fab.osgi.internal.FabResolverFactoryImpl$FabResolverImpl.getInfo(FabResolverFactoryImpl.java:256)[106:io.fabric8.fab.fab-osgi:1.0.0.redhat-328] at io.fabric8.fab.osgi.internal.FabConnection.getInputStream(FabConnection.java:93)[106:io.fabric8.fab.fab-osgi:1.0.0.redhat-328] at java.net.URL.openStream(URL.java:1037)[:1.7.0_51] at org.apache.felix.fileinstall.internal.DirectoryWatcher.install(DirectoryWatcher.java:941)[7:org.apache.felix.fileinstall:3.3.11.redhat-610328] at org.apache.felix.fileinstall.internal.DirectoryWatcher.install(DirectoryWatcher.java:857)[7:org.apache.felix.fileinstall:3.3.11.redhat-610328] at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:483)[7:org.apache.felix.fileinstall:3.3.11.redhat-610328] at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:291)[7:org.apache.felix.fileinstall:3.3.11.redhat-610328] Caused by: org.sonatype.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for com.camelinaction:cxf-to-jms-queue:pom:1.0.0 at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:317)[106:io.fabric8.fab.fab-osgi:1.0.0.redhat-328] at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:172)[106:io.fabric8.fab.fab-osgi:1.0.0.redhat-328] at org.sonatype.aether.impl.internal.DefaultRepositorySystem.readArtifactDescriptor(DefaultRepositorySystem.java:316)[106:io.fabric8.fab.fab-osgi:1.0.0.redhat-328] at io.fabric8.fab.MavenResolverImpl.collectDependencies(MavenResolverImpl.java:312)[106:io.fabric8.fab.fab-osgi:1.0.0.redhat-328] at io.fabric8.fab.MavenResolverImpl.collectDependenciesFromPom(MavenResolverImpl.java:294)[106:io.fabric8.fab.fab-osgi:1.0.0.redhat-328] at io.fabric8.fab.MavenResolverImpl.collectDependencies(MavenResolverImpl.java:263)[106:io.fabric8.fab.fab-osgi:1.0.0.redhat-328] at io.fabric8.fab.osgi.internal.FabResolverFactoryImpl$FabResolverImpl.collectDependencyTree(FabResolverFactoryImpl.java:148)[106:io.fabric8.fab.fab-osgi:1.0.0.redhat-328] at io.fabric8.fab.osgi.internal.FabClassPathResolver.resolve(FabClassPathResolver.java:135)[106:io.fabric8.fab.fab-osgi:1.0.0.redhat-328] at io.fabric8.fab.osgi.internal.FabResolverFactoryImpl$FabResolverImpl.configureInstructions(FabResolverFactoryImpl.java:279)[106:io.fabric8.fab.fab-osgi:1.0.0.redhat-328] at io.fabric8.fab.osgi.internal.FabResolverFactoryImpl$FabResolverImpl.createInstructions(FabResolverFactoryImpl.java:271)[106:io.fabric8.fab.fab-osgi:1.0.0.redhat-328] at io.fabric8.fab.osgi.internal.FabResolverFactoryImpl$FabResolverImpl.getInfo(FabResolverFactoryImpl.java:241)[106:io.fabric8.fab.fab-osgi:1.0.0.redhat-328] ... 6 more Caused by: org.apache.maven.model.resolution.UnresolvableModelException: Could not transfer artifact com.camelinaction:cxf:pom:1.0.0 from/to repos2 (https://repository.jboss.org/nexus/content/repositories/fs-ea): Access denied to: https://repository.jboss.org/nexus/content/repositories/fs-ea/com/camelinaction/cxf/1.0.0/cxf-1.0.0.pom at org.apache.maven.repository.internal.DefaultModelResolver.resolveModel(DefaultModelResolver.java:126)[106:io.fabric8.fab.fab-osgi:1.0.0.redhat-328] at org.apache.maven.model.building.DefaultModelBuilder.readParentExternally(DefaultModelBuilder.java:819)[106:io.fabric8.fab.fab-osgi:1.0.0.redhat-328] at org.apache.maven.model.building.DefaultModelBuilder.readParent(DefaultModelBuilder.java:670)[106:io.fabric8.fab.fab-osgi:1.0.0.redhat-328] at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:308)[106:io.fabric8.fab.fab-osgi:1.0.0.redhat-328] at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:232)[106:io.fabric8.fab.fab-osgi:1.0.0.redhat-328] at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:308)[106:io.fabric8.fab.fab-osgi:1.0.0.redhat-328] ... 16 more Caused by: org.sonatype.aether.resolution.ArtifactResolutionException: Could not transfer artifact com.camelinaction:cxf:pom:1.0.0 from/to repos2 (https://repository.jboss.org/nexus/content/repositories/fs-ea): Access denied to: https://repository.jboss.org/nexus/content/repositories/fs-ea/com/camelinaction/cxf/1.0.0/cxf-1.0.0.pom at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:541)[106:io.fabric8.fab.fab-osgi:1.0.0.redhat-328] at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:220)[106:io.fabric8.fab.fab-osgi:1.0.0.redhat-328] at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:197)[106:io.fabric8.fab.fab-osgi:1.0.0.redhat-328] at org.apache.maven.repository.internal.DefaultModelResolver.resolveModel(DefaultModelResolver.java:122)[106:io.fabric8.fab.fab-osgi:1.0.0.redhat-328] ... 21 more Caused by: org.sonatype.aether.transfer.ArtifactTransferException: Could not transfer artifact com.camelinaction:cxf:pom:1.0.0 from/to repos2 (https://repository.jboss.org/nexus/content/repositories/fs-ea): Access denied to: https://repository.jboss.org/nexus/content/repositories/fs-ea/com/camelinaction/cxf/1.0.0/cxf-1.0.0.pom at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(WagonRepositoryConnector.java:949)[106:io.fabric8.fab.fab-osgi:1.0.0.redhat-328] at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(WagonRepositoryConnector.java:940)[106:io.fabric8.fab.fab-osgi:1.0.0.redhat-328] at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.flush(WagonRepositoryConnector.java:695)[106:io.fabric8.fab.fab-osgi:1.0.0.redhat-328] at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.flush(WagonRepositoryConnector.java:689)[106:io.fabric8.fab.fab-osgi:1.0.0.redhat-328] at org.sonatype.aether.connector.wagon.WagonRepositoryConnector.get(WagonRepositoryConnector.java:445)[106:io.fabric8.fab.fab-osgi:1.0.0.redhat-328] at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:460)[106:io.fabric8.fab.fab-osgi:1.0.0.redhat-328] ... 24 more Caused by: org.apache.maven.wagon.authorization.AuthorizationException: Access denied to: https://repository.jboss.org/nexus/content/repositories/fs-ea/com/camelinaction/cxf/1.0.0/cxf-1.0.0.pom at org.apache.maven.wagon.providers.http.LightweightHttpWagon.fillInputData(LightweightHttpWagon.java:119)[106:io.fabric8.fab.fab-osgi:1.0.0.redhat-328] at org.apache.maven.wagon.StreamWagon.getInputStream(StreamWagon.java:116)[106:io.fabric8.fab.fab-osgi:1.0.0.redhat-328] at org.apache.maven.wagon.StreamWagon.getIfNewer(StreamWagon.java:88)[106:io.fabric8.fab.fab-osgi:1.0.0.redhat-328] at org.apache.maven.wagon.StreamWagon.get(StreamWagon.java:61)[106:io.fabric8.fab.fab-osgi:1.0.0.redhat-328] at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.run(WagonRepositoryConnector.java:608)[106:io.fabric8.fab.fab-osgi:1.0.0.redhat-328] at org.sonatype.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:64)[106:io.fabric8.fab.fab-osgi:1.0.0.redhat-328] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7.0_51] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7.0_51] at java.lang.Thread.run(Thread.java:744)[:1.7.0_51]
|
The deployment doesn't seem to be able to find the parent POM (cxf) in the parent folder and appears to be looking at the JBoss repository? I tried putting a <relativePath> attribute in my POM of ../pom.xml in hopes that it would locate the parent POM. Any thoughts on this?
But then, sometimes it seems to get by this previous issue, but then dies with a ClassNotFoundException when trying to access some of the classes I have referenced in my Camel route. Here is my route (I'm highlighting the class that is referenced in the subsequent call stack during deployment):
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:camel="http://camel.apache.org/schema/spring"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
<import resource="classpath:META-INF/spring/camel-cxf.xml" />
<bean id="bridgePropertyPlaceholder" class="org.apache.camel.spring.spi.BridgePropertyPlaceholderConfigurer">
<property name="location" value="classpath:cxf-to-jms-queue.properties"/>
<property name="ignoreUnresolvablePlaceholders" value="true"/>
</bean>
<bean id="activemq" class="org.apache.camel.component.jms.JmsComponent">
<property name="connectionFactory">
<bean class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL" value="tcp://localhost:61616" />
<property name="userName" value="${activeMQ.username}" />
<property name="password" value="${activeMQ.password}" />
</bean>
</property>
</bean>
<camelContext xmlns="http://camel.apache.org/schema/spring">
<route>
<from uri="cxf:bean:orderEndpoint"/>
<log message="Message received: ${body[0]},${body[1]},${body[2]}"/>
<choice>
<when>
<simple>${body[2]} == 'honda'</simple>
<log message="Honda Order Received and put into ActiveMQ {{activeMQ.queueName.honda}} queue"/>
<inOnly uri="activemq:queue:{{activeMQ.queueName.honda}}"/>
<transform>
<description>route starts from the cxf webservice, see camel-cxf.xml for details and then create the OK reply for the webservice which is still waiting for a reply</description>
<constant>OK</constant>
</transform>
</when>
<when>
<simple>${body[2]} == 'gm'</simple>
<log message="GM Order Received and put into ActiveMQ {{activeMQ.queueName.gm}} queue"/>
<inOnly uri="activemq:queue:{{activeMQ.queueName.gm}}"/>
<transform>
<description>route starts from the cxf webservice, see camel-cxf.xml for details and then create the OK reply for the webservice which is still waiting for a reply</description>
<constant>OK</constant>
</transform>
</when>
<otherwise>
<log message="Unknown customer (${body[2]}) Order Received and put into ActiveMQ {{activeMQ.queueName.unknownCustomer}} queue"/>
<inOnly uri="activemq:queue:{{activeMQ.queueName.unknownCustomer}}"/>
<transform>
<description>route starts from the cxf webservice, see camel-cxf.xml for details and then create the OK reply for the webservice which is still waiting for a reply</description>
<constant>BAD</constant>
</transform>
</otherwise>
</choice>
</route>
<route>
<from uri="activemq:queue:{{activeMQ.queueName.honda}}"/>
<log message="Production consuming Honda orders: ${body}"/>
<to uri="file:c:/temp/jms/honda"/>
</route>
<route>
<from uri="activemq:queue:{{activeMQ.queueName.gm}}"/>
<log message="Production consuming GM orders: ${body}"/>
<to uri="file:c:/temp/jms/gm"/>
</route>
<route>
<from uri="activemq:queue:{{activeMQ.queueName.unknownCustomer}}"/>
<log message="Production consuming Unknown Customer orders: ${body}"/>
<to uri="file:c:/temp/jms/unknown"/>
</route>
<route>
<description>test route</description>
<from uri="seda:incomingOrders"/>
<to uri="mock:end"/>
</route>
</camelContext>
</beans>
And here is the call stack during deployment:
org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.apache.camel.spring.spi.BridgePropertyPlaceholderConfigurer] for bean with name 'bridgePropertyPlaceholder' defined in URL [bundle://253.2:0/META-INF/spring/camel-route.xml]; nested exception is java.lang.ClassNotFoundException: org.apache.camel.spring.spi.BridgePropertyPlaceholderConfigurer not found from bundle [cxf-to-jms-queue]
at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1275)[124:org.springframework.beans:3.2.4.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:575)[124:org.springframework.beans:3.2.4.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1344)[124:org.springframework.beans:3.2.4.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:910)[124:org.springframework.beans:3.2.4.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:609)[124:org.springframework.beans:3.2.4.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)[122:org.springframework.context:3.2.4.RELEASE]
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$1600(AbstractDelegatedExecutionApplicationContext.java:69)[144:org.springframework.osgi.core:1.2.1]
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:355)[144:org.springframework.osgi.core:1.2.1]
at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)[144:org.springframework.osgi.core:1.2.1]
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320)[144:org.springframework.osgi.core:1.2.1]
at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:132)[143:org.springframework.osgi.extender:1.2.1]
at java.lang.Thread.run(Thread.java:744)[:1.7.0_51]
Caused by: java.lang.ClassNotFoundException: org.apache.camel.spring.spi.BridgePropertyPlaceholderConfigurer not found from bundle [cxf-to-jms-queue]
at org.springframework.osgi.util.BundleDelegatingClassLoader.findClass(BundleDelegatingClassLoader.java:103)[144:org.springframework.osgi.core:1.2.1]
at org.springframework.osgi.util.BundleDelegatingClassLoader.loadClass(BundleDelegatingClassLoader.java:156)[144:org.springframework.osgi.core:1.2.1]
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)[:1.7.0_51]
at org.springframework.util.ClassUtils.forName(ClassUtils.java:260)[120:org.springframework.core:3.2.4.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:416)[124:org.springframework.beans:3.2.4.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1296)[124:org.springframework.beans:3.2.4.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1267)[124:org.springframework.beans:3.2.4.RELEASE]
... 11 more
Caused by: java.lang.ClassNotFoundException: org.apache.camel.spring.spi.BridgePropertyPlaceholderConfigurer not found by cxf-to-jms-queue [253]
at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1532)[org.apache.felix.framework-4.0.3.redhat-610328.jar:]
at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)[org.apache.felix.framework-4.0.3.redhat-610328.jar:]
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)[org.apache.felix.framework-4.0.3.redhat-610328.jar:]
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)[:1.7.0_51]
at org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1870)[org.apache.felix.framework-4.0.3.redhat-610328.jar:]
at org.apache.felix.framework.BundleImpl.loadClass(BundleImpl.java:937)[org.apache.felix.framework-4.0.3.redhat-610328.jar:]
at org.springframework.osgi.util.BundleDelegatingClassLoader.findClass(BundleDelegatingClassLoader.java:99)[144:org.springframework.osgi.core:1.2.1]
... 17 more
Again, this all functions great when I run it in the IDE as a JUnit run or at the Maven command line, but during deployment if fails. The org.apache.camel.spring.spi.BridgePropertyPlaceholderConfigurer class is in camel-spring dependency in my POM and it appears under the Fuse "system" folder in a JAR file. So not sure why it's not being found. Additionally, if I remove that bean from my Camel route, it then starts complaining about org.apache.camel.component.jms.JmsComponent. Again, in my list of dependencies and a part of camel-jms in the Fuse installation. Is there something I need to do in Fuse to fix what appears to be a classpath issue?
So, 2 separate problems. Hopefully someone out there has seen this before and can help out. Thanks!
Shawn