Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9191671
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T20:44:28+00:00 2026-06-17T20:44:28+00:00

How to deactivate current bundle if in its activate method is thrown particular exception?

  • 0

How to deactivate current bundle if in its activate method is thrown particular exception?

    public void activate(BundleContext bundleContext) {
        try{
             if(something) throw new Exception(); 
        } catch(Exception e) {
             //deactivate bundle... 
        }
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T20:44:30+00:00Added an answer on June 17, 2026 at 8:44 pm

    I’m assuming that you’re talking about Declarative Service components, in that case, you can just let the activate method throw an exception (perhaps wrapping it inside a runtime exception), in that case the component won’t be activated.

    You should realize that the DS runtime might try to activate it more than once, though.

    There is a pretty similar question here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a ruby method (deactivate!) that is on an activeRecord class. However, I
Its related to a website that I am developing, I want to deactivate all
I can't find a way I can activate and deactivate the vibration at the
How to activate and deactivate the Rails code hyperlink using JQuery for the following
I'm trying to get spry to activate/deactivate validation depending on what was selected in
i have some problem in firefox add-on/jetpack. There its the event listener: tab.on('deactivate', cleardata);
How can I activate/deactivate dropdown of classic selectbox by clicking to link in jQuery?
I'm trying to give website admin ability to activate /deactivate or unlock multiple users
I'm trying to deactivate pythonbrew from a bash script. When inside the shell typing
When saving a form I deactivate the save button to avoid double submission. Save

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.