question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CXFServletExt#doPost generate 500 when INSERT to DB2

See original GitHub issue

We are currently using elastic-apm-agent-0.6.2.jar which works fine, collects data from our postgres and DB2 calls.

We wanted to try a new agent and installed, elastic-apm-agent-0.7.0-20180910.093339-71.jar, which resulted in a lot off 500’s

How and why I cant actually understand from reading the logs. I just see that before and after the result is totally different

Response-Code: 500
Encoding: UTF-8
Content-Type: text/xml
Headers: {}
Payload: <env:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Header/><env:Body><env:Fault xmlns:soap="http://schemas
.xmlsoap.org/soap/envelope/">
   <faultcode xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/">ns1:Server</faultcode>
   <faultstring>Unexpected error</faultstring>
   <detail>
      <LoginExceptionData xmlns="http://our-domain.se/our-login-path/data/v1_0" xmlns:ns2="http://our-domain.se/our-common-element-1/data/v4_6" xmlns:ns3="http://our-domain.se/our-common-element-2/data/v4_6">
         <Errormessage>(class: com/ibm/db2/jcc/am/CallableStatement, method: execute signature: ()Z) Illegal type in constant pool</Errormessage>
      </LoginExceptionData>
   </detail>
</env:Fault></env:Body></env:Envelope>

In the APM part of elastiic we did get two new requests MetricsStreamServlet#doGet CXFServletExt#doPost

It is the CXFServletExt#doPost that returns 500, it seems to be at time of INSERT

/Fredrik

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
felixbarnycommented, Sep 19, 2018

I was wrong when saying the db2 driver was compiled for Java 5. It is actually compiled for Java 2(!).

When trying to instrument the class, I get this error from Byte Buddy:

java.lang.IllegalStateException: Cannot write type to constant pool for class file version Java 2
	at net.bytebuddy.dynamic.scaffold.TypeWriter$Default$ValidatingClassVisitor$Constraint$ForClassFileVersion.assertTypeInConstantPool(TypeWriter.java:2622)
	at net.bytebuddy.dynamic.scaffold.TypeWriter$Default$ValidatingClassVisitor$Constraint$Compound.assertTypeInConstantPool(TypeWriter.java:2764)

Not quite sure though why that affects your application. I would have assumed that this class is just not being instrumented so there should actually be no harm besides the fact that the JDBC instrumentation does not work.

I have also tried the more recent version (db2jcc4), which is compiled with the byte code level 50 (Java 6) and this error did not occur. So updating your JDBC driver should fix this.

0reactions
lk95jofrcommented, Sep 18, 2018

The only reason I think it relates to -Delastic.apm.application_packages is that we specify that package, so no really good reason 😃 Unfortunately I can’t do that kind of test now (db2jcc4), it will be to much impact on our system. If you think that will solve it I recommend you to close this and when I get to that change I will notify you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Generate INSERT statements out of data in DB2-tables
Hi, DBeaver can do that even for the great DB2. Right click on the table and "Generate SQL". It will export all insert...
Read more >
Db2 12 - Codes - SQLCODE -500
The FETCH, UPDATE, DELETE, or CLOSE statement identifies a closed cursor that was defined with the WITH HOLD option. The cursor was closed...
Read more >
how to solve error "500, Internal Server error" while ...
I had the same problem, and the only way I got to solve the error was by deleting the DB2 resource from my...
Read more >
Db2 SQL Tutorial 5 - Insert Data - YouTube
FREE Courses (100+ hours) - https://calcur.tech/all-in-ones Python Course - https://calcur.tech/python-courses✓ Data Structures ...
Read more >
Create Table in DB2 | Insert Records | Select Statement
db2 create table from another table with datadb2 create table as select with data exampledb2 insert into tabledb2 create table with default ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found