[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [equinox-dev] DS activation and error logging

Hi Michael,

We've also experienced this situation. When an exception is throws in the activate method, the SCR tries to activate the bundle several times. The number of times are predictable. As soon as SCR gets the control, it tries to activate satisfied components.

As a workaround for this problem, we had to catch Throwable exceptions and log them. I know this is bad, but no better solution could be found.

protected void activate(ComponentContext ctxt) {
        try {
             //
        } catch (Throwable e) {
            log.error("Bundle X activation failed", e);
        }
 }

Thanks
Sameera



On Tue, Jun 16, 2009 at 12:57 AM, Michael Furtak <mfurtak@xxxxxxx> wrote:

Where I wrote: “Is the SCR attempting to start this bundle repeatedly?”, I should have asked “Is the SCR attempting to activate this component repeatedly?”

 

 

Also, where I wrote: “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”, “one of them” is referring to an activate() method of one of the components.

 

 

I apologize for any confusion.

 

-Mike

 

 
 
 
 
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.
 

 
 

From: equinox-dev-bounces@xxxxxxxxxxx [mailto:equinox-dev-bounces@xxxxxxxxxxx] On Behalf Of Michael Furtak
Sent: Monday, June 15, 2009 3:22 PM
To: equinox-dev@xxxxxxxxxxx
Subject: [equinox-dev] DS activation and error logging

 

Hi all,

 

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)

{

System.out.println(“Failing activation”);

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.

 

 

 

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):

 

org.eclipse.equinox.ds_1.1.0.v20090601.jar

org.eclipse.equinox.event_1.1.100.v20090520-1800.jar

org.eclipse.equinox.log_1.2.0.v20090520-1800.jar

org.eclipse.equinox.util_1.0.100.v20090520-1800.jar

org.eclipse.osgi.services_3.2.0.v20090520-1800.jar

org.eclipse.osgi.util_3.2.0.v20090520-1800.jar

org.eclipse.osgi_3.5.0.v20090520.jar

 

Program arguments are:

 

-console –consoleLog

 

 

 

Any thoughts or advice would be appreciated.

 

Thanks,

-Mike Furtak

 

 

 

 

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
equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev




--
Sameera Jayasoma
Software Engineer
WSO2 Inc.
Oxygenating the Web Service Platform.
http://wso2.org/

blog: http://tech.jayasoma.org