Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instrumentation failed with with Multiple classes found #44

Open
tormoseng opened this issue Sep 30, 2015 · 4 comments
Open

Instrumentation failed with with Multiple classes found #44

tormoseng opened this issue Sep 30, 2015 · 4 comments

Comments

@tormoseng
Copy link

(tested with branch without-i43-server)

Context: running an application that uses the Spring framework. Same error (see below) discovered when using the detectors "Expensive Database Call" and "OLB with database scope".

The instrumentation-agent states in the log
ERROR 2015-09-29 12:50:40 o.a.m.s.EnableMeasurementServlet: Instrumentation failed with exception org.aim.api.exceptions.InstrumentationException: Multiple classes found with name javax.sql.ConnectionPoolDataSource

Stacktrace
java.util.concurrent.ExecutionException: java.lang.RuntimeException: com.sun.jersey.api.client.UniformInterfaceException: POST http://localhost:8888/agent/instrumentation/instrument returned a response status of 500 Internal Server Error
org.aim.api.exceptions.InstrumentationException: java.util.concurrent.ExecutionException: java.lang.RuntimeException: com.sun.jersey.api.client.UniformInterfaceException: POST http://localhost:8888/agent/instrumentation/instrument returned a response status of 500 Internal Server Error
at org.spotter.core.instrumentation.InstrumentationBroker.instrument(InstrumentationBroker.java:110)
at org.spotter.core.detection.AbstractDetectionController.instrumentApplication(AbstractDetectionController.java:248)
at org.spotter.ext.detection.edc.EDCDetectionController.executeExperiments(EDCDetectionController.java:108)
at org.spotter.core.detection.AbstractDetectionController.analyzeProblem(AbstractDetectionController.java:129)
at org.spotter.core.Spotter.startDiagnosis(Spotter.java:143)
at org.spotter.service.SpotterServiceWrapper$1.run(SpotterServiceWrapper.java:127)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.util.concurrent.ExecutionException: java.lang.RuntimeException: com.sun.jersey.api.client.UniformInterfaceException: POST http://localhost:8888/agent/instrumentation/instrument returned a response status of 500 Internal Server Error
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:192)
at org.spotter.core.instrumentation.InstrumentationBroker.instrument(InstrumentationBroker.java:107)
... 10 more
Caused by: java.lang.RuntimeException: com.sun.jersey.api.client.UniformInterfaceException: POST http://localhost:8888/agent/instrumentation/instrument returned a response status of 500 Internal Server Error
at org.spotter.core.instrumentation.InstrumentationBroker$Task.run(InstrumentationBroker.java:156)
... 5 more
Caused by: com.sun.jersey.api.client.UniformInterfaceException: POST http://localhost:8888/agent/instrumentation/instrument returned a response status of 500 Internal Server Error
at com.sun.jersey.api.client.WebResource.voidHandle(WebResource.java:707)
at com.sun.jersey.api.client.WebResource.access$400(WebResource.java:74)
at com.sun.jersey.api.client.WebResource$Builder.post(WebResource.java:553)
at org.aim.artifacts.instrumentation.InstrumentationClient.instrument(InstrumentationClient.java:105)
at org.spotter.ext.instrumentation.DynamicInstrumentationClient.instrument(DynamicInstrumentationClient.java:59)
at org.spotter.core.instrumentation.InstrumentationBroker$InstrumentTask.executeTask(InstrumentationBroker.java:198)
at org.spotter.core.instrumentation.InstrumentationBroker$Task.run(InstrumentationBroker.java:154)
... 5 more

@tormoseng
Copy link
Author

Comment from Steffen: The problem is that AIM (the DS instrumentation library) does not consider applications having multiple class loaders correctly - however, this is common in frameworks like Spring.

snowball77 pushed a commit that referenced this issue Oct 1, 2015
@snowball77
Copy link

I committed a hotfix to the without-i43-server branch. Could you please
try whether this fix gets you further.

The fix assumes that you do not use multiple versions of a particular
file, i.e., loaded by separate class loaders.

Am 30.09.15 um 11:28 schrieb Tor M:

(tested with branch without-i43-server)

Context: running an application that uses the Spring framework. Same
error (see below) discovered when using the detectors "Expensive
Database Call" and "OLB with database scope".

The instrumentation-agent states in the log
ERROR 2015-09-29 12:50:40 o.a.m.s.EnableMeasurementServlet:
Instrumentation failed with exception
org.aim.api.exceptions.InstrumentationException: Multiple classes found
with name javax.sql.ConnectionPoolDataSource

