How-to remove application scope bean

I've found the following snippets to get rid of a session bean (to have it removed / recreated):
snippet 1:
FacesContext
     .getCurrentInstance()
     .getApplication()
     .createValueBinding( "#{yourBeanName}").setValue(FacesContext.getCurrentInstance(), null );snippet 2:
FacesContext.getCurrentInstance().getExternalContext().getSessionMap().remove("userBean");Would that work for application scoped beans as well? Is there a way of getting a list of all jsf beans? I need to re-initialize the web-application without deployment :S
thanks,
david

Yeah, I've tried it and it's looking good.
Is there any way I can get a list of (application scoped) jsf beans?

Similar Messages

  • Looking for best practice on application scope beans

    Hey – a portal newbie here. I’ve got some application scope beans that need to be initialized on startup. First thought was to create a servlet that would set the bean. Then I saw the GlobalApp setting, but I think that looks like it is more session scope than application… Looking to be corrected here if I am wrong.
    Is there a place where these type of things traditionally happen? Read only, so no cluster worries (I think) Using WLP 8.1 SP4 and looking for best practices. Thanks for the help!

    To support "code sharing" you need an integrated source code control system. Several options are out there but CVS (https://www.cvshome.org/) is a nice choice, and it's completely free and it runs on Windows, Linux, and most UNIX variants.
    Your next decision is on IDE and application server. These are usually from a single "source". For instance, you can choose Oracle's JDeveloper and Deploy to Oracle Application Server; or go with free NetBeans IDE and Jakarta Tomcat; or IBM's WebSphere and their application server. Selection of IDE and AppServer will likely result in heated debates.

  • Application-scope bean finalizer ?

    Hi,
    Using JSF on GlassFish. Have an application-scope bean that creates a javax.persistence.EntityManager and holds it for the duration of the application.
    When I redeploy, however, I get strange exceptions from TopLink which suggest that the state of the persistence provider is not correctly/fully cleared when undeploying. I suspect this because if I redeploy again, it (usually) works (unusually, I have to repeat the process 3 or 4 times).
    So I'm thinking of adding calls to EntityManager.close or something, when the application bean is terminated. Is there such a thing as a bean finalizer, or some method that's called by the app server when the application is undeployed ?
    BTW, the exception happens in this line of code:
    List<Quantity> qList = em.createQuery("SELECT q FROM Quantity q").getResultList();
    and the exception is:
    java.lang.ClassCastException: cannot cast class com.xxxxxx.Quantity to com.xxxxxx.Quantity ! (needless to say that I have not changed the class inbetween)
    Cheers,
    K

    Hi,
    Using JSF on GlassFish. Have an application-scope bean that creates a javax.persistence.EntityManager and holds it for the duration of the application.
    When I redeploy, however, I get strange exceptions from TopLink which suggest that the state of the persistence provider is not correctly/fully cleared when undeploying. I suspect this because if I redeploy again, it (usually) works (unusually, I have to repeat the process 3 or 4 times).
    So I'm thinking of adding calls to EntityManager.close or something, when the application bean is terminated. Is there such a thing as a bean finalizer, or some method that's called by the app server when the application is undeployed ?
    BTW, the exception happens in this line of code:
    List<Quantity> qList = em.createQuery("SELECT q FROM Quantity q").getResultList();
    and the exception is:
    java.lang.ClassCastException: cannot cast class com.xxxxxx.Quantity to com.xxxxxx.Quantity ! (needless to say that I have not changed the class inbetween)
    Cheers,
    K

  • How can a session scope bean access an application scope bean - help

    Hello,
    I have a JSP page that has references to an Application Scope and a Session Scope bean...
    <jsp:useBean id="myWebApp" scope="application" class="com.my.web.WebApplication" />
    <jsp:useBean id="myWebSession" scope="session" class="com.my.web.WebSession" />
    I would like the WebSession access methods in the WebApplication ... Can/ How does the WebSession object lookup the reference to WebApplication object?

    I don't think you should make the WebSession implement the session listener.
    The session listener will be created once, at the start of the servlet context and would be listening to all sessions. So you would have one instance of the WebSession belonging to the context (though not as an attribute), and others belonging to each session. This will be confusing in your code, I think.
    I would suggest having a different class act as the HttpSessionListener. Perhaps do something like this:
    public class WebSessionInjector implements HttpSessionListener {
      public void  sessionCreated(HttpSessionEvent e) {
        WebApplication webApp = (WebApplication)(e.getSession().getServletContext().getAttribute("webapp"));
        WebSession mySession = new WebSession();
        mySession.setWebApplication(webApp);
        e.getSession().setAttribute("mySession", mySession);
      public void sessionDestroyed(HttpSessionEvent e) { ... }
    }You may be able to use the WebApplication object itself as the listener ...
    Or, you could make the WebSession implement the HttpSessionBindingListener and use the valueBound event much like the sessionCreated event above, but from inside the WebSession object:
    public class WebSession implements HttpSessionBindingListener {
      public void  valueBound(HttpSessionBindingEvent e) {
        WebApplication webApp = (WebApplication)(e.getSession().getServletContext().getAttribute("webapp"));
        this.setWebApplication(webApp);
      public void valueUnbound(HttpSessionBindingEvent e) { ... }
    }

  • Initializing application scope beans on startup

    Hi All,
    I need to initialize an application scope managed bean on startup, and not have to wait for it to be referenced the first time.
    I was thinking of using ContextListener, but you dont have access to the faces context in the listener.
    And you cant even extend FacesServlet, since its final.
    Any ideas on how this can be achieved.
    Thanks for your help!!

    Try with FacesContext.getCurrentInstance() or http://www.jsffaq.com/Wiki.jsp?ptitle=How+to+access+FacesContext+from+the+Filter+or+Servlet%3F&page=HowToAccessFacesContextFromTheFilterOrServlet

  • Application scope bean Vs. EJB

    I want to cash some application data - and was thinking of using a singleton bean with application scope in my controller and JSP page.
    <jsp:useBean id="myBean" scope="application" class="bean.datacash" />
    I am not very familiar with EJBs - and wanted to know if it would be a mistake not to use an EJB to perform that task.
    Is there a downside to my approach?
    Thanks for any insight
    Mike

    Entity EJB'S are used as a kind of data persistence, mostly to Databases. In a way it's like a kind of cache but any changes you make to an EJB are usually persisted to the underlying data storage on a regular basis.
    Session EJB's are more for business logic and depending on the type of Session Bean you use can either remain persisted in a session state or used and thrown away.
    EJB's also require alot of code so depending on your application requirements it is kind of a big decision.
    Is the data your wanting to cache to be shared by all users using the application? Are there any race conditions that may be met by concurrent access to the data? What do you plan to do with the cached data store it in a database or just make it available to share?
    If you want to look into using EJB's then your going to require an EJB Container to run them in (this can be standalone like OpenEJB or as part of an J2EE Application server like JBoss or Oracle Application Server to name just a couple).
    Using the Singleton Javabean can keeps things simple but once you start to synchronize methods with multiple users you can find some slowing down of the logic as the singleton tries to complete a request before getting onto the next.
    The [url http://jakarta.apache.org]Jakarta team offer a package called commons pooling which is designed as a pooling framework (also a way of caching) that can come in handy, I've used it to create a custom JDBC Connection pooler and it works quite well when you get the hang of it.
    Another thing to consider is the load the application may be under at it's busiest time. How many concurrent users do you expect to access the application?
    Sorry I can't give you a real answer as that is entirely up to you and your requirements. If you have a small app that has around 20-50 users then EJBs are bit of an overkill. If you find you'll have 100+ users with lots of data to manage then EJB's are probably a good option.
    If you have a look at [url http://www.theserverside.com]the serverside web site you may find a couple of articles on data persistence or check out some of the online magazines which also have articles on this same topic.
    Anthony

  • How to remove applications from "Selected applications" list?

    I know how to delete applications from my iPhone 3G. I also understand that when I sync they will get restored on my phone if I have "Sync applications" checked and I choose the "All applications" radio button. If I want applications to "stay deleted," I need to choose the "Selected applications" radio button and make sure the ones I want to stay gone are un-checked.
    How do I "fully delete" an application, so it is both (a) no longer on my phone and (b) no longer in the "selected applications" list?
    Thanks!

    Simple go to where it has your applications in the Application menu (not tab in iPhone sync options, but the menu on left) and delete it from there.
    Say keep file when it asks if you want to delete it from your hard-drive if you at least want to keep it on your drive.
    In summary, just remove it from iTunes but keep the file. Or if you want to fully get rid of it, let it delete it from drive too. Remember, you can always re-download and even if you paid for it, it will discover you already bought it and say you can re-download for free.

  • How to remove applications

    Hi everyone, I am new to using iPhone. I have installed a number of applications into my iPhone and I need to remove some of these applications.
    Could someone help me by letting me know how to uninstall applications from iPone?
    Regards
    cbneo

    The User Guide explains everything:
    http://manuals.info.apple.com/en/iphoneuserguide.pdf
    *To remove an App Store application from your device:*
    1) Touch and hold any application icon on the Home screen until the icons start to wiggle.
    2) Tap the "x" in the corner of the application you want to delete.
    3) Tap Delete to remove the application and all of its data from your iPhone or iPod touch.
    4) Press the Home button to save your arrangement.

  • How to remove application icon from launcher..

    I want to remove application icon from launcher..
    So, i removed tag <category android:name="android.intent.category.LAUNCHER"/> in intent-filter..
    <application android:enabled="true">
              <activity android:excludeFromRecents="false">
                        <intent-filter>
                                  <action android:name="android.intent.action.MAIN"/>
                        </intent-filter>
              </activity>
    </application>
    but it's not work.. occur installing below error..
    3496 KB/s (42965 bytes in 0.012s)
            pkg: /data/local/tmp/AirTest.apk
    Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED]

    I have same problem with you but I haven't find an answer for that. Did you have your answer for the problem?
    Thanks!

  • How to remove session scope?

    Hi,
    I instantiated a bean using the JSP useBean tag and set its session scope to session. I want to at one point be able to remove the bean from session, how can I do this?
    regards
    Siliconbt

    you make the bean object null then u can remove the session.
    the above answer given in my view
    if any pls forward to me

  • How to remove application from Open With?

    Hi,
    I added by accident a wrong application to a file type in Finder. Now I would like to remove this entry from the files Open With list. How could this be done?
    Thanks and best regards
    Ralph

    Is it just that specific document you want to open with another application or is it all documents of the same format?
    #1 Hold down Ctrl key and choose Open with. Choose the application you want to open the document with. IF you want to always open this one document with another app then the pre-chosen one hold down both the CTRl and the Option key and choose application.
    #2 When you want a certain format of documents to open with another application, let us say all .rtf should open with Pages instead of Textedit, select one rtf document and use Command (apple) key and I to get the information window for this document. Somewhere in the middle you can choose with which app. to open this document with and right beneath there is another button that gives you the opportunity to open all document of the same format with the same application.
    Pardon my Swenglish, but I hope you are helped by this!

  • How to remove applications completely?

    I went to applications list and removed msn and yahoo messenger. AND I deleted the service books, restarted the phone and those icons are still there in my app list, and they work. How do I completely delete an unwanted application? Buggers won't go away. lol
    thank you,
    Didan
    Edited to add additional info: The apps I deleted on the advanced options app list are not listed in the applications list anymore, but the icons are still on the desktop and they work. Just wanted to clarify.
    Message Edited by didan on 12-20-2008 09:15 AM

    Go to Options > Advanced > Applications. Are they listed there? If so, delete.
    If not listed there, then they are not installed and all you see is an install shortcut, which is no big deal. Hide them.
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • (266436851) Q: WWSD-28 How to remove applications?

    Q:<WWSD-28> Can applications be undeployed AND removed (ie. deleted) with the console
    in WLS 6.1 or do you still need to edit the domains config.xml file manually?
    A<WWSD-28> Applications can be undeployed from the console but this does not necessarily
    remove the entry in the config.xml (other servers in the domain may still need
    them). The simplest way to ensure removal is to undeploy and then also delete
    the appropriate archive file (EAR,WAR,JAR) from the applications folder.

    Was looking in the wrong Library, found SIMBL, and removed ZZafari.
    ZZafari was installed by CosmoPod. Here's what CosmoPod's creators say (http://cocoamug.com/cosmopod/):
    Important note about CosmoPod and Safari 5.1 
    The current version of CosmoPod is not compatible with the latest Safari 5.1. We are working on a fix and we will provide a free upgrade when it's ready. Thanks for your patience.
    To uninstall CosmoPod, you can delete the following folder (quit Safari first) : /Library/Application Support/SIMBL/Plugins/CosmoPod.bundle.

  • How to remove Application icon from system tray on uninstalling the application

    Hello Friends
                        Is there any way to remove a system tray icon when i unistalled the application?
    i am making a desktop application but i am facing a problem that during uninstallation of that application it remains on the system tray.So can any body guide me any event which fire on unistallaion of application so that i can remove the application manually using cllosing event.please help me out from this poblem i am totally confused.
    Thanks and Regards
       Vineet Osho

    I have same problem with you but I haven't find an answer for that. Did you have your answer for the problem?
    Thanks!

  • How to remove application completely?

    Hello!
    I've just found some leftovers of an application I thought I have uninstalled. I tried to delete everything connected to the Cloud application I've had installed, including everything linked to it in the Library/SystemPreferences, but this is still here: https://www.evernote.com/shard/s287/sh/22ae3d46-5b47-4625-9f7d-59e6da55e42f/5947 b284f2dab2fb5fed7cde49c924f2
    It's in the System Preferences - Users & Groups.

    Select the item in that list then click on the Delete [-] button.
    For future reference:
    Uninstalling Software: The Basics
    Most OS X applications are completely self-contained "packages" that can be uninstalled by simply dragging the application to the Trash.  Applications may create preference files that are stored in the /Home/Library/Preferences/ folder.  Although they do nothing once you delete the associated application, they do take up some disk space.  If you want you can look for them in the above location and delete them, too.
    Some applications may install an uninstaller program that can be used to remove the application.  In some cases the uninstaller may be part of the application's installer, and is invoked by clicking on a Customize button that will appear during the install process.
    Some applications may install components in the /Home/Library/Applications Support/ folder.  You can also check there to see if the application has created a folder.  You can also delete the folder that's in the Applications Support folder.  Again, they don't do anything but take up disk space once the application is trashed.
    Some applications may install a startupitem or a Log In item.  Startupitems are usually installed in the /Library/StartupItems/ folder and less often in the /Home/Library/StartupItems/ folder.  Log In Items are set in the Accounts preferences.  Open System Preferences, click on the Accounts icon, then click on the LogIn Items tab.  Locate the item in the list for the application you want to remove and click on the "-" button to delete it from the list.
    Some software use startup daemons or agents that are a new feature of the OS.  Look for them in /Library/LaunchAgents/ and /Library/LaunchDaemons/ or in /Home/Library/LaunchAgents/.
    If an application installs any other files the best way to track them down is to do a Finder search using the application name or the developer name as the search term.  Unfortunately Spotlight will not look in certain folders by default.  You can modify Spotlight's behavior or use a third-party search utility, EasyFind, instead.
    Some applications install a receipt in the /Library/Receipts/ folder.  Usually with the same name as the program or the developer.  The item generally has a ".pkg" extension.  Be sure you also delete this item as some programs use it to determine if it's already installed.
    There are many utilities that can uninstall applications.  Here is a selection:
        1. AppZapper 2.0.1
        2. AppDelete 3.2.6
        3. Automaton 1.50
        4. Hazel
        5. AppCleaner 2.1.0
        6. CleanApp
        7. iTrash 1.8.2
        8. Amnesia
        9. Uninstaller 1.15.1
      10. Spring Cleaning 11.0.1
    For more information visit The XLab FAQs and read the FAQ on removing software.

Maybe you are looking for

  • Save layout in ALV-GRID OO

    Hi i'm using ALV-GRID OO and i have problems with saving my own layout. In the output-liste i have a button to chage the output, but i'm missig a button to save the new layout.   CALL METHOD GR_ALVGRID->SET_TABLE_FOR_FIRST_DISPLAY    EXPORTING       

  • Is Multiple line items can be posted?

    Hi Experts, From third party system, Fi data is coming into sap through interface, the Basic Idoc for this is ACC_INVOICE_RECEIPT03. Now , only one item per IDoc they are posting, is it possible, to post multiple line items with this basic IDoc type?

  • How to install the socket transport?

    hi i have build the sample-transport "OSB_ORACLE_HOME/samples/servicebus/sample-transport", and execute the following command: ant build-jar, after show the message: "..../Oracle_OSB1/samples/servicebus/sample-transport/build.xml:7: taskdef class web

  • Where is mail folder for import

    I need to import mail.  Where is it?  It must be in a file somewhere.  The mail Import command does a browes but I don't know where it is stored. Chuck

  • Multiple accounts with same email address

    Hello,   We are working on a system where we need a blackberry to access an email account, for example [email protected] - in this case its a POP account.  However we are also using a google apps for business account for calendaring where the login i