I'm trying to instrument Weblogic server using the Elastic APM Java Agent. I don't see any errors in the logs after restarting the server post applying the required JVM Arguments.
When we tried to access the application running on the Weblogic, we cannot see any data that is being sent to elastic/kibana for reporting.
I see below exception in logs.
2018-08-08 13:34:50.026 [[ACTIVE] ExecuteThread: '8' for queue: 'weblogic.kernel.Default (self-tuning)'] TRACE co.elastic.apm.impl.ElasticApmTracer - ending transaction at
java.lang.RuntimeException: this exception is just used to record where the transaction has been ended from
at co.elastic.apm.impl.ElasticApmTracer.endTransaction(ElasticApmTracer.java:257)
at co.elastic.apm.impl.transaction.Transaction.end(Transaction.java:219)
at co.elastic.apm.impl.transaction.Transaction.end(Transaction.java:210)
at co.elastic.apm.servlet.ServletTransactionHelper.onAfter(ServletTransactionHelper.java:138)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:734)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:286)
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:350)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:247)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3679)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3649)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:326)
at weblogic.security.service.SecurityManager.runAsForUserCode(SecurityManager.java:197)
at weblogic.servlet.provider.WlsSecurityProvider.runAsForUserCode(WlsSecurityProvider.java:203)
at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:71)
at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2433)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2281)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2259)
at weblogic.servlet.internal.ServletRequestImpl.runInternal(ServletRequestImpl.java:1691)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1651)
at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:270)
at weblogic.invocation.ComponentInvocationContextManager._runAs(ComponentInvocationContextManager.java:348)
at weblogic.invocation.ComponentInvocationContextManager.runAs(ComponentInvocationContextManager.java:333)
at weblogic.work.LivePartitionUtility.doRunWorkUnderContext(LivePartitionUtility.java:54)
at weblogic.work.PartitionUtility.runWorkUnderContext(PartitionUtility.java:41)
at weblogic.work.SelfTuningWorkManagerImpl.runWorkUnderContext(SelfTuningWorkManagerImpl.java:640)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:406)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:346)
It’s the actual JSON data I’m interested in. I need it to be able to see where the JSON is invalid. Alternatively, you can validate it yourself and tell me where it is invalid.
When i format it, below is the error i received.
Parse error on line 1:
..."headers":{"Date: ":,"Content-Length: ":
-----------------------^
Expecting 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '[', got ','
Like this i observed it at multiple locations, post correcting those it rendered correctly and no JSON parsing error.
Hope it helps to narrow down the issue.
Any comments about the Exception i mentioned above? Is this related to same json parsing?
What's really strange is this header key: "Date: ". Why is there a colon and a space after the header name? It seems to indicate that WebLogic returns "Date: " instead of "Date" when iterating over the header name Enumeration of javax.servlet.http.HttpServletRequest#getHeaderNames. This seems true for all headers where there is another method in the servlet API to get the header values: HttpServletRequest#getDateHeader, ServletRequest#getContentType, ServletRequest#getContentLength. Which WebLogic version are you using? This seems to be a WebLogic bug.
Nevertheless, the PR fixes the validation error. However, you won't see the value of the three aforementioned headers due to the WebLogic bug.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.