0

I am getting following error when connecting to AMS Enabled IBM-MQ from my service running in JBOSS AS 7.0.

2020-06-19 19:12:48,344 ERROR [stderr] (JBOSSEngineThread1-event51129525) Could not initialize log file, java.nio.file.AccessDeniedException: mqjms.log.0.lck
2020-06-19 19:12:48,347 ERROR [stderr] (JBOSSEngineThread1-event51129525) June 19, 2020 11:12:48 PM GMT[JBOSSEngineThread1-event51129525] com.ibm.mq.ese.prot.MessageProtectionBCImpl
2020-06-19 19:12:48,347 ERROR [stderr] (JBOSSEngineThread1-event51129525) The IBM MQ Advanced Message Security Java interceptor failed to protect message.
2020-06-19 19:12:48,347 ERROR [stderr] (JBOSSEngineThread1-event51129525) The IBM MQ Advanced Message Security Java interceptor was not able to protect the message.
2020-06-19 19:12:48,347 ERROR [stderr] (JBOSSEngineThread1-event51129525) See subsequent messages in the exception for more details about the cause of the error.
2020-06-19 19:12:48,347 ERROR [stderr] (JBOSSEngineThread1-event51129525) --------------------------------------------------------------------
2020-06-19 19:12:48,348 ERROR [stderr] (JBOSSEngineThread1-event51129525) June 19, 2020 11:12:48 PM GMT[JBOSSEngineThread1-event51129525] com.ibm.mq.ese.prot.MessageProtectionBCImpl
2020-06-19 19:12:48,348 ERROR [stderr] (JBOSSEngineThread1-event51129525) org.bouncycastle.operator.OperatorCreationException: cannot create signer: Supplied key (null) is not a RSAPrivateKey instance
2020-06-19 19:12:48,348 ERROR [stderr] (JBOSSEngineThread1-event51129525) --------------------------------------------------------------------
2020-06-19 19:12:48,348 ERROR [stderr] (JBOSSEngineThread1-event51129525) June 19, 2020 11:12:48 PM GMT[JBOSSEngineThread1-event51129525] com.ibm.mq.ese.prot.MessageProtectionBCImpl
2020-06-19 19:12:48,348 ERROR [stderr] (JBOSSEngineThread1-event51129525) java.security.InvalidKeyException: Supplied key (null) is not a 
2020-06-19 19:12:48,348 ERROR [stderr] (JBOSSEngineThread1-event51129525) --------------------------------------------------------------------
2020-06-19 19:12:48,435 ERROR [stderr] (JBOSSEngineThread1-event51129525)
2020-06-19 19:12:48,435 ERROR [stderr] (JBOSSEngineThread1-event51129525)
2020-06-19 19:12:48,435 ERROR [stderr] (JBOSSEngineThread1-event51129525)                                     FDCTitle
2020-06-19 19:12:48,435 ERROR [stderr] (JBOSSEngineThread1-event51129525)
2020-06-19 19:12:48,435 ERROR [stderr] (JBOSSEngineThread1-event51129525)
2020-06-19 19:12:48,435 ERROR [stderr] (JBOSSEngineThread1-event51129525) Product          :- ProductName
2020-06-19 19:12:48,435 ERROR [stderr] (JBOSSEngineThread1-event51129525) Date/Time        :- Fri Jun 19 23:12:48 GMT 2020
2020-06-19 19:12:48,435 ERROR [stderr] (JBOSSEngineThread1-event51129525) System time      :- 1592608368365
2020-06-19 19:12:48,435 ERROR [stderr] (JBOSSEngineThread1-event51129525) Operating System :- Linux
2020-06-19 19:12:48,435 ERROR [stderr] (JBOSSEngineThread1-event51129525) UserID           :- abcd
2020-06-19 19:12:48,435 ERROR [stderr] (JBOSSEngineThread1-event51129525) Java Vendor      :- Oracle Corporation
2020-06-19 19:12:48,435 ERROR [stderr] (JBOSSEngineThread1-event51129525) Java Version     :- 25.241-b26
2020-06-19 19:12:48,435 ERROR [stderr] (JBOSSEngineThread1-event51129525)
2020-06-19 19:12:48,436 ERROR [stderr] (JBOSSEngineThread1-event51129525) Source Class     :- com.ibm.mq.ese.intercept.JmqiPutInterceptorImpl
2020-06-19 19:12:48,436 ERROR [stderr] (JBOSSEngineThread1-event51129525) Source Method    :- beforePut
2020-06-19 19:12:48,436 ERROR [stderr] (JBOSSEngineThread1-event51129525) ProbeID          :- MP006004
2020-06-19 19:12:48,436 ERROR [stderr] (JBOSSEngineThread1-event51129525) Thread           :- name=JBOSSEngineThread1-event51129525 priority=5 group=EJB default ccl=ModuleClassLoader for Module "deployment.engineserver.war:main" from Service Module Loader

Same service code runs fine when AMS is disabled. earlier i was getting missing trustAnchor error, that i resolved by merging Keystore and truststore certs into one single jks file. i see cert is getting loaded and when i changed the cert alias in keystore properties, i get error message of invalid alias.

my MQS_KEYSTORE_CONF : /apps//keystore.conf

jks.keystore=/apps/<PATH>/app-keystore.jks
jks.certificate=<alias_name for Cert>
jks.encrypted=no
jks.keystore_pass=<keystore password>
jks.key_pass=<keystore password>
jks.provider=IBMJCE

I am using IBM jar version 9.0.0.5. Really appreciate any inputs to fix this issue!!

Amit
  • 1
  • 1
  • Could you supply the command you invoke to run the failing application? I don't see where the `trustAnchors` and `trustStore` values are coming from? – Morag Hughson Jun 19 '20 at 04:13
  • i fixed trustAnchor issues by combining Trust and app certs in one keystore file ; however now i am getting following error `org.bouncycastle.operator.OperatorCreationException: cannot create signer: Supplied key (null) is not a RSAPrivateKey instance` although when i check my cert , i do see it signed properly as `Signature Algorithm: sha256WithRSAEncryption Issuer: C=<>, O=<>, OU=<>, CN=<> 04 G2 Validity Subject: C=<>, O=<>, OU= <>, OU=<>, OU=<>, CN=<> Subject Public Key Info: Public Key Algorithm: rsaEncryption Public-Key: (2048 bit) ` – Amit Jun 19 '20 at 22:08
  • That error is saying that it can't find the PRIVATE key. Nothing to do with how it was signed. Please update your question to reflect the current problem you are facing – Morag Hughson Jun 21 '20 at 00:42
  • do i have to specify private key anywhere ? shouldn't it be picked from cert ? – Amit Jun 26 '20 at 18:37
  • It will be picked up if it is there. Perhaps when you update your question to reflect the current problem you are facing you can add the steps you took to put the certificate into the store? – Morag Hughson Jun 27 '20 at 03:53

0 Answers0