com.ibm.mq.jakarta.jms import issue
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
I have below import in one of my class
import com.ibm.mq.jakarta.jms.MQQueueConnectionFactory;
Open in new window
I did maven clean then maven install from my intellij idea but still getting below errors
package com.ibm.mq.jakarta.jms does not exist
I have cleaned my repository also to remove all old jars in cache.
Please advise
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
com.ibm.mq.jakarta.client-9.3.4.0.jar
This particular micro service on different machine does not pull it some reason
I noticed in past some cache issues with intellij idea. I am on intellij idea 2021. I will try with intellij idea 2023 as well and see.
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Please show us the pom.xml file in the root directory of your project.
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
But getting below error from other class now from below methods
fct.setConnectionFactory(mqQueueConnectionFactoryX());
fct.setConnectionFactory(mqQueueConnectionFactoryY());
cannot access javax.jms.ConnectionFactory
incompatible types: com.ibm.mq.jakarta.jms.MQQueueConnectionFactory cannot be converted to javax.jms.ConnectionFactory.
Please advise
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
This class supposed to be in below jar (also there are transitive dependencies pulled by other different jars by spring boot)which is working in other micro service on other machine.
com.ibm.mq.jakarta.client-9.3.4.0.jar
Following dependency is missing from the pom: https://mvnrepository.com/artifact/com.ibm.mq/com.ibm.mq.jakarta.client/9.3.4.0
...
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Then this should be missing too:
https://mvnrepository.com/artifact/jakarta.jms/jakarta.jms-api/3.1.0
...
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Roland Mueller wrote:Jakarta does not work with javax.jms-api and jakarta.jms-api replaces according to my knowledge javax.jms-api.
Then this should be missing too:
https://mvnrepository.com/artifact/jakarta.jms/jakarta.jms-api/3.1.0
Bad me :-( This is already in your pom.xml from some messages ago.
...
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
sai rama krishna wrote:A
But getting below error from other class now from below methods
fct.setConnectionFactory(mqQueueConnectionFactoryX());
fct.setConnectionFactory(mqQueueConnectionFactoryY());
cannot access javax.jms.ConnectionFactory
incompatible types: com.ibm.mq.jakarta.jms.MQQueueConnectionFactory cannot be converted to javax.jms.ConnectionFactory.
Please advise
There should be some import using javax stuff instead of jakarta packages. You should check the imports in Java and may be make a check the Maven dependency tree for javax.
...
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Experience keeps a dear School, but Fools will learn in no other.
---
Benjamin Franklin - Postal official and Weather observer
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
https://mvnrepository.com/artifact/org.json/json.
I did exclude jars from
I am facing some other issues using intellij idea community version while connecting to TFS repository.
Spending more time in solving these IDE related issues, security related issues than actual coding daily.
If I use intellij idea 2021.2.1 community version and some times getting below kind of errors while getting latest code from TFS due to some existing bug
https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000597044--Couldn-t-check-the-working-tree-for-unmerged-files-because-of-an-error-
If I use intellij idea 2023 community version get different errors like below while getting latest code from TFS
https://intellij-support.jetbrains.com/hc/en-us/community/posts/12744271234450-Git-error-unable-to-read-askpass-response-after-updating-to-2023-2-version-of-IntelliJ
As mentioned in above thread I am trying below solution
File > Invalidate Caches.. > enable Clear file system cache and Local History option > Invalidate and Restart)
But under file i do not see invalidate caches
I see 'invalidate caches' under File -->settings but I do not see below option
" enable Clear file system cache and Local History option > Invalidate and Restart"
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
How to check the imports in Java. Is it like checking import statements at top of class right?
How to check the Maven dependency tree for javax in intellij idea? In POM " dependency analyzer" view as attached right? Not sure what is difference between :All dependencies as a list" and "All dependencies as tree" options.
Also DAO class also has javax imports which are not touched in other working micro projects but only touched in other classes, layers to convert from javax to jakarta which sounds to me like half conversion only. Not sure what is the reasoning behind that.
What is JMS server? Is it IBM MQ queue or spring boot tomcat server I am using on intellij idea to run this micro service to consume message on the IBM MQ queue?
-
1 -
-
Number of slices to send:Optional 'thank-you' note:
-
-
Now it is all working fine.
I added below dependency which is not blocked by jfrog which does not have vulnerablilities
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20231013</version>
</dependency>
Also install intellij idea 2023.2.5 latest version resolved askpass errors as per below bug.
https://intellij-support.jetbrains.com/hc/en-us/community/posts/12744271234450-Git-error-unable-to-read-askpass-response-after-updating-to-2023-2-version-of-IntelliJ
Also below command from command prompt (after verifying git) resolved ownership bug related errors as per below bug
https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000597044--Couldn-t-check-the-working-tree-for-unmerged-files-because-of-an-error-
C:\Users\xyz>git config --global --add safe.directory C:/Users/xyz/Documents/DDrive/aaa-bbbmessages
C:\Users\xyz>
Also "reimport" and "Build Project" resolved some of cache issues on intellij idea to refresh as per latest maven dependencies modified in pom.xml
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
MQQueueConnectionFactory connectionFactory = new MQQueueConnectionFactory();
connectionFactory.setQueueManager(communicationData.getQueueManager());
connectionFactory.setHostName("");
connectionFactory.setPort("");
connectionFactory.setChannel("");
connectionFactory.setTransportType(Integer
.parseInt("1"));
if (StringUtils.isNotEmpty(communicationData.getCcsid())) {
connectionFactory.setCCSID(Integer.parseInt(""));
connectionFactory.setTargetClientMatching(false);
JmsTransactionManager transactionManager = new JmsTransactionManager((ConnectionFactory) connectionFactory); // not compatible
synchronized public void addJMSComponent(CamelContext camelContext, String componentName,
MQQueueConnectionFactory connectionFactory, JmsTransactionManager transactionManager) {
if(camelContext.getComponent(componentName) == null){
JmsComponent jmsComponent = new JmsComponent();
jmsComponent.setTransactionManager(transactionManager);
jmsComponent.setConnectionFactory((ConnectionFactory) connectionFactory);
jmsComponent.setTransacted(true);
camelContext.addComponent(componentName, jmsComponent);
}
Using Spring Boot 3.1.1 with Apache Camel 4 and IBM MQ 9.2.4.0
class com.ibm.mq.jms.MQQueueConnectionFactory cannot be cast to class jakarta.jms.ConnectionFactory (com.ibm.mq.jms.MQQueueConnectionFactory and jakarta.jms.ConnectionFactory
Will you please share the clear steps followed. It will be very helpful
| Sunglasses. AKA Coolness prosthetic. This tiny ad doesn't need shades: Paul Wheaton's 16th Kickstarter: Gardening playing cards for gardeners and homesteaders https://coderanch.com/t/889615/Paul-Wheaton-Kickstarter-Gardening-playing |







