Hi Chris

I would suggest installing the Equinox log service bundle 
org.eclipse.equinox.log. The SCR will log exceptions such as these to the 
LogService, if available.  Since the LogService is purely a message-sink, 
you'll either have to add a LogListener to the LogReaderService to dump 
log events to the console, or simply use the Equinox OSGi console's "log" 
command to do that for you.  The downside of the "log" command is that it 
simply dumps the entire contents of the LogService's internal buffer (by 
default 100 entries), which might mean that you will miss important 
messages if the application is particularly noisy.

Good luck,

Simon





"Chris Hopkins" <[EMAIL PROTECTED]> 
Sent by: [EMAIL PROTECTED]
07/24/2008 09:46 AM
Please respond to
Equinox development mailing list <[email protected]>


To
"Equinox development mailing list" <[email protected]>
cc

Subject
[equinox-dev] Declarative Services exception






Hi –
 
We are using DS for our project and have run into a situation where an 
exception is being swallowed somewhere and we only see it when we turn 
tracing on for the OSGi jar in our run configuration. Included below is an 
example of the exception that is happening within the constructor of our 
service. Is there a way to surface these exceptions without resorting to 
turning on tracing.
 
Thanks,
Chris
 
GenerateScenarioCommandComponentName Service Registration.getService() 
exception: Exception occured while creating new instance of component 
GenerateScenarioCommandComponentName
org.osgi.service.component.ComponentException: Exception occured while 
creating new instance of component GenerateScenarioCommandComponentName
   at 
org.eclipse.equinox.ds.model.ServiceComponent.createInstance(ServiceComponent.java:215)
   at 
org.eclipse.equinox.ds.model.ServiceComponentProp.createInstance(ServiceComponentProp.java:229)
   at 
org.eclipse.equinox.ds.model.ServiceComponentProp.build(ServiceComponentProp.java:282)
   at 
org.eclipse.equinox.ds.InstanceProcess.buildComponent(InstanceProcess.java:435)
   at org.eclipse.equinox.ds.ServiceReg.getService(ServiceReg.java:51)
   at 
org.eclipse.osgi.framework.internal.core.ServiceUse$1.run(ServiceUse.java:108)
   at java.security.AccessController.doPrivileged(Native Method)
   at 
org.eclipse.osgi.framework.internal.core.ServiceUse.getService(ServiceUse.java:106)
   at 
org.eclipse.osgi.framework.internal.core.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:345)
   at 
org.eclipse.osgi.framework.internal.core.BundleContextImpl.getService(BundleContextImpl.java:884)
   at 
org.eclipse.equinox.ds.InstanceProcess.getService(InstanceProcess.java:492)
   at 
org.eclipse.equinox.ds.model.ComponentReference.getMethod(ComponentReference.java:115)
   at 
org.eclipse.equinox.ds.model.ComponentReference.bind(ComponentReference.java:215)
   at 
org.eclipse.equinox.ds.model.ServiceComponentProp.bindReference(ServiceComponentProp.java:373)
   at 
org.eclipse.equinox.ds.model.ServiceComponentProp.bind(ServiceComponentProp.java:196)
   at 
org.eclipse.equinox.ds.model.ServiceComponentProp.build(ServiceComponentProp.java:294)
   at 
org.eclipse.equinox.ds.InstanceProcess.buildComponent(InstanceProcess.java:435)
   at org.eclipse.equinox.ds.ServiceReg.getService(ServiceReg.java:51)
   at 
org.eclipse.osgi.framework.internal.core.ServiceUse$1.run(ServiceUse.java:108)
   at java.security.AccessController.doPrivileged(Native Method)
   at 
org.eclipse.osgi.framework.internal.core.ServiceUse.getService(ServiceUse.java:106)
   at 
org.eclipse.osgi.framework.internal.core.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:345)
   at 
org.eclipse.osgi.framework.internal.core.BundleContextImpl.getService(BundleContextImpl.java:884)
   at 
org.eclipse.equinox.ds.InstanceProcess.getService(InstanceProcess.java:492)
   at 
org.eclipse.equinox.ds.model.ComponentReference.getMethod(ComponentReference.java:115)
   at 
