Setting mysql port number in agile toolkit - atk4

How do I set a port number for mysql connection in Agile Toolkit? The mysql in my local machine is running in a different port 3307, how should be my connection configuration look like?
I tried the following but it did not work,
$config['dsn']='mysql://atk:password#localhost:3307/atk';
I am getting the following error when I try a db test,
C:\xampp\htdocs\atk4.1.2\atk4\lib\DBlite/mysql.php:40 [2] mysql_pconnect() [function.mysql-pconnect]: [2002] No connection could be made because the target machine actively refused it. (trying to connect via tcp://localhost:3306)
C:\xampp\htdocs\atk4.1.2\atk4\lib\DBlite/mysql.php:40 [2] mysql_pconnect() [function.mysql-pconnect]: No connection could be made because the target machine actively refused it.
SQLException
Database connection failed
MySQL error:
No connection could be made because the target machine actively refused it.
C:\xampp\htdocs\atk4.1.2\atk4\lib\BaseException.php:37
Stack trace:
C:\xampp\htdocs\atk4.1.2\atk4\lib/BaseException.php :37 SQLException BaseException->collectBasicData(Null, 1, 0)
C:\xampp\htdocs\atk4.1.2\atk4\lib/SQLException.php :45 SQLException BaseException->__construct("<p>Database connection failed</p><b>MySQL error:</b> <div style='border: 1px solid black'><font color=red>No connection could be...", Null, 1)
C:\xampp\htdocs\atk4.1.2\atk4\lib/DBlite.php :359 SQLException SQLException->__construct(Null, "Database connection failed")
C:\xampp\htdocs\atk4.1.2\atk4\lib/DBlite.php :101 gift_project DBlite->fatal("Database connection failed", True)
C:\xampp\htdocs\atk4.1.2\atk4\lib/ApiCLI.php :276 gift_project DBlite->connect(Array(7))
C:\xampp\htdocs\atk4.1.2\page/dbtest.php :7 gift_project ApiCLI->dbConnect()
C:\xampp\htdocs\atk4.1.2\atk4\lib/AbstractObject.php :129 gift_project_dbtest page_dbtest->init()
C:\xampp\htdocs\atk4.1.2\atk4\lib/ApiFrontend.php :90 gift_project AbstractObject->add("page_dbtest", "dbtest", "Content")
C:\xampp\htdocs\atk4.1.2\atk4\lib/ApiWeb.php :305 gift_project ApiFrontend->layout_Content()
C:\xampp\htdocs\atk4.1.2\atk4\lib/ApiWeb.php :297 gift_project ApiWeb->addLayout("Content")
C:\xampp\htdocs\atk4.1.2\atk4\lib/ApiWeb.php :182 gift_project ApiWeb->initLayout()
C:\xampp\htdocs\atk4.1.2/index.php :15 gift_project ApiWeb->main()
Solution : The following type of configuration works,
$config['dsn']=array('type'=>'mysql',
'hostspec'=>'localhost:3307',
'username'=>'atk',
'password'=>'password',
'database'=>'atk',
'charset'=>'utf-8');

try the following
$config['dsn']=array('type'=>'mysql','username'=>'atk',
'host'=>'localhost','database'=>'atk','password'=>'password',
'port'=>3307,'charset'=>'utf-8');

Related

R2DBC-MSSQL how to connect to a database

I am trying to connect to my local SQL Server with R2DBC, unfortunately, I do not know where I am going wrong, I have a lot of experience with R2DBC, I use it all the time with other databases but this is my first time with MSSQL, below is my MSSQL ConnectionFactorythat is failing:
#Bean
override fun connectionFactory(): ConnectionFactory {
val options = builder()
.option(DRIVER, "sqlserver")
.option(HOST, properties.host)
.option(PORT, properties.port.toInt())
.option(USER, properties.username)
.option(PASSWORD, properties.password)
.option(DATABASE, properties.database)
.option(SSL, false)
.build()
val connectionFactory = ConnectionFactories.get(options)
val configuration = ConnectionPoolConfiguration.builder(connectionFactory)
.maxIdleTime(Duration.ofMillis(1000))
.maxSize(20)
.build()
connectionPool = ConnectionPool(configuration)
return ProxyConnectionFactory.builder(connectionPool)
.build()
}
My properties
com:
#Application database
database:
host: PC_NAME\SQLEXPRESS
port: 51306
database: app_database
username: user
password: pass
When I run my application I get the error below:
09:02:40.151 [reactor-tcp-nio-1] DEBUG reactor.pool.SimpleDequePool - failed to warm up extra resource 9/9: java.net.UnknownHostException: Failed to resolve 'PC_NAME\SQLEXPRESS' after 4 queries
09:02:40.153 [parallel-2] ERROR reactor.core.publisher.Operators - Operator called default onErrorDropped
reactor.core.Exceptions$ErrorCallbackNotImplemented: org.springframework.transaction.CannotCreateTransactionException: Could not open R2DBC Connection for transaction; nested exception is java.net.UnknownHostException: Failed to resolve 'PC_NAME\SQLEXPRESS' after 4 queries
Caused by: org.springframework.transaction.CannotCreateTransactionException: Could not open R2DBC Connection for transaction; nested exception is java.net.UnknownHostException: Failed to resolve 'PC_NAME\SQLEXPRESS' after 4 queries
I do not understand where I am going wrong, I can confirm that I have enabled TCP and shown below
And enabled remote connection on my server instance
Does anyone know how this works?

Server Exception :234 JDBC SQL server express 127.0.01 port: 1433 Clojure

I got this error when running it in clojure, I'm using SQL Express and a mock database to learn, as for this error I've tried to :
make an inbound exception in firewall (port : 1433)
change the ipall port : 1433, based on this thread post
but still result in error
com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host 127.0.0.1, port 1433 has failed. Error: "Connect timed out. Verify the connection properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make sure that TCP connections to the port are not blocked by a firewall.".
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError (SQLServerException.java:234)
com.microsoft.sqlserver.jdbc.SQLServerException.ConvertConnectExceptionToSQLServerException (SQLServerException.java:285)
com.microsoft.sqlserver.jdbc.SocketFinder.findSocket (IOBuffer.java:2466)
com.microsoft.sqlserver.jdbc.TDSChannel.open (IOBuffer.java:672)
com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper (SQLServerConnection.java:2747)
com.microsoft.sqlserver.jdbc.SQLServerConnection.login (SQLServerConnection.java:2418)
com.microsoft.sqlserver.jdbc.SQLServerConnection.connectInternal (SQLServerConnection.java:2265)
com.microsoft.sqlserver.jdbc.SQLServerConnection.connect (SQLServerConnection.java:1291)
com.microsoft.sqlserver.jdbc.SQLServerDriver.connect (SQLServerDriver.java:881)
java.sql.DriverManager.getConnection (DriverManager.java:677)
java.sql.DriverManager.getConnection (DriverManager.java:189)
next.jdbc.connection$get_driver_connection.invokeStatic (connection.clj:141)
next.jdbc.connection$get_driver_connection.invoke (connection.clj:136)
next.jdbc.connection$url_PLUS_etc$reify__1134.getConnection (connection.clj:359)
next.jdbc.connection$make_connection.invokeStatic (connection.clj:385)
next.jdbc.connection$make_connection.invoke (connection.clj:369)
next.jdbc.connection$eval1153$fn__1154.invoke (connection.clj:408)
next.jdbc.protocols$eval910$fn__911$G__901__918.invoke (protocols.clj:24)
next.jdbc.result_set$eval2030$fn__2038.invoke (result_set.clj:911)
next.jdbc.protocols$eval942$fn__973$G__933__982.invoke (protocols.clj:33)
next.jdbc$execute_BANG_.invokeStatic (jdbc.clj:238)
next.jdbc$execute_BANG_.invoke (jdbc.clj:225)
clojuresql.core$eval7498.invokeStatic (form-init4745400822415211621.clj:29)
clojuresql.core$eval7498.invoke (form-init4745400822415211621.clj:29)
clojure.lang.Compiler.eval (Compiler.java:7177)
clojure.lang.Compiler.eval (Compiler.java:7132)
clojure.core$eval.invokeStatic (core.clj:3214)
clojure.core$eval.invoke (core.clj:3210)
nrepl.middleware.interruptible_eval$evaluate$fn__6438$fn__6439.invoke (interruptible_eval.clj:87)
clojure.lang.AFn.applyToHelper (AFn.java:152)
clojure.lang.AFn.applyTo (AFn.java:144)
clojure.core$apply.invokeStatic (core.clj:665)
clojure.core$with_bindings_STAR_.invokeStatic (core.clj:1973)
clojure.core$with_bindings_STAR_.doInvoke (core.clj:1973)
clojure.lang.RestFn.invoke (RestFn.java:425)
nrepl.middleware.interruptible_eval$evaluate$fn__6438.invoke (interruptible_eval.clj:87)
clojure.main$repl$read_eval_print__9086$fn__9089.invoke (main.clj:437)
clojure.main$repl$read_eval_print__9086.invoke (main.clj:437)
clojure.main$repl$fn__9095.invoke (main.clj:458)
clojure.main$repl.invokeStatic (main.clj:458)
clojure.main$repl.doInvoke (main.clj:368)
clojure.lang.RestFn.invoke (RestFn.java:1523)
nrepl.middleware.interruptible_eval$evaluate.invokeStatic (interruptible_eval.clj:84)
nrepl.middleware.interruptible_eval$evaluate.invoke (interruptible_eval.clj:56)
nrepl.middleware.interruptible_eval$interruptible_eval$fn__6469$fn__6473.invoke (interruptible_eval.clj:152)
clojure.lang.AFn.run (AFn.java:22)
nrepl.middleware.session$session_exec$main_loop__6536$fn__6540.invoke (session.clj:202)
nrepl.middleware.session$session_exec$main_loop__6536.invoke (session.clj:201)
clojure.lang.AFn.run (AFn.java:22)
java.lang.Thread.run (Thread.java:832)
and here's my code
(ns clojuresql.core
(:require [next.jdbc :as jdbc]
[hugsql.core :as hugsql]
[hugsql.adapter.next-jdbc :as adapter]
[next.jdbc :as jdbc]
[honeysql.core :as sql]
[honeysql.helpers :refer :all :as helpers]))
(def db-sqlserver {:dbtype "sqlserver" :dbname "AdventureWorks"
:user "sa" :password "123456789"})
(def ds (jdbc/get-datasource db-sqlserver))
(jdbc/execute! ds
["show tables"])
is there something wrong? please help me... Thank you!
answered in here, i need to restart the SQL Server
https://javarevisited.blogspot.com/2015/10/sql-server-jdbc-error-tcpip-connection-to-host-failed-port-1433.html#axzz6mcL0VpRF

Unhandled Java exception: com.microsoft.sqlserver.jdbc.SQLServerException connecting to Sql Server from Linux Server usingJruby

I am trying to connect to MS SQL Server Database using jruby on Linux server.
This is how my code looks like:
require 'rubygems'
require 'java'
require '/home/testuser/sqljdbc_6.2/enu/mssql-jdbc-6.2.1.jre8.jar'
Java::com.microsoft.sqlserver.jdbc.SQLServerDriver
url = 'jdbc:sqlserver://myremotedb.test.com:19263;databaseName=testappdatabase'
connection = java.sql.DriverManager.get_connection(url, 'testuser1', 'testpass1')
testconn = conn.createstatement
When i do this, I am getting the following error:
Unhandled Java exception: com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user 'CORP/infautomic'. ClientConnectionId:ef4f1526-86d3-4e31-a3a8-31c1b026ac4b
com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user 'testuser1'. ClientConnectionId:ef4f1526-86d3-4e31-a3a8-31c1b026ac4b
makeFromDatabaseError at com/microsoft/sqlserver/jdbc/SQLServerException.java:216
onEOF at com/microsoft/sqlserver/jdbc/tdsparser.java:254
parse at com/microsoft/sqlserver/jdbc/tdsparser.java:84
sendLogon at com/microsoft/sqlserver/jdbc/SQLServerConnection.java:2908
logon at com/microsoft/sqlserver/jdbc/SQLServerConnection.java:2234
access$000 at com/microsoft/sqlserver/jdbc/SQLServerConnection.java:41
doExecute at com/microsoft/sqlserver/jdbc/SQLServerConnection.java:2220
execute at com/microsoft/sqlserver/jdbc/IOBuffer.java:5696
executeCommand at com/microsoft/sqlserver/jdbc/SQLServerConnection.java:1715
connectHelper at com/microsoft/sqlserver/jdbc/SQLServerConnection.java:1326
login at com/microsoft/sqlserver/jdbc/SQLServerConnection.java:991
connect at com/microsoft/sqlserver/jdbc/SQLServerConnection.java:827
connect at com/microsoft/sqlserver/jdbc/SQLServerDriver.java:1012
getConnection at java/sql/DriverManager.java:664
getConnection at java/sql/DriverManager.java:247
invoke at java/lang/reflect/Method.java:498
invokeDirectWithExceptionHandling at org/jruby/javasupport/JavaMethod.java:483
invokeStaticDirect at org/jruby/javasupport/JavaMethod.java:375
invokeOther17:get_connection at sqljdbc.rb:7
<main> at sqljdbc.rb:7
invokeWithArguments at java/lang/invoke/MethodHandle.java:627
runScript at org/jruby/Ruby.java:827
runNormally at org/jruby/Ruby.java:746
runNormally at org/jruby/Ruby.java:764
runFromMain at org/jruby/Ruby.java:577
doRunFromMain at org/jruby/Main.java:417
internalRun at org/jruby/Main.java:305
run at org/jruby/Main.java:232
main at org/jruby/Main.java:204
How can i fix this?

Apache Camel MQXAQueueConnectionFactory

So well, I am trying to get a MQXAQueueConnectionFactory to work, I have created a extended class from the JmsComponent to handle username and password when sending data to the queue.
It does get/put messages on the queue, but in my case I've created a router to test the XA such as
from("wmq:queue:incomingQueue")
.process(new Processor(){
... Thread.sleep(20000)
})
.to("wmq:queue:outgoingQueue")
while being in sleep, I shut down the queuemanager. However when trying to get uncommited messages from the queue
DISPLAY QSTATUS('qChainQueue') i get CURDEPTH(0), while it should be 1 as I understand the XA part.
Am I doing this totally wrong?
How can it be tested?
HelpClass to handle WMQ:
public class WMQComponent extends JmsComponent {
private final String username;
private final String password;
public WMQComponent(String hostname, int port, String username, String password,
String queueManager, String channel) throws JMSException {
super();
this.username = username;
this.password = password;
MQXAQueueConnectionFactory connectionFactory = new MQXAQueueConnectionFactory();
connectionFactory.setTransportType(JMSC.MQJMS_TP_CLIENT_MQ_TCPIP);
connectionFactory.setFailIfQuiesce(1);
connectionFactory.setHostName(hostname);
connectionFactory.setPort(port);
connectionFactory.setQueueManager(queueManager);
connectionFactory.setChannel(channel);
setConnectionFactory(connectionFactory);
}
#Override
public Endpoint createEndpoint(String uri) throws Exception {
if (uri.contains("username") || uri.contains("password")) {
throw new IllegalStateException("Username and password is set by the component");
}
if (uri.contains("?")) {
return super.createEndpoint(uri + "&username=" + username + "&password=" + password);
} else {
return super.createEndpoint(uri + "?username=" + username + "&password=" + password);
}
}
}
With the following errors:
2015-03-25 14:01:12,077 [ #2 - Multicast] INFO dest_chain_ldap - org.springframework.jms.IllegalStateException: JMSWMQ0018: Failed to connect to queue manager 'QMBATCHESB' with connection mode 'Client' and host name 'hostname.com'.; nested exception is com.ibm.msg.client.jms.DetailedIllegalStateException: JMSWMQ0018: Failed to connect to queue manager 'QMBATCHESB' with connection mode 'Client' and host name 'hostname.com'. 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.; nested exception is com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2059' ('MQRC_Q_MGR_NOT_AVAILABLE').
at org.springframework.jms.support.JmsUtils.convertJmsAccessException(JmsUtils.java:279)
at org.springframework.jms.support.JmsAccessor.convertJmsAccessException(JmsAccessor.java:168)
at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:469)
at org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate.send(JmsConfiguration.java:228)
at org.apache.camel.component.jms.JmsProducer.doSend(JmsProducer.java:431)
at org.apache.camel.component.jms.JmsProducer.processInOnly(JmsProducer.java:385)
at org.apache.camel.component.jms.JmsProducer.process(JmsProducer.java:153)
at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:120)
at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)
at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:163)
at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:416)
at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:118)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)
at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
at org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:51)
at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:120)
at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)
at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:163)
at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:416)
at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:105)
at org.apache.camel.processor.MulticastProcessor.doProcessParallel(MulticastProcessor.java:732)
at org.apache.camel.processor.MulticastProcessor.access$200(MulticastProcessor.java:82)
at org.apache.camel.processor.MulticastProcessor$1.call(MulticastProcessor.java:303)
at org.apache.camel.processor.MulticastProcessor$1.call(MulticastProcessor.java:288)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: com.ibm.msg.client.jms.DetailedIllegalStateException: JMSWMQ0018: Failed to connect to queue manager 'QMBATCHESB' with connection mode 'Client' and host name 'hostname.com'. 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.
at com.ibm.msg.client.wmq.common.internal.Reason.reasonToException(Reason.java:496)
at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:236)
at com.ibm.msg.client.wmq.internal.WMQConnection.<init>(WMQConnection.java:430)
at com.ibm.msg.client.wmq.internal.WMQXAConnection.<init>(WMQXAConnection.java:70)
at com.ibm.msg.client.wmq.factories.WMQXAConnectionFactory.createV7ProviderConnection(WMQXAConnectionFactory.java:190)
at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createProviderConnection(WMQConnectionFactory.java:6210)
at com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl.createConnection(JmsConnectionFactoryImpl.java:278)
at com.ibm.mq.jms.MQConnectionFactory.createCommonConnection(MQConnectionFactory.java:6155)
at com.ibm.mq.jms.MQQueueConnectionFactory.createQueueConnection(MQQueueConnectionFactory.java:144)
at com.ibm.mq.jms.MQQueueConnectionFactory.createConnection(MQQueueConnectionFactory.java:223)
at org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter.doCreateConnection(UserCredentialsConnectionFactoryAdapter.java:175)
at org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter.createConnection(UserCredentialsConnectionFactoryAdapter.java:150)
at org.springframework.jms.support.JmsAccessor.createConnection(JmsAccessor.java:184)
at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:456)
... 29 more
Caused by: com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2059' ('MQRC_Q_MGR_NOT_AVAILABLE').
at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:223)
... 41 more
Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2059;AMQ9204: Connection to host 'hostname.com(1514)' rejected. [1=com.ibm.mq.jmqi.JmqiException[CC=2;RC=2059;AMQ9213: A communications error for occurred. [1=java.net.ConnectException[Connection refused: connect],3=hostname.com]],3=hostname.com(1514),5=RemoteTCPConnection.connnectUsingLocalAddress]
at com.ibm.mq.jmqi.remote.internal.RemoteFAP.jmqiConnect(RemoteFAP.java:1831)
at com.ibm.msg.client.wmq.internal.WMQConnection.<init>(WMQConnection.java:345)
... 40 more
Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2059;AMQ9213: A communications error for occurred. [1=java.net.ConnectException[Connection refused: connect],3=hostname.com]
at com.ibm.mq.jmqi.remote.internal.RemoteTCPConnection.connnectUsingLocalAddress(RemoteTCPConnection.java:612)
at com.ibm.mq.jmqi.remote.internal.RemoteTCPConnection.protocolConnect(RemoteTCPConnection.java:940)
at com.ibm.mq.jmqi.remote.internal.system.RemoteConnection.connect(RemoteConnection.java:1097)
at com.ibm.mq.jmqi.remote.internal.system.RemoteConnectionPool.getConnection(RemoteConnectionPool.java:348)
at com.ibm.mq.jmqi.remote.internal.RemoteFAP.jmqiConnect(RemoteFAP.java:1503)
... 41 more
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:69)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:157)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:391)
at java.net.Socket.connect(Socket.java:579)
at java.net.Socket.connect(Socket.java:528)
at com.ibm.mq.jmqi.remote.internal.RemoteTCPConnection$2.run(RemoteTCPConnection.java:597)
at java.security.AccessController.doPrivileged(Native Method)
at com.ibm.mq.jmqi.remote.internal.RemoteTCPConnection.connnectUsingLocalAddress(RemoteTCPConnection.java:588)
... 45 more
The reason code 2059 and various errors stating that the connection was refused suggest either a mechanical issue (i.e. Listener not running) or an auths issue.
If I were attempting to debug this, the first thing I'd do is to enable authorization events, channel events, and any others you would normally enable. If you use MQ Explorer, also install the MS0P Plugin which will allow you to view the event messages in human-readable text.
Next, I would use the MQ sample programs to test. Since I always install the full client rather than grabbing the jar files, I have amqsputc available. However, the Java classes have IVT (initial verification test) programs. These ensure that the listener is running, the channel is configured and available, etc. As of v7.1 this also ensures that the CHLAUTH rules are set to allow the access. As of v8.0, or if you had the Capitalware exit installed, this also lets us test the user ID and password authentication.
The queue manager's error log and the event messages should provide good diagnostics, assuming the connection request makes it to MQ. Be sure to look both in the QMgr-specific error logs and the installation-global error logs.
Once I had confirmed that basic connectivity is in place, I'd reconcile my client-side configuration parameters for host, port, channel and if it is specified [shudder!] the QMgr name. Assuming these are correct and having proven basic connectivity works, it is now possible to test the app with some confidence.
The same method applies. First make sure the app's connection request makes it to the QMgr. If it does and is refused, the event messages and error logs will note this and why. If there is no indication of a failure in these places, the app isn't getting to the QMgr. The 2059 can indicate that the socket was refused, that the listener is up but the QMgr is not, that the channel instances have maxed out, or that after provisionally starting the channel it was closed by the QMgr, often due to a CHLAUTH rule. In any case, the event messages and error logs will have a detailed explanation as to why.
So I had done this a bit wrong, it was not enough to use the MQXAConnectionFactory but I had to create the JmsComponent as transacted.
Have tried to stop the queue manager while running the application and stop the application while handling a message and it seems to do the rollback as expected.
Ended up with
public static JmsComponent mqXAComponentTransacted(String hostname, int port, String username, String password,
String queueManager, String channel) throws JMSException {
MQXAQueueConnectionFactory connectionFactory = new MQXAQueueConnectionFactory();
connectionFactory.setTransportType(JMSC.MQJMS_TP_CLIENT_MQ_TCPIP);
connectionFactory.setFailIfQuiesce(1);
connectionFactory.setHostName(hostname);
connectionFactory.setPort(port);
connectionFactory.setQueueManager(queueManager);
connectionFactory.setChannel(channel);
UserCredentialsConnectionFactoryAdapter connectionFactoryAdapter=new UserCredentialsConnectionFactoryAdapter();
connectionFactoryAdapter.setTargetConnectionFactory(connectionFactory);
connectionFactoryAdapter.setUsername(username);
connectionFactoryAdapter.setPassword(password);
return JmsComponent.jmsComponentTransacted(connectionFactoryAdapter);
}
Also using the UserCredentialsConnectionFactoryAdapter, I didn't want to use Spring components but since the Jms package is already dependent of it, it was easier to use it than my previous solution to handle credentials.

