Open tormoseng opened 9 years ago
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.
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 https://github.com/sopeco/AIM/issues/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
steffen.becker@informatik.tu-chemnitz.de www.tu-chemnitz.de
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..)
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 https://github.com/sopeco/AIM/issues/44#issuecomment-145470933.
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
steffen.becker@informatik.tu-chemnitz.de www.tu-chemnitz.de
(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