Websphere MQ client deploy to Jboss Fuse - java

Error appear when MQConnectionFactory try to create connection.
At the same time I'm able to send\receive message from standalone application.
jboss stack trace.
Caused by: com.ibm.mq.MQException: JMSCMQ0001: JMSCMQ0001, 2, MQCC_FAILED, 2195, MQRC_UNEXPECTED_ERROR
at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:209)
... 24 more
Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2195;AMQ9204: Connection to host 'hostname(1450)' rejected. [1=com.ibm.mq.jmqi.JmqiException[CC=2;RC=2195],3=hostname(1450),5=WMQThreadPool.enqueue]
at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:2053)
at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:1226)
at com.ibm.msg.client.wmq.internal.WMQConnection.<init>(WMQConnection.java:346)
... 23 more
Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2195
at com.ibm.msg.client.wmq.common.internal.WMQThreadPool.enqueue(WMQThreadPool.java:109)
at com.ibm.mq.jmqi.remote.impl.RemoteConnection.setUpAsyncMode(RemoteConnection.java:1554)
at com.ibm.mq.jmqi.remote.impl.RemoteConnection.initSess(RemoteConnection.java:1348)
at com.ibm.mq.jmqi.remote.impl.RemoteConnection.connect(RemoteConnection.java:727)
at com.ibm.mq.jmqi.remote.impl.RemoteConnectionSpecification.getSessionFromNewConnection(RemoteConnectionSpecification.java:400)
at com.ibm.mq.jmqi.remote.impl.RemoteConnectionSpecification.getSession(RemoteConnectionSpecification.java:299)
at com.ibm.mq.jmqi.remote.impl.RemoteConnectionPool.getSession(RemoteConnectionPool.java:164)
at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:1598)
... 25 more
Caused by: com.ibm.msg.client.commonservices.CSIException: JMSCS0002
at com.ibm.msg.client.commonservices.workqueue.PIWorkQueueManager.enqueueItem(PIWorkQueueManager.java:67)
at com.ibm.msg.client.commonservices.workqueue.WorkQueueManager.enqueue(WorkQueueManager.java:225)
at com.ibm.msg.client.commonservices.workqueue.WorkQueueManager.enqueue(WorkQueueManager.java:194)
at com.ibm.msg.client.wmq.common.internal.WMQThreadPool.enqueue(WMQThreadPool.java:91)
Query manager log:
----- amqrmrsa.c : 898 --------------------------------------------------------
24.03.2015 17:09:06 - Process(21296.261) User(mqm) Program(amqrmppa)
Host(localserver-name) Installation(Installation1)
VRMF(7.5.0.2) QMgr(manager-name)
AMQ9209: Connection to host 'jboss-short-hostname (jboss-ip)' for channel
'channel-name' closed.
EXPLANATION:
An error occurred receiving data from 'jboss-short-hostname (jboss-ip)' over TCP/IP.
The connection to the remote host has unexpectedly terminated.
The channel name is 'channel-name'; in some cases it cannot be determined and so
is shown as '????'.
ACTION:
Tell the systems administrator.
----- amqccita.c : 3843 -------------------------------------------------------
24.03.2015 17:09:06 - Process(21296.261) User(mqm) Program(amqrmppa)
Host(localserver-name) Installation(Installation1)
VRMF(7.5.0.2) QMgr(manager-name)
AMQ9999: Channel 'channel-name' to host 'jboss-short-hostname (jboss-ip)' ended
abnormally.
EXPLANATION:
The channel program running under process ID 21296 for channel 'channel-name'
ended abnormally. The host name is 'jboss-short-hostname (jboss-ip)'; in some cases
the host name cannot be determined and so is shown as '????'.
ACTION:
Look at previous error messages for the channel program in the error logs to
determine the cause of the failure. Note that this message can be excluded
completely or suppressed by tuning the "ExcludeMessage" or "SuppressMessage"
attributes under the "QMErrorLog" stanza in qm.ini. Further information can be
found in the System Administration Guide.
----- amqrmrsa.c : 898 --------------------------------------------------------
About my test stand:
Fuse Fabric (7.2.0.redhat-024)
IBM WebSphere MQ Version : 7.5.0.2
Java 1.7
Server WebSphere MQ and jboss installed on different servers.
I installed as features following jars:
com.ibm.mq.osgi.directip_7.5.0.2.jar
com.ibm.mq.osgi.java_7.5.0.2.jar
com.ibm.msg.client.osgi.commonservices.j2se_7.5.0.2.jar
com.ibm.msg.client.osgi.jms.prereq_7.5.0.2.jar
com.ibm.msg.client.osgi.jms_7.5.0.2.jar
com.ibm.msg.client.osgi.nls_7.5.0.2.jar
com.ibm.msg.client.osgi.wmq.nls_7.5.0.2.jar
com.ibm.msg.client.osgi.wmq.prereq_7.5.0.2.jar
com.ibm.msg.client.osgi.wmq_7.5.0.2.jar
My code snippet:
MQQueueConnectionFactory cf = new MQQueueConnectionFactory();
// Config
cf.setHostName("hostname");
cf.setPort("port");
cf.setTransportType(JMSC.MQJMS_TP_CLIENT_MQ_TCPIP);
cf.setChannel("channel-name");
cf.setQueueManager("manager-name");
MQQueueConnection connectionDpc = (MQQueueConnection) cf.createQueueConnection("user", "pass");

