WSO2 ESB endpoint jms uri syntax-format in proxy service - wso2

In my proxy service, am trying to create endpoint with JMS-ActiveMQ and it fails in the uri. Is my JMS Endpoint uri correct? am using ActiveMQ with EI611 on tooling380.
<?xml version="1.0" encoding="UTF-8"?>
<proxy name="CSVProcessor" startOnLoad="true" transports="vfs" xmlns="http://ws.apache.org/ns/synapse">
<target>
<inSequence>
<log level="full"/>
<smooks config-key="smooks-config" description="GetSmooks">
<input type="text"/>
<output type="xml"/>
</smooks>
<log description="GetData" level="full"/>
<datamapper config="gov:datamapper/NewConfig.dmc" description="MapPriceData" inputSchema="gov:datamapper/NewConfig_inputSchema.json" inputType="XML" outputSchema="gov:datamapper/NewConfig_outputSchema.json" outputType="XML"/>
<log description="LogDataMapper" level="full"/>
<property name="OUT_ONLY" scope="default" type="STRING" value="true"/>
<send>
<endpoint>
<address uri="jms:/foo.bar?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&java.naming.provider.url=tcp://localhost:61616&transport.jms.DestinationType=queue"/>
</endpoint>
</send>
</inSequence>
<outSequence/>
<faultSequence/>
</target>
<parameter name="transport.PollInterval">5</parameter>
<parameter name="transport.vfs.FileURI">file://c:\test-data\in</parameter>
<parameter name="transport.vfs.ContentType">text/plain</parameter>
<parameter name="transport.vfs.ActionAfterProcess">MOVE</parameter>
<parameter name="transport.vfs.MoveAfterFailure">file://c:\test-data\original</parameter>
<parameter name="transport.vfs.ActionAfterFailure">MOVE</parameter>
<parameter name="transport.vfs.FileNamePattern">.*.csv</parameter>
<parameter name="transport.vfs.MoveAfterProcess">file://c:\test-data\out</parameter>
</proxy>
Error :
[2017-10-19 17:20:30,944] [] ERROR - ClientUtils The system cannot infer the transport information from the jms:/foo.bar?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&java.naming.provider.url=tcp://localhost:61616&transport.jms.DestinationType=queue URL.
[2017-10-19 17:20:30,948] [] ERROR - Axis2Sender Unexpected error during sending message out
org.apache.axis2.AxisFault: The system cannot infer the transport information from the jms:/foo.bar?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&java.naming.provider.url=tcp://localhost:61616&transport.jms.DestinationType=queue URL.
at org.apache.axis2.description.ClientUtils.inferOutTransport(ClientUtils.java:81)
at org.apache.axis2.client.OperationClient.prepareMessageContext(OperationClient.java:288)
at org.apache.axis2.description.OutOnlyAxisOperationClient.executeImpl(OutOnlyAxisOperation.java:249)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:149)
at org.apache.synapse.core.axis2.Axis2FlexibleMEPClient.send(Axis2FlexibleMEPClient.java:595)
at org.apache.synapse.core.axis2.Axis2Sender.sendOn(Axis2Sender.java:83)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2SynapseEnvironment.java:548)
at org.apache.synapse.endpoints.AbstractEndpoint.send(AbstractEndpoint.java:382)
at org.apache.synapse.endpoints.AddressEndpoint.send(AddressEndpoint.java:65)
at org.apache.synapse.mediators.builtin.SendMediator.mediate(SendMediator.java:121)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:97)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:59)
at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:158)
at org.apache.synapse.core.axis2.ProxyServiceMessageReceiver.receive(ProxyServiceMessageReceiver.java:213)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at org.apache.axis2.transport.base.AbstractTransportListener.handleIncomingMessage(AbstractTransportListener.java:328)
at org.apache.synapse.transport.vfs.VFSTransportListener.processFile(VFSTransportListener.java:824)
at org.apache.synapse.transport.vfs.VFSTransportListener.scanFileOrDirectory(VFSTransportListener.java:472)
at org.apache.synapse.transport.vfs.VFSTransportListener.poll(VFSTransportListener.java:188)
at org.apache.synapse.transport.vfs.VFSTransportListener.poll(VFSTransportListener.java:134)
at org.apache.axis2.transport.base.AbstractPollingTransportListener$1$1.run(AbstractPollingTransportListener.java:67)
at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
[2017-10-19 17:20:30,958] [] WARN - EndpointContext Endpoint : AnonymousEndpoint with address jms:/foo.bar?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&java.naming.provider.url=tcp://localhost:61616&transport.jms.DestinationType=queue will be marked SUSPENDED as it failed

Ok, that was my bad.
I did not fully uncomment the below entry in axis2.xml(in C:\wso2ei-6.1.1\conf\axis2), which resulted in this error. I uncommented the leading <!-- but not the trailing -->. Am an idiot, for sure.
<transportSender name="jms" class="org.apache.axis2.transport.jms.JMSSender"/>
After uncommenting, the data transformed from the source CSV file into a new XML format, was sent to the destination jms queue of ActiveMQ, as desired.

Related

WSO2 mailto transport. Could not connect to SMTP host: smtp.gmail.com, port: 587

I tried to send email using wso2 mail to transport but got this error
[2021-01-08 09:46:48,133] [EI-Core] INFO - TimeoutHandler This engine will expire all callbacks after GLOBAL_TIMEOUT: 120 seconds, irrespective of the timeout action, after the specified or optional timeout
[2021-01-08 09:48:55,485] [EI-Core] ERROR - MailTransportSender Error creating mail message or sending it to the configured server
javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 587;
nested exception is:
java.net.ConnectException: Connection timed out (Connection timed out)
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:297)
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)
at org.apache.axis2.transport.mail.MailTransportSender.sendMail(MailTransportSender.java:520)
at org.apache.axis2.transport.mail.MailTransportSender.sendMessage(MailTransportSender.java:182)
at org.apache.axis2.transport.base.AbstractTransportSender.invoke(AbstractTransportSender.java:112)
at org.apache.axis2.engine.AxisEngine$TransportNonBlockingInvocationWorker.run(AxisEngine.java:626)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.net.ConnectException: Connection timed out (Connection timed out)
at java.net.PlainSocketImpl.socketConnect(Native Method)
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.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at java.net.Socket.connect(Socket.java:538)
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)
... 13 more
[2021-01-08 09:48:55,493] [EI-Core] ERROR - MailTransportSender Error generating mail message
org.apache.axis2.AxisFault: Error creating mail message or sending it to the configured server
at org.apache.axis2.transport.base.AbstractTransportSender.handleException(AbstractTransportSender.java:229)
at org.apache.axis2.transport.mail.MailTransportSender.sendMail(MailTransportSender.java:531)
at org.apache.axis2.transport.mail.MailTransportSender.sendMessage(MailTransportSender.java:182)
at org.apache.axis2.transport.base.AbstractTransportSender.invoke(AbstractTransportSender.java:112)
at org.apache.axis2.engine.AxisEngine$TransportNonBlockingInvocationWorker.run(AxisEngine.java:626)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 587;
nested exception is:
java.net.ConnectException: Connection timed out (Connection timed out)
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:297)
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)
at org.apache.axis2.transport.mail.MailTransportSender.sendMail(MailTransportSender.java:520)
... 6 more
Caused by: java.net.ConnectException: Connection timed out (Connection timed out)
at java.net.PlainSocketImpl.socketConnect(Native Method)
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.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at java.net.Socket.connect(Socket.java:538)
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)
... 13 more
[2021-01-08 09:48:55,498] [EI-Core] INFO - AxisEngine [MessageContext: logID=ee60111e2cfd2756410df0877d7ff1cd768edb7f3087b9f9] Error generating mail message
here axist2 setting
<transportSender name="mailto" class="org.apache.axis2.transport.mail.MailTransportSender">
<parameter name="mail.smtp.host">smtp.gmail.com</parameter>
<parameter name="mail.smtp.port">587</parameter>
<parameter name="mail.smtp.starttls.enable">true</parameter>
<parameter name="mail.smtp.auth">true</parameter>
<parameter name="mail.smtp.user">sendmail</parameter>
<parameter name="mail.smtp.password">***</parameter>
<parameter name="mail.smtp.from">sendmail#gmail.com</parameter>
</transportSender>
EmailTemplate.xml
<?xml version="1.0" encoding="UTF-8"?>
<template name="EmailTemplate" xmlns="http://ws.apache.org/ns/synapse">
<parameter name="subject"/>
<parameter name="toAddress"/>
<sequence>
<property expression="$func:subject" name="Subject" scope="transport" type="STRING"/>
<property name="ContentType" scope="axis2" type="STRING" value="text/html"/>
<property name="messageType" value="text/html" scope="axis2"/>
<property name="OUT_ONLY" scope="default" type="STRING" value="true"/>
<property name="FORCE_SC_ACCEPTED" scope="axis2" type="STRING" value="true"/>
<property expression="fn:concat('mailto:',$ctx:email)" name="emailEP" scope="default" type="STRING"/>
<header expression="get-property('emailEP')" name="To" scope="default"/>
<send>
<endpoint>
<default/>
</endpoint>
</send>
</sequence>
</template>
I use activemq to trigered the message, here the email proxy
<?xml version="1.0" encoding="UTF-8"?>
<proxy name="UserMgtCreateEmailSender" startOnLoad="true" transports="jms" xmlns="http://ws.apache.org/ns/synapse">
<target>
<inSequence>
<property name="emailSubject" scope="default" type="STRING" value="Test Email Subject"/>
<property expression="json-eval($.email)" name="email" scope="default" type="STRING"/>
<xslt key="conf:xsl/email-body-xslt.xslt"/>
<call-template target="EmailTemplate">
<with-param name="subject" value="{$ctx:emailSubject}"/>
</call-template>
</inSequence>
<outSequence/>
<faultSequence/>
</target>
<parameter name="transport.jms.DestinationType">queue</parameter>
<parameter name="transport.jms.Destination">sendemail.user</parameter>
<parameter name="transport.jms.ContentType">
<rules xmlns="">
<jmsProperty>contentType</jmsProperty>
<default>application/json</default>
</rules>
</parameter>
<parameter name="transport.jms.ConnectionFactory">myQueueConnectionFactory</parameter>
</proxy>
and this is the email-body-xslt.xslt
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html" version="4.0" encoding="UTF-8" indent="yes" />
<xsl:template match="/">
<html>
<body>
<p>Service Name: Test Proxy</p>
<p>Execution success</p>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
The message i send to queue is the target email
{
"email":"username#gmail.com"
}
This code is work for several times but suddently got error like that. i dont know what cause. please help. I'm new with wso2.
I've had a lot of trouble with the SMTP configuration as well. I think what is currently wrong is the user. When I tried to configure it the user had to also be the full email.
<transportSender name="mailto" class="org.apache.axis2.transport.mail.MailTransportSender">
<parameter name="mail.smtp.host">smtp.gmail.com</parameter>
<parameter name="mail.smtp.port">587</parameter>
<parameter name="mail.smtp.starttls.enable">true</parameter>
<parameter name="mail.smtp.auth">true</parameter>
<parameter name="mail.smtp.user">sendmail#gmail.com</parameter>
<parameter name="mail.smtp.password">***</parameter>
<parameter name="mail.smtp.from">sendmail#gmail.com</parameter>
</transportSender>
Let me know if that works for you otherwise it might but some firewall issue.