org.eclipse.equinox.ds.model.ComponentReference.bind(ComponentReference.java:215)
   at 
org.eclipse.equinox.ds.model.ServiceComponentProp.bindReference(ServiceComponentProp.java:379)
   at 
org.eclipse.equinox.ds.model.ServiceComponentProp.bind(ServiceComponentProp.java:196)
   at 
org.eclipse.equinox.ds.model.ServiceComponentProp.build(ServiceComponentProp.java:294)
   at 
org.eclipse.equinox.ds.InstanceProcess.buildComponent(InstanceProcess.java:435)
   at org.eclipse.equinox.ds.ServiceReg.getService(ServiceReg.java:51)
   at 
org.eclipse.osgi.framework.internal.core.ServiceUse$1.run(ServiceUse.java:108)
   at java.security.AccessController.doPrivileged(Native Method)
   at 
org.eclipse.osgi.framework.internal.core.ServiceUse.getService(ServiceUse.java:106)
   at 
org.eclipse.osgi.framework.internal.core.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:345)
   at 
org.eclipse.osgi.framework.internal.core.BundleContextImpl.getService(BundleContextImpl.java:884)
   at 
org.eclipse.equinox.ds.InstanceProcess.getService(InstanceProcess.java:492)
   at 
org.eclipse.equinox.ds.model.ComponentReference.getMethod(ComponentReference.java:115)
   at 
org.eclipse.equinox.ds.model.ComponentReference.bind(ComponentReference.java:215)
   at 
org.eclipse.equinox.ds.model.ServiceComponentProp.bindReference(ServiceComponentProp.java:379)
   at 
org.eclipse.equinox.ds.model.ServiceComponentProp.bind(ServiceComponentProp.java:196)
   at 
org.eclipse.equinox.ds.model.ServiceComponentProp.build(ServiceComponentProp.java:294)
   at 
org.eclipse.equinox.ds.InstanceProcess.buildComponent(InstanceProcess.java:435)
   at org.eclipse.equinox.ds.ServiceReg.getService(ServiceReg.java:51)
   at 
org.eclipse.osgi.framework.internal.core.ServiceUse$1.run(ServiceUse.java:108)
   at java.security.AccessController.doPrivileged(Native Method)
   at 
org.eclipse.osgi.framework.internal.core.ServiceUse.getService(ServiceUse.java:106)
   at 
org.eclipse.osgi.framework.internal.core.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:345)
   at 
org.eclipse.osgi.framework.internal.core.BundleContextImpl.getService(BundleContextImpl.java:884)
   at 
org.eclipse.equinox.ds.InstanceProcess.getService(InstanceProcess.java:492)
   at 
org.eclipse.equinox.ds.model.ComponentReference.getMethod(ComponentReference.java:115)
   at 
org.eclipse.equinox.ds.model.ComponentReference.bind(ComponentReference.java:215)
   at 
org.eclipse.equinox.ds.model.ServiceComponentProp.bindReference(ServiceComponentProp.java:373)
   at 
org.eclipse.equinox.ds.model.ServiceComponentProp.bind(ServiceComponentProp.java:196)
   at 
org.eclipse.equinox.ds.model.ServiceComponentProp.build(ServiceComponentProp.java:294)
   at 
org.eclipse.equinox.ds.InstanceProcess.buildComponent(InstanceProcess.java:435)
   at 
org.eclipse.equinox.ds.InstanceProcess.buildComponents(InstanceProcess.java:113)
   at org.eclipse.equinox.ds.Resolver.performWork(Resolver.java:627)
   at 
org.eclipse.equinox.ds.SCRManager$QueuedJob.dispatch(SCRManager.java:593)
   at org.eclipse.equinox.ds.WorkThread.run(WorkThread.java:84)
   at 
org.eclipse.equinox.util.impl.tpt.threadpool.Executor.run(Executor.java:84)
Caused by: java.lang.NullPointerException
   at 
com.draper.jaguar.metronome.command.scenariobuilder.ScenarioBuilderCommand.getJaguarDocument(ScenarioBuilderCommand.java:71)
   at 