Weblogic - Received exception while creating connection for pool: "mds-SpacesDS": Socket read timed out

I am upgrading Oracle middleware suite from 11.1.2 to 11.1.3. When creating my weblogic domain, come to the step of testing database schema connections, it works fine (I have upgraded DEV_SOAINFRA to 11.1.3).
However, when I start my weblogic admin server, I have this error : Received exception while creating connection for pool: "mds-SpacesDS": Socket read timed out.
The part of the log file is:
<[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'> <> <> <1279769964111> <[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'> <> <> <1279769964112>
java.sql.SQLException: Socket read
timed out at
oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:74)
at
oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:135)
at
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:203)
at
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:489)
at
oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:439)
at
oracle.jdbc.driver.PhysicalConnection.(PhysicalConnection.java:640)
at
oracle.jdbc.driver.T4CConnection.(T4CConnection.java:205)
at
oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
at
oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:554)
at
weblogic.jdbc.common.internal.ConnectionEnvFactory.makeConnection(ConnectionEnvFactory.java:327)
at
weblogic.jdbc.common.internal.ConnectionEnvFactory.createResource(ConnectionEnvFactory.java:227)
at
weblogic.common.resourcepool.ResourcePoolImpl.makeResources(ResourcePoolImpl.java:1193)
at
weblogic.common.resourcepool.ResourcePoolImpl.makeResources(ResourcePoolImpl.java:1117)
at
weblogic.common.resourcepool.ResourcePoolImpl.recreateDeadResources(ResourcePoolImpl.java:2067)
at
weblogic.common.resourcepool.ResourcePoolImpl.access$1000(ResourcePoolImpl.java:40)
at
weblogic.common.resourcepool.ResourcePoolImpl$ResourcePoolMaintanenceTask.timerExpired(ResourcePoolImpl.java:2442)
at
weblogic.timers.internal.TimerImpl.run(TimerImpl.java:273)
at
weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528)
at
weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at
weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
Caused By: oracle.net.ns.NetException:
Socket read timed out at
oracle.net.ns.Packet.receive(Packet.java:333)
at
oracle.net.ns.NSProtocol.connect(NSProtocol.java:267)
at
oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1076)
at
oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:303)
at
oracle.jdbc.driver.PhysicalConnection.(PhysicalConnection.java:640)
at
oracle.jdbc.driver.T4CConnection.(T4CConnection.java:205)
at
oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
at
oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:554)
at
weblogic.jdbc.common.internal.ConnectionEnvFactory.makeConnection(ConnectionEnvFactory.java:327)
at
weblogic.jdbc.common.internal.ConnectionEnvFactory.createResource(ConnectionEnvFactory.java:227)
at
weblogic.common.resourcepool.ResourcePoolImpl.makeResources(ResourcePoolImpl.java:1193)
at
weblogic.common.resourcepool.ResourcePoolImpl.makeResources(ResourcePoolImpl.java:1117)
at
weblogic.common.resourcepool.ResourcePoolImpl.recreateDeadResources(ResourcePoolImpl.java:2067)
at
weblogic.common.resourcepool.ResourcePoolImpl.access$1000(ResourcePoolImpl.java:40)
at
weblogic.common.resourcepool.ResourcePoolImpl$ResourcePoolMaintanenceTask.timerExpired(ResourcePoolImpl.java:2442)
at
weblogic.timers.internal.TimerImpl.run(TimerImpl.java:273)
at
weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528)
at
weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at
weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
It seems that weblogic can't connect to the schema mds_spacesDS. I am, however, able to manually connect to the Database schema without any problem.
Does anyone encounter it before?
Khue.
I bit late but did you see this
http://forums.oracle.com/forums/thread.jspa?threadID=1102140

Resources