Skip to main content



      Home
Home » Eclipse Projects » Equinox » Get bundle-id and version from a classname in a stacktrace
Get bundle-id and version from a classname in a stacktrace [message #1409239] Sun, 17 August 2014 10:25 Go to next message
Eclipse UserFriend
I'm currently writing an error analysis tools that logs error messages logged via Eclipse ILog. On great utility of such an error analysis would be to fetch the bundle that declares a class mentioned in a stacktrace.

So, instead of logging:

Error
Sun Aug 17 16:01:56 CEST 2014
java.lang.NullPointerException

java.lang.NullPointerException
	at java.util.Objects.requireNonNull(Objects.java:203)
	at java.util.AbstractCollection.retainAll(AbstractCollection.java:405)
	at org.eclipse.oomph.targlets.internal.core.WorkspaceIUImporter$2.run(WorkspaceIUImporter.java:115)
	at org.eclipse.oomph.util.pde.TargetPlatformUtil.runWithTargetPlatformService(TargetPlatformUtil.java:124)
	at org.eclipse.oomph.targlets.internal.core.WorkspaceIUImporter.updateWorkspace(WorkspaceIUImporter.java:65)
	at org.eclipse.oomph.targlets.internal.core.WorkspaceIUImporter$ImportProjectsJob.run(WorkspaceIUImporter.java:171)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)



I'd like to log:

java.lang.NullPointerException
...
	at org.eclipse.oomph.targlets.internal.core.WorkspaceIUImporter$2.run(WorkspaceIUImporter.java:115) [org.eclipse.oomph.targlets, 1.0.0.v20140813-0835]
...


Is this in general possible to reconstruct this information from the equinox runtime?
I assume it would be expensive - but maybe it's not too expensive given that we may gain a lot of debugging information. If it is possible, could you briefly outline the best solution you can think of?

Thanks,
Marcel
Re: Get bundle-id and version from a classname in a stacktrace [message #1409579 is a reply to message #1409239] Mon, 18 August 2014 08:57 Go to previous messageGo to next message
Eclipse UserFriend
I'm not sure what you mean by reconstruct. The error log writer is handed the exception is simply prints the stacktrace. That is all that is fed through the Equinox logging facility. Are you wanting to change the log writer to highlight the "real" place of error? Or are you wanting to process the log entries yourself to gather this information?
Re: Get bundle-id and version from a classname in a stacktrace [message #1409591 is a reply to message #1409579] Mon, 18 August 2014 09:34 Go to previous message
Eclipse UserFriend
I thought about the second approach: do it myself.

Given an exception, I'd like to find all potential classes (and their bundles) that could have participated in that exception. It's an OSGI-ified version of http://logback.qos.ch/manual/layouts.html#xThrowable
Previous Topic:No repository found containing ... while creating a new eclipse product
Next Topic:LocationManager has disappeared ?
Goto Forum:
  


Current Time: Sun Jul 27 14:09:24 EDT 2025

Powered by FUDForum. Page generated in 0.03620 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top