java-docs-samples icon indicating copy to clipboard operation
java-docs-samples copied to clipboard

Opencensus Metric collection example failing with ClassNotFoundException

Open smn-codes opened this issue 3 years ago • 1 comments

Quickstart example that is given in the opencensus repo failing with below exception.

Exception in thread "main" java.lang.NoClassDefFoundError: com/google/api/client/json/jackson2/JacksonFactory
	at io.opencensus.exporter.stats.stackdriver.StackdriverStatsConfiguration.<clinit>(StackdriverStatsConfiguration.java:50)
	at com.example.opencensus.Quickstart.main(Quickstart.java:26)
Caused by: java.lang.ClassNotFoundException: com.google.api.client.json.jackson2.JacksonFactory
	at java.net.URLClassLoader.findClass(URLClassLoader.java:387)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
	... 2 more

I have just cloned the repo into my machine to ran the example. Did not make changes to either code or pom.xml, still I a getting the aboe exception.

Am I missing something here?

smn-codes avatar Aug 02 '22 04:08 smn-codes

@dazuma We probably should deprecate this sample in favor of OpenTelemetry. Is this in your world or can you send it to someone who should do it?

lesv avatar Aug 04 '22 23:08 lesv