In my current project using IBM Content Collector 4.0.1 SP5 with IBM Filenet P8 Content Engine 5.2.1 I need to collect files from file system and add them to a certain P8's object store.
This issue is related and comes after this one.
The WS response must conform to a custom metadata source called Esito which contains two metadata properties called resultCode and message.
The call seems correct but when getting the response I can read this message in the log and the file is not uploaded into P8 Content Manager:
2017-11-10T08:54:05.708Z FINEST [52] [ctms-native]
2017-11-10T08:54:05Z Trace2 0x15a4 Feeding JavaTask with 1 TaskInputs
ufibridge.dll:0x114ac [com.ibm.afu.ufibridge.logging.LoggingAdapter
log] [CTMS-task-15a4 45] 2017-11-10T08:54:05.708Z FINEST [53] Prepared
content to send to
webservice:{"e:\report\amm_000001_00001\2017\11\201711_amm_000001_00001_qxn_report_00.pdf":{"esito":"KO","fileName":"201711_AMM_000001_00001_QXN_REPORT_00(1)(2)(3).pdf"},"e:\report\amm_000001_00001\2017\11\201711_amm_000001_00001_qxn_report_00.xml":{"esito":"KO","fileName":"201711_AMM_000001_00001_QXN_REPORT_00(1)(2)(3).xml"}}
[com.ibm.afu.connector.webservice.task.InvokeServiceTask
getInputHttpEntity] [CTMS-task-15a4 45] 2017-11-10T08:54:05.708Z
FINEST [54] Configuration:
property name="message" type="STRING" displayName="message"
property name="resultCode" type="STRING" displayName="resultCode"
http://192.168.8.29:8080/sirfAcq/filenet/notificaArchiviazione
fileName esito
[com.ibm.afu.connector.webservice.task.InvokeServiceTask execute]
[CTMS-task-15a4 45] 2017-11-10T08:54:05.708Z FINEST [55] Invoking
webservice
URI:http://192.168.8.29:8080/sirfAcq/filenet/notificaArchiviazione
[com.ibm.afu.connector.webservice.task.InvokeServiceTask execute]
[CTMS-task-15a4 45] 2017-11-10T08:54:05.739Z FINEST [56] Invocation
took time (ms): 31
[com.ibm.afu.connector.webservice.task.InvokeServiceTask execute]
[CTMS-task-15a4 45] 2017-11-10T08:54:05.739Z SEVERE [57]
java.lang.String incompatible with com.ibm.json.java.JSONObject
[com.ibm.afu.connector.webservice.task.InvokeServiceTask execute]
[CTMS-task-15a4 45]Exception [java.lang.ClassCastException]:
java.lang.String incompatible with com.ibm.json.java.JSONObject
com.ibm.afu.connector.webservice.task.InvokeServiceTask.processResponse(InvokeServiceTask.java:140)
com.ibm.afu.connector.webservice.task.InvokeServiceTask.execute(InvokeServiceTask.java:112)
Could someone please explain me the correct format of the WS response JSON?
Could it be possible to use the One-Way mode instead of the Request-Response mode?
This issue seems to happen because of the incompatibility between the produce and the response body definition, based on the code snippet I had for your first post, your problem should be here:
produces = {MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_XML_VALUE })
#ResponseBody
String notificaArchiviazione(#RequestParam("fileName") String fileName, #RequestParam("esito") String esito)
The first parameter in produce is sat as JSONMediaType.APPLICATION_JSON_VALUE while in the response body you expect a string #RequestParam("fileName") String fileName
I'm trying to work through the [Elastisch tutorial] to create some test data in an ElasticSearch instance running on a VM.
I am running this code:
(ns content-rendering.core
(:require [clojurewerkz.elastisch.native :as esr]
[clojurewerkz.elastisch.native.index :as esi]))
(defn populate-test-data
[]
(let [conn (esr/connect "http://10.10.10.101:9200")]
(esi/create conn "test")))
(populate-test-data)
And I am seeing the following exception when I try and execute the code in the namespace using either Cider in emacs or from a Leiningen repl:
Caused by java.lang.UnsupportedOperationException
nth not supported on this type: Character
RT.java: 933 clojure.lang.RT/nthFrom
RT.java: 883 clojure.lang.RT/nth
native.clj: 266 clojurewerkz.elastisch.native/connect
core.clj: 7 content-rendering.core/populate-test-data
core.clj: 10 content-rendering.core/eval5078
If I require the Elastisch namespaces into a repl and run something like the following, it works fine:
(def conn (esr/connect "http://10.10.10.101:9200"))
(esi/create conn "test") ; {:acknowledged true}
Any ideas what I'm missing here?
There are two clients in elastisch, the REST one and the native one. You're using the native transport, but passing it the REST URL when it expects a seq of [host port] pairs.
You can switch to the REST client by changing esr/esi to their clojurewerkz.elastisch.rest pendants, or point the native one to the correct endpoints:
(esr/connect [["10.10.10.101" 9300]])
If your cluster name is not the default you have to set it using an additional options map:
(esr/connect [["10.10.10.101" 9300]] {"cluster.name" "my-es"})
we want wo use Jetty WebSocket Client API in OSGi (Equinox).
I have annotated the client socket implementation with org.eclipse.jetty.websocket.api.annotations.WebSocket but running into InvalidWebSocketException saying
MySocket is not a valid WebSocket object. Object must obey one of the following rules:
(1) class implements org.eclipse.jetty.websocket.api.WebSocketListener or
(2) class is annotated with #org.eclipse.jetty.websocket.api.annotations.WebSocket
If I run the service (which creates MySocket) as standalone from Eclipse it works fine.
As proposed in Establishing a WebSocket client connection in Jetty? I’m not using the actual version of Jetty but 9.2.0.RC0.
Edit: With Jetty 9.2.3.v20140905 I get the same error.
Maybe there is an interference with some other bundle? (we are using apache-cxf-dosgi-ri-1.5.0 so there are many bundles...)
com.basho.riak.client_1.4.4
com.eclipsesource.jaxrs.jersey-all_2.10.1
com.eclipsesource.jaxrs.publisher_3.0.0.201306171539
com.fasterxml.jackson.core.jackson-annotations_2.2.2
com.fasterxml.jackson.core.jackson-core_2.2.2
com.fasterxml.jackson.core.jackson-databind_2.2.2
com.googlecode.json-simple_1.1.1
com.rabbitmq.client_3.3.2
com.sun.jersey.client_1.18.1
com.sun.jersey.core_1.18.1
com.sun.jersey.jersey-server_1.18.1
cxf-dosgi-ri-discovery-distributed_1.6.0
cxf-dosgi-ri-discovery-distributed-zookeeper-server_1.6.0
cxf-dosgi-ri-discovery-local_1.6.0
cxf-dosgi-ri-dsw-cxf_1.6.0
cxf-dosgi-ri-osgi-api_1.6.0
cxf-dosgi-ri-topology-manager_1.6.0
jackson-core-asl_1.9.13
jackson-mapper-asl_1.9.13
javax.annotation-api_1.2.0
javax.mail_1.4.4
javax.mail_1.4.5
javax.servlet_2.5.0.v200806031605
javax.servlet-api_3.1.0
javax.websocket-api_1.1.0
javax.ws.rs-api_2.0.1
javax.xml_1.3.4.v201005080400
org.apache.aries.blueprint.api_1.0.0
org.apache.aries.blueprint.cm_1.0.1
org.apache.aries.blueprint.core_1.1.0
org.apache.aries.proxy.api_1.0.0
org.apache.aries.proxy.impl_1.0.1
org.apache.aries.util_1.1.0
org.apache.commons.beanutils_1.9.1
org.apache.commons.codec_1.3.0.v201101211617
org.apache.commons.codec_1.7.0
org.apache.commons.collections_3.2.1
org.apache.commons.el_1.0.0.v201101211617
org.apache.commons.io_2.4.0
org.apache.commons.lang3_3.3.2
org.apache.commons.logging_1.0.4.v201101211617
org.apache.commons.pool_1.6.0
org.apache.cxf.cxf-api_2.7.8
org.apache.cxf.cxf-rt-bindings-soap_2.7.8
org.apache.cxf.cxf-rt-bindings-xml_2.7.8
org.apache.cxf.cxf-rt-core_2.7.8
org.apache.cxf.cxf-rt-databinding-aegis_2.7.8
org.apache.cxf.cxf-rt-databinding-jaxb_2.7.8
org.apache.cxf.cxf-rt-frontend-jaxrs_2.7.8
org.apache.cxf.cxf-rt-frontend-jaxws_2.7.8
org.apache.cxf.cxf-rt-frontend-simple_2.7.8
org.apache.cxf.cxf-rt-management_2.7.8
org.apache.cxf.cxf-rt-rs-extension-providers_2.7.8
org.apache.cxf.cxf-rt-rs-extension-search_2.7.8
org.apache.cxf.cxf-rt-transports-http_2.7.8
org.apache.cxf.cxf-rt-transports-http-jetty_2.7.8
org.apache.cxf.karaf.cxf-karaf-commands_2.7.8
org.apache.felix.configadmin_1.6.0
org.apache.felix.fileinstall_3.2.6
org.apache.felix.gogo.command_0.8.0.v201108120515
org.apache.felix.gogo.runtime_0.8.0.v201108120515
org.apache.felix.gogo.shell_0.8.0.v201110170705
org.apache.felix.webconsole_3.1.8
org.apache.geronimo.specs.geronimo-annotation_1.0_spec_1.1.1
org.apache.geronimo.specs.geronimo-jta_1.1_spec_1.1.1
org.apache.geronimo.specs.geronimo-osgi-registry_1.1.0
org.apache.geronimo.specs.geronimo-servlet_2.5_spec_1.2.0
org.apache.hadoop.zookeeper_3.3.2
org.apache.httpcomponents.httpclient_4.3.3
org.apache.httpcomponents.httpcore_4.3.2
org.apache.jasper_5.5.17.v201101211617
org.apache.log4j_1.2.15.v201012070815
org.apache.servicemix.bundles.fastinfoset_1.2.13.1
org.apache.servicemix.bundles.jaxb-impl_2.2.1.1_2
org.apache.servicemix.bundles.jaxb-xjc_2.2.1.1_2
org.apache.servicemix.bundles.wsdl4j_1.6.3.1
org.apache.servicemix.bundles.xmlresolver_1.2.0.5
org.apache.servicemix.specs.activation-api-1.1_2.2.0
org.apache.servicemix.specs.jaxb-api-2.2_2.2.0
org.apache.servicemix.specs.jaxws-api-2.2_2.2.0
org.apache.servicemix.specs.jsr339-api-m10_2.2.0
org.apache.servicemix.specs.saaj-api-1.3_2.2.0
org.apache.servicemix.specs.stax-api-1.0_2.2.0
org.apache.ws.xmlschema.core_2.0.3
org.apache.xmlbeans_0.2.0.SNAPSHOT
org.codehaus.jettison.jettison_1.3.4
org.eclipse.equinox.console_1.0.0.v20120522-1841
org.eclipse.equinox.ds_1.1.1.R35x_v20090806
org.eclipse.equinox.event_1.1.101.R35x_v20100209
org.eclipse.equinox.log_1.2.0.v20090520-1800
org.eclipse.equinox.util_1.0.100.v20090520-1800
org.eclipse.jetty.client_7.6.8.v20121106
org.eclipse.jetty.continuation_7.6.8.v20121106
org.eclipse.jetty.http_7.6.8.v20121106
org.eclipse.jetty.io_7.6.8.v20121106
org.eclipse.jetty.io_9.2.0.RC0
org.eclipse.jetty.jmx_7.6.8.v20121106
org.eclipse.jetty.jndi_7.6.8.v20121106
org.eclipse.jetty.plus_7.6.8.v20121106
org.eclipse.jetty.security_7.6.8.v20121106
org.eclipse.jetty.server_7.6.8.v20121106
org.eclipse.jetty.servlet_7.6.8.v20121106
org.eclipse.jetty.servlets_7.6.8.v20121106
org.eclipse.jetty.util_7.6.8.v20121106
org.eclipse.jetty.util_9.2.0.RC0
org.eclipse.jetty.webapp_7.6.8.v20121106
org.eclipse.jetty.websocket.api_9.2.0.RC0
org.eclipse.jetty.websocket.client_9.2.0.RC0
org.eclipse.jetty.websocket.common_9.2.0.RC0
org.eclipse.jetty.websocket.javax.websocket_9.2.0.RC0
org.eclipse.jetty.websocket_7.6.8.v20121106
org.eclipse.jetty.xml_7.6.8.v20121106
org.eclipse.osgi.services_3.3.0.v20110513
org.eclipse.osgi.util_3.2.0.v20090520-1800
org.eclipse.osgi_3.8.0.v20120529-1548
org.json-wrapper_0.1.0.SNAPSHOT
org.ops4j.base.lang_1.4.0
org.ops4j.pax.logging.pax-logging-api_1.7.0
org.ops4j.pax.logging.pax-logging-service_1.7.0
org.ops4j.pax.web.pax-web-api_1.1.14
org.ops4j.pax.web.pax-web-extender-whiteboard_1.1.14
org.ops4j.pax.web.pax-web-jetty_1.1.14
org.ops4j.pax.web.pax-web-runtime_1.1.14
org.ops4j.pax.web.pax-web-spi_1.1.14
stax2-api_3.1.1
woodstox-core-asl_4.2.0
In a webmachine project I am also requesting https pages from other servers.
In the prototype I managed to do it in this way:
to_html(ReqData, State) ->
OtherResource = "https://example.com",
inets:start(),
ssl:start(),
{ok, {{Version, 200, ReasonPhrase}, Headers, Body}} =
httpc:request(get, {OtherResource, []}, [], []),
%% building the HTML response here...
{HTML, ReqData, State}.
It works as a prototype and now I wonder how and where to start the inets and ssl and keep them running in a proper way.
I have seen that there is also started inets in src/myapp.erl, but this inets instance was not available in my page rendering above:
start() ->
ensure_started(inets),
You could start the inets and ssl applications as part of the standard startup script (or whatever you're using - as you might use reltool for that). Also, if you need some state for the while of the request (the one from webmachine), you could start whatever you want as part of the init/1 function (and if you want to stop it at the end of the request, you can call whatever stop procedure within finish_request/2 - "This function, if exported, is called just before the final response is constructed and sent. The Result is ignored, so any effect of this function must be by returning a modified ReqData."):
Here is a snippet from reltool.config:
{sys, [
{lib_dirs, []},
{erts, [{mod_cond, derived}, {app_file, strip}]},
{app_file, strip},
{rel, "myapp", "1",
[
kernel,
stdlib,
sasl,
myapp
]},
{rel, "start_clean", "",
[
kernel,
stdlib
]},
{boot_rel, "myapp"},
{profile, embedded},
{incl_cond, exclude},
{excl_archive_filters, [".*"]}, %% Do not archive built libs
{excl_sys_filters, ["^bin/.*", "^erts.*/bin/(dialyzer|typer)",
"^erts.*/(doc|info|include|lib|man|src)"]},
{excl_app_filters, ["\.gitignore"]},
{app, sasl, [{incl_cond, include}]},
{app, stdlib, [{incl_cond, include}]},
{app, kernel, [{incl_cond, include}]},
{app, mnesia, [{incl_cond, include}]},
{app, inets, [{incl_cond, include}]}
]}.
You could add another entry for ssl, the same as inets ({app, inets, [{incl_cond, include}]} ).
Usually, you can generate all the skeleton files that you need, by using rebar.
i'm using JMeter command line to stress test our website api. Now, here's a sample result i'm getting back:
Creating summariser <summary>
Created the tree successfully using street_advisor.jmx
Starting the test # Sat Oct 03 15:22:59 PDT 2009 (1254608579848)
Waiting for possible shutdown message on port 4445
summary + 1 in 0.0s = 37.0/s Avg: 27 Min: 27 Max: 27 Err: 1 (100.00%)
<snip a few more lines>
<then i break it>
So i'm getting an error.
Currently, all errors are going to a file. When i check that file, it's saying it's a 404. Er.. ok. Is there anyway i can see exactly what the request JMeter tried?
here's a snippet of my config file...
<ResultCollector guiclass="SimpleDataWriter" testclass="ResultCollector" testname="Error Writer" enabled="true">
<boolProp name="ResultCollector.error_logging">true</boolProp>
<objProp>
<name>saveConfig</name>
<value class="SampleSaveConfiguration">
<time>true</time>
<latency>true</latency>
<timestamp>false</timestamp>
<success>true</success>
<label>true</label>
<code>true</code>
<message>true</message>
<threadName>false</threadName>
<dataType>true</dataType>
<encoding>false</encoding>
<assertions>true</assertions>
<subresults>true</subresults>
<responseData>false</responseData>
<samplerData>false</samplerData>
<xml>true</xml>
<fieldNames>false</fieldNames>
<responseHeaders>true</responseHeaders>
<requestHeaders>true</requestHeaders>
<responseDataOnError>false</responseDataOnError>
<saveAssertionResultsFailureMessage>false</saveAssertionResultsFailureMessage>
<assertionsResultsToSave>0</assertionsResultsToSave>
<bytes>true</bytes>
</value>
</objProp>
<stringProp name="filename">./error.jtl</stringProp>
</ResultCollector>
Now, before someone says 'Check the webserver log files', I know I can do this and yep, I've found the 404 .. but i'm hoping to see if it's possible without accessing them .. especially if they are on another server and/or I can't get access to them.
Please help!
The View Results Tree component shows a tree of all sample responses, allowing you to view both the request and response for any sample.
When load testing (Always in NON GUI mode), fill in "Filename" field and select to only save Responses in Error:
As you can see above we clicked on Configure to select all fields except CSV ones.
You can also save the entire response to a file using Save Responses to a file:
I found this thread searching for a solution to log the response only when a sampler fails, so the accepted solution is not good for me. I have occasional sample failures at a very high load involving hundreds of thousands of samples, so a tree listener is completely impractical for me (it will reach several gigabytes in size), so here is what I came up with (which should be good for the OP's scenario as well):
Add a [JSR223 Assertion][1] (should come after all the other assertions) and put the below code in it:
if (Boolean.valueOf(vars.get("DEBUG"))) {
for (a: SampleResult.getAssertionResults()) {
if (a.isError() || a.isFailure()) {
log.error(Thread.currentThread().getName()+": "+SampleLabel+": Assertion failed for response: " + new String((byte[]) ResponseData));
}
}
}
This will cause the entire response getting logged to the jmeter log file which is fine in my case, as I know that the responses are really small, but for large responses, more intelligent processing could be done.
There is a 'Save responses to a file' listener, which can save to file only when error occurs.
This is how I log the full request (request URL + request body) for failed requests.
Add a Listener inside the Thread Group
try{
var message = "";
var currentUrl = sampler.getUrl();
message += ". URL = " +currentUrl;
var requestBody = sampler.getArguments().getArgument(0).getValue();
message += " --data " + sampler.getArguments();
if(!sampleResult.isSuccessful()){
log.error(message);
}
}catch(err){
//do nothing. this could be a debug sampler. no need to log the error
}
For every Sampler inside the Thread Group, the Listener will execute this code after the Sampler.