[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [equinox-dev] DS activation and error logging
- From: Stoyan Boshev <s.boshev@xxxxxxxxxxx>
- Date: Tue, 16 Jun 2009 16:40:18 +0300
- Delivered-to: email@example.com
- User-agent: Thunderbird 188.8.131.52 (Windows/20090302)
Michael Furtak wrote:
I have recently upgraded to the release candidate versions of Equinox
3.5 and am seeing some unexpected behavior from DS.
The first question I have is in regard to component activation. In the
RC versions I have noticed that if an exception is thrown in the
activate() method, the SCR will attempt to instantiate the component
again, a variable number of times. As far as I can tell, this number of
times seems to be related to how many other bundles
(components/services) are activated within the framework.
So, for example:
protected void activate(ComponentContext context)
throw new RuntimeException();
“Failing activation” will be printed once for a run configuration that
includes that bundle, the OSGi bundles, and nothing else. However, if a
number of other bundles are activated, it can appear more than once. Is
the SCR attempting to start this bundle repeatedly? If so, does that
behavior jive with the specification? This behavior is new to the 3.5
releases, and did not occur in 3.4.2.
This behavior is not against the DS spec. In fact it is not described
what shall be done in such cases.
I think the current behavior is more appropriate than blacklisting the
component and never activate it again.
Perhaps there should be a limited number of tries for activation and/or
timeout for each subsequent activation try. But this seems like a
feature request. Ideally this should go also as a DS spec update. I will
post an issue to OSGi about that.
The second question I have is regarding the exception logging behavior
of DS. What has been doubly confusing about this simple example
situation is that I am not seeing any report about the exception thrown
in the activate() method. No log file is generated in the configuration
directory, and no stack trace is printed to the console. (I’m using the
–consoleLog program argument). The strange thing is that if I use a much
more complex run configuration with many bundles using DS, I can slip an
exception into the activate() method of one of them and I will see the
log file and console statements generated.
The set of Equinox jars I am using is (3.5 RC4):
Program arguments are:
The DS spec requires that errors and warnings are logged by SCR via the
LogService if available. In your configuration it is provided by the
org.eclipse.equinox.log bundle. If your environment does not have
LogService then you will not be able to see any errors from SCR.
Any thoughts or advice would be appreciated.
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
equinox-dev mailing list