com.draper.jaguar.metronome.command.scenariobuilder.GenerateScenarioCommand.<init>(GenerateScenarioCommand.java:52)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native 
Method)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown 
Source)
   at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown 
Source)
   at java.lang.reflect.Constructor.newInstance(Unknown Source)
   at java.lang.Class.newInstance0(Unknown Source)
   at java.lang.Class.newInstance(Unknown Source)
   at 
org.eclipse.equinox.ds.model.ServiceComponent.createInstance(ServiceComponent.java:211)
   ... 60 more
Nested Exception:
java.lang.NullPointerException
   at 
com.draper.jaguar.metronome.command.scenariobuilder.ScenarioBuilderCommand.getJaguarDocument(ScenarioBuilderCommand.java:71)
   at 
com.draper.jaguar.metronome.command.scenariobuilder.GenerateScenarioCommand.<init>(GenerateScenarioCommand.java:52)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native 
Method)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown 
Source)
   at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown 
Source)
   at java.lang.reflect.Constructor.newInstance(Unknown Source)
   at java.lang.Class.newInstance0(Unknown Source)
   at java.lang.Class.newInstance(Unknown Source)
   at 
org.eclipse.equinox.ds.model.ServiceComponent.createInstance(ServiceComponent.java:211)
   at 
org.eclipse.equinox.ds.model.ServiceComponentProp.createInstance(ServiceComponentProp.java:229)
   at 
org.eclipse.equinox.ds.model.ServiceComponentProp.build(ServiceComponentProp.java:282)
   at 
org.eclipse.equinox.ds.InstanceProcess.buildComponent(InstanceProcess.java:435)
   at org.eclipse.equinox.ds.ServiceReg.getService(ServiceReg.java:51)
   at 
org.eclipse.osgi.framework.internal.core.ServiceUse$1.run(ServiceUse.java:108)
   at java.security.AccessController.doPrivileged(Native Method)
   at 
org.eclipse.osgi.framework.internal.core.ServiceUse.getService(ServiceUse.java:106)
   at 
org.eclipse.osgi.framework.internal.core.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:345)
   at 
org.eclipse.osgi.framework.internal.core.BundleContextImpl.getService(BundleContextImpl.java:884)
   at 
org.eclipse.equinox.ds.InstanceProcess.getService(InstanceProcess.java:492)
   at 
org.eclipse.equinox.ds.model.ComponentReference.getMethod(ComponentReference.java:115)
   at 
org.eclipse.equinox.ds.model.ComponentReference.bind(ComponentReference.java:215)
   at 
org.eclipse.equinox.ds.model.ServiceComponentProp.bindReference(ServiceComponentProp.java:373)
   at 
org.eclipse.equinox.ds.model.ServiceComponentProp.bind(ServiceComponentProp.java:196)
   at 
org.eclipse.equinox.ds.model.ServiceComponentProp.build(ServiceComponentProp.java:294)
   at 
org.eclipse.equinox.ds.InstanceProcess.buildComponent(InstanceProcess.java:435)
   at org.eclipse.equinox.ds.ServiceReg.getService(ServiceReg.java:51)
   at 
org.eclipse.osgi.framework.internal.core.ServiceUse$1.run(ServiceUse.java:108)
   at java.security.AccessController.doPrivileged(Native Method)
   at 
org.eclipse.osgi.framework.internal.core.ServiceUse.getService(ServiceUse.java:106)
   at 
org.eclipse.osgi.framework.internal.core.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:345)
   at 
org.eclipse.osgi.framework.internal.core.BundleContextImpl.getService(BundleContextImpl.java:884)
   at 
org.eclipse.equinox.ds.InstanceProcess.getService(InstanceProcess.java:492)
   at 
org.eclipse.equinox.ds.model.ComponentReference.getMethod(ComponentReference.java:115)
   at 
org.eclipse.equinox.ds.model.ComponentReference.bind(ComponentReference.java:215)
   at 
org.eclipse.equinox.ds.model.ServiceComponentProp.bindReference(ServiceComponentProp.java:379)
   at 
org.eclipse.equinox.ds.model.ServiceComponentProp.bind(ServiceComponentProp.java:196)
   at 