Use WSO2 EI to send an email

I use WSO2 EI to send an email but I get an error message below.
2019-01-24 17:53:12,353 To:
/services/SimpleProxy2.SimpleProxy2HttpSoap12Endpoint, WSAction:
urn:mediate, SOAPAction: urn:mediate, MessageID:
urn:uuid:06891289-318c-49b1-83bd-bc71c7590078, Direction: request,
MESSAGE = Executing default 'fault' sequence, ERROR_CODE = 0,
ERROR_MESSAGE = Unexpected error during sending message out, Envelope:
Hello
WSO2.....!
2019-01-24 17:53:12,347 Suspending endpoint : AnonymousEndpoint with address mailto:zoehuang#asqimacau.com - current suspend duration
is : 30000ms - Next retry after : Thu Jan 24 17:53:42 CST 2019
2019-01-24 17:53:12,347 Endpoint : AnonymousEndpoint with address mailto:zoehuang#asqimacau.com will be marked SUSPENDED as it failed
2019-01-24 17:53:12,308 Unexpected error during sending message out
2019-01-24 17:53:12,302 Error generating mail message
2019-01-24 17:53:12,284 Error creating mail message or sending it to the configured server
2019-01-24 17:51:26,988 Unable to sendViaPost to url[http://asqi-vm:8280/services/SimpleProxy2.SimpleProxy2HttpSoap12Endpoint]
2019-01-24 17:50:27,008 This engine will expire all callbacks after GLOBAL_TIMEOUT: 1200 seconds, irrespective of the timeout
action, after the specified or optional timeout
2019-01-24 17:50:26,990 To: /services/SimpleProxy2.SimpleProxy2HttpSoap12Endpoint, WSAction:
urn:mediate, SOAPAction: urn:mediate, MessageID:
urn:uuid:06891289-318c-49b1-83bd-bc71c7590078, Direction: request,
Envelope: Hello
WSO2.....!
configuration file setting in EI_HOME\conf\axis2\axis2.xml
<transportSender name="mailto" class="org.apache.axis2.transport.mail.MailTransportSender">
<parameter name="mail.smtp.host">xxxx-mail1.com</parameter>
<parameter name="mail.smtp.port">465</parameter>
<parameter name="mail.smtp.starttls.enable">true</parameter>
<parameter name="mail.smtp.auth">true</parameter>
<parameter name="mail.smtp.user">xxxxx#xxxxx.com</parameter>
<parameter name="mail.smtp.password">password</parameter>
<parameter name="mail.smtp.from">xxxxx#xxxxx.com</parameter>
</transportSender>
My proxy service code in EI
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="SimpleProxy2"
startOnLoad="true"
statistics="disable"
trace="disable"
transports="http,https">
<target>
<inSequence>
<property name="messageType"
scope="axis2"
type="STRING"
value="text/html"/>
<property name="ContentType" scope="axis2" value="text/html"/>
<property name="Subject" scope="transport" value="Testing ESB"/>
<property name="OUT_ONLY" value="true"/>
<property name="FORCE_SC_ACCEPTED" scope="axis2" value="true"/>
<payloadFactory media-type="xml">
<format>
<ns:text xmlns:ns="http://ws.apache.org/commons/ns/payload">$1</ns:text>
</format>
<args>
<arg value="Hello WSO2.....!"/>
</args>
</payloadFactory>
<log level="full"/>
<send>
<endpoint>
<address uri="mailto:xxxxx#xxxxx.com"/>
</endpoint>
</send>
<log level="full"/>
</inSequence>
<outSequence>
</outSequence>
</target>
<description/>
</proxy>
I expected I can use WSO2 EI to send an e-mail and receive an e-mail.
If you can refer to the documentation in [1] we can observe the following sample configuration for the mail transport
<transportSender name="mailto" class="org.apache.axis2.transport.mail.MailTransportSender">
<parameter name="mail.smtp.host">smtp.gmail.com</parameter>
<parameter name="mail.smtp.port">587</parameter>
<parameter name="mail.smtp.starttls.enable">true</parameter>
<parameter name="mail.smtp.auth">true</parameter>
<parameter name="mail.smtp.user">synapse.demo.0</parameter>
<parameter name="mail.smtp.password">mailpassword</parameter>
<parameter name="mail.smtp.from">synapse.demo.0#gmail.com</parameter>
</transportSender>
Please refer to the following parameters in your configuration. In the following can you please modify the smtp.user value to xxxxx (synapse.demo.0 in above) rather than xxxxx#xxxxx.com
<parameter name="mail.smtp.user">xxxxx#xxxxx.com</parameter>
<parameter name="mail.smtp.from">xxxxx#xxxxx.com</parameter>
[1]-https://docs.wso2.com/display/EI640/MailTo+Transport

Correct configuration for transport Sender & Receiver JMS?

I have some questions because documentation is not clear..
How should I setup WSO2 ESB environment to be able to read and write messages form WSO2 MessageBroker.
I followed ConfigurewithWSO2MessageBroker
I have ESB and MB on same server (MB has Offset=2)
/repository/conf/axis2/axis2.xml
....
<transportReceiver name="jms" class="org.apache.axis2.transport.jms.JMSListener">
<parameter name="JMSTopic" locked="false">
<parameter name="java.naming.factory.initial" locked="false">org.wso2.andes.jndi.PropertiesFileInitialContextFactory</parameter>
<parameter name="java.naming.provider.url" locked="false">repository/conf/jndi.properties</parameter>
<parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">TopicConnectionFactory</parameter>
<parameter name="transport.jms.ConnectionFactoryType" locked="false">topic</parameter>
</parameter>
<parameter name="JMSQueue" locked="false">
<parameter name="java.naming.factory.initial" locked="false">org.wso2.andes.jndi.PropertiesFileInitialContextFactory</parameter>
<parameter name="java.naming.provider.url" locked="false">repository/conf/jndi.properties</parameter>
<parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">QueueConnectionFactory</parameter>
<parameter name="transport.jms.ConnectionFactoryType" locked="false">queue</parameter>
</parameter>
<parameter name="default" locked="false">
<parameter name="java.naming.factory.initial" locked="false">org.wso2.andes.jndi.PropertiesFileInitialContextFactory</parameter>
<parameter name="java.naming.provider.url" locked="false">repository/conf/jndi.properties</parameter>
<parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">QueueConnectionFactory</parameter>
<parameter name="transport.jms.ConnectionFactoryType" locked="false">queue</parameter>
</parameter>
</transportReceiver>
...
and sender part
<transportSender name="jms" class="org.apache.axis2.transport.jms.JMSSender">
<parameter name="default" locked="false">
<parameter name="java.naming.factory.initial" locked="false">org.wso2.andes.jndi.PropertiesFileInitialContextFactory</parameter>
<parameter name="java.naming.provider.url" locked="false">repository/conf/jndi.properties</parameter>
<parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">ConnectionFactory</parameter>
</parameter>
</transportSender>
jndi.properties files
connectionfactory.QueueConnectionFactory = amqp://admin:admin#clientID/carbon?brokerlist='tcp://gst-esb-qa-01:5674'
connectionfactory.TopicConnectionFactory = amqp://admin:admin#clientID/carbon?brokerlist='tcp://gst-esb-qa-01:5674'
connectionfactory.ConnectionFactory = amqp://admin:admin#clientID/carbon?brokerlist='tcp://gst-esb-qa-01:5674'
queue.myQueue = myQueue
queue.testQueue= testQueue
topic.MyTopic = MyTopic
My proxy
<proxy name="SendMessagetoJMSProxy" transports="http" startOnLoad="true">
<target>
<endpoint>
<address uri="jms:/myQueue?&transport.jms.DestinationType=queue"/>
</endpoint>
<inSequence>
<log level="custom">
<property name="STATE" value="message is sent to queue"/>
</log>
<property name="OUT_ONLY" value="true"/>
<property name="FORCE_SC_ACCEPTED" value="true" scope="axis2"/>
</inSequence>
<outSequence/>
</target>
</proxy>
my SOAP UI call
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://services.samples" xmlns:xsd="http://services.samples/xsd">
<soapenv:Header/>
<soapenv:Body>
<ser:dummy>
<xsd:symbol>IBM</xsd:symbol>
</ser:dummy>
</soapenv:Body>
</soapenv:Envelope>
According to doc I should see the message in JMS Message Broker BUT I get
Error while building Passthrough stream
TID[-1234] [ESB] [2017-05-16 12:52:47,137] ERROR {org.apache.synapse.transport.passthru.util.RelayUtils} - Error while building Passthrough stream org.apache.axiom.om.impl.builder.StAXOMBuilder.lookahead(StAXOMBuilder.java:711) org.apache.axiom.soap.impl.llom.SOAPBodyImpl.hasLookahead(SOAPBodyImpl.java:191) org.apache.axiom.soap.impl.llom.SOAPBodyImpl.getFirstElementLocalName(SOAPBodyImpl.java:217) org.apache.axiom.soap.impl.llom.SOAPBodyImpl.hasFault(SOAPBodyImpl.java:99) org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.hasFault(SOAPEnvelopeImpl.java:305) org.apache.synapse.transport.passthru.util.DeferredMessageBuilder.getDocument(DeferredMessageBuilder.java:189) org.apache.synapse.transport.passthru.util.RelayUtils.builldMessage(RelayUtils.java:137) org.apache.synapse.transport.passthru.util.RelayUtils.buildMessage(RelayUtils.java:100) org.apache.synapse.mediators.AbstractListMediator.buildMessage(AbstractListMediator.java:140) org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:83) org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:59) org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:158) org.apache.synapse.core.axis2.ProxyServiceMessageReceiver.receive(ProxyServiceMessageReceiver.java:210) org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180) org.apache.synapse.transport.passthru.ServerWorker.processEntityEnclosingRequest(ServerWorker.java:403) org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:151) org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) java.lang.Thread.run(Thread.java:745)
AND
Endpoint : AnonymousEndpoint with address jms:/myQueue?&transport.jms.DestinationType=queue will be marked SUSPENDED as it failed
First question :
java.naming.provider.url param in axis2.xml is it relative to [ESB Home] location ?
Im my case server folder structure looks like ...
maybe that should look like ....????
<parameter name="java.naming.provider.url" locked="false">file:/home/wso2admin/wso2esb-5.0.0/repository/conf/jndi.properties</parameter>
SECOND :
is this error related to Message Builder and Formater ????
any help would be nice ...couse Im stuck for days ...
First Question:java.naming.provider.url param in axis2.xml is it relative to [ESB Home] location ?
No, you dont need to add ESB home location.
Second Question: is this error related to Message Builder and Formater ????
Yes, you are getting an error with message builders.
Just verify whether you added client jars and verify your proxy. Please create a proxy as follow and try it.
Sample Proxy:
<proxy name="QueueProxy" startOnLoad="true" transports="jms">
<target>
<inSequence>
<property name="OUT_ONLY" value="true"/>
<property name="FORCE_SC_ACCEPTED" value="true" scope="axis2"/>
<send>
<endpoint>
<address uri="jms:/MyQueue?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&java.naming.factory.initial=org.wso2.andes.jndi.PropertiesFileInitialContextFactory&java.naming.provider.url=repository/conf/jndi.properties"/>
</endpoint>
</send>
</inSequence>
</target>
</proxy>
Reference: https://docs.wso2.com/display/ESB500/ESB+as+a+JMS+Producer
Please try the below proxy and check the URL format you are using
<proxy xmlns="http://ws.apache.org/ns/synapse" name="StockQuoteProxy" transports="http">
<target>
<inSequence>
<property action="set" name="OUT_ONLY" value="true"/>
<send>
<endpoint>
<address uri="jms:/myQueue?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&java.naming.provider.url=tcp://localhost:61616&transport.jms.DestinationType=queue"/>
</endpoint>
</send>
</inSequence>
<outSequence>
<send/>
</outSequence>
</target>
<publishWSDL uri="file:repository/samples/resources/proxy/sample_proxy_1.wsdl"/>
for more
https://docs.wso2.com/display/ESB500/ESB+as+a+JMS+Producer
https://docs.wso2.com/display/MB310/Integrating+WSO2+ESB
Thanks to Rajjaz and Jan ...
I created a proxy
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="SendMessagetoJMSProxy"
startOnLoad="true"
statistics="disable"
trace="disable"
transports="http,https">
<target>
<inSequence>
<log level="custom">
<property name="STATE" value="message is sent to myQueue"/>
</log>
<property name="OUT_ONLY" value="true"/>
<property name="FORCE_SC_ACCEPTED" scope="axis2" value="true"/>
</inSequence>
<outSequence/>
<endpoint>
<address uri="jms:/myQueue?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&java.naming.factory.initial=org.wso2.andes.jndi.PropertiesFileInitialContextFactory&java.naming.provider.url=repository/conf/jndi.properties"/>
</endpoint>
</target>
<description/>
</proxy>
also I figure out that if you have define default JMS configuration part in axis2.xml for transportReceiver it is enough to put name of Queue
so this is also working
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="SendMessagetoJMSProxy2"
startOnLoad="true"
statistics="disable"
trace="disable"
transports="http,https">
<target>
<inSequence>
<log level="custom">
<property name="STATE" value="message is sent to GST_TMS_ASSOCIATE_LEASE Queue"/>
</log>
<property name="OUT_ONLY" value="true"/>
<property name="FORCE_SC_ACCEPTED" scope="axis2" value="true"/>
</inSequence>
<outSequence/>
<endpoint>
<address uri="jms:/myQueue"/>
</endpoint>
</target>
<description/>
</proxy>
and now I can publish a message to JMS queue with proxy ...
Im little confused (still) where all this log in System logs coming from and why ?!?]1

