I have a DB2 Purescale environment set up. I am trying to configure client affinity for it on my client machine. I have modified my db2dsdriver.cfg file as follows to include the client affinity parameters:-
<configuration>
<dsncollection>
<dsn alias="sample" name="sample" host="127.0.0.0" port="50000">
<parameter name="Authentication" value="Server"/>
</dsn>
</dsncollection>
<databases>
<database name="sample" host="127.0.0.0" port="50000">
<parameter name="keepAliveTimeout" value="20"/>
<acr>
<parameter name="enableAcr" value="true"/>
<parameter name="enableSeamlessACR" value="true"/>
<parameter name="maxAcrRetries" value="2"/>
<parameter name="acrRetryInterval" value="3"/>
<parameter name="affinityFailbackInterval" value="60"/>
<parameter name="enableAlternateServerListFirstConnect" value="false"/>
<alternateserverlist>
<server name="host-1" hostname="127.0.0.0" port="50000"/>
<server name="host-2" hostname="127.0.0.1" port="50000"/>
<server name="host-3" hostname="127.0.0.2" port="50000"/>
</alternateserverlist>
<affinitylist>
<list name="list1" serverorder="host-1,host-2,host-3">
</list>
</affinitylist>
<clientaffinitydefined>
<client name="ABC" hostname="127.0.0.3" listname="list1">
</client>
</clientaffinitydefined>
</acr>
</database>
</databases>
</configuration>
Please note that all the IPs and the machine names provided here are just made up.
But, when I try the db2clp to connect to my database, I get the following error:-
"SQL5163N A required configuration parameter "listname or serverorder under affinitylist group" is missing from the db2dsdriver.cfg configuration file."I have tried but cannot figure out what is missing as both the listname and the serverorder are present in the file.
Also, if I use the CLPPLUS to access the DB from client machine, I can access the DB on host-1, but if I stop the instance on host-1 to test client affinity, my client machine cannot connect to the DB on host-2. I get the following error:-
Error when instance stopped on host-1 and running on host-2
Can someone please help me understand what might be the problem?
Check the following address:
<client name="ABC" hostname="127.0.0.3" listname="list1">
</client>
This must be your client's address. If it's not correct, you get such an error you mentioned.
As for CLPPLUS. It's a jdbc application, and it doesn't use db2dsdriver.cfg.
You must set the corresponding properties.
Example of enabling client affinities in Java clients for Db2 on Linux, UNIX, and Windows systems connections.
Related
I Have enable automatic backup by xml file(orientdb-server-plugin.xml)
it as follows.
<handler class="com.orientechnologies.orient.server.handler.OAutomaticBackup"> <parameters>
<parameter value="true" name="enabled"/>
<parameter value="4h" name="delay"/>
<parameter value="23:00:00" name="firstTime"/>
<parameter value="backup" name="target.directory"/>
<parameter value="${DBNAME}-${DATE:yyyyMMddHHmmss}.zip" name="target.fileName"/>
<parameter value="9" name="compressionLevel"/>
<parameter value="1048576" name="bufferSize"/>
<parameter value="" name="db.include"/>
<parameter value="" name="db.exclude"/>
</parameters>
</handler>
But backup not working for me.
Please assist me to do this.
You should put the configuration into orientdb-server-config.xml file (Reference: Automatic Backup Server Plugin).
What OS are you using? You can also put absolute path of the backup folder in the target.directory parameter, just to be sure of location where backups will be stored. Check you logs, there should be a line saying:
Automatic backup plugin installed and active: ...
If not, please post your logs here for further investigation.
Thanks.
Hope it helps.
During the evaluation of sample data I discovered the following problem. When the content in the JMS contains the "upside down question mark" <test>Inverted¿QuestionMark</test>, the proxy crashes - in fact hangs and the CPU goes up to 100%.
Here the code of the proxy to reproduce easily:
Just add <test>Inverted¿QuestionMark</test> into a queue named "test_qEncoding" and see how the CPU goes up and the proxy hangs.
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse" name="test_encoding_crash_jms" transports="jms" startOnLoad="true" trace="disable">
<parameter name="transport.jms.Destination">test_qEncoding</parameter>
<parameter name="transport.jms.ConnectionFactory">myQueueConnectionFactory</parameter>
<parameter name="transport.jms.DestinationType">queue</parameter>
<parameter name="transport.jms.ContentType">
<rules>
<jmsProperty>contentType</jmsProperty>
<default>application/xml;charset="iso-8859-15"</default>
</rules>
</parameter>
<target>
<inSequence>
<log level="custom">
<property name="Context" value="Proxy test_encoding_crash_jms called"/>
</log>
<log level="full"/>
</inSequence>
</target>
</proxy>
When I use a vfs proxy and read as ISO-8859 it works. When I don't specify ;charset="iso-8859-15"then it works also, but the content is then not in the correct endoding for my output.
How should I get the message from the JMS when I want to send it then as ISO-8859?
Why does the above proxy hangs and blocks the whole WSO2 ESB?
This was reported sometime back [1]. Seems to be an issue existing. Please refer the JIRA for more details. Further if you can reproduce it consistently please mention that so we can raise the priority.
[1] https://wso2.org/jira/browse/ESBJAVA-1751
We're trying to configure a Spring application to work with JTA transactions. It is not like it is failing, but everything we tried just do the select and ignores our persistence operations.
As you can see in the following logs, even though the save statement run there’s no insert statement, neither an exception, neither an error/warning logs
server.log
DEBUG [xxxx.xxxx.persistence] (http--0.0.0.0-8080-1) execute $Proxy363.save(whatever.core.entities.XxxAssignedTime#51a8c542)
DEBUG [org.springframework.data.repository.core.support.TransactionalRepositoryProxyPostProcessor$CustomAnnotationTransactionAttributeSource] (http--0.0.0.0-8080-1) Adding transactional method 'save' with attribute: PROPAGATION_REQUIRED,ISOLATION_DEFAULT; ''
DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] (http--0.0.0.0-8080-1) Returning cached instance of singleton bean 'transactionManager'
DEBUG [org.springframework.transaction.jta.JtaTransactionManager] (http--0.0.0.0-8080-1) Participating in existing transaction
INFO [xxxx.xxxx.impl.BpmnUserBusinessImpl] (http--0.0.0.0-8080-1) Last Assigned Time Updated to *******, Thu Sep 06 15:48:48 ICT 2012
It is like thought the application server thinks everything went right. Whereas if you check the table no insertion or update was made.
The datasource that we intend to use with a spring application is successfully used with JTA transactions by a Java EE war application running in the same application server.
Since we have no idea where the problem might be I'd like to put it all in full context.
spring 3.1.2-RELEASE
hibernate 4.1.5.Final
spring-data-jpa 1.1.1.Final
apache axis 1.4
jboss AS7.1
DB: oracle 10g
We've been trying all sorts of crazy configuration in order to try to make it work, so I will just copy here the simplest one.
standalone.xml
<datasource jta="true" jndi-name="java:jboss/datasources/EngineDS" pool-name="EngineDS" enabled="true" use-java-context="true" use-ccm="true">
<connection-url>jdbc:oracle:thin:#server:port:****</connection-url>
<driver>oracle</driver>
<transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
<pool>
<min-pool-size>10</min-pool-size>
<max-pool-size>100</max-pool-size>
<prefill>true</prefill>
</pool>
<security>
<user-name>****</user-name>
<password>****</password>
</security>
<statement>
<prepared-statement-cache-size>32</prepared-statement-cache-size>
<share-prepared-statements>true</share-prepared-statements>
</statement>
</datasource>
<drivers>
<driver name="oracle" module="com.oracle.ojdbc6">
<xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
</driver>
</drivers>
web.xml
[...]
<resource-ref id="DS">
<res-ref-name>EngineDS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
<mapped-name>java:jboss/datasources/EngineDS</mapped-name>
</resource-ref>
[...]
spring-jpa-config.xml
<jpa:repositories base-package="whatever.core.repositories" />
<jee:jndi-lookup id="dataSource" jndi-name="EngineDS" cache="true" resource-ref="true" expected-type="javax.sql.DataSource"/>
<bean id="entityManagerFactory"
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="packagesToScan" value="whatever.core.entities" />
<property name="jpaVendorAdapter">
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
<property name="showSql" value="${hibernate.show_sql}" />
<property name="generateDdl" value="${jpa.generateDdl}" />
<property name="databasePlatform" value="${jpa.dialect}" />
</bean>
</property>
</bean>
<tx:annotation-driven />
<tx:jta-transaction-manager />
<bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor"/>
<bean class="org.springframework.orm.hibernate4.HibernateExceptionTranslator"/>
We had made in the past jboss AS5/Spring 3.0 applications to work with JTA transactions, so it is not like is my first time doing this, and we've been looking around all possible blogs and open source projects I could find. Yet anything that seem to work smoothly to everybody seems to be ignored in my application. I'm sure it should be that we're missing something really stupid somewhere but we've tried so far 70+ different configurations and none seem do a simple insert that otherwise work when not trying JTA.
(The fact that we use axis 1.4 might be relevant or not, but I'd like to tell because our application only triggers actions after a web service call). At this point we are starting to believe in configuration paranormal activity...
Any clue anyone?
It turned out that the configuration above wasn't working due to the fact that I was using org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.
To have JTA I should lookup for the JBoss container-managed entity manager spring-jpa.config.xml:
<!-- lookup the container-managed JPA-EMF -->
<!-- the JNDI name is specified in META-INF/persistence.xml -->
<!-- SEE: https://docs.jboss.org/author/display/AS71/JPA+Reference+Guide#JPAReferenceGuide-BindingEntityManagerFactorytoJNDI -->
<jee:jndi-lookup id="defaultPu" jndi-name="java:jboss/defaultPu" />
And in the META-INF/persistence.xml you bind the Entity Manager Factory into JNDI:
<!-- bind the EMF in JNDI -->
<property name="jboss.entity.manager.factory.jndi.name" value="java:jboss/defaultPu" />
So, I let Jboss bootstrap JPA, and in such way the JTA transactions work!
Right now i have to make migration of one application.
Basic configuration:
JBOSS 5.1.0 GA
Seam 2.2.0.GA
JBPM 3.2.2
RichFaces 3.3.1.GA
Hibernate 3.3.1.GA
OS: Debian/Linux
Application has been deployed on JBoss server with its own configuration.
On old machine there was postfix (localhost, port 25) for sending messages.
On new machine i have different host and port.
What i have now in components.xml:
<mail:mail-session session-jndi-name="java:/Mail" />
My mail-service.xml:
<mbean code="org.jboss.mail.MailService"
name="jboss:service=Mail">
<attribute name="JNDIName">java:/Mail</attribute>
<attribute name="User">XXX</attribute>
<attribute name="Password">XXX</attribute>
<attribute name="Configuration">
<!-- A test configuration -->
<configuration>
<!-- Change to your mail server prototocol -->
<property name="mail.store.protocol" value="pop3"/>
<property name="mail.transport.protocol" value="smtp"/>
<!-- Change to the user who will receive mail -->
<property name="mail.user" value="XXX"/>
<!-- Change to the mail server -->
<property name="mail.pop3.host" value="localhost"/>
<!-- Change to the SMTP gateway server -->
<property name="mail.smtp.host" value="XXX"/>
<property name="mail.smtp.auth" value="true"></property>
<property name="mail.smtp.ssl.enable" value="false"></property>
<property name="mail.smtp.port" value="587"/>
<property name="mail.smtp.connectiontimeout" value="20000"></property>
<property name="mail.smtp.timeout" value="20000"></property>
<!-- The mail server port -->
<!-- Change to the address mail will be from -->
<property name="mail.from" value="XXX"/>
<!-- Enable debugging output from the javamail classes -->
<property name="mail.debug" value="true"/>
</configuration>
</attribute>
<depends>jboss:service=Naming</depends>
I'm intrested only in sending messages.
But still:
javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 25;
nested exception is:
java.net.ConnectException: Connection refused
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1282)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:370)
at javax.mail.Service.connect(Service.java:275)
at javax.mail.Service.connect(Service.java:156)
at javax.mail.Service.connect(Service.java:105)
at javax.mail.Transport.send0(Transport.java:168)
at javax.mail.Transport.send(Transport.java:98)
<xxx>
Caused by: java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:529)
at java.net.Socket.connect(Socket.java:478)
at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:232)
at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:189)
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1250)
... 59 more
Of course connection is refused because application is still pointed on localhost:25.
I have tried to find with grep other configurations, allocations, etc. mail-service is started (jmx-console info). Still its looked like aplication is not configured properly but using defaults.. Whats wrong?
PS: I'm not specialist in JBoss. I don't have root account on this hosting server.
I am trying to integrate IBMMQ v6.0.2 with jbossESB.
we have local Queue available on IBMMQ on one of our QA QUEUEMANAGER.
I am able to listen to the QUEUE using JMSprovider of jboss ESB. As soon as a message (of type jms_text ) is dropped , esb listen to it and pick it up and before it hit the next action it throws following error message.
ERROR [JmsComposer] Unsupported JMS message type: com.ibm.jms.JMSTextMessage
Here are the steps I followed.
jboss-service.mxl : Defined Connection Factory and QUEUE
added jars ( com.ibm.mq.* ) to ${jbossesb}/server/${mynode}/lib
Added jms lsinterner configuration on jboss-esb.xml
Please guide me what I m missing here... Do I need to create custom MessagePlugin ?
jboss-esb looks like this
<jms-provider name="WSMQ" connection-factory="MQQueueConnectionFactory">
<jms-bus busid="queuestartGwChannel"> <jms-message-filter
dest-type="QUEUE"
dest-name="wsmq/SerivceOrderQueue"
acknowledge-mode ="AUTO_ACKNOWLEDGE"
/>
</jms-bus>
<jms-bus busid="queuestartEsbChannel">
<jms-message-filter
dest-type="QUEUE"
dest-name="wsmq/SerivceOrderQueue"
/>
</jms-bus>
</jms-provider>
jboss-service.xml looks like this
<mbean code="jmx.service.wsmq.WSMQConnectionFactory"
name="jmx.service.wsmq:service=MQQueueConnectionFactory">
<attribute name="JndiName">MQQueueConnectionFactory</attribute>
<attribute name="JMSStyle">Queue</attribute>
<attribute name="IsXA">false</attribute>
<attribute name="QueueManagerName">SQAT0083</attribute>
<attribute name="HostName">111.111.111.111</attribute>
<attribute name="Port">1415</attribute>
<attribute name="Channel">MYCO.SVRCONN</attribute>
<attribute name="TransportType">CLIENT</attribute>
<depends>jboss:service=Naming</depends>
</mbean>
<mbean code="jmx.service.wsmq.WSMQDestination"
name="jmx.service.wsmq:service=WSMQRequestQueue">
<attribute name="JndiName">wsmq/SerivceOrderQueue</attribute>
<attribute name="JMSStyle">Queue</attribute>
<attribute name="QueueManagerName">SQAT0083</attribute>
<attribute name="DestinationName">MYCO.SERVICEORDER.QA01.QL01</attribute>
<attribute name="TargetClient">MQ</attribute>
<depends>jboss:service=Naming</depends>
</mbean>
I am using jboss-eap-4.3. Really appreciate any help.
Here is my Service Tag Looks like in jboss-esb.xml
<listeners>
<jms-listener name="MQ-Gateway"
busidref="queuestartGwChannel"
is-gateway="true" maxThreads="1"
/>
<jms-listener name="MQ-EsbListener" busidref="queuestartEsbChannel" />
</listeners>
<actions mep="OneWay">
<action name="serviceOrderMarshaller"
class="com.my.esb.actions.ServiceOrderMessageUnMarshallerAction"
process="unmarshalPayload">
<property name="springContextXml" value="spring/mainApplicationContext.xml"/>
</action>
<action name="serviceOrderStaging"
class="com.my.esb.actions.ServiceOrdersStagingAction"
process="stageServiceOrders">
<property name="springContextXml" value="spring/mainApplicationContext.xml"/>
</action>
<action name="marginAndLeadTimeRetriever"
class="com.my.esb.actions.MarginAndLeadTimeRetrieverAction"
process="retrieveJobCodeInfo">
<property name="springContextXml" value="spring/mainApplicationContext.xml"/>
</action>
<action name="createDraftRequestMapper"
class="com.my.esb.actions.CreateDraftRequestMapperAction"
process="mapData">
<property name="springContextXml" value="spring/mainApplicationContext.xml"/>
</action>
<action name="omsCreateDraftRequestTranslator"
class="com.my.esb.actions.OMSCreateDraftRequestTranslatorAction"
process="translateData">
<property name="springContextXml" value="spring/mainApplicationContext.xml"/>
</action>
<action name="createDraftRequestProcessor"
class="com.my.esb.actions.CreateDraftRequestProcessorAction"
process="dispatchRequest">
<property name="springContextXml" value="spring/mainApplicationContext.xml"/>
</action>
</actions>
Bit late response but if someone reads this, the answer is:
queuestartEsbChannel is listening to the same queue that is delivering jmstextmessages and it has is-gateway set to false (default value).
If is-gateway is false, only ESB messages can be recieved on that listener.
I would have expected to see com.ibm.mqjms.jar in the CLASSPATH for a JMS app, not com.ibm.mq.*.
Depending on the version of WMQ you are using, please reference the Environment Variables page in the Infocenter. WMQ V6 page is here (see Table #2), and the WMQ v7 page is here (see the table and the notes below). Note that the classes have been repackaged between versions and the CLASSPATH requirements are quite different.
On UNIX flavors, you can run the setmqjms script to configure the environment for WMQ JMS. It lives in /opt/mqm/java/bin or /usr/mqm/java/bin on AIX. This assumes a standard WMQ client installation, though. If you just grabbed the jars and relocated them, it won't work. In particular, if you just grabbed the com.ibm.mq* jars it likely won't work. You can verify your installation by running the Initial Verification Test (IVT) supplied with the client install. The additional benefit of using a full WMQ client is that all of the trace utilities and sample code and other diagnostics are installed.
One other piece of advice, be sure to use the WMQ v7 client even if the WMQ server is at v6. This is because WMQ v6 is going out of service next year and will not be supported after that. Using the v7 client now will save you a migration later, CLASSPATH changes, etc. In addition, the v7 classes have lots of cool new features when used with a v7 QMgr such as automatic client reconnection to the same or different QMgr, depending on your configuration. The WMQ client install is a free download (registration required) as SupportPac MQC7.