I have been using c3p0 pool but I could not find any information on how to add connection properties such as shown below to a c3p0 connection pool configuration XML, any help would be greatly appreciated. Not sure if this not supported, any alternatives would be great too. Thanks
oracle.net.encryption_client=REQUIRED;
oracle.net.encryption_types_client=RC4_256;
oracle.net.crypto_checksum_client=REQUIRED;
oracle.net.crypto_checksum_types_client=MD5
Finally got it working, this is what works for me.
<bean id="myDS" class="com.mchange.v2.c3p0.ComboPooledDataSource"
destroy-method="close"
p:driverClass="${db.driver}"
p:jdbcUrl="${db.url}"
p:acquireIncrement="1"
p:idleConnectionTestPeriod="60"
p:maxPoolSize="${jdbc.pool.size}"
p:acquireRetryAttempts="2"
p:minPoolSize="${pool.initialsize}"
p:testConnectionOnCheckout="true"
p:preferredTestQuery="select 1 from dual">
<property name="properties">
<props>
<prop key="user">${db.username}</prop>
<prop key="password">${db.password}</prop>
<prop key="oracle.net.encryption_client">REQUIRED</prop>
<prop key="oracle.net.encryption_types_client">RC4_256</prop>
<prop key="oracle.net.crypto_checksum_client">REQUIRED</prop>
<prop key="oracle.net.crypto_checksum_types_client">MD5</prop>
</props>
</property>
Related
Scenario:
I'm using the WSO2 EI 6.4.0. ESB to convert an incoming SOAP message to JSON and sending it out to our internal applications REST service.
Currently I'm using an inbound endpoint to handle the SOAP request (although I've tried Proxy service which gives me the same result). The incoming message is successfully received, the conversion seems fine as well, but the call to the internal rest is failing. For some reason, the ESB handles all the requests to this rest interface as follows:
/http:/InternalApp:8000/rest/xml_messages/iend_incoming
Notice that the actual URL that I provide in the SEND mediator is as follows:
http://InternalApp:8000/rest/xml_messages/
The last piece of the incorrect url (i.e. iend_incoming) is actually the name of the inbound endpoint on the ESB itself. I'm pretty confused as to how this ended up but it looks as though the ESB is considering this to be some sort of proxy call.
The following code is used on the ESB in the sequence tied to aforementioned inbound endpoint:
<?xml version="1.0" encoding="UTF-8"?>
<sequence name="seq_send_soap_to_rest" trace="disable" xmlns="http://ws.apache.org/ns/synapse">
<property name="HTTP_METHOD" scope="axis2" type="STRING" value="POST"/>
<property name="FORCE_HTTP_1.0" scope="axis2" type="STRING" value="true"/>
<payloadFactory media-type="json">
<format>
{
"xml_content": "$1",
"sender": "$2",
"receiver": "$3"
}
</format>
<args>
<arg evaluator="xml" expression="base64Encode($env)"/>
<arg evaluator="xml" expression="$body//cac:ConsigneeParty/cac:PartyIdentification/cbc:ID" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"/>
<arg evaluator="xml" expression="$body//cac:ConsignorParty/cac:PartyIdentification/cbc:ID" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"/>
</args>
</payloadFactory>
<property expression="fn:concat('Basic ', base64Encode('USRNAME:PWD'))" name="Proxy-Authorization" scope="transport" type="STRING"/>
<property name="POST_TO_URI" scope="axis2" type="STRING" value="true"/>
<property name="messageType" scope="axis2" type="STRING" value="application/json"/>
<send>
<endpoint>
<address format="rest" uri="http://InternalApp:8000/rest/xml_messages/"/>
</endpoint>
</send>
</sequence>
Does anyone have any clue as to how that malformed URL ended up there and how I can fix it?
Apparently, it was this line:
<property name="POST_TO_URI" scope="axis2" type="STRING" value="true"/>
Setting it to false gave me a bad request but at least I knew where to look. The name of the variable might be a bit misleading.
I have confluence 5.10.6 on tomcat 8.
In tomcat I have setup jmx:
CATALINA_OPTS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=6969 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false ${CATALINA_OPTS}"
and using jconsole trying to have access to Confluence MBeans.
Unfortunately only several of MBeans available:
CacheStatistics
IndexingStatistics
MailTaskQueue
SchedulingStatistics
SystemInformation
But I need also RequestMetrics (https://confluence.atlassian.com/doc/live-monitoring-using-the-jmx-interface-150274182.html).
What I missed in my configuration?
Your configuration is perfectly fine.
The missing RequestMetrics MBean is actually a known bug in Confluence since 5.9.2: https://jira.atlassian.com/browse/CONF-40442
You can vote for this issue there to raise awareness by Atlassian.
I have the same MBeans, in my evaluation version of the confluence.
I have a "confluense.jar" file with "jmxContext.xml" inside.
jmxContext.xml (it contains a reference to MBeanExporterWithUnregisterImpl implementaion) :
<bean id="exporter" class="com.atlassian.confluence.jmx.MBeanExporterWithUnregisterImpl">
<constructor-arg index="0" ref="eventPublisher"/>
<constructor-arg index="1" ref="tenantAccessor"/>
<property name="server" ref="mbeanServer"/>
<property name="beans">
<map>
<entry key="Confluence:name=MailTaskQueue">
<bean class="com.atlassian.confluence.jmx.TaskQueueWrapper"><constructor-arg
ref="mailTaskQueue"/></bean>
</entry>
<entry key="Confluence:name=IndexingStatistics">
<bean class="com.atlassian.confluence.jmx.JmxIndexManagerWrapper"><constructor-arg
ref="indexManager"/></bean>
</entry>
<entry key="Confluence:name=SchedulingStatistics">
<bean class="com.atlassian.confluence.jmx.JmxScheduledTaskWrapper"><constructor-arg
ref="scheduler"/></bean>
</entry>
<entry key="Confluence:name=SystemInformation">
<bean class="com.atlassian.confluence.jmx.JmxSystemInfoWrapper"><constructor-arg
ref="systemInformationService"/></bean>
</entry>
<entry key="Confluence:name=CacheStatistics">
<bean class="com.atlassian.confluence.jmx.JxmCacheStatisticsWrapper">
<constructor-arg ref="cacheStatisticsManager"/>
</bean>
</entry>
</map>
</property>
<property name="exposeManagedResourceClassLoader" value="true"/>
</bean>
So, at least there is nothing wrong, because our installation does not support RequestMetrics mbean, and as far as we can see the RequestMetrics.class inside of confluence.jar, i believe it is a licensing issue.
I am using spring web services framework to call some SOAP apis.
My configuration is like this:
<bean name="wsTemplate" class="org.springframework.ws.client.core.WebServiceTemplate" scope="prototype" >
<constructor-arg ref="messageFactory" />
<property name="marshaller" ref="marshaller"/>
<property name="unmarshaller" ref="unmarshaller"/>
</bean>
<bean id="messageFactory" class="org.springframework.ws.soap.saaj.SaajSoapMessageFactory">
<property name="soapVersion">
<util:constant static-field="org.springframework.ws.soap.SoapVersion.SOAP_11"/>
</property>
</bean>
<bean id="marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller" >
<property name="contextPaths">
<list>
some configured classes here
</list>
</property>
</bean>
<bean id="unmarshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller" >
<property name="contextPaths">
<list>
some configured classes here
</list>
</property>
</bean>
Note I am using a prototype scope. I am not sure if that could be causing issues.
In my java code I use WebServiceTemplate like this:
#PostConstruct
private void init() {
try {
String uri = "https://web/file.svc?wsdl"
webServiceTemplate.setDefaultUri(uri);
} catch (Exception exception) {
logger.error("Error creating URL for the wsdl location.", exception);
}
}
I call the webservice like this:
Response response = (Response) webServiceTemplate.marshalSendAndReceive(request, new SoapActionCallback(SOAP_ACTION_URL));
I am getting the following read time out exception which I am not sure what it is, I have read it is because the response it is too big, but it really is not. It is not bigger than 100K
org.springframework.ws.client.WebServiceIOException: I/O error: Read timed out; nested exception is java.net.SocketTimeoutException: Read timed out
15:27:49,028 INFO [stdout] (default task-22) at org.springframework.ws.client.core.WebServiceTemplate.sendAndReceive(WebServiceTemplate.java:561) ~[spring-ws-core-2.2.4.RELEASE.jar:2.2.4.RELEASE]
15:27:49,028 INFO [stdout] (default task-22) at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:390) ~[spring-ws-core-2.2.4.RELEASE.jar:2.2.4.RELEASE]
15:27:49,028 INFO [stdout] (default task-22) at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:383) ~[spring-ws-core-2.2.4.RELEASE.jar:2.2.4.RELEASE]
What could be the issue ? I am clueless
At the end, I am not sure what was the issue, but I solved it by setting the message sender to a diferent provider . I set it to some apache library
<bean name="wsTemplate" class="org.springframework.ws.client.core.WebServiceTemplate" scope="prototype" >
<constructor-arg ref="messageFactory" />
<property name="marshaller" ref="marshaller"/>
<property name="unmarshaller" ref="unmarshaller"/>
<property name="messageSender">
<bean class="org.springframework.ws.transport.http.HttpComponentsMessageSender" />
</property>
</bean>
i'm using tomcat 5.5, with a spring app, and i having memory leak problems.
so i'm trying to connect jmx in my spring app to monitoring the app, and try to find what is causing the memory leak, but i can't yet.
i add the Mbeanexporter in my aplicationContext.xml
<bean id="exporter" class="org.springframework.jmx.export.MBeanExporter">
<property name="beans">
<map>
<entry key="bean:name=catalogFacadeTarget1" value-ref="catalogFacadeTarget"/>
</map>
</property>
</bean>
and in the catalina.sh
export CATALINA_OPTS="-Dcom.sun.management.jmxremote.port=8081
-Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.managment.jmxremote.host=localhost
-Dcom.sun.management.jmxremote.authenticate=false"
i run jconsole, but there no have any of my bean.
i need some direction here, thank you for any advice!
Be sure to set lazy-init = false for your MBeanExporter to get picked up. Like so:
<bean id="exporter" class="org.springframework.jmx.export.MBeanExporter" lazy-init="false">
...
</bean>
That should do the trick.
I found this tutorial on google, maybe it could help you:
http://blog.markshead.com/1129/connecting-visual-vm-to-tomcat-7/
I am currently using JBoss 4.3 for a web application. I would like to move to the JBoss AS 7. I have been able to fix must of the differences of the application in both versions but one. The application has some JMX beans that are created thru the spring framework. Unfortunately the AS 7 release removed the class: org.jboss.mx.util.MBeanServerLocator which was used in spring to locate the JBoss JMX server and create some beans. I am not to familiar with JMX but so far the only thing I have found so far is:
"http://lists.jboss.org/pipermail/jboss-as7-dev/2011-February/000569.html". I was wondering if somebody knows how to replace the class above from JBOSS with the new JMX 1.6 classes. Here is my spring configuration snipet for the piece I need to fix:
<bean class="org.springframework.jmx.export.MBeanExporter">
<property name="server">
<bean class="org.jboss.mx.util.MBeanServerLocator" factory-method="locateJBoss"/>
</property>
<property name="beans">
<map>
<entry key="MywebMbeans:name=profileListenerContainer" value-ref="profileListenerContainer"/>
<entry key="MywebMbeans:name=jmsSenderService" value-ref="jmsSenderService"/>
<entry key="MywebMbeans:name=mailSender" value-ref="mailSender"/>
</map>
</property>
<property name="assembler" ref="mbeanAssembler"/>
</bean>
Thanks,
The MBeanServer used by JBoss 7 (by default) is the platform MBeanServer. The class name is com.sun.jmx.mbeanserver.JmxMBeanServer and the default domain is DefaultDomain. Accordingly, you can simply use:
java.lang.management.ManagementFactory.getPlatformMBeanServer()
Alternatively:
for(MBeanServer server: javax.management.MBeanServerFactory.findMBeanServer(null)) {
if("DefaultDomain".equals(server.getDefaultDomain())) return server;
}
throw new Exception("Failed to locate MBeanServer");
Actually I just look in the JMX page for spring
http://static.springsource.org/spring/docs/1.2.x/reference/jmx.html
The following will work in both JBoss instaces 4 and 7.
<bean id="mbeanServer" class="org.springframework.jmx.support.MBeanServerFactoryBean">
<property name="locateExistingServerIfPossible" value="true" />
</bean>
<bean class="org.springframework.jmx.export.MBeanExporter">
<property name="server" ref="mbeanServer"/>
</property>
<property name="beans">
<map>
<entry key="MywebMbeans:name=profileListenerContainer" value-ref="profileListenerContainer"/>
<entry key="MywebMbeans:name=jmsSenderService" value-ref="jmsSenderService"/>
<entry key="MywebMbeans:name=mailSender" value-ref="mailSender"/>
</map>
</property>
<property name="assembler" ref="mbeanAssembler"/>
</bean>