Why does Send Mediator not execute?

<?xml version="1.0" encoding="UTF-8" ?>
<proxy name="VFS_RTDB_Proxy" serviceGroup="" startOnLoad="true" trace="enable" transports="vfs" xmlns="http://ws.apache.org/ns/synapse">
<target>
<inSequence>
<payloadFactory media-type="json">
<format>{rtdatas:$1}</format>
<args>
<arg expression="get-property('rtDataSets')" />
</args>
</payloadFactory>
<send>
<endpoint>
<address format="rest" statistics="enable" trace="enable" uri="http://211.154.164.28:9666/services/oge/vzdb/post/history" />
</endpoint>
</send>
</inSequence>
</target>
<parameter name="transport.vfs.Streaming">true</parameter>
<parameter name="transport.PollInterval">2</parameter>
<parameter name="transport.vfs.ContentType">text/plain</parameter>
<parameter name="transport.vfs.ActionAfterProcess">MOVE</parameter>
<parameter name="transport.vfs.ActionAfterProces">MOVE</parameter>
<parameter name="transport.vfs.FileURI">D:\exportRTDB</parameter>
<parameter name="transport.vfs.FileURI">G:\MoveAfterFailure</parameter>
<parameter name="transport.vfs.MoveAfterFailure">G:\MoveAfterFailure</parameter>
<parameter name="transport.vfs.FileNamePattern">.*.csv</parameter>
<parameter name="transport.vfs.ActionAfterFailure">MOVE</parameter>
</proxy>
Why does Send Mediator not execute? When I set Address Endpoint wrapped in Call Mediator, this doesn't execute either. How can I solve this?
When wrapped in Call Mediator, I get follow error:
[2016-03-30 20:31:25,550] INFO - BuilderUtil OMException in
getSOAPBuilder org.apache.axiom.soap.SOAPProcessingException: First
Element must contain the local name, Envelope , but found html
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.constructNode(StAXSOAPModelBuilder.java:305)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createOMElement(StAXSOAPModelBuilder.java:252)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createNextOMElement(StAXSOAPModelBuilder.java:234)
at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:249)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnvelope(StAXSOAPModelBuilder.java:204)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.(StAXSOAPModelBuilder.java:154)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.(StAXSOAPModelBuilder.java:140)
at org.apache.axis2.builder.BuilderUtil.getSOAPBuilder(BuilderUtil.java:659)
at org.apache.axis2.transport.TransportUtils.createDocumentElement(TransportUtils.java:206)
at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:146)
at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:109)
at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:68)
at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:348)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:445)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:225)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:149)
at org.apache.synapse.message.senders.blocking.BlockingMsgSender.sendReceive(BlockingMsgSender.java:254)
at org.apache.synapse.message.senders.blocking.BlockingMsgSender.send(BlockingMsgSender.java:175)
at org.apache.synapse.mediators.builtin.CallMediator.handleBlockingCall(CallMediator.java:113)
at org.apache.synapse.mediators.builtin.CallMediator.mediate(CallMediator.java:85)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:81)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:48)
at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:149)
at org.apache.synapse.core.axis2.ProxyServiceMessageReceiver.receive(ProxyServiceMessageReceiver.java:185)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at org.apache.axis2.transport.base.AbstractTransportListener.handleIncomingMessage(AbstractTransportListener.java:328)
at org.apache.synapse.transport.vfs.VFSTransportListener.processFile(VFSTransportListener.java:751)
at org.apache.synapse.transport.vfs.VFSTransportListener.scanFileOrDirectory(VFSTransportListener.java:407)
at org.apache.synapse.transport.vfs.VFSTransportListener.poll(VFSTransportListener.java:177)
at org.apache.synapse.transport.vfs.VFSTransportListener.poll(VFSTransportListener.java:124)
at org.apache.axis2.transport.base.AbstractPollingTransportListener$1$1.run(AbstractPollingTransportListener.java:67)
at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745) [2016-03-30 20:31:25,635] INFO - BuilderUtil Remaining input stream :[]
[2016-03-30 20:31:25,635] WARN - FaultHandler ERROR_CODE : 401000
[2016-03-30 20:31:25,651] WARN - FaultHandler ERROR_MESSAGE : First
Element must contain the local name, Envelope , but found html
[2016-03-30 20:31:25,651] WARN - FaultHandler ERROR_DETAIL :
[2016-03-30 20:31:25,651] WARN - FaultHandler ERROR_EXCEPTION :
org.apache.synapse.SynapseException: Error while performing the call
operation [2016-03-30 20:31:25,651] WARN - FaultHandler FaultHandler
: org.apache.synapse.mediators.MediatorFaultHandler#4207ac5d
[2016-03-30 20:31:25,651] WARN - MediatorFaultHandler Executing fault
handler mediator : org.apache.synapse.mediators.base.SequenceMediator
The follow is changed proxy config, Get error By follow config;I have not publish proxy as WSDL,so I did not found web Page....
<?xml version="1.0" encoding="UTF-8"?>
<proxy name="VFS_RTDB_Proxy" serviceGroup="" startOnLoad="true"
trace="enable" transports="vfs" xmlns="http://ws.apache.org/ns/synapse">
<localEntry key="smooks-key" src="file:repository/samples/resources/smooks/smooks-config.xml"/>
<target>
<inSequence>
<class description="" name="cn.oge.kdm.mediator.RTDataSetMediator"/>
<!-- <log description="" level="custom">
<property expression="get-property('rtDataSets')" name="RTDATASET"/>
</log> -->
<payloadFactory media-type="json">
<format>{"rtdatas":$1}</format>
<args>
<arg expression="get-property('rtDataSets')"/>
</args>
</payloadFactory>
<call blocking="true">
<endpoint>
<address statistics="enable" trace="enable" uri="http://211.154.164.98:9766/services/oge/vzdb/post/history"/>
</endpoint>
</call>
</inSequence>
<outSequence>
<!-- <log level="full"/> -->
<property name="OUT_ONLY" scope="default" type="STRING" value="true"/>
<property
expression="fn:concat(fn:substring-after(get-property('MessageID'), 'urn:uuid:'), '.xml')"
name="transport.vfs.ReplyFileName" scope="transport" type="STRING"/>
</outSequence>
<faultSequence>
<!-- <class description="" name="cn.oge.kdm.mediator.DecompressionMediator"/> -->
<log level="full"/>
</faultSequence>
</target>
<parameter name="transport.vfs.Streaming">true</parameter>
<parameter name="transport.PollInterval">2</parameter>
<parameter name="transport.vfs.ContentType">text/plain</parameter>
<parameter name="transport.vfs.ActionAfterProcess">MOVE</parameter>
<parameter name="transport.vfs.ActionAfterProces">MOVE</parameter>
<parameter name="transport.vfs.FileURI">D:\exportRTDB</parameter>
<parameter name="transport.vfs.MoveAfterProcess">vfs:ftp://ProEditor:****#211.154.164.99/</parameter>
<parameter name="transport.vfs.MoveAfterFailure">G:\MoveAfterFailure</parameter>
<parameter name="transport.vfs.FileNamePattern">.*.csv</parameter>
<parameter name="transport.vfs.ActionAfterFailure">MOVE</parameter>
</proxy>