org.eclipse.equinox.ds.model.ServiceComponentProp.build(ServiceComponentProp.java:294)
   at 
org.eclipse.equinox.ds.InstanceProcess.buildComponent(InstanceProcess.java:435)
   at org.eclipse.equinox.ds.ServiceReg.getService(ServiceReg.java:51)
   at 
org.eclipse.osgi.framework.internal.core.ServiceUse$1.run(ServiceUse.java:108)
   at java.security.AccessController.doPrivileged(Native Method)
   at 
org.eclipse.osgi.framework.internal.core.ServiceUse.getService(ServiceUse.java:106)
   at 
org.eclipse.osgi.framework.internal.core.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:345)
   at 
org.eclipse.osgi.framework.internal.core.BundleContextImpl.getService(BundleContextImpl.java:884)
   at 
org.eclipse.equinox.ds.InstanceProcess.getService(InstanceProcess.java:492)
   at 
org.eclipse.equinox.ds.model.ComponentReference.getMethod(ComponentReference.java:115)
   at 
org.eclipse.equinox.ds.model.ComponentReference.bind(ComponentReference.java:215)
   at 
org.eclipse.equinox.ds.model.ServiceComponentProp.bindReference(ServiceComponentProp.java:379)
   at 
org.eclipse.equinox.ds.model.ServiceComponentProp.bind(ServiceComponentProp.java:196)
   at 
org.eclipse.equinox.ds.model.ServiceComponentProp.build(ServiceComponentProp.java:294)
   at 
org.eclipse.equinox.ds.InstanceProcess.buildComponent(InstanceProcess.java:435)
   at org.eclipse.equinox.ds.ServiceReg.getService(ServiceReg.java:51)
   at 
org.eclipse.osgi.framework.internal.core.ServiceUse$1.run(ServiceUse.java:108)
   at java.security.AccessController.doPrivileged(Native Method)
   at 
org.eclipse.osgi.framework.internal.core.ServiceUse.getService(ServiceUse.java:106)
   at 
org.eclipse.osgi.framework.internal.core.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:345)
   at 
org.eclipse.osgi.framework.internal.core.BundleContextImpl.getService(BundleContextImpl.java:884)
   at 
org.eclipse.equinox.ds.InstanceProcess.getService(InstanceProcess.java:492)
   at 
org.eclipse.equinox.ds.model.ComponentReference.getMethod(ComponentReference.java:115)
   at 
org.eclipse.equinox.ds.model.ComponentReference.bind(ComponentReference.java:215)
   at 
org.eclipse.equinox.ds.model.ServiceComponentProp.bindReference(ServiceComponentProp.java:373)
   at 
org.eclipse.equinox.ds.model.ServiceComponentProp.bind(ServiceComponentProp.java:196)
   at 
org.eclipse.equinox.ds.model.ServiceComponentProp.build(ServiceComponentProp.java:294)
   at 
org.eclipse.equinox.ds.InstanceProcess.buildComponent(InstanceProcess.java:435)
   at 
org.eclipse.equinox.ds.InstanceProcess.buildComponents(InstanceProcess.java:113)
   at org.eclipse.equinox.ds.Resolver.performWork(Resolver.java:627)
   at 
org.eclipse.equinox.ds.SCRManager$QueuedJob.dispatch(SCRManager.java:593)
   at org.eclipse.equinox.ds.WorkThread.run(WorkThread.java:84)
   at 
org.eclipse.equinox.util.impl.tpt.threadpool.Executor.run(Executor.java:84)
 
 
 
 
 
THIS MESSAGE IS INTENDED FOR THE USE OF THE PERSON TO WHOM IT IS 
ADDRESSED. IT MAY CONTAIN INFORMATION THAT IS PRIVILEGED, CONFIDENTIAL AND 
EXEMPT FROM DISCLOSURE UNDER APPLICABLE LAW. If you are not the intended 
recipient, your use of this message for any purpose is strictly 
prohibited. If you have received this communication in error, please 
delete the message and notify the sender so that we may correct our 
records. 
 
 
 _______________________________________________
equinox-dev mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/equinox-dev


_______________________________________________
equinox-dev mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/equinox-dev

Reply via email to