Please try using the IBM MQ 7.5.0.6 (or later) OSGI bundles. The 7.5.0.2 bundles are known to have this issue.

Related

Testcontainers + db2 issue

I am having an issue with db2 using testcontainers. I keep receiving a connection refused error.
When running db2 with:
docker run I am able to connect with dbvis.
using fabric8 maven plugin to start the db2 container and again I am able to connect with dbvis
I put a breakpoint in the junit5 test and attempt access db2 and I receive the connection refused.
My db2 testcontainers configuration:
#Testcontainers
public class ArchiveTest {
#Container
private static final Db2Container DB2 = new Db2Container("ibmcom/db2:11.5.7.0").withPrivilegedMode(true)
.acceptLicense().withUsername("db2inst1").withPassword("password").withDatabaseName("BPMF")
.withEnv("ARCHIVE_LOGS", "false").withEnv("PERSISTENT_HOME", "false");
The db2 logs from docker:
(*) Previous setup has not been detected. Creating the users...
(*) Creating users ...
(*) Creating instance ...
DB2 installation is being initialized.
Total estimated time for all tasks to be performed: 309 second(s)
Total number of tasks to be performed: 4
Estimated time 1 second(s)
Description: Setting default global profile registry variables
Task #1 start
Task #1 end
Estimated time 5 second(s)
Description: Initializing instance list
Task #2 start
Task #2 end
Estimated time 300 second(s)
Description: Configuring DB2 instances
Task #3 start
Task #3 end
The execution completed successfully.
Task #4 end
Estimated time 3 second(s)
Description: Updating global profile registry
Task #4 start
For more information see the DB2 installation log at "/tmp/db2icrt.log.72".
(*) Fixing /etc/services file for DB2 ...
DBI1070I Program db2icrt completed successfully.
DBI1446I The db2icrt command is running.
chown: cannot access '/database/config/db2inst1/sqllib/adm/fencedid': No such file or directory
03/16/2022 10:26:18 0 0 SQL1032N No start database manager command was issued.
SQL1032N No start database manager command was issued. SQLSTATE=57019
(*) Cataloging existing databases
(*) Applying Db2 license ...
ls: cannot access /database/data/db2inst1/NODE0000: No such file or directory
LIC1426I This product is now licensed for use as outlined in your License Agreement. USE OF THE PRODUCT CONSTITUTES ACCEPTANCE OF THE TERMS OF THE IBM LICENSE AGREEMENT, LOCATED IN THE FOLLOWING DIRECTORY: "/opt/ibm/db2/V11.5/license/en_US.iso88591"
LIC1402I License added successfully.
(*) Updating DBM CFG parameters ...
(*) Saving the checksum of the current nodelock file ...
successfully.
DB20000I The UPDATE DATABASE MANAGER CONFIGURATION command completed
successfully.
DB20000I The UPDATE DATABASE MANAGER CONFIGURATION command completed
successfully.
DB20000I The UPDATE DATABASE MANAGER CONFIGURATION command completed
(*) Remounting /database with suid...
No Cgroup memory limit detected, instance memory will follow automatic tuning
(*) Nothing appears in the Db2 directory. will skip update/upgrade.
(*) Code level is the same. No update/upgrade needed.
DB2 State : Operable
Starting DB2...
DB2 has not been started
SQL1063N DB2START processing was successful.
03/16/2022 10:26:29 0 0 SQL1063N DB2START processing was successful.
(*) Creating database BPMF ...
(*) User chose to create BPMF database
DB20000I The CREATE DATABASE command completed successfully.
DB20000I The ACTIVATE DATABASE command completed successfully.
(*) Instance and database will not be auto configured. AUTOCONFIG has been set to false.
(*) Log archiving will not be configured as ARCHIVE_LOGS has been set to false.
(*) Skipping TEXT_SEARCH setup for database BPMF because TEXT_SEARCH is not configured for the instance ...
ssh-keygen: generating new host keys: RSA1 RSA DSA ECDSA ED25519
(*) All databases are now active.
(*) Setup has completed.
2022-03-16 12:27:28 | INFO | [main] d.5.7.0]:503 - Container ibmcom/db2:11.5.7.0 started in PT1M27.212S
The error from java is:
Caused by: com.ibm.db2.jcc.am.DisconnectNonTransientConnectionException: [jcc][t4][2043][11550][4.25.13] Exception java.net.ConnectException: Error opening socket to server /127.0.0.1 on port 50,000 with message: Connection refused: connect. ERRORCODE=-4499, SQLSTATE=08001
at com.ibm.db2.jcc.am.b6.a(b6.java:338)
at com.ibm.db2.jcc.am.b6.a(b6.java:435)
at com.ibm.db2.jcc.t4.a0.a(a0.java:445)
at com.ibm.db2.jcc.t4.a0.<init>(a0.java:96)
at com.ibm.db2.jcc.t4.a.b(a.java:366)
at com.ibm.db2.jcc.t4.b.newAgent_(b.java:2148)
at com.ibm.db2.jcc.am.Connection.initConnection(Connection.java:839)
at com.ibm.db2.jcc.am.Connection.<init>(Connection.java:784)
at com.ibm.db2.jcc.t4.b.<init>(b.java:350)
at com.ibm.db2.jcc.DB2SimpleDataSource.getConnection(DB2SimpleDataSource.java:233)
at com.ibm.db2.jcc.DB2SimpleDataSource.getConnection(DB2SimpleDataSource.java:200)
at com.ibm.db2.jcc.DB2Driver.connect(DB2Driver.java:471)
at com.ibm.db2.jcc.DB2Driver.connect(DB2Driver.java:113)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:247)
at org.osjava.datasource.SJDataSource.getConnection(SJDataSource.java:115)
at org.osjava.datasource.SJDataSource.getConnection(SJDataSource.java:106)
at org.osjava.datasource.SJDataSource.getConnection(SJDataSource.java:88)
at org.flywaydb.core.internal.jdbc.JdbcUtils.openConnection(JdbcUtils.java:48)
... 105 common frames omitted
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:607)
at com.ibm.db2.jcc.t4.x.run(x.java:49)
at java.security.AccessController.doPrivileged(Native Method)
at com.ibm.db2.jcc.t4.a0.a(a0.java:431)
... 121 common frames omitted
Caused by: org.springframework.beans.BeanInstantiationException:
Failed to instantiate [org.flywaydb.core.Flyway]: Factory method 'migration' threw exception; nested exception is org.flywaydb.core.internal.exception.FlywaySqlException: Unable to obtain connection from database: [jcc][t4][2043][11550][4.25.13] Exception java.net.ConnectException: Error opening socket to server /127.0.0.1 on port 50,000 with message: Connection refused: connect. ERRORCODE=-4499, SQLSTATE=08001
I have confirmed my JDBC parameters are correct...so I am at a bit of a loss where it is going wrong.
EDIT 1: db2 is running:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
e7046334e6c8 ibmcom/db2:11.5.0.0a "/var/db2_setup/lib/…" About a minute ago Up About a minute 22/tcp, 55000/tcp, 60006-60007/tcp, 0.0.0.0:53444->50000/tcp wizardly_cartwright
ccfe6845bfb1 testcontainers/ryuk:0.3.3 "/app" About a minute ago Up About a minute 0.0.0.0:53439->8080/tcp testcontainers-ryuk-99222438-9340-47ca-b6d2-0a13bfe50f9d
EDIT2: docker-for-java command parameters:
AbstrDockerCmd:34 - Cmd: org.testcontainers.shaded.com.github.dockerjava.core.command.CreateContainerCmdImpl#7df60067[name=<null>,hostName=<null>,domainName=<null>,user=<null>,attachStdin=<null>,attachStdout=<null>,attachStderr=<null>,portSpecs=<null>,tty=<null>,stdinOpen=<null>,stdInOnce=<null>,env={DB2INSTANCE=db2inst1,AUTOCONFIG=false,ARCHIVE_LOGS=false,DB2INST1_PASSWORD=password,PERSISTENT_HOME=false,DBNAME=BPMF,LICENSE=accept},cmd={},healthcheck=<null>,argsEscaped=<null>,entrypoint=<null>,image=ibmcom/db2:11.5.0.0a,volumes=Volumes(volumes=[]),workingDir=<null>,macAddress=<null>,onBuild=<null>,networkDisabled=<null>,exposedPorts=ExposedPorts(exposedPorts=[50000/tcp]),stopSignal=<null>,stopTimeout=<null>,hostConfig=HostConfig(binds=[], blkioWeight=null, blkioWeightDevice=null, blkioDeviceReadBps=null, blkioDeviceWriteBps=null, blkioDeviceReadIOps=null, blkioDeviceWriteIOps=null, memorySwappiness=null, nanoCPUs=null, capAdd=null, capDrop=null, containerIDFile=null, cpuPeriod=null, cpuRealtimePeriod=null, cpuRealtimeRuntime=null, cpuShares=null, cpuQuota=null, cpusetCpus=null, cpusetMems=null, devices=null, deviceCgroupRules=null, deviceRequests=null, diskQuota=null, dns=null, dnsOptions=null, dnsSearch=null, extraHosts=[], groupAdd=null, ipcMode=null, cgroup=null, links=[], logConfig=LogConfig(type=null, config=null), lxcConf=null, memory=null, memorySwap=null, memoryReservation=null, kernelMemory=null, networkMode=null, oomKillDisable=null, init=null, autoRemove=null, oomScoreAdj=null, portBindings={50000/tcp=[Lcom.github.dockerjava.api.model.Ports$Binding;#393881f0}, privileged=true, publishAllPorts=null, readonlyRootfs=null, restartPolicy=null, ulimits=null, cpuCount=null, cpuPercent=null, ioMaximumIOps=null, ioMaximumBandwidth=null, volumesFrom=[], mounts=null, pidMode=null, isolation=null, securityOpts=null, storageOpt=null, cgroupParent=null, volumeDriver=null, shmSize=null, pidsLimit=null, runtime=null, tmpFs=null, utSMode=null, usernsMode=null, sysctls=null, consoleSize=null),labels={org.testcontainers=true, org.testcontainers.sessionId=090442b0-8cc4-4f6e-b07e-1afdfed5ec15},shell=<null>,networkingConfig=<null>,ipv4Address=<null>,ipv6Address=<null>,aliases=<null>,authConfig=<null>,platform=<null>]
As I am using smplie-jndi and have the JDBC parameters in property files, the port for the JDBC URL is not 50000. Busy looking how to set it to a specific port as the default is specified in the DB2Container class
EDIT 1: It's mentioned in the docs
Note that this exposed port number is from the perspective of the container.
From the host's perspective Testcontainers actually exposes this on a random free port. This is by design, to avoid port collisions that may arise with locally running software or in between parallel test runs.
Please make sure to use DB2.getJdbcUrl() or similar access the container after starting it. Testcontainers publishes the exposed ports of the container to a random free host port and this dynamic port needs to be injected into your system under test at runtime. Depending on framework and libraries, there are different ways to achieve these, either configuration properties in Spring, or worst case, by templating config files.

JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2009' ('MQRC_CONNECTION_BROKEN')

I've tried to connect to ibm mq using ccdt. Below is my java code
private MQQueueConnectionFactory connectionFactory = new MQQueueConnectionFactory();
String cddtpath = "C:/tmp/AMQCLCHL.TAB";
connectionFactory.setCCDTURL(new URL("file:///" + ccdtpath));
connectionFactory.setQueueManager("MINE");
queueConnection = connectionFactory.createConnection(username, pwd);
I've created SVRCONN as below:
DEFINE CHANNEL(MINE.TCP.SVRCONN) CHLTYPE(SVRCONN) REPLACE in my 20-config.mqsc file
and also I added corresponding CLNTCONN as below:
echo "DEFINE CHANNEL(MINE.TCP.SVRCONN) CHLTYPE(CLNTCONN) QMNAME(MINE) CONNAME('localhost(9443)')" | MQCHLLIB=/tmp MQCHLTAB=AMQCLCHL.TAB runmqsc -n
as mentioned here Connecting to IBM MQ using CCDT file in JMS
after that I copied ccdt tab into local destination.
But I get an error: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2009' ('MQRC_CONNECTION_BROKEN').
On docker I have latest (9 version) but in app I'm using 8.0 version.
What can be the reason?
After restart I can see below logs in ./mnt/mqm/data/errors/AMQERR01.LOG:
07/03/20 07:54:59 - Process(108.3) User(mqm) Program(amqzmuc0)
Host(b3316126fce2) Installation(Installation1)
VRMF(9.1.5.0)
Time(2020-07-03T07:54:59.992Z)
ArithInsert1(108)
CommentInsert1(MINE)
AMQ6184W: An internal IBM MQ error has occurred on queue manager MINE.
EXPLANATION:
An error has been detected, and the IBM MQ error recording routine has been
called. The failing process is process 108.
ACTION:
Use the standard facilities supplied with your system to record the problem
identifier and to save any generated output files. Use either the MQ Support
site: http://www.ibm.com/software/integration/wmq/support/, or IBM Support
Assistant (ISA): http://www.ibm.com/software/support/isa/, to see whether a
solution is already available. If you are unable to find a match, contact your
IBM support center. Do not discard these files until the problem has been
resolved.
Full 2009 error:
<Could not refresh JMS Connection for destination 'queue://MINE/MYQUEUE' - retrying in 5000 ms. Cause: JMSWMQ2020: Failed to connect to queue manager 'MINE' with connection mode 'Client' and supplied CCDT URL 'file:/C:/tmp/AMQCLCHL.TAB', see linked exception for more information.; nested exception is com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2009' ('MQRC_CONNECTION_BROKEN').>
0001 CC=2;RC=2009;AMQ9208: Error on receive from host 'localhost/127.0.0.1:9443 (localhost)'. [1=-1,2=ffffffff,3=localhost/127.0.0.1:9443 (localhost),4=TCP] [com.ibm.mq.jmqi.JmqiException]
[03/06/20 18:16:54.130.0K] 0001 #785fc51 c.i.m.j.remote.api.RemoteFAP ----+---- ! jmqiConnect(String,JmqiConnectOptions,MQCNO,Hconn,Phconn,Pint,Pint,RemoteHconn)<throwIndex 20>, CC=2;RC=2009;AMQ9204: Connection to host 'localhost(9443)' rejected. [1=com.ibm.mq.jmqi.JmqiException[CC=2;RC=2009;AMQ9208: Error on receive from host 'localhost/127.0.0.1:9443 (localhost)'. [1=-1,2=ffffffff,3=localhost/127.0.0.1:9443 (localhost),4=TCP]],3=localhost(9443) ,5=RemoteConnection.receiveTSH] [com.ibm.mq.jmqi.JmqiException]
Full 2278 error:
JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2278' ('MQRC_CLIENT_CONN_ERROR').>
:::::::----+- { reasonToException(int,String,String,String,String,HashMap<String , ? extends Object>) [2278(0x8e6)] [JMSWMQ2020: Failed to connect to queue manager '' with connection mode 'Client' and supplied CCDT URL 'file:/C:/tmp/AMQCLCHL.TAB', see linked exception for more information.] [JMSWMQ2020] <null> [Check the queue manager is started and if running in client mode, check there is a listener running. Please see the linked exception for more information.] [{XMSC_INSERT_QUEUE_MANAGER=, XMSC_WMQ_CONNECTION_MODE=Client, XMSC_WMQ_CCDTURL=file:/C:/tmp/AMQCLCHL.TAB}]

How to fix 'JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2035' ('MQRC_NOT_AUTHORIZED')'

I am running a Docker container with MQ 7.1 on it and I am trying to send a test message to the queue using a Java application that will send a message. The docker container is running on a RHEL server and I am trying to send a message from my Windows PC using the Java application in Eclipse locally.
I am tripping up when creating the MQQueueConnection, as I am getting the following error:
Exception in thread "main" com.ibm.msg.client.jms.DetailedJMSSecurityException: JMSWMQ2013: The security authentication was not valid that was supplied for QueueManager '' with connection mode 'Client' and host name 'x.x.x.x(1414)'.
Please check if the supplied username and password are correct on the QueueManager to which you are connecting.
at com.ibm.msg.client.wmq.common.internal.Reason.reasonToException(Reason.java:516)
at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:216)
at com.ibm.msg.client.wmq.internal.WMQConnection.<init>(WMQConnection.java:423)
at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createV7ProviderConnection(WMQConnectionFactory.java:6772)
at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createProviderConnection(WMQConnectionFactory.java:6151)
at com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl.createConnection(JmsConnectionFactoryImpl.java:280)
at com.ibm.mq.jms.MQConnectionFactory.createCommonConnection(MQConnectionFactory.java:6143)
at com.ibm.mq.jms.MQQueueConnectionFactory.createQueueConnection(MQQueueConnectionFactory.java:115)
at mq.MQMessageSender.main(MQMessageSender.java:107)
Caused by: com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2035' ('MQRC_NOT_AUTHORIZED').
at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:204)
... 7 more
I have tried to change the authorization of the 'nobody' user and try open the gates with the following command but its not working:
setmqaut -m QM1 -t qmgr -p 'nobody' +allmqi
Some info below:
Queue Manager: QM1
Queues: Q1, Q2
Channel name: MESSAGESENDER
Just fixed this error. I added the 'mqm' user I was using on the docker container to my createQueueConnection call like this:
MQQueueConnection queueConn = (MQQueueConnection) cf.createQueueConnection("admin1", "");
this is the typical error when the MQ client does not provide conn creds, it can also happen in the WebSphere log when you forgot to specify creds in the Integrated Console

Cannot connect to Wildfly

I have just installed Wildfly and I tried to connect it :
\wildfly-11.0.0.Final\bin>jboss-cli.bat -c
But gives me follow error :
Failed to connect to the controller: The controller is not available
at localhost:9990: java.net.ConnectException: WFLYPRT0053: Could not
connect to remote+http://localhost:9990. The connection failed:
WFLYPRT0053: Could not connect to remote+http://localhost:9990. The
connection failed: Connection refused: no further information
I tried a lot of solutions but it's not working for me.
With Widlfly running, i.e. (standalone.bat), use the --controller option to define where it is:
jboss-cli.bat -c --controller=localhost:9990
Got the same error on wildfly version 16
Error
Failed to connect to the controller: The controller is not available at localhost:: java.net.ConnectException: WFLYPRT0053: Could not connect to remote+http://localhost:. The connection failed: WFLYPRT0053: Could not connect to remote+http://localhost:. The connection failed: Connection refused
And following done and resolved successfully
Step 01
Comment (or you can remove) following line from /bin/jboss-cli.xml
default-protocol use-legacy-override="true">remote+https</default-protocol
Correct protocol Ex:
<default-protocol use-legacy-override="true">remote+http</default-protocol>
<!-- The default controller to connect to when 'connect' command is executed w/o arguments -->
<default-controller>
<protocol>remote+http</protocol>
<host>localhost</host>
<port>9990</port>
</default-controller>
Step 02
In my case i have alredy created a Administrative user hence, I have statup the CLI with following commnad
./jboss-cli.sh --user="<user>" --password="<password>" --controller=remote+http:<your IP>:<port> --connect
Example :
./jboss-cli.sh --user="Admin" --password="Password" --controller=remote+http://19.199.115.172:9990 --connect
Make sure your wildfly is up and running. If you have used different port for the admin console it should be added .
Jboss must be running while doing this. I was trying to do this while my jboss was not up n running... then i got this error message. So boot up jboss and try again.
The most common case is that there is a mismatch between the default controller defined in jboss-cli.xml and the management port, configured in the standalone.xml/domain.xml. Out of the box, they should converge on localhost:9990. Therefore, verify if you changed any of the two files. Other than that, it could be a firewall/network issue.
See also: Cannot connect to WildFly with CLI