JMS Not working in Wso2Esb 4.7.0

i am working with wso2esb 4.7.0 and ActiveMQ5.8.0 whenever i am working with wso2esb4.6.0 and ActiveMQ5.5.1 its working fine i am publishing my configuration below any one help for this
message store
<messageStore xmlns="http://ws.apache.org/ns/synapse"
class="org.wso2.carbon.message.store.persistence.jms.JMSMessageStore"
name="JMSQueue">
<parameter name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
<parameter name="store.jms.cache.connection">false</parameter>
<parameter name="java.naming.provider.url">tcp://localhost:61616</parameter>
<parameter name="store.jms.JMSSpecVersion">1.1</parameter>
<parameter name="store.jms.destination">JMS_Reading_Queue</parameter>
</messageStore>
message processor
<messageProcessor xmlns="http://ws.apache.org/ns/synapse"
class="org.apache.synapse.message.processors.forward.ScheduledMessageForwardingProcessor"
name="faisal"
messageStore="JMSQueue">
<parameter name="max.delivery.attempts">4</parameter>
<parameter name="interval">1000</parameter>
</messageProcessor
and proxy is like this
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="Jms"
transports="https http jms"
startOnLoad="true"
trace="disable">
<description/>
<target>
<inSequence>
<property name="messageType" value="application/json" scope="axis2"/>
<log level="full"/>
<store messageStore="JMSQueue"/>
<property name="target.endpoint"
value="JmsEndpoint"
scope="default"
type="STRING"/>
</inSequence>
<outSequence/>
</target>
</proxy>
and i defined my endpoint in endpoints
<endpoint xmlns="http://ws.apache.org/ns/synapse" name="JmsEndpoint">
<address uri="http://192.168.1.122:8282/services/ReadingsMobile"
format="soap11"/>
</endpoint>
now i am getting no target endpoint errors same configuration working in wso2esb4.6.0 mbut not working in wso2esb4.7.0
and its giving errors like this
[2013-08-21 16:48:32,049] WARN - ForwardingHandler Property target.endpoint not found in the message context. Removing the message.
[2013-08-21 16:49:32,093] WARN - SourceHandler Connection time out after request is read: http-incoming-13
Try doing the below modifications in the proxy configuration in order to get rid of the warnings;
a) Replace < target > with < target endpoint="JmsEndpoint" >
b) Move the "store" tag entry after the property where you set the "target.endpoint".
These changes seem to do the trick in my environment. Check if it fixes your issue too.
Hope this helps.
Basically the error you are getting says message processor cannot find the target.endpoint property from the stored message context.
The reason for this is, you are storing the message before setting this property.
You have to set the 'target.endpoint' property before the store mediator in the flow.
Proxy configuration should look likes follows.
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="Jms"
transports="https http jms"
startOnLoad="true"
trace="disable">
<description/>
<target>
<inSequence>
<property name="messageType" value="application/json" scope="axis2"/>
<log level="full"/>
<property name="target.endpoint"
value="JmsEndpoint"
scope="default"
type="STRING"/>
<store messageStore="JMSQueue"/>
</inSequence>
<outSequence/>
</target>
</proxy>