I have set the variable before I use dplookup to select result,the paramater is:
mc.setProperty("year","2019");
mc.setProperty("month","11");
mc.setProperty("date","7");
the dblookup is
<dblookup>
<connection>
<pool>
<password>XXXX</password>
<driver>com.mysql.jdbc.Driver</driver>
<url>jdbc:mysql://XXXX</url>
<user>XXXX</user>
</pool>
</connection>
<statement>
<sql><![CDATA[
SELECT IFNULL(max(ID_),0) as MAX_ID_ FROM KETTLE WHERE YEAR(FROM_UNIXTIME(DETECTION_TIME_ / 1000)) = ? AND MONTH(FROM_UNIXTIME(DETECTION_TIME_ / 1000)) = ? AND DAYOFMONTH(FROM_UNIXTIME(DETECTION_TIME_ / 1000)) = ?;
]]></sql>
<parameter expression="get-property('year')" type="VARCHAR"/>
<parameter expression="get-property('month')" type="VARCHAR"/>
<parameter expression="get-property('date')" type="VARCHAR"/>
<result column="MAX_ID_" name="MAX_ID_"/>
</statement>
</dblookup>
Sometimes it works, sometimes it doesn't work
when success the log is:
TID: [-1234] [] [2019-11-07 15:11:40,072] DEBUG {org.apache.synapse.mediators.db.DBLookupMediator} - Setting as parameter : 1 value : 2019 as JDBC Type : 12(see java.sql.Types for valid types) {org.apache.synapse.mediators.db.DBLookupMediator}
TID: [-1234] [] [2019-11-07 15:11:40,073] DEBUG {org.apache.synapse.mediators.db.DBLookupMediator} - Setting as parameter : 2 value : 11 as JDBC Type : 12(see java.sql.Types for valid types) {org.apache.synapse.mediators.db.DBLookupMediator}
TID: [-1234] [] [2019-11-07 15:11:40,073] DEBUG {org.apache.synapse.mediators.db.DBLookupMediator} - Setting as parameter : 3 value : 7 as JDBC Type : 12(see java.sql.Types for valid types) {org.apache.synapse.mediators.db.DBLookupMediator}
TID: [-1234] [] [2019-11-07 15:11:40,073] DEBUG {org.apache.synapse.mediators.db.DBLookupMediator} - Successfully prepared statement :
SELECT IFNULL(max(ID_),0) as MAX_ID_ FROM KETTLE WHERE YEAR(FROM_UNIXTIME(DETECTION_TIME_ / 1000)) = ? AND MONTH(FROM_UNIXTIME(DETECTION_TIME_ / 1000)) = ? AND DAYOFMONTH(FROM_UNIXTIME(DETECTION_TIME_ / 1000)) = ?;
against DataSource : jdbc:XXXX{org.apache.synapse.mediators.db.DBLookupMediator}
TID: [-1234] [] [2019-11-07 15:11:40,235] DEBUG {org.apache.synapse.mediators.db.DBLookupMediator} - Processing the first row returned :
SELECT IFNULL(max(ID_),0) as MAX_ID_ FROM KETTLE WHERE YEAR(FROM_UNIXTIME(DETECTION_TIME_ / 1000)) = ? AND MONTH(FROM_UNIXTIME(DETECTION_TIME_ / 1000)) = ? AND DAYOFMONTH(FROM_UNIXTIME(DETECTION_TIME_ / 1000)) = ?;
{org.apache.synapse.mediators.db.DBLookupMediator}
TID: [-1234] [] [2019-11-07 15:11:40,235] DEBUG {org.apache.synapse.mediators.db.DBLookupMediator} - Column : MAX_ID_ returned value : 0 Setting this as the message property : MAX_ID_ {org.apache.synapse.mediators.db.DBLookupMediator}
when failure the log is:
TID: [-1234] [] [2019-11-07 09:29:50,073] DEBUG {org.apache.synapse.mediators.db.DBLookupMediator} - Getting a connection from DataSource jdbc:mysql://XXXX and preparing statement :
SELECT IFNULL(max(ID_),0) as MAX_ID_ FROM KETTLE WHERE YEAR(FROM_UNIXTIME(DETECTION_TIME_ / 1000)) = ? AND MONTH(FROM_UNIXTIME(DETECTION_TIME_ / 1000)) = ? AND DAYOFMONTH(FROM_UNIXTIME(DETECTION_TIME_ / 1000)) = ?;
{org.apache.synapse.mediators.db.DBLookupMediator}
TID: [-1234] [] [2019-11-07 09:29:50,074] DEBUG {org.apache.synapse.mediators.db.DBLookupMediator} - [ DB Connection : org.apache.commons.dbcp.PoolableConnection#1ff8a7ec ] {org.apache.synapse.mediators.db.DBLookupMediator}
TID: [-1234] [] [2019-11-07 09:29:50,075] DEBUG {org.apache.synapse.mediators.db.DBLookupMediator} - [ DB Connection instance identifier : 1ff8a7ec ] {org.apache.synapse.mediators.db.DBLookupMediator}
TID: [-1234] [] [2019-11-07 09:29:50,075] DEBUG {org.apache.synapse.mediators.db.DBLookupMediator} - [ Number of Active Connection : 1 ] {org.apache.synapse.mediators.db.DBLookupMediator}
TID: [-1234] [] [2019-11-07 09:29:50,075] DEBUG {org.apache.synapse.mediators.db.DBLookupMediator} - [ Number of Idle Connection : 0 ] {org.apache.synapse.mediators.db.DBLookupMediator}
TID: [-1234] [] [2019-11-07 09:29:50,075] DEBUG {org.apache.synapse.mediators.db.DBLookupMediator} - Setting as parameter : 1 value : 2019 as JDBC Type : 12(see java.sql.Types for valid types) {org.apache.synapse.mediators.db.DBLookupMediator}
TID: [-1234] [] [2019-11-07 09:29:50,075] ERROR {org.apache.synapse.mediators.db.DBLookupMediator} - SQL Exception occurred while executing statement :
SELECT IFNULL(max(ID_),0) as MAX_ID_ FROM KETTLE WHERE YEAR(FROM_UNIXTIME(DETECTION_TIME_ / 1000)) = ? AND MONTH(FROM_UNIXTIME(DETECTION_TIME_ / 1000)) = ? AND DAYOFMONTH(FROM_UNIXTIME(DETECTION_TIME_ / 1000)) = ?;
against DataSource : jdbc:mysql:XXXXX{org.apache.synapse.mediators.db.DBLookupMediator}
java.sql.SQLException: No operations allowed after statement closed.
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:964)
Related
I get this MQTT payload from a device: (and I can't change how the device sends it)
{t:2021-11-08T16:17:15Z,10:99,14:24,55:20.85,56:64.38,53:36.00}
This is the timestamp: t:2021-11-08T16:17:15Z
I know that TB expects the UNIX style timestamp, and I expected to change this timestamp into the UNIX style in a transform node in the Rule Chain.
But, it never gets there because I believe that TB parses it before getting to the Rule Chain, and throughs an exception and rejects the readings.
How can I prevent TB to do that early parsing so I can get to the value and change it to the expected ts format? Is there a configuration or any other way besides forking the project and rewriting the parser?
Thank you!
Here is the error I get from the logs:
2021-11-08 23:39:25,124 [nioEventLoopGroup-4-5] INFO o.t.s.t.mqtt.MqttTransportHandler - [f5a4a965-8177-4daf-9a56-9197a55fab7d] Processing connect msg for client: xxxx!
2021-11-08 23:39:25,125 [nioEventLoopGroup-4-5] INFO o.t.s.t.mqtt.MqttTransportHandler - [f5a4a965-8177-4daf-9a56-9197a55fab7d] Processing connect msg for client with user name: null!
2021-11-08 23:39:25,167 [DefaultTransportService-18-34] INFO o.t.s.t.mqtt.MqttTransportHandler - [f5a4a965-8177-4daf-9a56-9197a55fab7d] Client connected!
2021-11-08 23:39:25,183 [nioEventLoopGroup-4-5] WARN o.t.s.t.mqtt.MqttTransportHandler - [f5a4a965-8177-4daf-9a56-9197a55fab7d] Failed to process publish msg [device/lre/readings][1]
org.thingsboard.server.common.transport.adaptor.AdaptorException: com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Unterminated object at line 1 column 18 path $.t
at org.thingsboard.server.transport.mqtt.adaptors.JsonMqttAdaptor.convertToPostTelemetry(JsonMqttAdaptor.java:67)
at org.thingsboard.server.transport.mqtt.MqttTransportHandler.processDevicePublish(MqttTransportHandler.java:343)
at org.thingsboard.server.transport.mqtt.MqttTransportHandler.processPublish(MqttTransportHandler.java:298)
at org.thingsboard.server.transport.mqtt.MqttTransportHandler.processRegularSessionMsg(MqttTransportHandler.java:255)
at org.thingsboard.server.transport.mqtt.MqttTransportHandler.lambda$processMsgQueue$0(MqttTransportHandler.java:249)
at org.thingsboard.server.transport.mqtt.session.DeviceSessionCtx.tryProcessQueuedMsgs(DeviceSessionCtx.java:181)
at org.thingsboard.server.transport.mqtt.MqttTransportHandler.processMsgQueue(MqttTransportHandler.java:249)
at org.thingsboard.server.transport.mqtt.MqttTransportHandler.enqueueRegularSessionMsg(MqttTransportHandler.java:241)
at org.thingsboard.server.transport.mqtt.MqttTransportHandler.processMqttMsg(MqttTransportHandler.java:183)
at org.thingsboard.server.transport.mqtt.MqttTransportHandler.channelRead(MqttTransportHandler.java:156)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:324)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:296)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:719)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:655)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:581)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Unterminated object at line 1 column 18 path $.t
at com.google.gson.internal.Streams.parse(Streams.java:60)
at com.google.gson.JsonParser.parse(JsonParser.java:84)
at com.google.gson.JsonParser.parse(JsonParser.java:59)
at com.google.gson.JsonParser.parse(JsonParser.java:45)
at org.thingsboard.server.transport.mqtt.adaptors.JsonMqttAdaptor.convertToPostTelemetry(JsonMqttAdaptor.java:65)
... 30 common frames omitted
Caused by: com.google.gson.stream.MalformedJsonException: Unterminated object at line 1 column 18 path $.t
at com.google.gson.stream.JsonReader.syntaxError(JsonReader.java:1567)
at com.google.gson.stream.JsonReader.doPeek(JsonReader.java:495)
at com.google.gson.stream.JsonReader.hasNext(JsonReader.java:418)
at com.google.gson.internal.bind.TypeAdapters$29.read(TypeAdapters.java:742)
at com.google.gson.internal.bind.TypeAdapters$29.read(TypeAdapters.java:718)
at com.google.gson.internal.Streams.parse(Streams.java:48)
... 34 common frames omitted
2021-11-08 23:39:25,183 [nioEventLoopGroup-4-5] INFO o.t.s.t.mqtt.MqttTransportHandler - [f5a4a965-8177-4daf-9a56-9197a55fab7d] Closing current session due to invalid publish msg [device/lre/readings][1]
2021-11-08 23:39:25,184 [nioEventLoopGroup-4-5] INFO o.t.s.t.mqtt.MqttTransportHandler - [f5a4a965-8177-4daf-9a56-9197a55fab7d] Client disconnected!
2021-11-08 23:39:28,533 [queue-scheduler-11-thread-1] INFO o.t.s.q.u.DefaultTbApiUsageClient - Reporting API usage statistics for 3 tenants and customers
2021-11-08 23:39:29,253 [sql-log-1-thread-1] INFO o.t.s.dao.sql.TbSqlBlockingQueue - Queue-0 [TS] queueSize [0] totalAdded [6] totalSaved [6] totalFailed [0]
2021-11-08 23:39:29,254 [sql-log-1-thread-1] INFO o.t.s.dao.sql.TbSqlBlockingQueue - Queue-2 [TS] queueSize [0] totalAdded [90] totalSaved [90] totalFailed [0]
2021-11-08 23:39:29,351 [sql-log-1-thread-1] INFO o.t.s.dao.sql.TbSqlBlockingQueue - Queue-0 [TS Latest] queueSize [0] totalAdded [6] totalSaved [6] totalFailed [0]
2021-11-08 23:39:29,351 [sql-log-1-thread-1] INFO o.t.s.dao.sql.TbSqlBlockingQueue - Queue-2 [TS Latest] queueSize [0] totalAdded [90] totalSaved [90] totalFailed [0]
2021-11-08 23:39:29,530 [TB-Scheduling-6] INFO o.t.server.actors.ActorSystemContext - Rule Engine JS Invoke Stats: requests [6] responses [3] failures [0]
2021-11-08 23:39:29,612 [TB-Scheduling-5] INFO o.t.s.s.s.DefaultTbEntityDataSubscriptionService - Stats: regularQueryInvocationCnt = [1], regularQueryInvocationTime = [2], dynamicQueryCnt = [3] dynamicQueryInvocationCnt = [1], dynamicQueryInvocationTime = [2], alarmQueryInvocationCnt = [0], alarmQueryInvocationTime = [0]
On both Integration Studio 8.0.0 and Enterprise Integrator 6.6.0 i'm having an error when using a datamapper mediator to convert a JSON payload to another JSON payload.
The error has the base64 conversion of the datamapper .dmc file.
A full log mediator placed before the datamapper shows that I received a correct json response
TID: [-1234] [] [2021-09-08 13:43:01,076] DEBUG {org.apache.synapse.mediators.builtin.LogMediator} - Start : Log mediator
TID: [-1234] [] [2021-09-08 13:43:01,076] INFO {org.apache.synapse.mediators.builtin.LogMediator} - To: http://www.w3.org/2005/08/addressing/anonymous, WSAction: , SOAPAction: , MessageID: urn:uuid:8f511c89-c468-4f24-a067-d0f476a63fb7, Direction: response, Payload: (the whole json response)
TID: [-1234] [] [2021-09-08 13:43:01,077] DEBUG {org.apache.synapse.mediators.builtin.LogMediator} - End : Log mediator
The full error is
TID: [-1234] [] [2021-09-08 13:43:01,077] DEBUG {org.apache.synapse.mediators.base.SequenceMediator} - Building message. Sequence <SequenceMediator> is content aware
TID: [-1234] [] [2021-09-08 13:43:01,078] DEBUG {org.apache.synapse.transport.passthru.util.RelayUtils} - Content Type is application/json; charset=UTF-8
TID: [-1234] [] [2021-09-08 13:43:01,078] INFO {org.wso2.carbon.mediation.dependency.mgt.DependencyTracker} - Local entry : gov:datamappers/ricercaUoDataMapper.dmc was added to the Synapse configuration successfully
TID: [-1234] [] [2021-09-08 13:43:01,082] INFO {org.wso2.carbon.mediation.dependency.mgt.DependencyTracker} - Local entry : gov:datamappers/ricercaUoDataMapper_inputSchema.json was added to the Synapse configuration successfully
TID: [-1234] [] [2021-09-08 13:43:01,084] INFO {org.wso2.carbon.mediation.dependency.mgt.DependencyTracker} - Local entry : gov:datamappers/ricercaUoDataMapper_outputSchema.json was added to the Synapse configuration successfully
TID: [-1234] [] [2021-09-08 13:43:01,100] DEBUG {org.apache.synapse.config.SynapsePropertiesLoader} - Retrieving synapse properties from the cache
TID: [-1234] [] [2021-09-08 13:43:01,102] DEBUG {org.apache.synapse.commons.json.JsonReadOnlyStream} - #close
TID: [-1234] [] [2021-09-08 13:43:01,580] ERROR {org.wso2.carbon.mediator.datamapper.DataMapperMediator} - DataMapper mediator : mapping failed Error while reading input stream. Script engine unable to execute the script javax.script.ScriptException: ReferenceError: "bWFwX1Nfcm9vdF9TX3Jvb3QgPSBmdW5jdGlvbigpeyAKdmFyIG91dHB1dHJvb3Q9e307Cgp2YXIgY291bnRfaV9VT18xMDI0NjFhMl9jMzVjXzQ2MTdfYTUwYV82MTFkNWNiOGE1ZGUgPSAwOwpvdXRwdXRyb290ID0gIHt9OwpvdXRwdXRyb290LmNvdW50ID0gaW5wdXRyb290LmZvdW5kVU9zLmNvdW50OwpvdXRwdXRyb290LnJlc3VsdCA9ICB7fTsKb3V0cHV0cm9vdC5yZXN1bHQudW9zID0gIFtdOwoKZm9yKGlfVU9fMTAyNDYxYTJfYzM1Y180NjE3X2E1MGFfNjExZDVjYjhhNWRlIGluIGlucHV0cm9vdC5mb3VuZFVPcy5pbnRlcm5hbFVPcy5VT3MuVU8pewpvdXRwdXRyb290LnJlc3VsdC51b3NbY291bnRfaV9VT18xMDI0NjFhMl9jMzVjXzQ2MTdfYTUwYV82MTFkNWNiOGE1ZGVdID0gIHt9OwpvdXRwdXRyb290LnJlc3VsdC51b3NbY291bnRfaV9VT18xMDI0NjFhMl9jMzVjXzQ2MTdfYTUwYV82MTFkNWNiOGE1ZGVdLmlkID0gTnVtYmVyKGlucHV0cm9vdC5mb3VuZFVPcy5pbnRlcm5hbFVPcy5VT3MuVU9baV9VT18xMDI0NjFhMl9jMz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NfNDYxN19hNTBhXzYxMWQ1Y2I4YTVkZV0uZGF0YV9pbml6aW87Cm91dHB1dHJvb3QucmVzdWx0LnVvc1tjb3VudF9pX1VPXzEwMjQ2MWEyX2MzNWNfNDYxN19hNTBhXzYxMWQ1Y2I4YTVkZV0uZGF0YV9maW5lID0gaW5wdXRyb290LmZvdW5kVU9zLmludGVybmFsVU9zLlVPcy5VT1tpX1VPXzEwMjQ2MWEyX2MzNWNfNDYxN19hNTBhXzYxMWQ1Y2I4YTVkZV0uZGF0YV9maW5lOwoKY291bnRfaV9VT18xMDI0NjFhMl9jMzVjXzQ2MTdfYTUwYV82MTFkNWNiOGE1ZGUrKzsKfQpyZXR1cm4gb3V0cHV0cm9vdDsKfTsKCgoKCgoKCgoKCgoKCgoK" is not defined in <eval> at line number 1
at org.wso2.carbon.mediator.datamapper.engine.input.readers.JSONInputReader.read(JSONInputReader.java:62)
at org.wso2.carbon.mediator.datamapper.engine.input.InputBuilder.buildInputModel(InputBuilder.java:59)
at org.wso2.carbon.mediator.datamapper.engine.core.mapper.MappingHandler.doMap(MappingHandler.java:90)
at org.wso2.carbon.mediator.datamapper.DataMapperMediator.transform(DataMapperMediator.java:390)
at org.wso2.carbon.mediator.datamapper.DataMapperMediator.mediate(DataMapperMediator.java:301)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:109)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:71)
at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:158)
at org.apache.synapse.rest.Resource.process(Resource.java:331)
at org.apache.synapse.rest.API.process(API.java:380)
at org.apache.synapse.rest.RESTRequestHandler.apiProcessNonDefaultStrategy(RESTRequestHandler.java:149)
at org.apache.synapse.rest.RESTRequestHandler.dispatchToAPI(RESTRequestHandler.java:95)
at org.apache.synapse.rest.RESTRequestHandler.process(RESTRequestHandler.java:58)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:327)
at org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:578)
at org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:195)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:284)
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)
TID: [-1234] [] [2021-09-08 13:43:02,307] WARN {org.apache.synapse.FaultHandler} - ERROR_CODE : 0
TID: [-1234] [] [2021-09-08 13:43:02,308] WARN {org.apache.synapse.FaultHandler} - ERROR_MESSAGE : DataMapper mediator : mapping failed
TID: [-1234] [] [2021-09-08 13:43:02,308] WARN {org.apache.synapse.FaultHandler} - ERROR_DETAIL : org.apache.synapse.SynapseException: DataMapper mediator : mapping failed
at org.apache.synapse.mediators.AbstractMediator.handleException(AbstractMediator.java:367)
at org.wso2.carbon.mediator.datamapper.DataMapperMediator.transform(DataMapperMediator.java:444)
at org.wso2.carbon.mediator.datamapper.DataMapperMediator.mediate(DataMapperMediator.java:301)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:109)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:71)
at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:158)
at org.apache.synapse.rest.Resource.process(Resource.java:331)
at org.apache.synapse.rest.API.process(API.java:380)
at org.apache.synapse.rest.RESTRequestHandler.apiProcessNonDefaultStrategy(RESTRequestHandler.java:149)
at org.apache.synapse.rest.RESTRequestHandler.dispatchToAPI(RESTRequestHandler.java:95)
at org.apache.synapse.rest.RESTRequestHandler.process(RESTRequestHandler.java:58)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:327)
at org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:578)
at org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:195)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:284)
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)
Caused by: Error while reading input stream. Script engine unable to execute the script javax.script.ScriptException: ReferenceError: "bWFwX1Nfcm9vdF9TX3Jvb3QgPSBmdW5jdGlvbigpeyAKdmFyIG91dHB1dHJvb3Q9e307Cgp2YXIgY291bnRfaV9VT18xMDI0NjFhMl9jMzVjXzQ2MTdfYTUwYV82MTFkNWNiOGE1ZGUgPSAwOwpvdXRwdXRyb290ID0gIHt9OwpvdXRwdXRyb290LmNvdW50ID0gaW5wdXRyb290LmZvdW5kVU9zLmNvdW50OwpvdXRwdXRyb290LnJlc3VsdCA9ICB7fTsKb3V0cHV0cm9vdC5yZXN1bHQudW9zID0gIFtdOwoKZm9yKGlfVU9fMTAyNDYxYTJfYzM1Y180NjE3X2E1MGFfNjExZDVjYjhhNWRlIGluIGlucHV0cm9vdC5mb3VuZFVPcy5pbnRlcm5hbFVPcy5VT3MuVU8pewpvdXRwdXRyb290LnJlc3VsdC51b3NbY291bnRfaV9VT18xMDI0NjFhMl9jMzVjXzQ2MTdfYTUwYV82MTFkNWNiOGE1ZGVdID0gIHt9OwpvdXRwdXRyb290LnJlc3VsdC51b3NbY291bnRfaV9VT18xMDI0NjFhMl9jMzVjXzQ2MTdfYTUwYV82MTFkNWNiOGE1ZGVdLmlkID0gTnVtYmVy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gaW5wdXRyb290LmZvdW5kVU9zLmludGVybmFsVU9zLlVPcy5VT1tpX1VPXzEwMjQ2MWEyX2MzNWNfNDYxN19hNTBhXzYxMWQ1Y2I4YTVkZV0uZGF0YV9pbml6aW87Cm91dHB1dHJvb3QucmVzdWx0LnVvc1tjb3VudF9pX1VPXzEwMjQ2MWEyX2MzNWNfNDYxN19hNTBhXzYxMWQ1Y2I4YTVkZV0uZGF0YV9maW5lID0gaW5wdXRyb290LmZvdW5kVU9zLmludGVybmFsVU9zLlVPcy5VT1tpX1VPXzEwMjQ2MWEyX2MzNWNfNDYxN19hNTBhXzYxMWQ1Y2I4YTVkZV0uZGF0YV9maW5lOwoKY291bnRfaV9VT18xMDI0NjFhMl9jMzVjXzQ2MTdfYTUwYV82MTFkNWNiOGE1ZGUrKzsKfQpyZXR1cm4gb3V0cHV0cm9vdDsKfTsKCgoKCgoKCgoKCgoKCgoK" is not defined in <eval> at line number 1
at org.wso2.carbon.mediator.datamapper.engine.input.readers.JSONInputReader.read(JSONInputReader.java:62)
at org.wso2.carbon.mediator.datamapper.engine.input.InputBuilder.buildInputModel(InputBuilder.java:59)
at org.wso2.carbon.mediator.datamapper.engine.core.mapper.MappingHandler.doMap(MappingHandler.java:90)
at org.wso2.carbon.mediator.datamapper.DataMapperMediator.transform(DataMapperMediator.java:390)
... 18 more
TID: [-1234] [] [2021-09-08 13:43:02,309] WARN {org.apache.synapse.FaultHandler} - ERROR_EXCEPTION : org.apache.synapse.SynapseException: DataMapper mediator : mapping failed
TID: [-1234] [] [2021-09-08 13:43:02,309] WARN {org.apache.synapse.FaultHandler} - FaultHandler : org.apache.synapse.mediators.MediatorFaultHandler#11271f01
TID: [-1234] [] [2021-09-08 13:43:02,309] WARN {org.apache.synapse.mediators.MediatorFaultHandler} - Executing fault handler mediator : org.apache.synapse.mediators.base.SequenceMediator
TID: [-1234] [] [2021-09-08 13:43:02,309] DEBUG {org.apache.synapse.mediators.base.SequenceMediator} - Start : Sequence <anonymous>
TID: [-1234] [] [2021-09-08 13:43:02,309] DEBUG {org.apache.synapse.mediators.base.SequenceMediator} - Sequence <SequenceMediator> :: mediate()
TID: [-1234] [] [2021-09-08 13:43:02,309] DEBUG {org.apache.synapse.mediators.base.SequenceMediator} - Mediation started from mediator position : 0
TID: [-1234] [] [2021-09-08 13:43:02,310] DEBUG {org.apache.synapse.mediators.base.SequenceMediator} - End : Sequence <anonymous>
The whole interaction happens with a Accept: application/json header, but it happens even with a xml -> json datamapping.
If the payload is json why are you using xml->json data mapping? should it not be json->json data mapping?
Accept:application/json header means it would be json so ideally you should use json->json mapping
Hi guys can you help me out with my WSO2 - ESB problem.
I am experiencing the following error in our UAT environment but not in my SIT environment. I need a hint on why this is happening so I can change my CAR file or add the proper configuration to our server if needed.
For some reason when the Client doing a Post request I am experiencing a timeout error. Upon checking the logs I see that their is an error that states that the Payload could not be written as JSON. This does not happen in a GET request so I am at a lost. I can also confirm that the request is being sent in the back end using either GET/POST.
Please note that the following servers does not exist so app03/app04 so failure to connect to those server is expected (We only have 2 UAT servers but 4 in our PRD environment).
What I do not understand is why this only happens in Post request and if i need to modify my code or set something in the WSO2-ESB server.
For any clarification or additional information please do not hesitate to ask.
Thanks for your help
Carbon Logs
TID: [-1234] [] [2017-09-22 09:12:03,608] INFO {org.apache.synapse.mediators.builtin.LogMediator} - Request: Target URL = /services/XXXX-ws_PS/payments/validate, Client IP = 172.22.222.156, Request ID = urn:uuid:0df0d876-6093-4479-9537-70bbbdf4d649 {org.apache.synapse.mediators.builtin.LogMediator}
TID: [-1234] [] [2017-09-22 09:12:04,029] INFO {org.apache.synapse.mediators.builtin.LogMediator} - Response: To = /services/XXXX-ws_PS/payments/validate, IP = 172.22.222.156, RequestID = urn:uuid:0df0d876-6093-4479-9537-70bbbdf4d649 {org.apache.synapse.mediators.builtin.LogMediator}
TID: [-1234] [] [2017-09-22 09:12:04,029] ERROR {org.apache.synapse.commons.json.JsonUtil} - #writeAsJson. Payload could not be written as JSON. MessageID: urn:uuid:3b69a0e3-f6b3-4e49-8d14-23d7596c2366 {org.apache.synapse.commons.json.JsonUtil}
TID: [-1234] [] [2017-09-22 09:12:04,029] ERROR {org.apache.synapse.transport.passthru.PassThroughHttpSSLSender} - Failed to submit the response {org.apache.synapse.transport.passthru.PassThroughHttpSSLSender}
org.apache.axis2.AxisFault: Payload could not be written as JSON.
at org.apache.synapse.commons.json.JsonUtil.writeAsJson(JsonUtil.java:263)
at org.apache.synapse.commons.json.JsonStreamFormatter.writeTo(JsonStreamFormatter.java:61)
at org.apache.synapse.transport.passthru.PassThroughHttpSender.submitResponse(PassThroughHttpSender.java:555)
at org.apache.synapse.transport.passthru.PassThroughHttpSender.invoke(PassThroughHttpSender.java:264)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442)
at org.apache.synapse.core.axis2.Axis2Sender.sendBack(Axis2Sender.java:222)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2SynapseEnvironment.java:531)
at org.apache.synapse.mediators.builtin.SendMediator.mediate(SendMediator.java:118)
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.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:337)
at org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:554)
at org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:188)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:261)
at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
TID: [-1234] [] [2017-09-22 09:12:04,042] ERROR {org.apache.synapse.core.axis2.Axis2Sender} - <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body/></soapenv:Envelope> Unexpected error sending message back {org.apache.synapse.core.axis2.Axis2Sender}
org.apache.axis2.AxisFault: Failed to submit the response
at org.apache.synapse.transport.passthru.PassThroughHttpSender.handleException(PassThroughHttpSender.java:613)
at org.apache.synapse.transport.passthru.PassThroughHttpSender.invoke(PassThroughHttpSender.java:266)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442)
at org.apache.synapse.core.axis2.Axis2Sender.sendBack(Axis2Sender.java:222)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2SynapseEnvironment.java:531)
at org.apache.synapse.mediators.builtin.SendMediator.mediate(SendMediator.java:118)
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.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:337)
at org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:554)
at org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:188)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:261)
at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.axis2.AxisFault: Payload could not be written as JSON.
at org.apache.synapse.commons.json.JsonUtil.writeAsJson(JsonUtil.java:263)
at org.apache.synapse.commons.json.JsonStreamFormatter.writeTo(JsonStreamFormatter.java:61)
at org.apache.synapse.transport.passthru.PassThroughHttpSender.submitResponse(PassThroughHttpSender.java:555)
at org.apache.synapse.transport.passthru.PassThroughHttpSender.invoke(PassThroughHttpSender.java:264)
... 16 more
TID: [-1234] [] [2017-09-22 09:12:04,047] ERROR {org.apache.synapse.mediators.builtin.LogMediator} - Error: To = /services/XXXX-ws_PS/payments/validate, IP = 172.22.222.156, RequestID = urn:uuid:0df0d876-6093-4479-9537-70bbbdf4d649 {org.apache.synapse.mediators.builtin.LogMediator}
TID: [-1234] [] [2017-09-22 09:12:20,541] INFO {org.apache.synapse.mediators.builtin.LogMediator} - Request: Target URL = /services/XXXX-ws_PS/institutions/details/00239, Client IP = 172.22.222.156, Request ID = urn:uuid:e5aca458-03a6-41b3-81b5-d409c5eaa66a {org.apache.synapse.mediators.builtin.LogMediator}
TID: [-1] [] [2017-09-22 09:12:20,542] WARN {org.apache.synapse.transport.passthru.ConnectCallback} - Connection refused or failed for : app03.XXXX.uat.XXX.com.ph:50209 {org.apache.synapse.transport.passthru.ConnectCallback}
TID: [-1234] [] [2017-09-22 09:12:20,542] WARN {org.apache.synapse.endpoints.EndpointContext} - Endpoint : AnonymousEndpoint with address https://app03.XXXX.uat.XXX.com.ph:50209/XXXX-ws/ will be marked SUSPENDED as it failed {org.apache.synapse.endpoints.EndpointContext}
TID: [-1234] [] [2017-09-22 09:12:20,542] WARN {org.apache.synapse.endpoints.EndpointContext} - Suspending endpoint : AnonymousEndpoint with address https://app03.XXXX.uat.XXX.com.ph:50209/XXXX-ws/ - last suspend duration was : 300000ms and current suspend duration is : 300000ms - Next retry after : Fri Sep 22 09:17:20 PHT 2017 {org.apache.synapse.endpoints.EndpointContext}
TID: [-1234] [] [2017-09-22 09:12:20,542] WARN {org.apache.synapse.endpoints.LoadbalanceEndpoint} - Endpoint [XXXX-ws_LBEP] Detect a Failure in a child endpoint : AnonymousEndpoint {org.apache.synapse.endpoints.LoadbalanceEndpoint}
TID: [-1] [] [2017-09-22 09:12:20,545] WARN {org.apache.synapse.transport.passthru.ConnectCallback} - Connection refused or failed for : app04.XXXX.uat.XXX.com.ph:50209 {org.apache.synapse.transport.passthru.ConnectCallback}
TID: [-1234] [] [2017-09-22 09:12:20,545] WARN {org.apache.synapse.endpoints.EndpointContext} - Endpoint : AnonymousEndpoint with address https://app04.XXXX.uat.XXX.com.ph:50209/XXXX-ws/ will be marked SUSPENDED as it failed {org.apache.synapse.endpoints.EndpointContext}
TID: [-1234] [] [2017-09-22 09:12:20,546] WARN {org.apache.synapse.endpoints.EndpointContext} - Suspending endpoint : AnonymousEndpoint with address https://app04.XXXX.uat.XXX.com.ph:50209/XXXX-ws/ - last suspend duration was : 300000ms and current suspend duration is : 300000ms - Next retry after : Fri Sep 22 09:17:20 PHT 2017 {org.apache.synapse.endpoints.EndpointContext}
TID: [-1234] [] [2017-09-22 09:12:20,546] WARN {org.apache.synapse.endpoints.LoadbalanceEndpoint} - Endpoint [XXXX-ws_LBEP] Detect a Failure in a child endpoint : AnonymousEndpoint {org.apache.synapse.endpoints.LoadbalanceEndpoint}
TID: [-1234] [] [2017-09-22 09:12:20,785] INFO {org.apache.synapse.mediators.builtin.LogMediator} - Response: To = /services/XXXX-ws_PS/institutions/details/00239, IP = 172.22.222.156, RequestID = urn:uuid:e5aca458-03a6-41b3-81b5-d409c5eaa66a {org.apache.synapse.mediators.builtin.LogMediator}
TID: [-1] [] [2017-09-22 09:15:03,802] WARN {org.apache.synapse.transport.passthru.SourceHandler} - Connection time out after request is read: http-incoming-49847 Socket Timeout : 180000 Remote Address : h02610a24.ho.ad.XXX/172.22.222.156:58409 {org.apache.synapse.transport.passthru.SourceHandler}
TID: [-1234] [] [2017-09-22 09:30:09,430] INFO {org.apache.synapse.mediators.builtin.LogMediator} - To: /, MessageID: urn:uuid:d233e911-f717-4d42-a24c-eca0e7c32768, Direction: request, Envelope: <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><soapenv:Body/></soapenv:Envelope> {org.apache.synapse.mediators.builtin.LogMediator}
TID: [-1] [] [2017-09-22 09:47:24,248] ERROR {org.apache.synapse.transport.passthru.SourceHandler} - I/O error: Unrecognized SSL message, plaintext connection? {org.apache.synapse.transport.passthru.SourceHandler}
javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
at sun.security.ssl.EngineInputRecord.bytesInCompletePacket(EngineInputRecord.java:156)
at sun.security.ssl.SSLEngineImpl.readNetRecord(SSLEngineImpl.java:868)
at sun.security.ssl.SSLEngineImpl.unwrap(SSLEngineImpl.java:781)
at javax.net.ssl.SSLEngine.unwrap(SSLEngine.java:624)
at org.apache.http.nio.reactor.ssl.SSLIOSession.doUnwrap(SSLIOSession.java:245)
at org.apache.http.nio.reactor.ssl.SSLIOSession.doHandshake(SSLIOSession.java:280)
at org.apache.http.nio.reactor.ssl.SSLIOSession.isAppInputReady(SSLIOSession.java:410)
at org.apache.http.impl.nio.reactor.AbstractIODispatch.inputReady(AbstractIODispatch.java:119)
at org.apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.java:159)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:338)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:316)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:277)
at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:105)
at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:586)
at java.lang.Thread.run(Thread.java:745)
TID: [-1234] [] [2017-09-22 10:00:14,936] INFO {org.apache.synapse.mediators.builtin.LogMediator} - To: /, MessageID: urn:uuid:d5e87ee5-d83b-4ded-8110-b64dd01ce08f, Direction: request, Envelope: <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><soapenv:Body/></soapenv:Envelope> {org.apache.synapse.mediators.builtin.LogMediator}
Proxy Code
<?xml version="1.0" encoding="UTF-8"?>
<proxy name="XXXX-ws_PS" startOnLoad="true" transports="https http" xmlns="http://ws.apache.org/ns/synapse">
<target>
<inSequence>
<property description="targetURL" expression="get-property('To')" name="targetURL" scope="default" type="STRING"/>
<property description="clientIP" expression="get-property('axis2','REMOTE_ADDR')" name="clientIP" scope="default" type="STRING"/>
<property description="requestID" expression="get-property('MessageID')" name="requestID" scope="default" type="STRING"/>
<log description="requestLog" level="custom">
<property expression="get-property('targetURL')" name="Request: Target URL"/>
<property expression="get-property('clientIP')" name="Client IP"/>
<property expression="get-property('requestID')" name="Request ID"/>
</log>
<send description="">
<endpoint key="XXXX-ws_LBEP"/>
</send>
</inSequence>
<outSequence>
<log description="resposeLog" level="custom">
<property expression="get-property('targetURL')" name="Response: To"/>
<property expression="get-property('clientIP')" name="IP"/>
<property expression="get-property('requestID')" name="RequestID"/>
</log>
<send/>
</outSequence>
<faultSequence>
<log category="ERROR" description="errorLog" level="custom">
<property expression="get-property('targetURL')" name="Error: To"/>
<property expression="get-property('clientIP')" name="IP"/>
<property expression="get-property('requestID')" name="RequestID"/>
</log>
</faultSequence>
</target>
</proxy>
Endpoint Code
<?xml version="1.0" encoding="UTF-8"?>
<endpoint name="XXXX-ws_LBEP" xmlns="http://ws.apache.org/ns/synapse">
<loadbalance algorithm="org.apache.synapse.endpoints.algorithms.RoundRobin">
<endpoint>
<http uri-template="https://app01.XXXX.uat.XXX.com.ph:50209/XXXX-ws/">
<timeout>
<duration>600000</duration>
<responseAction>fault</responseAction>
</timeout>
<suspendOnFailure>
<initialDuration>300000</initialDuration>
<progressionFactor>1.0</progressionFactor>
<maximumDuration>1800000</maximumDuration>
</suspendOnFailure>
<markForSuspension>
<retriesBeforeSuspension>3</retriesBeforeSuspension>
<retryDelay>30000</retryDelay>
</markForSuspension>
</http>
</endpoint>
<endpoint>
<http uri-template="https://app02.XXXX.uat.XXX.com.ph:50209/XXXX-ws/">
<timeout>
<duration>600000</duration>
<responseAction>fault</responseAction>
</timeout>
<suspendOnFailure>
<initialDuration>300000</initialDuration>
<progressionFactor>1.0</progressionFactor>
<maximumDuration>1800000</maximumDuration>
</suspendOnFailure>
<markForSuspension>
<retriesBeforeSuspension>3</retriesBeforeSuspension>
<retryDelay>30000</retryDelay>
</markForSuspension>
</http>
</endpoint>
<endpoint>
<http uri-template="https://app03.XXXX.uat.XXX.com.ph:50209/XXXX-ws/">
<timeout>
<duration>600000</duration>
<responseAction>fault</responseAction>
</timeout>
<suspendOnFailure>
<initialDuration>300000</initialDuration>
<progressionFactor>1.0</progressionFactor>
<maximumDuration>1800000</maximumDuration>
</suspendOnFailure>
<markForSuspension>
<retriesBeforeSuspension>3</retriesBeforeSuspension>
<retryDelay>30000</retryDelay>
</markForSuspension>
</http>
</endpoint>
<endpoint>
<http uri-template="https://app04.XXXX.uat.XXX.com.ph:50209/XXXX-ws/">
<timeout>
<duration>600000</duration>
<responseAction>fault</responseAction>
</timeout>
<suspendOnFailure>
<initialDuration>300000</initialDuration>
<progressionFactor>1.0</progressionFactor>
<maximumDuration>1800000</maximumDuration>
</suspendOnFailure>
<markForSuspension>
<retriesBeforeSuspension>3</retriesBeforeSuspension>
<retryDelay>30000</retryDelay>
</markForSuspension>
</http>
</endpoint>
</loadbalance>
</endpoint>
The use of 'targetURL' is not correct. Instead define the endpoint in the <send> So something like
<send>
<endpoint key="XXXX-ws_LBEP" />
</send>
WSO2 installed on Linux with Oracle-RAC. Followed all steps (I think!)
When starting it for the first time, i don't got any error:
TID: [-1234] [] [2017-04-25 15:28:17,964] INFO {org.wso2.carbon.analytics.spark.core.internal.SparkAnalyticsExecutor} - Started Spark CLIENT in the cluster pointing to MASTER local with the application name : CarbonAnalytics and UI port : 4040 {org.wso2.carbon.analytics.spark.core.internal.SparkAnalyticsExecutor}
TID: [-1234] [] [2017-04-25 15:28:17,987] INFO {org.wso2.carbon.ml.core.internal.MLCoreDS} - H2O Server will start in local mode. {org.wso2.carbon.ml.core.internal.MLCoreDS}
TID: [-1234] [] [2017-04-25 15:28:18,655] INFO {org.wso2.carbon.ml.core.impl.H2OServer} - H2o Server has started. {org.wso2.carbon.ml.core.impl.H2OServer}
TID: [-1234] [] [2017-04-25 15:28:18,659] INFO {org.wso2.carbon.ml.core.internal.MLCoreDS} - Machine Learner Wizard URL : https://172.17.9.67:9443/ml {org.wso2.carbon.ml.core.internal.MLCoreDS}
TID: [-1234] [] [2017-04-25 15:28:18,660] INFO {org.wso2.carbon.ml.core.internal.MLCoreDS} - ML core bundle activated
TID: [-1234] [] [2017-04-25 15:28:19,229] INFO {org.wso2.carbon.ntask.core.impl.AbstractQuartzTaskManager} - Task scheduled: [-1234][ANALYTICS_SPARK_EVENTING][STORE_EVENT_ROUTER_TASK] {org.wso2.carbon.ntask.core.impl.AbstractQuartzTaskManager}
TID: [-1234] [] [2017-04-25 15:28:19,315] INFO successfully. {org.wso2.carbon.ml.core.internal.MLCoreDS}{org.wso2.carbon.core.init.JMXServerManager} - JMX Service URL : service:jmx:rmi://localhost:11111/jndi/rmi://localhost:9999/jmxrmi {org.wso2.carbon.core.init.JMXServerManager}
TID: [-1234] [] [2017-04-25 15:28:19,358] INFO {org.wso2.carbon.core.internal.StartupFinalizerServiceComponent} - Server : WSO2 Data Analytics Server-3.1.0 {org.wso2.carbon.core.internal.StartupFinalizerServiceComponent}
TID: [-1234] [] [2017-04-25 15:28:19,360] INFO {org.wso2.carbon.core.internal.StartupFinalizerServiceComponent} - WSO2 Carbon started in 40 sec {org.wso2.carbon.core.internal.StartupFinalizerServiceComponent}
TID: [-1234] [] [2017-04-25 15:28:19,983] INFO {org.wso2.carbon.ui.internal.CarbonUIServiceComponent} - Mgt Console URL : https://172.17.9.67:9443/carbon/ {org.wso2.carbon.ui.internal.CarbonUIServiceComponent}
TID: [-1] [] [2017-04-25 15:28:45,332] INFO {org.wso2.carbon.event.processor.manager.core.internal.CarbonEventManagementService} - Starting polling event receivers {org.wso2.carbon.event.processor.manager.core.internal.CarbonEventManagementService}
But I'm not able to run console, nothing showed when loading http url :-(
Also trying 172.17.9.67:9763/carbon/ after deleting comment on AllowHttp label
The situation is that I have a fairly simple BPEL process that invokes a service. I want to access the response message elements and assign then to another service (or even to the result of the BPEL process itself to return to the client). The issue I am having is that the imported wsdl for the service to invoke has a namespace declaration in it e.g. ldap and all the imported xsd elements for that wsdl also have the same ldap namespace declared.
<definitions
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:ldap="http://webservices.hrldaplookup.ecis.police.uk/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/"
targetNamespace="http://webservices.hrldaplookup.ecis.police.uk/" name="LDAPLookupServiceImpl">
This is then imported into my BPEL process, again using the ldap namespace.
<bpel:process name="HRLDAPProces"
targetNamespace="http://ldap.ecis.police.uk/Person/process"
suppressJoinFailure="yes"
xmlns:tns="http://ldap.ecis.police.uk/Person/process"
xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
xmlns:ldap="http://webservices.hrldaplookup.ecis.police.uk/" xmlns:ns1="http://www.w3.org/2001/XMLSchema" xmlns:ns0="http://uk.police.ecis.police.uk/athena/services/ConstrainedValueService" xmlns:ns="http://webservices.cvmanagement.athena.ecis.police.uk/">
<!-- Import the client WSDL -->
<bpel:import namespace="http://webservices.cvmanagement.athena.ecis.police.uk/" location="ConstrainedValueService.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"></bpel:import>
<bpel:import namespace="http://uk.police.ecis.police.uk/athena/services/ConstrainedValueService" location="ConstrainedValueService_1.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"></bpel:import>
<bpel:import namespace="http://webservices.hrldaplookup.ecis.police.uk/" location="LDAPLookupServiceImpl.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"></bpel:import>
<bpel:import location="HRLDAPProcesArtifacts.wsdl" namespace="http://ldap.ecis.police.uk/Person/process"
importType="http://schemas.xmlsoap.org/wsdl/" />
When the service is invoked the response message has its own arbitrary namespaces assigned to the elements.
<getPersonnelResponse xmlns="http://webservices.hrldaplookup.ecis.police.uk/" xmlns:S="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns2="http://webservices.hrldaplookup.ecis.police.uk/" xmlns:ns3="http://ldap.ecis.police.uk/Person" xmlns:ns4="http://ecis.police.uk/ldaplookupservice"><personnelData xmlns="http://ecis.police.uk/ldaplookupservice"><detail xmlns="http://ldap.ecis.police.uk/Person">
When I want to assign variable parameter parts to something else I don't know which namespace to use.
$LDAPLookupResponse.parameters/ldap:personnelData/ldap:detail/item[1]
or
$LDAPLookupResponse.parameters/ns2:personnelData/ns4:detail/ns4:item[1]
Neither seem to work.
I'm sure I am just missing something simple, I just need pointing in the right direction.
Thanks
I'm using WSO2 Business Process server.
Full bpel process is here as requested by Thilini Ishaka - thanks!
and the log file for the error is
TID: [0] [BPS] [2013-01-21 16:22:47,750] DEBUG {org.wso2.carbon.bpel.messagetrace} - Service invocation completed: MEXId: hqejbhcnphr7xlanvn6p6t :: {http://webservices.hrldaplookup.ecis.police.uk/}LDAPLookupServiceImpl.getPersonnel {org.wso2.carbon.bpel.messagetrace}
TID: [0] [BPS] [2013-01-21 16:22:47,750] TRACE {org.wso2.carbon.bpel.messagetrace} - Response message: MEXId: hqejbhcnphr7xlanvn6p6t :: <?xml version='1.0' encoding='utf-8'?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"><S:Body><ns2:getPersonnelResponse xmlns:ns2="http://webservices.hrldaplookup.ecis.police.uk/" xmlns:ns4="http://ecis.police.uk/ldaplookupservice" xmlns:ns3="http://ldap.ecis.police.uk/Person"><ns4:personnelData><ns3:detail><ns3:item title="Managers Name">Bob NELSON PSE 56619</ns3:item><ns3:item title="Fullname">Conrad CRAMPTON PSE 52704</ns3:item><ns3:item title="Rank">PSE</ns3:item><ns3:item title="Collar Number">46052704</ns3:item><ns3:item title="Location">Headquarters</ns3:item><ns3:item title="Email address">conrad.crampton#kent.pnn.police.uk</ns3:item><ns3:item title="Last Name">Crampton</ns3:item><ns3:item title="Force Number">52704</ns3:item><ns3:item title="Managers Force Number">56619</ns3:item><ns3:item title="First Name">Conrad</ns3:item></ns3:detail></ns4:personnelData></ns2:getPersonnelResponse></S:Body></S:Envelope> {org.wso2.carbon.bpel.messagetrace}
TID: [0] [BPS] [2013-01-21 16:22:47,750] INFO {org.apache.ode.bpel.runtime.ASSIGN} - Assignment Fault: {http://docs.oasis-open.org/wsbpel/2.0/process/executable}selectionFailure,lineNo=322,faultExplanation={http://docs.oasis-open.org/wsbpel/2.0/process/executable}selectionFailure: R-Value expression "{OXPath10Expression $LDAPLookupResponse.parameters//ldap:item[#title = 'Rank']}" did not select any nodes. {org.apache.ode.bpel.runtime.ASSIGN}
TID: [0] [BPS] [2013-01-21 16:22:47,750] INFO {org.apache.ode.bpel.runtime.ASSIGN} - Assignment Fault: {http://docs.oasis-open.org/wsbpel/2.0/process/executable}selectionFailure,lineNo=322,faultExplanation={http://docs.oasis-open.org/wsbpel/2.0/process/executable}selectionFailure: R-Value expression "{OXPath10Expression $LDAPLookupResponse.parameters//ldap:item[#title = 'Rank']}" did not select any nodes. {org.apache.ode.bpel.runtime.ASSIGN}
TID: [0] [BPS] [2013-01-21 16:22:47,765] WARN {org.apache.ode.bpel.engine.BpelProcess} - Instance 3652 of {http://ldap.ecis.police.uk/Person/process}HRLDAPProces-31 has completed with fault: FaultData: [faultName={http://docs.oasis-open.org/wsbpel/2.0/process/executable}selectionFailure, faulType=null ({http://docs.oasis-open.org/wsbpel/2.0/process/executable}selectionFailure: R-Value expression "{OXPath10Expression $LDAPLookupResponse.parameters//ldap:item[#title = 'Rank']}" did not select any nodes.)] #322 {org.apache.ode.bpel.engine.BpelProcess}
TID: [0] [BPS] [2013-01-21 16:22:47,765] WARN {org.apache.ode.bpel.engine.BpelProcess} - Instance 3652 of {http://ldap.ecis.police.uk/Person/process}HRLDAPProces-31 has completed with fault: FaultData: [faultName={http://docs.oasis-open.org/wsbpel/2.0/process/executable}selectionFailure, faulType=null ({http://docs.oasis-open.org/wsbpel/2.0/process/executable}selectionFailure: R-Value expression "{OXPath10Expression $LDAPLookupResponse.parameters//ldap:item[#title = 'Rank']}" did not select any nodes.)] #322 {org.apache.ode.bpel.engine.BpelProcess}
TID: [0] [BPS] [2013-01-21 16:22:47,859] DEBUG {org.wso2.carbon.bpel.messagetrace} - Reply Sent: HRLDAPProces.{http://ldap.ecis.police.uk/Person/process}process {org.wso2.carbon.bpel.messagetrace}
TID: [0] [BPS] [2013-01-21 16:22:47,859] TRACE {org.wso2.carbon.bpel.messagetrace} - Response message: <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Header xmlns:wsa="http://www.w3.org/2005/08/addressing"><wsa:Action>http://ldap.ecis.police.uk/Person/process/HRLDAPProces/processResponse</wsa:Action><wsa:RelatesTo>http://identifiers.wso2.com/messageid/1358785364081/1999227541</wsa:RelatesTo></soapenv:Header><soapenv:Body><soapenv:Fault><faultcode>soapenv:Server</faultcode><faultstring xmlns:axis2ns2="http://docs.oasis-open.org/wsbpel/2.0/process/executable">axis2ns2:selectionFailure</faultstring><detail/></soapenv:Fault></soapenv:Body></soapenv:Envelope> {org.wso2.carbon.bpel.messagetrace}
TID: [0] [BPS] [2013-01-21 16:23:17,875] INFO {org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} - 'admin#carbon.super [-1234]' logged in at [2013-01-21 16:23:17,875+0000] {org.wso2.carbon.core.services.util.CarbonAuthenticationUtil}
The problem could be a namespace conflict in your process file.
Ideally it should work with;
$LDAPLookupResponse.parameters/ldap:personnelData/ldap:detail/item[1]
Can you please post the full bpel config and the full error log to check whether any namespace conflicts in the configuration.