Fuse 6.2 Интеграция с Websphere MQ 8.0.0.3
Я пытаюсь связать новейшую версию Jboss Fuse 6.2 с новейшей версией Websphere MQ 8.0.0.3.
У меня возникают проблемы, когда приложение перестает ждать службы: [ОШИБКА] Не удалось выполнить цель org.apache.camel:camel-maven-plugin:2.15.1.redhat-620133: выполнить (default-cli) в проекте WebsphereThroughput: null: MojoExecutionException: InvocationTargetException: ожидание службы (objectClass=org.apache.camel.CamelContext) -> [Справка 1]
Я добавил ConnectionFactory в мой источник проекта:
<bean id="wmq" class="org.apache.camel.component.jms.JmsComponent">
<property name="connectionFactory">
<bean class="com.ibm.jms.MQConnectionFactory">
<property name="transportType" value="1" />
<property name="hostName" value="<InsertIPAddressOfRemoteWMQServer>"/>
<property name="port" value="1414"/>
<property name="queueManager" value="WQM"/>
</bean>
</property>
</bean>
Мой маршрут прост и берет сообщение из файла и вставляет его в очередь Websphere MQ с именем INPUT:
<camelContext xmlns="http://camel.apache.org/schema/spring">
<route>
<from uri="file:C:\Users\Administrator\Desktop\test"/>
<to uri="wmq:queue:INPUT"/>
</route>
</camelContext>
Наконец, я добавил следующие зависимости IBM внутри файла pom.xml (а также установил их в мой локальный репозиторий maven):
<dependency>
<groupId>com.ibm.mq</groupId>
<artifactId>com.ibm.mq.allclient</artifactId>
<version>8.0.0.3</version>
</dependency>
<dependency>
<groupId>com.ibm</groupId>
<artifactId>com.ibm.mq</artifactId>
<version>8.0.0.3</version>
</dependency>
<dependency>
<groupId>com.ibm</groupId>
<artifactId>com.ibm.mqjms</artifactId>
<version>8.0.0.3</version>
</dependency>
<dependency>
<groupId>jms</groupId>
<artifactId>jms</artifactId>
<version>8.0.0.3</version>
</dependency>
Я был бы признателен за любую помощь, так как это меня уже озадачило. Спасибо.
Трассировки стека:
[INFO] Scanning for projects...
[INFO]
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Camel Blueprint Route 1.0.0
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for com.sun.xml.bind:jaxb-core:jar:2.2.11 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for com.sun.xml.bind:jaxb-impl:jar:2.2.11 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ test ---
[INFO] Deleting C:\Users\Administrator\workspace\test\target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ test ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ test ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-bundle-plugin:2.3.7:manifest (bundle-manifest) @ test ---
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ test ---
[INFO] Not copying test resources
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) @ test ---
[INFO] Not compiling test sources
[INFO]
[INFO] --- maven-surefire-plugin:2.18.1:test (default-test) @ test ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- maven-bundle-plugin:2.3.7:bundle (default-bundle) @ test ---
[WARNING] Bundle org.Fuse.Testing:test:bundle:1.0.0 : Instructions in Private-Package, or -testpackages that are never used: org\.Fuse\.Testing\.test\..*|org\.Fuse\.Testing\.test
Classpath: Jar:.,Jar:camel-core,Jar:jaxb-core,Jar:jaxb-impl,Jar:camel-blueprint,Jar:camel-core-xml,Jar:camel-core-osgi,Jar:slf4j-api,Jar:slf4j-log4j12,Jar:log4j,Jar:camel-test-blueprint,Jar:camel-test,Jar:camel-core,Jar:org.apache.aries.blueprint,Jar:org.apache.aries.util,Jar:org.apache.aries.proxy.impl,Jar:org.apache.aries.proxy.api,Jar:de.kalpatec.pojosr.framework,Jar:pax-swissbox-tinybundles,Jar:ops4j-base-lang,Jar:ops4j-base-io,Jar:ops4j-base-monitors,Jar:ops4j-base-store,Jar:pax-swissbox-bnd,Jar:bndlib,Jar:commons-logging,Jar:junit,Jar:hamcrest-core,Jar:org.apache.felix.configadmin,Jar:org.apache.felix.fileinstall,Jar:camel-jms,Jar:camel-spring,Jar:spring-aop,Jar:aopalliance,Jar:spring-jms,Jar:spring-core,Jar:spring-messaging,Jar:spring-context,Jar:spring-expression,Jar:spring-tx,Jar:spring-beans
[INFO]
[INFO] >>> camel-maven-plugin:2.15.1.redhat-620133:run (default-cli) @ test >>>
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ test ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ test ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-bundle-plugin:2.3.7:manifest (bundle-manifest) @ test ---
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ test ---
[INFO] Not copying test resources
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) @ test ---
[INFO] Not compiling test sources
[INFO]
[INFO] <<< camel-maven-plugin:2.15.1.redhat-620133:run (default-cli) @ test <<<
[INFO]
[INFO] --- camel-maven-plugin:2.15.1.redhat-620133:run (default-cli) @ test ---
[INFO] Using org.apache.camel.test.blueprint.Main to initiate a CamelContext
[WARNING] Invalid POM for com.sun.xml.bind:jaxb-core:jar:2.2.11, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] Invalid POM for com.sun.xml.bind:jaxb-impl:jar:2.2.11, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] Invalid POM for com.sun.xml.bind:jaxb-core:jar:2.2.11, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] Invalid POM for com.sun.xml.bind:jaxb-impl:jar:2.2.11, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] Invalid POM for com.sun.xml.bind:jaxb-core:jar:2.2.11, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] Invalid POM for com.sun.xml.bind:jaxb-impl:jar:2.2.11, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] Invalid POM for com.sun.xml.bind:jaxb-core:jar:2.2.11, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] Invalid POM for com.sun.xml.bind:jaxb-impl:jar:2.2.11, transitive dependencies (if any) will not be available, enable debug logging for more details
[INFO] Starting Camel ...
[mel.test.blueprint.Main.main()] MainSupport INFO Apache Camel 2.15.1.redhat-620133 starting
[mel.test.blueprint.Main.main()] Activator INFO Camel activator starting
[mel.test.blueprint.Main.main()] Activator INFO Camel activator started
[mel.test.blueprint.Main.main()] BlueprintExtender INFO No quiesce support is available, so blueprint components will not participate in quiesce operations
[ Blueprint Extender: 1] BlueprintContainerImpl INFO Bundle test is waiting for namespace handlers [http://camel.apache.org/schema/blueprint]
[ Blueprint Extender: 1] BeanRecipe WARN Object to be destroyed is not an instance of UnwrapperedBeanHolder, type: null
[ Blueprint Extender: 1] BlueprintCamelContext INFO Apache Camel 2.15.1.redhat-620133 (CamelContext: camel-1) is shutting down
[ Blueprint Extender: 1] BlueprintCamelContext INFO Apache Camel 2.15.1.redhat-620133 (CamelContext: camel-1) uptime not started
[ Blueprint Extender: 1] BlueprintCamelContext INFO Apache Camel 2.15.1.redhat-620133 (CamelContext: camel-1) is shutdown in 0.016 seconds
[ Blueprint Extender: 1] BlueprintContainerImpl ERROR Unable to start blueprint container for bundle test
org.osgi.service.blueprint.container.ComponentDefinitionException: Unable to instantiate components
at org.apache.aries.blueprint.container.BlueprintContainerImpl.instantiateEagerComponents(BlueprintContainerImpl.java:672)
at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:370)
at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:261)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at org.apache.aries.blueprint.container.ExecutorServiceWrapper.run(ExecutorServiceWrapper.java:106)
at org.apache.aries.blueprint.utils.threading.impl.DiscardableRunnable.run(DiscardableRunnable.java:48)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NoClassDefFoundError: javax/jms/ConnectionFactory
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
at java.lang.Class.getConstructors(Unknown Source)
at org.apache.aries.blueprint.container.BeanRecipe.findMatchingConstructors(BeanRecipe.java:509)
at org.apache.aries.blueprint.container.BeanRecipe.getInstance(BeanRecipe.java:327)
at org.apache.aries.blueprint.container.BeanRecipe.internalCreate2(BeanRecipe.java:806)
at org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:787)
at org.apache.aries.blueprint.di.AbstractRecipe$1.call(AbstractRecipe.java:79)
at java.util.concurrent.FutureTask.run(Unknown Source)
at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:88)
at org.apache.aries.blueprint.container.BlueprintRepository.createInstances(BlueprintRepository.java:245)
at org.apache.aries.blueprint.container.BlueprintRepository.createAll(BlueprintRepository.java:183)
at org.apache.aries.blueprint.container.BlueprintContainerImpl.instantiateEagerComponents(BlueprintContainerImpl.java:668)
... 13 more
Caused by: java.lang.ClassNotFoundException: javax.jms.ConnectionFactory
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 26 more
[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN Test bundle headers: Bundle-ManifestVersion=2, Bundle-Name=System Bundle, Bundle-SymbolicName=de.kalpatec.pojosr.framework, Bundle-Vendor=kalpatec, Bundle-Version=0.2.1
[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.apache.camel.spi.TypeConverterLoader], bundle: org.apache.camel.camel-spring [28], symbolicName: org.apache.camel.camel-spring
[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.apache.camel.spi.DataFormatResolver], bundle: org.apache.camel.camel-core [3], symbolicName: org.apache.camel.camel-core
[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.osgi.framework.hooks.bundle.EventHook], bundle: org.apache.aries.blueprint [13], symbolicName: org.apache.aries.blueprint
[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.apache.felix.cm.PersistenceManager], bundle: org.apache.felix.configadmin [25], symbolicName: org.apache.felix.configadmin
[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.apache.aries.blueprint.NamespaceHandler], bundle: org.apache.aries.blueprint [13], symbolicName: org.apache.aries.blueprint
[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.apache.camel.spi.TypeConverterLoader], bundle: org.apache.camel.camel-core [3], symbolicName: org.apache.camel.camel-core
[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.apache.camel.spi.ComponentResolver], bundle: org.apache.camel.camel-spring [28], symbolicName: org.apache.camel.camel-spring
[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.osgi.service.cm.ConfigurationAdmin], bundle: org.apache.felix.configadmin [25], symbolicName: org.apache.felix.configadmin
[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.apache.aries.blueprint.NamespaceHandler], bundle: org.apache.aries.blueprint [13], symbolicName: org.apache.aries.blueprint
[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.osgi.service.url.URLStreamHandlerService], bundle: org.apache.felix.fileinstall [26], symbolicName: org.apache.felix.fileinstall
[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.osgi.service.startlevel.StartLevel], bundle: de.kalpatec.pojosr.framework [0], symbolicName: de.kalpatec.pojosr.framework
[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.osgi.service.cm.ManagedServiceFactory], bundle: org.apache.felix.fileinstall [26], symbolicName: org.apache.felix.fileinstall
[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.apache.aries.blueprint.NamespaceHandler], bundle: org.apache.aries.blueprint [13], symbolicName: org.apache.aries.blueprint
[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.apache.aries.blueprint.NamespaceHandler], bundle: org.apache.aries.blueprint [13], symbolicName: org.apache.aries.blueprint
[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.apache.aries.blueprint.services.ParserService], bundle: org.apache.aries.blueprint [13], symbolicName: org.apache.aries.blueprint
[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.apache.aries.blueprint.NamespaceHandler], bundle: org.apache.aries.blueprint [13], symbolicName: org.apache.aries.blueprint
[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.apache.aries.blueprint.NamespaceHandler], bundle: org.apache.camel.camel-blueprint [6], symbolicName: org.apache.camel.camel-blueprint
[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.osgi.service.packageadmin.PackageAdmin], bundle: de.kalpatec.pojosr.framework [0], symbolicName: de.kalpatec.pojosr.framework
[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.apache.aries.blueprint.NamespaceHandler], bundle: org.apache.aries.blueprint [13], symbolicName: org.apache.aries.blueprint
[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.osgi.service.blueprint.container.BlueprintContainer], bundle: org.apache.aries.blueprint [13], symbolicName: org.apache.aries.blueprint
[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.apache.camel.spi.TypeConverterLoader], bundle: de.kalpatec.pojosr.framework [0], symbolicName: de.kalpatec.pojosr.framework
[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.apache.camel.spi.LanguageResolver], bundle: org.apache.camel.camel-spring [28], symbolicName: org.apache.camel.camel-spring
[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.apache.camel.spi.LanguageResolver], bundle: org.apache.camel.camel-core [3], symbolicName: org.apache.camel.camel-core
[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.apache.camel.spi.ComponentResolver], bundle: org.apache.camel.camel-core [3], symbolicName: org.apache.camel.camel-core
[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.osgi.service.cm.ConfigurationListener, org.apache.felix.fileinstall.ArtifactListener, org.apache.felix.fileinstall.ArtifactInstaller], bundle: org.apache.felix.fileinstall [26], symbolicName: org.apache.felix.fileinstall
[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.apache.aries.proxy.ProxyManager], bundle: org.apache.aries.proxy.impl [15], symbolicName: org.apache.aries.proxy.impl
[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.osgi.service.blueprint.container.BlueprintContainer], bundle: org.apache.camel.camel-blueprint [6], symbolicName: org.apache.camel.camel-blueprint
[mel.test.blueprint.Main.main()] CamelBlueprintHelper WARN ServiceReference: [org.apache.camel.spi.ComponentResolver], bundle: org.apache.camel.camel-jms [27], symbolicName: org.apache.camel.camel-jms
[mel.test.blueprint.Main.main()] BlueprintExtender INFO Destroying BlueprintContainer for bundle test
[mel.test.blueprint.Main.main()] BlueprintExtender INFO Destroying BlueprintContainer for bundle org.apache.aries.blueprint
[mel.test.blueprint.Main.main()] BlueprintExtender INFO Destroying BlueprintContainer for bundle org.apache.camel.camel-blueprint
[mel.test.blueprint.Main.main()] Activator INFO Camel activator stopping
[mel.test.blueprint.Main.main()] Activator INFO Camel activator stopped
[mel.test.blueprint.Main.main()] CamelBlueprintHelper INFO Deleting work directory target/bundles/1442417582122
[ERROR] *************************************
[ERROR] Error occurred while running main from: org.apache.camel.test.blueprint.Main
[ERROR]
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.camel.maven.RunMojo$1.run(RunMojo.java:488)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.RuntimeException: Gave up waiting for service (objectClass=org.apache.camel.CamelContext)
at org.apache.camel.test.blueprint.CamelBlueprintHelper.getOsgiService(CamelBlueprintHelper.java:240)
at org.apache.camel.test.blueprint.CamelBlueprintHelper.getOsgiService(CamelBlueprintHelper.java:202)
at org.apache.camel.test.blueprint.Main.doStart(Main.java:104)
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
at org.apache.camel.main.MainSupport.run(MainSupport.java:150)
at org.apache.camel.main.MainSupport.run(MainSupport.java:354)
at org.apache.camel.test.blueprint.Main.main(Main.java:81)
... 6 more
[ERROR] *************************************
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 34.478 s
[INFO] Finished at: 2015-09-16T11:33:32-05:00
[INFO] Final Memory: 33M/458M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.camel:camel-maven-plugin:2.15.1.redhat-620133:run (default-cli) on project test: null: MojoExecutionException: InvocationTargetException: Gave up waiting for service (objectClass=org.apache.camel.CamelContext) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
3 ответа
После множества возможных решений я нашел то, что работает:
Во-первых, у меня не было правильной версии файлов.jar..Jars должна быть той же версии, что и используемый вами MQ. (в моем случае я должен был использовать 8.0.0.2)
Второе - вам нужны следующие файлы: com.ibm.mq.allclient.jar, fscontext.jar, providerutil.jar и jms.jar
Третье - банки должны быть импортированы через Maven..Jars нельзя добавить в путь к классам, так как Fuse не знает, как искать здесь.
Наконец - боб выглядел так:
<bean id="websphere" class="org.apache.camel.component.jms.JmsComponent">
<property name="connectionFactory">
<bean class="com.ibm.mq.jms.MQConnectionFactory">
<property name="transportType" value="1" />
<property name="hostName" value="IPAddress"/>
<property name="port" value="1414"/>
<property name="queueManager" value="WQM"/>
<property name="channel" value="SYSTEM.ADMIN.SVRCONN"/>
</bean>
</property>
</bean>
Вы можете получить доступ к IBM MQ 8 с помощью JBoss Fuse 6.2 через клиентский код IBM MQ 7.5. IBM MQ 8 - это JMS 2.0, а JBoss Fuse 6.2 - на основе JMS 1.1. IBM сертифицирует код клиента 7.5 по отношению к брокеру 8.
Эта статья может быть полезна для вас: http://www.soapassion.com/jboss/integrate-ibm-websphere-mq-8-jboss-fuse-6-3/
Если вы используете Fuse в контейнере Karaf, то вам потребуется компонент osgi. Если у вас есть эти компоненты, то Fuse (Karaf) распознает их.