Oracle Service Bus error: ClassCastException: CountingRequestWrapper cannot be cast to ServletRequestImpl - weblogic12c

I developed a service for Oracle Service Bus and deployed on a WebLogic 12c server. The proxy service uses an HTTP adapter so that the service can be called using SOAP. The business service uses a REST adapter.
The service works fine when I test it on the integrated server or on my UAT server (which is WebLogic 12c) using the test page that's invoked from the ServiceBus console. Also tried using SOAPUI tool on two different Windows PC's.
However, when the third party invokes my service, I get an exception in my log. I added alerts and logs in my pipeline but neither of them get invoked meaning the exception happens in WebLogic before it can pass the request to my adapter.
Googling for "CountingRequestWrapper" gives zero results. I really can't figure out what is causing this.
Here's the log:
module:/MyApp/MyService path:null spec-version:3.1], request: weblogic.servlet.internal.ServletRequestImpl#35881271[
GET /MyApp/MyService?wsdl HTTP/1.1
Content-Type: text/xml;charset="utf-8"
Accept: /
Connection: Keep-Alive
]] Root cause of ServletException.
java.lang.ClassCastException: com.bea.wli.sb.transports.http.wls.CountingRequestWrapper cannot be cast to weblogic.servlet.internal.ServletRequestImpl
at com.bea.wli.sb.transports.http.wls.HttpTransportServlet.service(HttpTransportServlet.java:121)
at weblogic.servlet.FutureResponseServlet.service(FutureResponseServlet.java:24)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:295)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:260)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:137)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:353)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:25)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
I did notice that at the top it says: path: null. Could it be something to do with that?

Request from log looks like a GET to wsdl address (GET /MyApp/MyService?wsdl) and you mentioned it's a soap proxy so that should most likely be a POST to service endpoint address. I would suggest to check 3rd party client side configuration first.

Related

Identity propagation in wildfly elytron with HTTP bearer authentication

We use a elytron/token-realm with a elytron/http-authentication-factory and the BEARER_TOKEN mechanism to authenticate users. The system consists of two applications, running in separate wildfly instances. One application remotely invokes EJBs of the other application. We would like the identity of the current user to be propagated over the remote EJB call.
I am trying to set up Identity propagation according to the JBoss documentation.
BEARER_TOKEN is listed as a supported mechanism. The ejb system is configured to use the new HTTP transport (call target is http://server:port/wildfly-services), instead of the remote+http protocol.
I would expect the bearer token to be added as an HTTP “Authorization: Bearer” header by the forwarding server, when making the ejb call to the receiving server, however this does not happen and the HTTP response is 401.
This is the configuration of the forwarding server:
/subsystem=ejb3/application-security-domain=other:write-attribute(name=security-domain,value=ApplicationDomain)
/subsystem=elytron/authentication-configuration=remote-ejb-configuration:add(security-domain=ApplicationDomain)
/subsystem=elytron/authentication-context=remote-ejb-context:add(match-rules=[{authentication-configuration=remote-ejb-configuration}])
/socket-binding-group=standard-sockets/remote-destination-outbound-socket-binding=remote-partner-ejb/:add(host="server",port="8080")
/subsystem=remoting/remote-outbound-connection=remote-ejb:add(outbound-socket-binding-ref=remote-partner-ejb, authentication-context=remote-ejb-context)
/subsystem=undertow/server=default-server/host=default-host/setting=http-invoker:undefine-attribute(name=security-realm)
/subsystem=undertow/server=default-server/host=default-host/setting=http-invoker:write-attribute(name=http-authentication-factory, value=jwt-http-authentication)
And here is the error seen on the forwarding server side:
Caused by: javax.naming.AuthenticationException: WFHTTP000013: Authentication failed (full response ClientResponse{responseHeaders={Connection=[keep-alive], WWW-Authenticate=[Bearer realm="jwt-realm"], Set-Cookie=[JSESSIONID=0BAxZeBpW-RuStmtGFylfbYBpypUJYsqLMlsrw04.partner-as-76d77b7f5c-6bcb6; path=/wildfly-services], Server=[nginx/1.23.3], Content-Type=[text/html], Content-Length=[77], Date=[Mon, 09 Jan 2023 10:34:00 GMT]}, responseCode=401, status='Unauthorized', protocol=HTTP/1.1})
There is a quickstart showing identity propagation, but it uses SASL authentication, which does not support BEARER_TOKEN mechanism
Has anyone had luck with a setup like this?

Can my Web Server Issue a Client Rest Request to another REST Server

I have a web server that handles configuration set-up for various IO devices. I need to get some data from a REST server that is running on a different server. Can that web server code issue a client REST GET command to a REST server running on a different server? I tried it but I get a http 500 error. The server code is failing on the REST server request code.
I am closing out this question. Yes, your server can issue http requests to other services. I was having another problem with a self-signed certificate and the error made it look like their was a problem with my http request service.

Monitoring SOAP with zabbix

As i understand from documents, zabbix has made it possible to monitor SOAP web service by using custom headers from v2.4. but it has no clear explanation on how to do this!!can anyone explain more about this?
UPDATE: i have SOAP web service on a port on my localhost.can i monitor it's performance using zabbix 2.4?!
SOAP request usually needs custom header, e.g.:
Content-Type: application/soap+xml
You can define this custom header(s) in the Zabbix 2.4 Webmonitoring. But keep in mind, that Webmonitoring is executed from the Zabbix server (or proxy) only. Make sure, that your soap server is reachable from the Zabbix server (proxy) and only then you can use Webmonitoring. Otherwise (if service is localhost only) you have to use checks, which are executed from the zabbix agent (net.tcp.service.perf, UserParameters) and in that case you can have a problem with headers.
It depends how deeply you want to monitor your SOAP service. If it's only http connection time, then you don't need a Webmonitoring (net.tcp.service.perf is enough). If you want create some special SOAP request with response content check, then Webmonitoring is right choice for you.
Docs:
https://www.zabbix.com/documentation/2.4/manual/web_monitoring
https://www.zabbix.com/documentation/2.4/manual/config/items/itemtypes/zabbix_agent

How to get tcp/ip monitor to use authentication in Eclipse

I have a web-service defined in XML (EJB project). I override this endpoint and send it through the tcp/ip monitor - which works fine, however I get:
javax.xml.ws.WebServiceException: HTTP ( 401 ) Unauthorized address
I know the credentials and can hit the service through a browser but I can't seem to get Eclipse (IBM's RAD version) to allow me to specify the security credentials, there's no option for it:
In my XMLI have:
overriddenEndpointURI="http://localhost:8887/xxx/xxx/ServiceName"
Any suggestions?

get 502 bad gateway error when calling a webservice

In my SEAM web application running under JBOSS-AS 4.2.3 there is a plain SOAP message call to a webservice, using SOAPConnection.call().
The call ends up with a
org.jboss.remoting.CannotConnectException: Can not connect http client invoker. Invalid HTTP server response [502] - Bad Gateway.
Running the same code outside the JBOSS as a pure java application all works fine.
So question: Is there something in JBoss I have to configure that makes things work ?
Thx for answers,
Frank