Stacktrace
java.util.concurrent.ExecutionException: java.lang.RuntimeException:
com.sun.jersey.api.client.UniformInterfaceException: POST
http://localhost:8888/agent/instrumentation/instrument returned a
response status of 500 Internal Server Error
org.aim.api.exceptions.InstrumentationException:
java.util.concurrent.ExecutionException: java.lang.RuntimeException:
com.sun.jersey.api.client.UniformInterfaceException: POST
http://localhost:8888/agent/instrumentation/instrument returned a
response status of 500 Internal Server Error
at
org.spotter.core.instrumentation.InstrumentationBroker.instrument(InstrumentationBroker.java:110)
at
org.spotter.core.detection.AbstractDetectionController.instrumentApplication(AbstractDetectionController.java:248)
at
org.spotter.ext.detection.edc.EDCDetectionController.executeExperiments(EDCDetectionController.java:108)
at
org.spotter.core.detection.AbstractDetectionController.analyzeProblem(AbstractDetectionController.java:129)
at org.spotter.core.Spotter.startDiagnosis(Spotter.java:143)
at
org.spotter.service.SpotterServiceWrapper$1.run(SpotterServiceWrapper.java:127)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.util.concurrent.ExecutionException:
java.lang.RuntimeException:
com.sun.jersey.api.client.UniformInterfaceException: POST
http://localhost:8888/agent/instrumentation/instrument returned a
response status of 500 Internal Server Error
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:192)
at
org.spotter.core.instrumentation.InstrumentationBroker.instrument(InstrumentationBroker.java:107)
... 10 more
Caused by: java.lang.RuntimeException:
com.sun.jersey.api.client.UniformInterfaceException: POST
http://localhost:8888/agent/instrumentation/instrument returned a
response status of 500 Internal Server Error
at
org.spotter.core.instrumentation.InstrumentationBroker$Task.run(InstrumentationBroker.java:156)
... 5 more
Caused by: com.sun.jersey.api.client.UniformInterfaceException: POST
http://localhost:8888/agent/instrumentation/instrument returned a
response status of 500 Internal Server Error
at com.sun.jersey.api.client.WebResource.voidHandle(WebResource.java:707)
at com.sun.jersey.api.client.WebResource.access$400(WebResource.java:74)
at com.sun.jersey.api.client.WebResource$Builder.post(WebResource.java:553)
at
org.aim.artifacts.instrumentation.InstrumentationClient.instrument(InstrumentationClient.java:105)
at
org.spotter.ext.instrumentation.DynamicInstrumentationClient.instrument(DynamicInstrumentationClient.java:59)
at
org.spotter.core.instrumentation.InstrumentationBroker$InstrumentTask.executeTask(InstrumentationBroker.java:198)
at
org.spotter.core.instrumentation.InstrumentationBroker$Task.run(InstrumentationBroker.java:154)
... 5 more


Reply to this email directly or view it on GitHub
#44.

Prof. Steffen Becker
Professur Softwaretechnik
Angewandte Informatik

Technische Universität Chemnitz
Straße der Nationen 62 | R. B216B
09111 Chemnitz
Germany

Tel: +49 371 531-36144
Fax: +49 371 531-836144

[email protected]
www.tu-chemnitz.de

@tormoseng
Copy link
Author

The fix worked well on database scope. The agent finds several executeUpdate and prepareStatements, among others. So now I have the entry-point scope with some Servlet classes, and database scope with detailed database methods. What I lack then is the middle one - the one which could tell me where the problem is in our code... I will also try the synchronized scope, but will have to build it again due to the UI-bug, which let me only pick two out of three scopes..

I coud paste the log from the instrumentation-agent in an e-mail if you like (might become a bit messy with all the text here..)

@snowball77
Copy link

This sounds good. Marcel, our student, works on the UI bug.

Am 05.10.15 um 11:14 schrieb Tor M:

The fix worked well on database scope. The agent finds several
executeUpdate and prepareStatements, among others. So now I have the
entry-point scope with some Servlet classes, and database scope with
detailed database methods. What I lack then is the middle one - the one
which could tell me where the problem is in our code... I will also try
the synchronized scope, but will have to build it again due to the
UI-bug, which let me only pick two out of three scopes..


Reply to this email directly or view it on GitHub
#44 (comment).

Prof. Steffen Becker
Professur Softwaretechnik
Angewandte Informatik

Technische Universität Chemnitz
Straße der Nationen 62 | R. B216B
09111 Chemnitz
Germany

Tel: +49 371 531-36144
Fax: +49 371 531-836144

[email protected]
www.tu-chemnitz.de

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants