Http status 500 with error message "Error when processing resource" when creating Sales Order with SDK - sap-cloud-sdk

The OData Service I used is API_SALES_ORDER_SRV in SAP API Business Hub.
The payload to create sales order is as below. It works very good in SAP Gateway Client.
{
"DistributionChannel": "01",
"OrganizationDivision": "01",
"SalesOrderType": "***",
"SalesOrganization": "***",
"SoldToParty": "***",
"to_Item": [
{
"SalesOrderItem" : "10",
"RequestedQuantity": "10",
"Material": "***"
}
]
}
But when I create sales order with Cloud SDK, I got the following error message.
2019-11-12 19:51:02.870 ERROR 10392 --- [nio-8080-exec-8] c.b.h.service.MySalesOrderService : The endpoint responded with HTTP error code 500.
Full error message:
Error when processing resource
com.sap.cloud.sdk.datamodel.odata.helper.ODataVdmErrorResultHandler$ErpODataException: The endpoint responded with HTTP error code 500.
Full error message:
Error when processing resource
at com.sap.cloud.sdk.datamodel.odata.helper.ODataVdmErrorResultHandler.createException(ODataVdmErrorResultHandler.java:114)
at com.sap.cloud.sdk.datamodel.odata.helper.ODataVdmErrorResultHandler.createError(ODataVdmErrorResultHandler.java:94)
at com.sap.cloud.sdk.datamodel.odata.helper.ODataVdmErrorResultHandler.createError(ODataVdmErrorResultHandler.java:31)
at com.sap.cloud.sdk.odatav2.connectivity.internal.ODataConnectivityUtil.checkHttpStatus(ODataConnectivityUtil.java:217)
at com.sap.cloud.sdk.odatav2.connectivity.impl.ODataCreateRequestImpl.create(ODataCreateRequestImpl.java:275)
at com.sap.cloud.sdk.odatav2.connectivity.impl.ODataCreateRequestImpl.handleExecute(ODataCreateRequestImpl.java:391)
at com.sap.cloud.sdk.odatav2.connectivity.impl.ODataCreateRequestImpl.execute(ODataCreateRequestImpl.java:367)
at com.sap.cloud.sdk.datamodel.odata.helper.FluentHelperCreate.execute(FluentHelperCreate.java:155)
at com.bosch.hackathon.service.MySalesOrderService.createSalesOrder(MySalesOrderService.java:451)
at com.bosch.hackathon.controllers.MySalesOrderController.createSalesOrderSDK(MySalesOrderController.java:63)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:215)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:142)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:800)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1038)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:998)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:901)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:660)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:875)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at com.sap.cloud.sdk.cloudplatform.servlet.RequestAccessorFilter.lambda$doFilter$1(RequestAccessorFilter.java:71)
at com.sap.cloud.sdk.cloudplatform.thread.AbstractThreadContextExecutor.lambda$execute$0(AbstractThreadContextExecutor.java:317)
at com.sap.cloud.sdk.cloudplatform.thread.ThreadContextCallable.call(ThreadContextCallable.java:247)
at com.sap.cloud.sdk.cloudplatform.thread.AbstractThreadContextExecutor.execute(AbstractThreadContextExecutor.java:319)
at com.sap.cloud.sdk.cloudplatform.servlet.RequestAccessorFilter.doFilter(RequestAccessorFilter.java:71)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:92)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:93)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:791)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1417)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
2019-11-12 19:51:02.888 WARN 10392 --- [nio-8080-exec-8] .m.m.a.ExceptionHandlerExceptionResolver : Resolved [com.bosch.hackathon.exception.BusinessException: The endpoint responded with HTTP error code 500.
Full error message:
Error when processing resource]
The code I used to create Sales order is as below. First I build an Sales Order Object and then use it as the parameter of method createSalesOrder.
private SalesOrder buildSalesOrderObject() {
SalesOrderItem item = SalesOrderItem.builder()
.salesOrderItem("myplant")
.material("mymaterial")
.requestedQuantity(new BigDecimal(10))
.build();
SalesOrder salesOrder = SalesOrder.builder()
.salesOrderType("YTA")
.salesOrganization("myso")
.distributionChannel("01")
.organizationDivision("01")
.soldToParty("party")
.item(item)
.build();
return salesOrder;
}
public SalesOrder createSalesOrder() throws BusinessException {
SalesOrder salesOrderCreated = buildSalesOrderObject();
try {
salesOrderCreated = salesOrderService.createSalesOrder(salesOrder)
.execute(DestinationUtil.getHttpDestinationT4X());
} catch (ODataException e) {
log.error(e.getMessage(), e);
throw BusinessException.convert(e);
}
return salesOrderCreated;
}
Could you take a look at this issue?
SAP Cloud SDK Version: 3.3.1
S/4HANA On-premise Version: 1909
Provide wire log.
2019-11-15 08:59:14.717 DEBUG 15276 --- [nio-8080-exec-5] h.i.c.PoolingHttpClientConnectionManager : Connection request: [route: {}->http://host:8091][total kept alive: 0; route allocated: 0 of 100; total allocated: 0 of 200]
2019-11-15 08:59:14.731 DEBUG 15276 --- [nio-8080-exec-5] h.i.c.PoolingHttpClientConnectionManager : Connection leased: [id: 0][route: {}->http://host:8091][total kept alive: 0; route allocated: 1 of 100; total allocated: 1 of 200]
2019-11-15 08:59:14.733 DEBUG 15276 --- [nio-8080-exec-5] o.a.http.impl.execchain.MainClientExec : Opening connection {}->http://host:8091
2019-11-15 08:59:14.944 DEBUG 15276 --- [nio-8080-exec-5] .i.c.DefaultHttpClientConnectionOperator : Connecting to host/ip1:8091
2019-11-15 08:59:15.161 DEBUG 15276 --- [nio-8080-exec-5] .i.c.DefaultHttpClientConnectionOperator : Connection established ip2:58702<->ip1:8091
2019-11-15 08:59:15.162 DEBUG 15276 --- [nio-8080-exec-5] o.a.http.impl.execchain.MainClientExec : Executing request GET /sap/opu/odata/sap/API_SALES_ORDER_SRV/$metadata HTTP/1.1
2019-11-15 08:59:15.162 DEBUG 15276 --- [nio-8080-exec-5] o.a.http.impl.execchain.MainClientExec : Proxy auth state: UNCHALLENGED
2019-11-15 08:59:15.163 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 >> GET /sap/opu/odata/sap/API_SALES_ORDER_SRV/$metadata HTTP/1.1
2019-11-15 08:59:15.163 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 >> com.sap.cloud.sdk.cloudplatform.connectivity.HttpClientWrapper$ApacheHttpHeader#65d86a53
2019-11-15 08:59:15.163 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 >> Host: host:8091
2019-11-15 08:59:15.163 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 >> Connection: Keep-Alive
2019-11-15 08:59:15.163 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 >> User-Agent: Apache-HttpClient/4.5.10 (Java/1.8.0_191)
2019-11-15 08:59:15.164 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 >> Accept-Encoding: gzip,deflate
2019-11-15 08:59:16.485 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 << HTTP/1.1 200 OK
2019-11-15 08:59:16.486 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 << set-cookie: sap-usercontext=sap-client=011; path=/
2019-11-15 08:59:16.486 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 << set-cookie: MYSAPSSO2=***; path=/; domain=***
2019-11-15 08:59:16.486 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 << set-cookie: SAP_SESSIONID_***_011=***; path=/
2019-11-15 08:59:16.486 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 << content-type: application/xml
2019-11-15 08:59:16.486 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 << content-length: 8058
2019-11-15 08:59:16.486 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 << last-modified: Mon, 21 Oct 2019 07:48:47 GMT
2019-11-15 08:59:16.486 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 << cache-control: max-age=0
2019-11-15 08:59:16.486 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 << dataserviceversion: 2.0
2019-11-15 08:59:16.486 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 << sap-processing-info: ODataBEP=,crp=,RAL=,st=,MedCacheHub=Table,codeployed=X,softstate=
2019-11-15 08:59:16.486 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 << sap-server: true
2019-11-15 08:59:16.486 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 << sap-perf-fesrec: 893169.000000
2019-11-15 08:59:16.487 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 << content-encoding: gzip
2019-11-15 08:59:16.492 DEBUG 15276 --- [nio-8080-exec-5] o.a.http.impl.execchain.MainClientExec : Connection can be kept alive indefinitely
2019-11-15 08:59:16.496 DEBUG 15276 --- [nio-8080-exec-5] o.a.h.c.protocol.ResponseProcessCookies : Cookie accepted [sap-usercontext="sap-client=011", version:0, domain:host, path:/, expiry:null]
2019-11-15 08:59:16.497 DEBUG 15276 --- [nio-8080-exec-5] o.a.h.c.protocol.ResponseProcessCookies : Cookie accepted [MYSAPSSO2="***", version:0, domain:***, path:/, expiry:null]
2019-11-15 08:59:16.497 DEBUG 15276 --- [nio-8080-exec-5] o.a.h.c.protocol.ResponseProcessCookies : Cookie accepted [SAP_SESSIONID_***_011="***", version:0, domain:host, path:/, expiry:null]
2019-11-15 08:59:16.621 DEBUG 15276 --- [nio-8080-exec-5] h.i.c.PoolingHttpClientConnectionManager : Connection [id: 0][route: {}->http://host:8091] can be kept alive indefinitely
2019-11-15 08:59:16.622 DEBUG 15276 --- [nio-8080-exec-5] h.i.c.DefaultManagedHttpClientConnection : http-outgoing-0: set socket timeout to 0
2019-11-15 08:59:16.622 DEBUG 15276 --- [nio-8080-exec-5] h.i.c.PoolingHttpClientConnectionManager : Connection released: [id: 0][route: {}->http://host:8091][total kept alive: 1; route allocated: 1 of 100; total allocated: 1 of 200]
2019-11-15 08:59:16.624 DEBUG 15276 --- [nio-8080-exec-5] o.a.h.client.protocol.RequestAddCookies : CookieSpec selected: default
2019-11-15 08:59:16.641 DEBUG 15276 --- [nio-8080-exec-5] o.a.h.client.protocol.RequestAddCookies : Cookie [version: 0][name: MYSAPSSO2][value: ***][domain: ***][path: /][expiry: null] match [host:8091/sap/opu/odata/sap/API_SALES_ORDER_SRV]
2019-11-15 08:59:16.642 DEBUG 15276 --- [nio-8080-exec-5] o.a.h.client.protocol.RequestAddCookies : Cookie [version: 0][name: SAP_SESSIONID_***_011][value: ***][domain: host][path: /][expiry: null] match [host:8091/sap/opu/odata/sap/API_SALES_ORDER_SRV]
2019-11-15 08:59:16.642 DEBUG 15276 --- [nio-8080-exec-5] o.a.h.client.protocol.RequestAddCookies : Cookie [version: 0][name: sap-usercontext][value: sap-client=011][domain: host][path: /][expiry: null] match [host:8091/sap/opu/odata/sap/API_SALES_ORDER_SRV]
2019-11-15 08:59:16.642 DEBUG 15276 --- [nio-8080-exec-5] o.a.h.client.protocol.RequestAuthCache : Auth cache not set in the context
2019-11-15 08:59:16.642 DEBUG 15276 --- [nio-8080-exec-5] h.i.c.PoolingHttpClientConnectionManager : Connection request: [route: {}->http://host:8091][total kept alive: 1; route allocated: 1 of 100; total allocated: 1 of 200]
2019-11-15 08:59:16.642 DEBUG 15276 --- [nio-8080-exec-5] h.i.c.PoolingHttpClientConnectionManager : Connection leased: [id: 0][route: {}->http://host:8091][total kept alive: 0; route allocated: 1 of 100; total allocated: 1 of 200]
2019-11-15 08:59:16.643 DEBUG 15276 --- [nio-8080-exec-5] h.i.c.DefaultManagedHttpClientConnection : http-outgoing-0: set socket timeout to 0
2019-11-15 08:59:16.643 DEBUG 15276 --- [nio-8080-exec-5] o.a.http.impl.execchain.MainClientExec : Executing request HEAD /sap/opu/odata/sap/API_SALES_ORDER_SRV HTTP/1.1
2019-11-15 08:59:16.643 DEBUG 15276 --- [nio-8080-exec-5] o.a.http.impl.execchain.MainClientExec : Proxy auth state: UNCHALLENGED
2019-11-15 08:59:16.643 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 >> HEAD /sap/opu/odata/sap/API_SALES_ORDER_SRV HTTP/1.1
2019-11-15 08:59:16.643 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 >> x-csrf-token: Fetch
2019-11-15 08:59:16.643 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 >> com.sap.cloud.sdk.cloudplatform.connectivity.HttpClientWrapper$ApacheHttpHeader#54937cbe
2019-11-15 08:59:16.643 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 >> Host: host:8091
2019-11-15 08:59:16.643 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 >> Connection: Keep-Alive
2019-11-15 08:59:16.643 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 >> User-Agent: Apache-HttpClient/4.5.10 (Java/1.8.0_191)
2019-11-15 08:59:16.643 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 >> Cookie: MYSAPSSO2=***; SAP_SESSIONID_***_011=***; sap-usercontext=sap-client=011
2019-11-15 08:59:16.643 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 >> Accept-Encoding: gzip,deflate
2019-11-15 08:59:16.902 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 << HTTP/1.1 200 OK
2019-11-15 08:59:16.903 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 << content-type: text/html
2019-11-15 08:59:16.903 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 << content-length: 0
2019-11-15 08:59:16.903 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 << x-csrf-token: jgGDK5ILPjPZmMUDQJmvLg==
2019-11-15 08:59:16.903 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 << dataserviceversion: 2.0
2019-11-15 08:59:16.903 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 << cache-control: no-store, no-cache, must-revalidate, max-age=0, post-check=0, pre-check=0
2019-11-15 08:59:16.903 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 << pragma: no-cache
2019-11-15 08:59:16.903 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 << expires: Tue, 03 Jul 2001 06:00:00 GMT
2019-11-15 08:59:16.903 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 << sap-processing-info: ODataBEP=,crp=,RAL=,st=,MedCacheHub=,codeployed=,softstate=
2019-11-15 08:59:16.903 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 << sap-server: true
2019-11-15 08:59:16.904 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 << sap-perf-fesrec: 49848.000000
2019-11-15 08:59:16.904 DEBUG 15276 --- [nio-8080-exec-5] o.a.http.impl.execchain.MainClientExec : Connection can be kept alive indefinitely
2019-11-15 08:59:16.904 DEBUG 15276 --- [nio-8080-exec-5] h.i.c.PoolingHttpClientConnectionManager : Connection [id: 0][route: {}->http://host:8091] can be kept alive indefinitely
2019-11-15 08:59:16.904 DEBUG 15276 --- [nio-8080-exec-5] h.i.c.DefaultManagedHttpClientConnection : http-outgoing-0: set socket timeout to 0
2019-11-15 08:59:16.904 DEBUG 15276 --- [nio-8080-exec-5] h.i.c.PoolingHttpClientConnectionManager : Connection released: [id: 0][route: {}->http://host:8091][total kept alive: 1; route allocated: 1 of 100; total allocated: 1 of 200]
2019-11-15 08:59:16.924 DEBUG 15276 --- [nio-8080-exec-5] o.a.h.client.protocol.RequestAddCookies : CookieSpec selected: default
2019-11-15 08:59:16.924 DEBUG 15276 --- [nio-8080-exec-5] o.a.h.client.protocol.RequestAddCookies : Cookie [version: 0][name: MYSAPSSO2][value:***][domain: ***][path: /][expiry: null] match [host:8091/sap/opu/odata/sap/API_SALES_ORDER_SRV/A_SalesOrder]
2019-11-15 08:59:16.924 DEBUG 15276 --- [nio-8080-exec-5] o.a.h.client.protocol.RequestAddCookies : Cookie [version: 0][name: SAP_SESSIONID_***_011][value: ***][domain: host][path: /][expiry: null] match [host:8091/sap/opu/odata/sap/API_SALES_ORDER_SRV/A_SalesOrder]
2019-11-15 08:59:16.925 DEBUG 15276 --- [nio-8080-exec-5] o.a.h.client.protocol.RequestAddCookies : Cookie [version: 0][name: sap-usercontext][value: sap-client=011][domain: host][path: /][expiry: null] match [host:8091/sap/opu/odata/sap/API_SALES_ORDER_SRV/A_SalesOrder]
2019-11-15 08:59:16.925 DEBUG 15276 --- [nio-8080-exec-5] o.a.h.client.protocol.RequestAuthCache : Auth cache not set in the context
2019-11-15 08:59:16.925 DEBUG 15276 --- [nio-8080-exec-5] h.i.c.PoolingHttpClientConnectionManager : Connection request: [route: {}->http://host:8091][total kept alive: 1; route allocated: 1 of 100; total allocated: 1 of 200]
2019-11-15 08:59:16.925 DEBUG 15276 --- [nio-8080-exec-5] h.i.c.PoolingHttpClientConnectionManager : Connection leased: [id: 0][route: {}->http://host:8091][total kept alive: 0; route allocated: 1 of 100; total allocated: 1 of 200]
2019-11-15 08:59:16.925 DEBUG 15276 --- [nio-8080-exec-5] h.i.c.DefaultManagedHttpClientConnection : http-outgoing-0: set socket timeout to 0
2019-11-15 08:59:16.926 DEBUG 15276 --- [nio-8080-exec-5] o.a.http.impl.execchain.MainClientExec : Executing request POST /sap/opu/odata/sap/API_SALES_ORDER_SRV/A_SalesOrder HTTP/1.1
2019-11-15 08:59:16.926 DEBUG 15276 --- [nio-8080-exec-5] o.a.http.impl.execchain.MainClientExec : Proxy auth state: UNCHALLENGED
2019-11-15 08:59:16.926 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 >> POST /sap/opu/odata/sap/API_SALES_ORDER_SRV/A_SalesOrder HTTP/1.1
2019-11-15 08:59:16.926 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 >> x-csrf-token: jgGDK5ILPjPZmMUDQJmvLg==
2019-11-15 08:59:16.926 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 >> Content-Type: application/json
2019-11-15 08:59:16.926 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 >> Accept: application/json
2019-11-15 08:59:16.926 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 >> com.sap.cloud.sdk.cloudplatform.connectivity.HttpClientWrapper$ApacheHttpHeader#f38e7be
2019-11-15 08:59:16.926 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 >> Content-Length: 218
2019-11-15 08:59:16.926 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 >> Host: host:8091
2019-11-15 08:59:16.926 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 >> Connection: Keep-Alive
2019-11-15 08:59:16.926 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 >> User-Agent: Apache-HttpClient/4.5.10 (Java/1.8.0_191)
2019-11-15 08:59:16.926 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 >> Cookie: MYSAPSSO2=***; SAP_SESSIONID_***_011=***; sap-usercontext=sap-client=011
2019-11-15 08:59:16.926 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 >> Accept-Encoding: gzip,deflate
2019-11-15 08:59:17.150 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 << HTTP/1.1 500 Internal Server Error
2019-11-15 08:59:17.150 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 << content-type: text/plain; charset=utf-8
2019-11-15 08:59:17.150 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 << content-length: 30
2019-11-15 08:59:17.150 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 << sap-processing-info: ODataBEP=,crp=,RAL=,st=,MedCacheHub=,codeployed=X,softstate=
2019-11-15 08:59:17.151 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 << sap-server: true
2019-11-15 08:59:17.151 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 << sap-perf-fesrec: 13762.000000
2019-11-15 08:59:17.151 DEBUG 15276 --- [nio-8080-exec-5] org.apache.http.headers : http-outgoing-0 << connection: close
2019-11-15 08:59:17.157 DEBUG 15276 --- [nio-8080-exec-5] h.i.c.DefaultManagedHttpClientConnection : http-outgoing-0: Close connection
2019-11-15 08:59:17.158 DEBUG 15276 --- [nio-8080-exec-5] o.a.http.impl.execchain.MainClientExec : Connection discarded
2019-11-15 08:59:17.158 DEBUG 15276 --- [nio-8080-exec-5] h.i.c.PoolingHttpClientConnectionManager : Connection released: [id: 0][route: {}->http://host:8091][total kept alive: 0; route allocated: 0 of 100; total allocated: 0 of 200]
2019-11-15 08:59:17.161 ERROR 15276 --- [nio-8080-exec-5] c.b.h.service.MySalesOrderService : The endpoint responded with HTTP error code 500.
DestinationUtil class
public class DestinationUtil {
// #Value("${destination.http.t4x}")
// private String destinationName;
public static HttpDestination getHttpDestinationT4X() {
Destination destination = DestinationAccessor.getDestination("***");
return destination.asHttp();
}
public static HttpDestination getHttpDestinationS4X() {
Destination destination = DestinationAccessor.getDestination("***");
return destination.asHttp();
}
}

Finally I found the root cause. It is due to the ICF Nodes configuration of sales order service on S4HANA system. By default, the parameter of GUI configuration is ~CHECK_CSRF_TOKEN 0. That means, xsrf check is disabled and switch to X-Requested-With. I need to provide parameter X-Requested-With in HTTP request header.

Related

Spring Integration TCP Inbound Adapter client disconnect issue

We have created an IntegrationFlow for an inbound TCP server. Whenever we test this the integration is fine until the client disconnects, then we get a continuous flow of empty messages.
Spring Integration 5.2.5.RELEASE
Flow:
#Bean
public IntegrationFlow inboundFlow(MyService myService) {
return IntegrationFlows.from(
Tcp.inboundAdapter(
Tcp.netServer(12345)
.deserializer(TcpCodecs.lengthHeader4())))
.transform(Transformers.objectToString())
.log(INFO) // Logging only for testing
.handle(myService, "process") // Do some processing of the message
.get();
}
Test method:
public void sendPackets() throws Exception {
List<Path> files = getAllFilesSorted("/some/location");
try (Socket socket = new Socket("localhost", 12345)) {
log.info("local port: {}", socket.getLocalPort());
try (OutputStream outputStream = socket.getOutputStream()) {
for (int i = 0; i < 10; i++) {
Path path = files.get(i);
log.info("{} ({} of {})", path.toString(), i, files.size());
byte[] bytes = Files.readAllBytes(path);
outputStream.write(bytes);
outputStream.flush();
Thread.sleep(200);
}
}
}
}
Partial Log after test completes:
2020-05-05 11:00:52.963 INFO 31793 --- [pool-1-thread-2] o.s.integration.handler.LoggingHandler : GenericMessage [payload=, headers={ip_tcp_remotePort=59407, ip_connectionId=localhost:59407:44745:df23388b-b8b0-4250-b926-4199030b2ff6, ip_localInetAddress=/127.0.0.1, ip_address=127.0.0.1, id=813ccf6b-9eb7-2ff3-0f8d-f2810966d8d7, ip_hostname=localhost, timestamp=1588672852963}]
2020-05-05 11:00:52.963 INFO 31793 --- [pool-1-thread-2] o.s.integration.handler.LoggingHandler : GenericMessage [payload=, headers={ip_tcp_remotePort=59407, ip_connectionId=localhost:59407:44745:df23388b-b8b0-4250-b926-4199030b2ff6, ip_localInetAddress=/127.0.0.1, ip_address=127.0.0.1, id=1fd5c4c7-b2e0-6a89-7de6-894c8e42e242, ip_hostname=localhost, timestamp=1588672852963}]
2020-05-05 11:00:52.963 INFO 31793 --- [pool-1-thread-2] o.s.integration.handler.LoggingHandler : GenericMessage [payload=, headers={ip_tcp_remotePort=59407, ip_connectionId=localhost:59407:44745:df23388b-b8b0-4250-b926-4199030b2ff6, ip_localInetAddress=/127.0.0.1, ip_address=127.0.0.1, id=78b852e8-0094-f8b9-8d05-37bc4912d096, ip_hostname=localhost, timestamp=1588672852963}]
2020-05-05 11:00:52.963 INFO 31793 --- [pool-1-thread-2] o.s.integration.handler.LoggingHandler : GenericMessage [payload=, headers={ip_tcp_remotePort=59407, ip_connectionId=localhost:59407:44745:df23388b-b8b0-4250-b926-4199030b2ff6, ip_localInetAddress=/127.0.0.1, ip_address=127.0.0.1, id=4e4a7ee0-c66e-9501-9ef7-4d25143531b3, ip_hostname=localhost, timestamp=1588672852963}]
2020-05-05 11:00:52.963 INFO 31793 --- [pool-1-thread-2] o.s.integration.handler.LoggingHandler : GenericMessage [payload=, headers={ip_tcp_remotePort=59407, ip_connectionId=localhost:59407:44745:df23388b-b8b0-4250-b926-4199030b2ff6, ip_localInetAddress=/127.0.0.1, ip_address=127.0.0.1, id=c90abe17-7036-94cc-af59-3b0cac5e75e4, ip_hostname=localhost, timestamp=1588672852963}]
2020-05-05 11:00:52.963 INFO 31793 --- [pool-1-thread-2] o.s.integration.handler.LoggingHandler : GenericMessage [payload=, headers={ip_tcp_remotePort=59407, ip_connectionId=localhost:59407:44745:df23388b-b8b0-4250-b926-4199030b2ff6, ip_localInetAddress=/127.0.0.1, ip_address=127.0.0.1, id=425d2e2a-75c5-0184-06da-6d27eb546931, ip_hostname=localhost, timestamp=1588672852963}]
2020-05-05 11:00:52.965 INFO 31793 --- [pool-1-thread-2] o.s.integration.handler.LoggingHandler : GenericMessage [payload=, headers={ip_tcp_remotePort=59407, ip_connectionId=localhost:59407:44745:df23388b-b8b0-4250-b926-4199030b2ff6, ip_localInetAddress=/127.0.0.1, ip_address=127.0.0.1, id=4c55d1d0-7421-1832-23ca-03744419c847, ip_hostname=localhost, timestamp=1588672852965}]
2020-05-05 11:00:52.965 INFO 31793 --- [pool-1-thread-2] o.s.integration.handler.LoggingHandler : GenericMessage [payload=, headers={ip_tcp_remotePort=59407, ip_connectionId=localhost:59407:44745:df23388b-b8b0-4250-b926-4199030b2ff6, ip_localInetAddress=/127.0.0.1, ip_address=127.0.0.1, id=05b6fea6-8f76-5c74-e4cc-33bd8099d8e8, ip_hostname=localhost, timestamp=1588672852965}]
2020-05-05 11:00:52.965 INFO 31793 --- [pool-1-thread-2] o.s.integration.handler.LoggingHandler : GenericMessage [payload=, headers={ip_tcp_remotePort=59407, ip_connectionId=localhost:59407:44745:df23388b-b8b0-4250-b926-4199030b2ff6, ip_localInetAddress=/127.0.0.1, ip_address=127.0.0.1, id=9b8fe16c-07f4-b64b-faec-794eb743559c, ip_hostname=localhost, timestamp=1588672852965}]
2020-05-05 11:00:52.965 INFO 31793 --- [pool-1-thread-2] o.s.integration.handler.LoggingHandler : GenericMessage [payload=, headers={ip_tcp_remotePort=59407, ip_connectionId=localhost:59407:44745:df23388b-b8b0-4250-b926-4199030b2ff6, ip_localInetAddress=/127.0.0.1, ip_address=127.0.0.1, id=222725e8-19c6-62b6-8ba7-103892191c96, ip_hostname=localhost, timestamp=1588672852965}]
2020-05-05 11:00:52.965 INFO 31793 --- [pool-1-thread-2] o.s.integration.handler.LoggingHandler : GenericMessage [payload=, headers={ip_tcp_remotePort=59407, ip_connectionId=localhost:59407:44745:df23388b-b8b0-4250-b926-4199030b2ff6, ip_localInetAddress=/127.0.0.1, ip_address=127.0.0.1, id=951403b6-18a9-ffe9-29b7-67b8c01ea311, ip_hostname=localhost, timestamp=1588672852965}]
2020-05-05 11:00:52.965 INFO 31793 --- [pool-1-thread-2] o.s.integration.handler.LoggingHandler : GenericMessage [payload=, headers={ip_tcp_remotePort=59407, ip_connectionId=localhost:59407:44745:df23388b-b8b0-4250-b926-4199030b2ff6, ip_localInetAddress=/127.0.0.1, ip_address=127.0.0.1, id=2ac3002b-ccd1-9506-f3aa-60f4b63e26b8, ip_hostname=localhost, timestamp=1588672852965}]
2020-05-05 11:00:52.965 INFO 31793 --- [pool-1-thread-2] o.s.integration.handler.LoggingHandler : GenericMessage [payload=, headers={ip_tcp_remotePort=59407, ip_connectionId=localhost:59407:44745:df23388b-b8b0-4250-b926-4199030b2ff6, ip_localInetAddress=/127.0.0.1, ip_address=127.0.0.1, id=dbbf12cf-0a27-407b-0a96-5b27ab0539db, ip_hostname=localhost, timestamp=1588672852965}]
2020-05-05 11:00:52.965 INFO 31793 --- [pool-1-thread-2] o.s.integration.handler.LoggingHandler : GenericMessage [payload=, headers={ip_tcp_remotePort=59407, ip_connectionId=localhost:59407:44745:df23388b-b8b0-4250-b926-4199030b2ff6, ip_localInetAddress=/127.0.0.1, ip_address=127.0.0.1, id=3282d09e-9508-b053-3763-cc23d3c817a8, ip_hostname=localhost, timestamp=1588672852965}]
2020-05-05 11:00:52.966 INFO 31793 --- [pool-1-thread-2] o.s.integration.handler.LoggingHandler : GenericMessage [payload=, headers={ip_tcp_remotePort=59407, ip_connectionId=localhost:59407:44745:df23388b-b8b0-4250-b926-4199030b2ff6, ip_localInetAddress=/127.0.0.1, ip_address=127.0.0.1, id=549b2326-341f-19c0-db98-6b31da1901d8, ip_hostname=localhost, timestamp=1588672852966}]
There is nothing in the log about the client disconnecting. We would see socket close activity in the log.
The log implies we are receiving packets containing 0x00000000.
Use wireshark or similar to look at the activity on the wire.
EDIT
Your custom deserializer is causing the problem.
if (read < 0) {
return 0;
}
You need to throw a SoftEndOfStreamException when you detect a socket close.
This is explained in the documentation.
When the deserializer detects a closed input stream between messages, it must throw a SoftEndOfStreamException; this is a signal to the framework to indicate that the close was "normal". If the stream is closed while decoding a message, some other exception should be thrown instead.

Spring Integration Wrong Host Header

We've been experiencing this weird problem with the request Host header being set as the application's URL. This results to the external system to not handle our requests.
Here's the DEBUG log of apache of the Spring Integration application hosted on localhost:8082. Don't mind the content for now but the Content-Type will be a problem subsequently:
org.apache.http.wire - http-outgoing-0 >> "POST /health HTTP/1.1[\r][\n]"
org.apache.http.wire - http-outgoing-0 >> "Accept: */*[\r][\n]"
org.apache.http.wire - http-outgoing-0 >> "cookie: PHPSESSID=ost897ibh0j7rovf2rudr33c22[\r][\n]"
org.apache.http.wire - http-outgoing-0 >> "host: localhost:8082[\r][\n]"
org.apache.http.wire - http-outgoing-0 >> "connection: keep-alive[\r][\n]"
org.apache.http.wire - http-outgoing-0 >> "Cache-Control: no-cache[\r][\n]"
org.apache.http.wire - http-outgoing-0 >> "Content-Type: application/xml[\r][\n]"
org.apache.http.wire - http-outgoing-0 >> "accept-encoding: gzip, deflate[\r][\n]"
org.apache.http.wire - http-outgoing-0 >> "user-agent: PostmanRuntime/6.1.6[\r][\n]"
org.apache.http.wire - http-outgoing-0 >> "Content-Length: 4[\r][\n]"
org.apache.http.wire - http-outgoing-0 >> "[\r][\n]"
org.apache.http.wire - http-outgoing-0 >> "test"
org.apache.http.wire - http-outgoing-0 << "HTTP/1.1 200 OK[\r][\n]"
org.apache.http.wire - http-outgoing-0 << "Content-Type: application/json[\r][\n]"
org.apache.http.wire - http-outgoing-0 << "Transfer-Encoding: chunked[\r][\n]"
org.apache.http.wire - http-outgoing-0 << "Server: Jetty(9.2.z-SNAPSHOT)[\r][\n]"
org.apache.http.wire - http-outgoing-0 << "[\r][\n]"
org.apache.http.wire - http-outgoing-0 << "27[\r][\n]"
org.apache.http.wire - http-outgoing-0 << "{"success":true,"message":"Service up"}"
org.apache.http.headers - http-outgoing-0 << HTTP/1.1 200 OK
org.apache.http.headers - http-outgoing-0 << Content-Type: application/json
org.apache.http.headers - http-outgoing-0 << Transfer-Encoding: chunked
org.apache.http.headers - http-outgoing-0 << Server: Jetty(9.2.z-SNAPSHOT)
org.apache.http.wire - http-outgoing-0 << "[\r][\n]"
org.apache.http.wire - http-outgoing-0 << "0[\r][\n]"
org.apache.http.wire - http-outgoing-0 << "[\r][\n]"
and here's the request done with curl:
curl -v -X POST http://localhost:9292/health
* Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 9292 (#0)
> POST /health HTTP/1.1
> Host: localhost:9292
> User-Agent: curl/7.54.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Content-Type: application/json
< Transfer-Encoding: chunked
< Server: Jetty(9.2.z-SNAPSHOT)
So with Spring Integration
org.apache.http.wire - http-outgoing-0 >> "host: localhost:8082[\r][\n]"
and with curl
> Host: localhost:9292
We can easily solve the host problem in Spring Integration by setting the header mapper of the outgate:
handler.setHeaderMapper(new DefaultHttpHeaderMapper());
org.apache.http.wire - http-outgoing-0 >> "POST /health HTTP/1.1[\r][\n]"
org.apache.http.wire - http-outgoing-0 >> "Accept: application/json, application/*+json[\r][\n]"
org.apache.http.wire - http-outgoing-0 >> "Content-Type: text/plain;charset=UTF-8[\r][\n]"
org.apache.http.wire - http-outgoing-0 >> "Content-Length: 4[\r][\n]"
org.apache.http.wire - http-outgoing-0 >> "Host: localhost:9292[\r][\n]"
org.apache.http.wire - http-outgoing-0 >> "Connection: Keep-Alive[\r][\n]"
org.apache.http.wire - http-outgoing-0 >> "User-Agent: Apache-HttpClient/4.5.2 (Java/1.8.0_112)[\r][\n]"
org.apache.http.wire - http-outgoing-0 >> "Accept-Encoding: gzip,deflate[\r][\n]"
org.apache.http.wire - http-outgoing-0 >> "[\r][\n]"
org.apache.http.wire - http-outgoing-0 >> "test"
So we were able to solve the problem with the Host header, unfortunately, it seems that the Content-Type set through an enricher has been ignored and has been set to text/plain instead of application/xml.
What seems to be the problem here? I'm assuming this has to do with just using a basic DefaultHttpHeaderMapper.
Here's the flow configuration snippet:
public class BasicIntegrationConfig {
#Bean
public MessageChannel basicRequestChannel() {
return MessageChannels.publishSubscribe().get();
}
#Bean
public MessageChannel basicResponseChannel() {
return MessageChannels.publishSubscribe().get();
}
#Bean
public MessagingGatewaySupport basicInGate() {
HttpRequestHandlingMessagingGateway handler = new HttpRequestHandlingMessagingGateway();
RequestMapping mapping = new RequestMapping();
mapping.setPathPatterns("api/v1/basic");
mapping.setMethods(HttpMethod.GET);
mapping.setProduces(MediaType.APPLICATION_JSON_UTF8_VALUE);
handler.setRequestMapping(mapping);
handler.setRequestChannel(basicRequestChannel());
handler.setReplyChannel(basicResponseChannel());
return handler;
}
#Bean
public MessageHandler basicOutGate() {
HttpRequestExecutingMessageHandler handler =
new HttpRequestExecutingMessageHandler("http://localhost:9292/health");
handler.setHttpMethod(HttpMethod.POST);
handler.setExpectedResponseType(BaseResponse.class);
handler.setRequestFactory(new HttpComponentsClientHttpRequestFactory());
handler.setHeaderMapper(new DefaultHttpHeaderMapper());
return handler;
}
#Bean
public IntegrationFlow basicFlow() {
return (IntegrationFlowDefinition<?> f) -> f
.channel(basicRequestChannel())
.log("basic")
.handle((GenericHandler<Object>) (o, map) -> "test")
.enrichHeaders(e -> e.header(MessageHeaders.CONTENT_TYPE, MediaType.APPLICATION_XML_VALUE, true))
.log("basic")
.handle(basicOutGate())
.log("basic")
.enrichHeaders(e -> e.header(MessageHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_UTF8_VALUE, true))
.channel(basicResponseChannel());
}
}
Use
DefaultHttpHeaderMapper mapper = DefaultHttpHeaderMapper.outboundMapper();
mapper.setExcludedOutboundStandardRequestHeaderNames(new String[] { "Host" });
handler.setHeaderMapper(mapper);

Random "http first read error: EOF" errors

I see sporadic fetch errors from backend but backend is normally healthy. It seems that timeout is not the root issue in this case. What could be the reason?
* << BeReq >> 98808229
- Begin bereq 98808228 fetch
- Timestamp Start: 1490683823.763272 0.000000 0.000000
- BereqMethod GET
- BereqURL XXXX
- BereqProtocol HTTP/1.1
- BereqHeader Pragma: no-cache
- BereqHeader Accept: */*
- BereqHeader From: bingbot(at)microsoft.com
- BereqHeader Host: XXXX
- BereqHeader User-Agent: Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)
- BereqHeader Accept-Encoding: gzip
- BereqHeader X-Varnish: 98808229
- VCL_call BACKEND_FETCH
- VCL_return fetch
- BackendOpen 38 reload_2017-03-20T11:32:44.st2 10.35.78.11 80 172.17.0.2 48388
- BackendStart 10.35.78.11 80
- Timestamp Bereq: 1490683823.763758 0.000487 0.000487
- FetchError http first read error: EOF
- BackendClose 38 reload_2017-03-20T11:32:44.st2
- Timestamp Beresp: 1490683823.764271 0.000999 0.000513
- Timestamp Error: 1490683823.764277 0.001005 0.000005
- BerespProtocol HTTP/1.1
- BerespStatus 503
- BerespReason Service Unavailable
- BerespReason Backend fetch failed
- BerespHeader Date: Tue, 28 Mar 2017 06:50:23 GMT
- BerespHeader Server: Varnish
- VCL_call BACKEND_ERROR
- BereqHeader X-Varnish-Backend-5xx: 1
- VCL_return retry
- Timestamp Retry: 1490683823.764294 0.001022 0.000017
- Link bereq 97940444 retry
- End

I cannot run jhipster application using the latest jhipster version 3.0

I'm using the new version of jhipster 3.0 , I created a jhipster application and when I run my application I had no error but no thing was displayed on my browser I cannot understand the problem.
I import my application to intellij and I run it from intellij.
Here is what I get in the intellij run console:
2016-03-25 01:39:33.675 DEBUG 3220 --- [nio-8080-exec-1]c.lyance.test.aop.logging.LoggingAspect : Enter: org.springframework.boot.actuate.audit.AuditEventRepository.add() with argument[s] = [AuditEvent [timestamp=Fri Mar 25 01:39:33 GMT-08:00 2016, principal=anonymousUser, type=AUTHORIZATION_FAILURE, data={type=org.springframework.security.access.AccessDeniedException, message=Access is denied}]] 2016-03-25 01:39:33.736 DEBUG 3220 --- [nio-8080-exec-1] c.lyance.test.aop.logging.LoggingAspect : Exit: org.springframework.boot.actuate.audit.AuditEventRepository.add() with result = null 2016-03-25 01:39:34.094 DEBUG 3220 --- [nio-8080-exec-1] c.l.t.s.Http401UnauthorizedEntryPoint : Pre-authenticated entry point called. Rejecting access 2016-03-25 01:39:39.922 DEBUG 3220 --- [nio-8080-exec-5] c.lyance.test.aop.logging.LoggingAspect : Enter: org.springframework.boot.actuate.audit.AuditEventRepository.add() with argument[s] = [AuditEvent [timestamp=Fri Mar 25 01:39:39 GMT-08:00 2016, principal=anonymousUser, type=AUTHORIZATION_FAILURE, data={type=org.springframework.security.access.AccessDeniedException, message=Access is denied}]]2016-03-25 01:39:39.923 DEBUG 3220 --- [nio-8080-exec-5] c.lyance.test.aop.logging.LoggingAspect : Exit:org.springframework.boot.actuate.audit.AuditEventRepository.add() with result = null 2016-03-25 01:39:39.923 DEBUG 3220 --- [nio-8080-exec-5] c.l.t.s.Http401UnauthorizedEntryPoint : Pre-authenticated entry point called. Rejecting access 2016-03-25 02:03:14.549 DEBUG 3220 --- [nio-8080-exec-6] c.lyance.test.aop.logging.LoggingAspect : Enter: org.springframework.boot.actuate.audit.AuditEventRepository.add() with argument[s] = [AuditEvent [timestamp=Fri Mar 25 02:03:11 GMT-08:00 2016, principal=anonymousUser, type=AUTHORIZATION_FAILURE, data={type=org.springframework.security.access.AccessDeniedException, message=Access is denied}]]2016-03-25 02:03:15.076 DEBUG 3220 --- [nio-8080-exec-6] c.lyance.test.aop.logging.LoggingAspect : Exit: org.springframework.boot.actuate.audit.AuditEventRepository.add() with result = null
2016-03-25 02:03:15.620 DEBUG 3220 --- [nio-8080-exec-6] c.l.t.s.Http401UnauthorizedEntryPoint : Pre-authenticated entry point called. Rejecting access
2016-03-25 02:03:21.547 DEBUG 3220 --- [nio-8080-exec-9] c.lyance.test.aop.logging.LoggingAspect : Enter: org.springframework.boot.actuate.audit.AuditEventRepository.add() with argument[s] = [AuditEvent [timestamp=Fri Mar 25 02:03:21 GMT-08:00 2016, principal=anonymousUser, type=AUTHORIZATION_FAILURE, data={type=org.springframework.security.access.AccessDeniedException, message=Access is denied}]]
2016-03-25 02:03:21.548 DEBUG 3220 --- [nio-8080-exec-9] c.lyance.test.aop.logging.LoggingAspect : Exit: org.springframework.boot.actuate.audit.AuditEventRepository.add() with result = null
2016-03-25 02:03:21.549 DEBUG 3220 --- [nio-8080-exec-9] c.l.t.s.Http401UnauthorizedEntryPoint : Pre-authenticated entry point called. Rejecting access
2016-03-25 02:03:31.991 DEBUG 3220 --- [nio-8080-exec-6] c.lyance.test.aop.logging.LoggingAspect : Enter: org.springframework.boot.actuate.audit.AuditEventRepository.add() with argument[s] = [AuditEvent [timestamp=Fri Mar 25 02:03:31 GMT-08:00 2016, principal=anonymousUser, type=AUTHORIZATION_FAILURE, data={type=org.springframework.security.access.AccessDeniedException, message=Access is denied}]]
2016-03-25 02:03:31.992 DEBUG 3220 --- [nio-8080-exec-6] c.lyance.test.aop.logging.LoggingAspect : Exit: org.springframework.boot.actuate.audit.AuditEventRepository.add() with result = null
2016-03-25 02:03:31.992 DEBUG 3220 --- [nio-8080-exec-6] c.l.t.s.Http401UnauthorizedEntryPoint : Pre-authenticated entry point called. Rejecting access
2016-03-25 02:03:39.009 DEBUG 3220 --- [nio-8080-exec-2] c.lyance.test.aop.logging.LoggingAspect : Enter: org.springframework.boot.actuate.audit.AuditEventRepository.add() with argument[s] = [AuditEvent [timestamp=Fri Mar 25 02:03:39 GMT-08:00 2016, principal=anonymousUser, type=AUTHORIZATION_FAILURE, data={type=org.springframework.security.access.AccessDeniedException, message=Access is denied}]]
2016-03-25 02:03:39.009 DEBUG 3220 --- [nio-8080-exec-2] c.lyance.test.aop.logging.LoggingAspect : Exit: org.springframework.boot.actuate.audit.AuditEventRepository.add() with result = null
2016-03-25 02:03:39.010 DEBUG 3220 --- [nio-8080-exec-2] c.l.t.s.Http401UnauthorizedEntryPoint : Pre-authenticated entry point called. Rejecting access
2016-03-25 02:03:43.700 DEBUG 3220 --- [nio-8080-exec-1] c.lyance.test.aop.logging.LoggingAspect : Enter: org.springframework.boot.actuate.audit.AuditEventRepository.add() with argument[s] = [AuditEvent [timestamp=Fri Mar 25 02:03:43 GMT-08:00 2016, principal=anonymousUser, type=AUTHORIZATION_FAILURE, data={type=org.springframework.security.access.AccessDeniedException, message=Access is denied}]]
2016-03-25 02:03:43.701 DEBUG 3220 --- [nio-8080-exec-1] c.lyance.test.aop.logging.LoggingAspect : Exit: org.springframework.boot.actuate.audit.AuditEventRepository.add() with result = null
2016-03-25 02:03:43.701 DEBUG 3220 --- [nio-8080-exec-1] c.l.t.s.Http401UnauthorizedEntryPoint : Pre-authenticated entry point called. Rejecting access
2016-03-25 02:03:48.072 DEBUG 3220 --- [nio-8080-exec-9] c.lyance.test.aop.logging.LoggingAspect : Enter: org.springframework.boot.actuate.audit.AuditEventRepository.add() with argument[s] = [AuditEvent [timestamp=Fri Mar 25 02:03:48 GMT-08:00 2016, principal=anonymousUser, type=AUTHORIZATION_FAILURE, data={type=org.springframework.security.access.AccessDeniedException, message=Access is denied}]]
2016-03-25 02:03:48.072 DEBUG 3220 --- [nio-8080-exec-9] c.lyance.test.aop.logging.LoggingAspect : Exit: org.springframework.boot.actuate.audit.AuditEventRepository.add() with result = null
2016-03-25 02:03:48.073 DEBUG 3220 --- [nio-8080-exec-9] c.l.t.s.Http401UnauthorizedEntryPoint : Pre-authenticated entry point called. Rejecting access
2016-03-25 02:03:51.393 DEBUG 3220 --- [nio-8080-exec-5] c.lyance.test.aop.logging.LoggingAspect : Enter: org.springframework.boot.actuate.audit.AuditEventRepository.add() with argument[s] = [AuditEvent [timestamp=Fri Mar 25 02:03:51 GMT-08:00 2016, principal=anonymousUser, type=AUTHORIZATION_FAILURE, data={type=org.springframework.security.access.AccessDeniedException, message=Access is denied}]]
2016-03-25 02:03:51.393 DEBUG 3220 --- [nio-8080-exec-5] c.lyance.test.aop.logging.LoggingAspect : Exit: org.springframework.boot.actuate.audit.AuditEventRepository.add() with result = null
2016-03-25 02:03:51.421 DEBUG 3220 --- [nio-8080-exec-5] c.l.t.s.Http401UnauthorizedEntryPoint : Pre-authenticated entry point called. Rejecting access
2016-03-25 02:05:13.542 DEBUG 3220 --- [nio-8080-exec-7] c.lyance.test.aop.logging.LoggingAspect : Enter: org.springframework.boot.actuate.audit.AuditEventRepository.add() with argument[s] = [AuditEvent [timestamp=Fri Mar 25 02:05:13 GMT-08:00 2016, principal=anonymousUser, type=AUTHORIZATION_FAILURE, data={type=org.springframework.security.access.AccessDeniedException, message=Access is denied}]]
2016-03-25 02:05:13.543 DEBUG 3220 --- [nio-8080-exec-7] c.lyance.test.aop.logging.LoggingAspect : Exit: org.springframework.boot.actuate.audit.AuditEventRepository.add() with result = null
2016-03-25 02:05:13.544 DEBUG 3220 --- [nio-8080-exec-7] c.l.t.s.Http401UnauthorizedEntryPoint : Pre-authenticated entry point called. Rejecting access
2016-03-25 02:05:19.580 DEBUG 3220 --- [nio-8080-exec-1] c.lyance.test.aop.logging.LoggingAspect : Enter: org.springframework.boot.actuate.audit.AuditEventRepository.add() with argument[s] = [AuditEvent [timestamp=Fri Mar 25 02:05:19 GMT-08:00 2016, principal=anonymousUser, type=AUTHORIZATION_FAILURE, data={type=org.springframework.security.access.AccessDeniedException, message=Access is denied}]]
2016-03-25 02:05:19.581 DEBUG 3220 --- [nio-8080-exec-1] c.lyance.test.aop.logging.LoggingAspect : Exit: org.springframework.boot.actuate.audit.AuditEventRepository.add() with result = null
2016-03-25 02:05:19.582 DEBUG 3220 --- [nio-8080-exec-1] c.l.t.s.Http401UnauthorizedEntryPoint : Pre-authenticated entry point called. Rejecting access
here is the code of .yo-rc.json file :
{
"generator-jhipster": {
"jhipsterVersion": "3.0.0",
"baseName": "test2",
"packageName": "com.lyance.test",
"packageFolder": "com/lyance/test",
"serverPort": "8080",
"authenticationType": "oauth2",
"hibernateCache": "ehcache",
"clusteredHttpSession": "no",
"websocket": "spring-websocket",
"databaseType": "sql",
"devDatabaseType": "postgresql",
"prodDatabaseType": "postgresql",
"searchEngine": "no",
"buildTool": "maven",
"useSass": true,
"applicationType": "monolith",
"testFrameworks": [
"gatling"
],
"enableTranslation": true,
"nativeLanguage": "fr",
"languages": [
"fr"
]
}
}
npm install & bower install :
npm WARN optional Skipping failed optional dependency / chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture : fsevents#1.0.9
From your .yo-rc.json file, I can see that you use SASS, it's probable that CSS were not generated, try running gulp sass.
Also for your dev workflow, you should consider running both maven and gulp as explained in the doc (Using the Java server and Gulp together): https://jhipster.github.io/development/
Hello #chouchato and #gaël-marziou
Recently, I've had to face the chouchato's error too. And I took considerable time to find a way to fix it. How the error did no sense for me, I did those (many) steps like trial and error and then the problem doesn't appeared again:
npm = 3.8.9
node = 5.9.0
1) Update NPM
2) Update all npm packages to LTS versions
3) Update yoeman package too (now 1.8.1)
4) Follow #gaël-marziou's advise: delete directory node_modules/ and bower_components/
5) I had to run npm rebuild to recompile packages C++ for Sass
6) Ran npm install & bower install
That is it. Everything is working like a charm now.

Receiving Error from Sharepoint "Server was unable to process request. ---> Site is not configured for Claims Forms Authentication."

I am trying to consume sharepoint webservices using apache httpcomponent client api.
I am able to perform a httpget and post authentication using ntlm. however attempting to post a request soap xml returns following error
Server was unable to process request. ---> Site is not configured for Claims Forms Authentication.
2014-05-22 07:57:36,241 [main] DEBUG http.wire - http-outgoing-0 >> "<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://schemas.microsoft.com/sharepoint/soap/"> <soapenv:Header/> <soapenv:Body> <soap:Login> <soap:username>sansharma</soap:username> <soap:password>******</soap:password> </soap:Login> </soapenv:Body> </soapenv:Envelope>"
2014-05-22 07:57:42,141 [main] DEBUG http.wire - http-outgoing-0 << "HTTP/1.1 500 Internal Server Error[\r][\n]"
2014-05-22 07:57:42,142 [main] DEBUG http.wire - http-outgoing-0 << "Cache-Control: private[\r][\n]"
2014-05-22 07:57:42,142 [main] DEBUG http.wire - http-outgoing-0 << "Content-Type: text/xml; charset=utf-8[\r][\n]"
2014-05-22 07:57:42,142 [main] DEBUG http.wire - http-outgoing-0 << "Server: Microsoft-IIS/8.0[\r][\n]"
2014-05-22 07:57:42,142 [main] DEBUG http.wire - http-outgoing-0 << "X-AspNet-Version: 4.0.30319[\r][\n]"
2014-05-22 07:57:42,142 [main] DEBUG http.wire - http-outgoing-0 << "SPRequestGuid: e63e939c-895c-9011-4ed2-bbaeb1a6574b[\r][\n]"
2014-05-22 07:57:42,142 [main] DEBUG http.wire - http-outgoing-0 << "request-id: e63e939c-895c-9011-4ed2-bbaeb1a6574b[\r][\n]"
2014-05-22 07:57:42,143 [main] DEBUG http.wire - http-outgoing-0 << "X-FRAME-OPTIONS: SAMEORIGIN[\r][\n]"
2014-05-22 07:57:42,143 [main] DEBUG http.wire - http-outgoing-0 << "SPRequestDuration: 5485[\r][\n]"
2014-05-22 07:57:42,143 [main] DEBUG http.wire - http-outgoing-0 << "SPIisLatency: 1[\r][\n]"
2014-05-22 07:57:42,143 [main] DEBUG http.wire - http-outgoing-0 << "Persistent-Auth: false[\r][\n]"
2014-05-22 07:57:42,143 [main] DEBUG http.wire - http-outgoing-0 << "X-Powered-By: ASP.NET[\r][\n]"
2014-05-22 07:57:42,144 [main] DEBUG http.wire - http-outgoing-0 << "MicrosoftSharePointTeamServices: 15.0.0.4420[\r][\n]"
2014-05-22 07:57:42,144 [main] DEBUG http.wire - http-outgoing-0 << "X-Content-Type-Options: nosniff[\r][\n]"
2014-05-22 07:57:42,144 [main] DEBUG http.wire - http-outgoing-0 << "X-MS-InvokeApp: 1; RequireReadOnly[\r][\n]"
2014-05-22 07:57:42,144 [main] DEBUG http.wire - http-outgoing-0 << "Date: Thu, 22 May 2014 02:27:56 GMT[\r][\n]"
2014-05-22 07:57:42,144 [main] DEBUG http.wire - http-outgoing-0 << "Content-Length: 443[\r][\n]"
2014-05-22 07:57:42,144 [main] DEBUG http.wire - http-outgoing-0 << "[\r][\n]"
2014-05-22 07:57:42,144 [main] DEBUG http.wire - http-outgoing-0 << "<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><soap:Fault><faultcode>soap:Server</faultcode><faultstring>Server was unable to process request. ---> Site is not configured for Claims Forms Authentication.</faultstring><detail /></soap:Fault></soap:Body></soap:Envelope>"
Is this a configuration issue. I am trying to invoke the authorization service with login operation.
regards
San Sharma

Resources