spring-attic / spring-cloud-stream-binder-ibm-mq

Apache License 2.0
10 stars 29 forks source link

Missing com.ibm.mq.allclient.jar and com.ibm.mq.pcf.jar files #6

Open CH-AhmetBombaci opened 5 years ago

CH-AhmetBombaci commented 5 years ago

I do not have com.ibm.mq.allclient.jar and com.ibm.mq.pcf.jar files in my MQ installation. Please note that I have 8.0.0.4 so I am not sure if IBM changed these jar files or not. In my java/lib folder, I have following jar files: |-- com.ibm.mq.commonservices.jar |-- com.ibm.mq.defaultconfig.jar |-- com.ibm.mq.postcard.jar |-- com.ibm.mq.tools.ras.jar

Do you have any recommendation in my case?

As a follow up question, I developed a small app that reads/writes messages from/to MQ queues by following IBM tutorial page. In that case, I used following maven repos:

    <!-- https://mvnrepository.com/artifact/com.ibm.mq/com.ibm.mq.allclient -->
    <dependency>
        <groupId>com.ibm.mq</groupId>
        <artifactId>com.ibm.mq.allclient</artifactId>
        <version>9.0.4.0</version>
    </dependency>

    <!-- https://mvnrepository.com/artifact/javax.jms/javax.jms-api -->
    <dependency>
        <groupId>javax.jms</groupId>
        <artifactId>javax.jms-api</artifactId>
        <version>2.0.1</version>
    </dependency>

I am not sure if I am missing anything but since this repo is 2 years old, maybe IBM exposed their jar files via maven during this period or maybe there is a functionality exists in the jar files that you mentioned which I am not aware of.

CH-AhmetBombaci commented 5 years ago

I made a few changes in pom.xml

Change 1:

9.0.4.0 Change 2: com.ibm.mq com.ibm.mq.allclient ${ibm.mq.version}
CH-AhmetBombaci commented 5 years ago

I get rid off pcf.jar and build is working fine. Right now, I am trying to solve test error:

java.lang.RuntimeException: Could not create MQ Queue Manager object for 'PCCHH01'
    at org.springframework.cloud.stream.binder.jms.ibmmq.IBMMQRequests.<init>(IBMMQRequests.java:52)
    at org.springframework.cloud.stream.binder.jms.ibmmq.IBMMQProvisioningProvider.<init>(IBMMQProvisioningProvider.java:47)
    at org.springframework.cloud.stream.binder.jms.ibmmq.integration.EndToEndIntegrationTests.<init>(EndToEndIntegrationTests.java:28)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at org.junit.runners.BlockJUnit4ClassRunner.createTest(BlockJUnit4ClassRunner.java:217)
    at org.junit.runners.BlockJUnit4ClassRunner$1.runReflectiveCall(BlockJUnit4ClassRunner.java:266)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.BlockJUnit4ClassRunner.methodBlock(BlockJUnit4ClassRunner.java:263)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
CH-AhmetBombaci commented 5 years ago

I fixed above issue. It was specific to my local environment. In my channel setup, I made SSL mandatory so it failed during authentication. I just removed it for now but still getting another error:

java.lang.NoSuchMethodError: org.springframework.cloud.stream.binding.StreamListenerMessageHandler.setNotPropagatedHeaders([Ljava/lang/String;)V
    at org.springframework.cloud.stream.binding.StreamListenerMessageHandler.<init>(StreamListenerMessageHandler.java:40) ~[spring-cloud-stream-1.2.3.BUILD-SNAPSHOT.jar:1.2.3.BUILD-SNAPSHOT]
    at org.springframework.cloud.stream.binding.StreamListenerAnnotationBeanPostProcessor.afterSingletonsInstantiated(StreamListenerAnnotationBeanPostProcessor.java:357) ~[spring-cloud-stream-1.2.3.BUILD-SNAPSHOT.jar:1.2.3.BUILD-SNAPSHOT]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:774) ~[spring-beans-4.3.4.RELEASE.jar:4.3.4.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:866) ~[spring-context-4.3.4.RELEASE.jar:4.3.4.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542) ~[spring-context-4.3.4.RELEASE.jar:4.3.4.RELEASE]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:761) ~[spring-boot-1.4.2.BUILD-SNAPSHOT.jar:1.4.2.BUILD-SNAPSHOT]
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:371) ~[spring-boot-1.4.2.BUILD-SNAPSHOT.jar:1.4.2.BUILD-SNAPSHOT]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) ~[spring-boot-1.4.2.BUILD-SNAPSHOT.jar:1.4.2.BUILD-SNAPSHOT]
    at org.springframework.cloud.stream.binder.test.integration.EndToEndIntegrationTests.createReceiver(EndToEndIntegrationTests.java:462) [spring-cloud-stream-binder-jms-common-test-support-1.0.0.BUILD-SNAPSHOT.jar:1.0.0.BUILD-SNAPSHOT]
    at org.springframework.cloud.stream.binder.jms.ibmmq.integration.EndToEndIntegrationTests.testBindingDestinationsWithInvalidCharacters(EndToEndIntegrationTests.java:38) [test-classes/:na]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_192]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_192]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_192]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_192]
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) [junit-4.12.jar:4.12]
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) [junit-4.12.jar:4.12]
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) [junit-4.12.jar:4.12]
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) [junit-4.12.jar:4.12]
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) [junit-4.12.jar:4.12]
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) [junit-4.12.jar:4.12]
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) [junit-4.12.jar:4.12]
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) [junit-4.12.jar:4.12]
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) [junit-4.12.jar:4.12]
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) [junit-4.12.jar:4.12]
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) [junit-4.12.jar:4.12]
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) [junit-4.12.jar:4.12]
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) [junit-4.12.jar:4.12]
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) [junit-4.12.jar:4.12]
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363) [junit-4.12.jar:4.12]
    at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252) [surefire-junit4-2.12.4.jar:2.12.4]
    at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141) [surefire-junit4-2.12.4.jar:2.12.4]
    at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112) [surefire-junit4-2.12.4.jar:2.12.4]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_192]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_192]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_192]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_192]
    at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189) [surefire-api-2.12.4.jar:2.12.4]
    at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165) [surefire-booter-2.12.4.jar:2.12.4]
    at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85) [surefire-booter-2.12.4.jar:2.12.4]
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115) [surefire-booter-2.12.4.jar:2.12.4]
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75) [surefire-booter-2.12.4.jar:2.12.4]
CH-AhmetBombaci commented 5 years ago

I overcame above error as well as various errors in jms project by upgrading Spring Cloud Stream version to 2 as well as Spring Boot version 2.

However; most of test cases that exist in jms is failing. I think this might be because of IBM MQ implementation but I am still investigating. I will update this post if I come up with a working solution.

arslanakhtar61 commented 5 years ago

@CH-AhmetBombaci , are you able to successfully package the final .jar with all the test passing? I tried to package it without running tests but I am getting exceptions in another spring-cloud-stream application that uses this .jar. Any success using this .jar?

CH-AhmetBombaci commented 5 years ago

@arslanakhtar61 we decided not to use SCS binder implementation. Instead, we are using JMS to read/put messages.

arslanakhtar61 commented 5 years ago

@CH-AhmetBombaci I agree. It would have been sweet if we could have used this binder implementation in our SCS app. It would have simplified development. I will explore spring-boot JMS with ibm-mq, Thanks for sharing.