Stop jboss 5.x from shell script

I am writing some small shell script utility which automates deployment process. I ready many links related to command for shutting down the jboss server in linux so that I can shutdown the server from my utility.
Read some links which will tell how to do it in jboss 7 or later but not in old jboss versions like 5.x. One such is
"$JBOSS_HOME/bin/jboss-cli.sh" --connect command=:shutdown
I want to shutdown the jboss 5.2 version from my shell script?
Edit: Jboss 5 version has shutdown.sh in the bin folder. But I am getting the below exception when I say
sh shutdown.sh -S
[john#mymachine bin]$ sh shutdown.sh -S
Exception in thread "main" javax.naming.CommunicationException: Could not obtain connection to any of these urls: localhost:1099 [Root exception is javax.naming.CommunicationException: Failed to connect to server localhost/127.0.0.1:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost/127.0.0.1:1099 [Root exception is java.net.ConnectException: Connection refused]]]
at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1851)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:720)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:713)
at javax.naming.InitialContext.lookup(InitialContext.java:411)
at org.jboss.Shutdown.main(Shutdown.java:225)
Caused by: javax.naming.CommunicationException: Failed to connect to server localhost/127.0.0.1:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost/127.0.0.1:1099 [Root exception is java.net.ConnectException: Connection refused]]
at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:362)
at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:287)
at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1821)
... 4 more
Caused by: javax.naming.ServiceUnavailableException: Failed to connect to server localhost/127.0.0.1:1099 [Root exception is java.net.ConnectException: Connection refused]
at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:332)
... 6 more
Caused by: java.net.ConnectException: Connection refused
Any idea ??
Regards
JBoss 5 has a shutdown.sh, from the docs:
usage: shutdown [options] <operation>
options:
-h, --help Show this help message (default)
-D<name>[=<value>] Set a system property
-- Stop processing options
-s, --server=<url> Specify the JNDI URL of the remote server
-n, --serverName=<url> Specify the JMX name of the ServerImpl
-a, --adapter=<name> Specify JNDI name of the MBeanServerConnection to use
-u, --user=<name> Specify the username for authentication
-p, --password=<name> Specify the password for authentication
operations:
-S, --shutdown Shutdown the server
-e, --exit=<code> Force the VM to exit with a status code
-H, --halt=<code> Force the VM to halt with a status code
I believe you should check your JBoss configuration and look for the JNP port. Probably you are running with a non default port and that's why you receive the connection refused exception.
Have a look at the file server/default/conf/bindingservice.beans/META-INF/bindings-jboss-beans.xml.
Reference https://community.jboss.org/wiki/ConfigurePorts
If you have on ubuntu with default visual interface, open the "System Monitor", change to tab Process and filter by "jboss", it's will result in a java process, kill then.

Categories