OEM doesn't detect Servlet .init() failure!?!

I'm trying to move some one-time initialization into a servlet .init() method and I wanted to see what would happen in OEM (Oracle Enterprise Manager) when this servlet's init() method failed (by throwing ServletException). I was hoping to see a Stop Sign or something...but instead OEM thinks everything is fine. Does anyone know how to make OEM aware of the actual state of the Servlets deployed under the OC4J containers it maintains?
Bob
package demos;
import org.apache.struts.action.ActionServlet;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletContext;
public class MyActionServlet extends ActionServlet {
public MyActionServlet() { }
public void init() throws ServletException {
super.init();
ServletContext sc = this.getServletContext();
sc.setAttribute("AppScopeAttribute",
"sc.toString()=" + sc.toString());
sc.setAttribute("MyInitParam",
this.getInitParameter("MyInitParam"));
throw new ServletException(
new Exception("This sucks...that sucks...everything sucks")
}

Maybe if I format the source better someone will render an opinion? I'm looking for ways to have the Oracle Enterprise Manager detect and report on .init() problems in my servlets. Here is a sample servlet that does nothing but throw and exception at .init() time. How can I configure OEM to react to and report this condition?
package demos;
import org.apache.struts.action.ActionServlet;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletContext;
public class MyActionServlet extends ActionServlet {
  public MyActionServlet() { }
  public void init() throws ServletException {
    super.init();
    ServletContext sc = this.getServletContext();
    sc.setAttribute("AppScopeAttribute", "sc.toString()=" + sc.toString());
    sc.setAttribute("MyInitParam", this.getInitParameter("MyInitParam"));
    throw new ServletException( new Exception("This sucks...that sucks...everything sucks"));
}

Similar Messages

  • Configuring OEM to detect servlet.init() failures

    I'm trying to move some one-time initialization into a servlet .init() method and I wanted to see what would happen in OEM (Oracle Enterprise Manager) when this servlet's init() method failed (by throwing ServletException). I wrote a simple Servlet that does nothing but fail when it attempts to initialize. I was hoping to see a Stop Sign or something in OEM when I deloyed it, but instead OEM thinks everything is fine. Does anyone know how to make OEM aware of the actual state of the Servlets deployed under the OC4J containers?
    Bob
    package demos;
    import org.apache.struts.action.ActionServlet;
    import javax.servlet.ServletConfig;
    import javax.servlet.ServletException;
    import javax.servlet.ServletContext;
    public class MyActionServlet extends ActionServlet {
    public MyActionServlet() { }
    public void init() throws ServletException {
    super.init();
    throw new ServletException( new Exception("I failed to init...DO SOMETHING!"));

    Maybe if I format the source better someone will render an opinion? I'm looking for ways to have the Oracle Enterprise Manager detect and report on .init() problems in my servlets. Here is a sample servlet that does nothing but throw and exception at .init() time. How can I configure OEM to react to and report this condition?
    package demos;
    import org.apache.struts.action.ActionServlet;
    import javax.servlet.ServletConfig;
    import javax.servlet.ServletException;
    import javax.servlet.ServletContext;
    public class MyActionServlet extends ActionServlet {
      public MyActionServlet() { }
      public void init() throws ServletException {
        super.init();
        ServletContext sc = this.getServletContext();
        sc.setAttribute("AppScopeAttribute", "sc.toString()=" + sc.toString());
        sc.setAttribute("MyInitParam", this.getInitParameter("MyInitParam"));
        throw new ServletException( new Exception("This sucks...that sucks...everything sucks"));
    }

  • Servlet init block doesn't work with getServletContext().getRequestDispat..

    Hi Everyone,
    I am getting null pointer exception when i have coded init method inside my servlet(inside that i am fetching init parameter passed from web,xml file) and while getting requestdispatcher from context.
    if i get requestdispatcher from request then it works fine. i dont understand reason behind this behaviour.
    please give your valueable comment.
    find code below:
    public void init(ServletConfig config) throws ServletException
    enum1 = config.getInitParameterNames();
    while(enum1.hasMoreElements()){
    init_paramNm = (String)enum1.nextElement();
    init_paramVal = config.getInitParameter(init_paramNm);
    System.out.println("Name = "init_paramNm" and value = "+init_paramVal);
    getting null pointer exception with this
    RequestDispatcher rd = getServletContext().getRequestDispatcher("/ObjJSPtoServlet.jsp");
    rd.forward(request, response);
    work fine with
    RequestDispatcher rd = request.getRequestDispatcher("/ObjJSPtoServlet.jsp");
    rd.forward(request, response);

    public void init(ServletConfig config)
    throws ServletException
    Called by the servlet container to indicate to a servlet that the servlet is being placed into service. See Servlet.init(javax.servlet.ServletConfig).
    This implementation stores the ServletConfig object it receives from the servlet container for later use. When overriding this form of the method, call super.init(config). ...
    [More Info|http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/GenericServlet.html#init%28javax.servlet.ServletConfig%29]

  • Servlet init() method called multiple times

    We have a Servlet-based application which does lengthy initialization.
    We've noticed that when multiple requests arrive,
    but the Servlet's init() method has not returned yet
    for the first request, the application server calls init() multiple times.
    You can even see this with the Fortune sample
    Servlet. Starting the app server and sending 20 or 30
    simultaneous requests causes multiple Fortune Servlet init messages to appear in the kjs log.
    Why is this? We do not implement SingleThreadModel.
    Doesn't the J2EE 1.2 spec say init will be called
    only once?
    How do we prevent it?
    A Startup class which inits our
    Servlet?
    Or a synchronized block within our init method, with some checks of static member variables
    so that the initialization work only happens once?
    Or is there some kregedit magic or deployment descriptor change I could make?
    Again, it's not a SingleThreadModel issue, so don't
    point me there.
    This is iAS 6.0 SP4, on Solaris, by the way.

    Hi
    Yes,you are right. In iAS6.0 SP4 When multiple requests arrive,and the Servlet's init() method has not returned yet for the first request, the application server calls init()multiple times. This problem is resolved in iAS 6.5.
    There is no kregedit magic that will solve this problem.
    Right now the workaround is any of the solution you proposed. Or use iAS6.5. I have tested it with fortune.
    Please download it and check with your application.
    you can find free download at http://developer.iplanet.com/appserver/testdrive/testdrive_65.html
    Thanks

  • My Mac doesn't detect my windows DVD for bootcamp, help?

    hi , i just grab my Windows 7 DVD for installing windows on Mac using bootcamp , but my mac doesn't detect my windows installation disc in boot menu... how to resolve?

    You're not alone - I'm installed Windows (8 Pro 64-bit) on a MacBook Air Mid 2013 yesterday from the OEM/system builder media, and Boot Camp Assistant 5.0.4 didn't recognize the DVD. It asked for an .iso disk image instead, and I created one in a UNIX geek way**, but if you're an average mac user, you'll want to create one using the Disk Utility:
    1) Open the Disk Utility. This is in the Utilities folder (go to a finder window and type command-shift-u)
    2) Click on your DVD to select it.
    3) In the File menu, select New -> Disk Image from "HRM_CCSA_X64FRE_EN-US_DV5"… (or your Windows disk title)
    4) In the Save sheet, select Image Format: DVD/CD master. The Disk Utility saves this with the file extension/type .cdr, but this is the same file format as .iso. When the Disk Utility has finished, find the file you save and change the file extension to .iso.
    5) Launch Boot Camp Assistant and select the .iso file as the source of your Windows installation.
    Since I have a MacBook Air, the windows source was copied by the Boot Camp Assistant to a USB flash drive. MacOS X restarted and Windows was installed automatically, but the Boot Camp driver installer wasn't automatically launched at the end of the Windows install. I opened the flash drive's BootCamp folder and double clicked setup.exe.
    Voila! The best trackpad anywhere! Network! Sound! Brightness control from the keyboard! The best Windows 8 computer!
    ** In Terminal: diskutil list; diskutil unmount /Volumes/HRM_CCSA_X64FRE_EN-US_DV5; sudo dd if=/dev/disk2 of=win8pro.iso. Use the output of 'diskutil list' to match your Windows 8 CD/DVD to a disk# for the 'dd' command. Be very careful.

  • I tried to install the new iOs 7 on my iphone 4, but it wasn't completed (showing error 4005). Now, my iphone is stuck on the itunes' logo with the usb cord, and I can't use my phone. And itunes doesn't detect my iphone when I connect it on my computer.

    Hi everyone! I tried to install the new iOs 7 on my iphone 4, but it wasn't completed (showing error 4005). Now, my iphone is stuck on the itunes' logo with the usb cord, and I can't use my phone. And itunes doesn't detect my iphone when I connect it on my computer, so I can't put it in recovery mode or someting like that... What can I do?? I tried everything they tell me to do in the apple support but nothing seems to work. Thank you!

    No problem, glad to help!
    Update: my PC USB hub was connected to a USB 3 port, I connected the 30 pin cable directly to my PC, And the restore worked just fine. Restored phone from iCloud backup and seems to be working fine.

  • How can I print from iPad to a Brother printer with a TP-link tl-wps510u connected to it without using a computer? It doesn't detect the printer.

    I have a Brother printer that doesn't have wifi, but I bought a Wireless Server Print to connect to it. I want the iPad can print directly to the printer without using a computer, but the iPad doesn't detect the printer. Is that possible?

    javigomez88 wrote:
    I know that Brother has an app that works with its wireless printers, even if they are not airprint. My printer isn't wireless, is a wireless print server attached to the printer what is able to make this printer wireless. Could this app be a solution or only would work with the wireless Brother printers?
    The Apps usually only work with wireless printers, though if its free, there is no harm in trying, and see if it gets picked up, but its doubtful, as the print server would need to transmit in the same protocol the Brother Print App is expecting from the supported wireless printers. 

  • HT5167 after I updated to 10.7.4 my macbook pro 2011 doesn't detect external display anymore what should I do?

    after I updated to 10.7.4 my macbook pro 2011 doesn't detect external display anymore what should I do?

    after I updated to 10.7.4 my macbook pro 2011 doesn't detect external display anymore what should I do?

  • What is apple doing. This macbook pro doesn't detect external display, doesn't detect my wacom..

    This is awsome. Cant work on this laptop... Doesn´t detect nothing.

    Hey there mrlrsm,
    Welcome to Apple Support Communities. 
    The article below provides troubleshooting tips that may help you resolve the issue with your MacBook Pro no longer recognizing the external display.
    Apple computers: Troubleshooting issues with video on internal or external displays - Apple Support
    Ciao,
    -Jason

  • My MacBook Pro 13.3inch (Late 2011) doesn't detect earphones.

    My MacBook Pro 13.3inch (Late 2011) doesn't detect earphones being plugged in after I installed Mountain Lion. If I reboot, it works but after a few unpluggings and more plugins, it doesn't detect them anymore until I reboot. Help please.

    This may or may not fix your problem.
    Try a NVRAM reset.
    Try a SMC reset.
    If neither work, you're just going to have to take your unit into your local Apple Store or AASP and see if you've a hardware issue.
    Good luck,
    Clinton

  • Since last update on itunes, my PC doesn't detect any of my devices. HELP!

    Since I downloaded the last version of iTunes my PC doesn't detect any of my devices (ipad, ipod, iphone). Have been connecting my devices to the PC, when opening iTunes there is a legend, with the ipod saying that itunes doesnt detect the device to uninstall itunes and reinstall, have done it twice and the problem is still there. Just bought a new ipad and when I connect it to the PC iTunes doesnt detect it. When connecting my iPhone same thing happens, when I try to export the photos to the PC the folder where the photos are suppossed to be has no photos

    Hello andreaparra,
    Thanks for using Apple Support Communities.
    I found the following article that will help you in resolving this issue, where none of your devices are being recognized by iTunes.
    iOS: Device not recognized in iTunes for Windows
    http://support.apple.com/kb/TS1538
    If you get to the part where it asks you to uninstall iTunes, even though you have done it before, be sure to uninstall iTunes and the other components in the order listed.
    Take care,
    Alex H.

  • MacBook Pro doesn't detect tv as display.

    MacBook Pro doesn't detect tv as display when connected via Mini Display Port to HDMI adapter.

    Hi l,
    Is it possible to try another adapter? There have been a number of posts here about faulty adapters. Also, have you checked in Display Preferences? Selected the proper input on the TV?

  • [SOLVED] CUPS doesn't detect USB Samsung ML-2010 printer

    Hi. I only speak a little English. Sorry for that.
    I have got an USB Samsung ML-2010 printer. Before I used cups-usblp from AUR, and it worked. But it doesn't work now. The cups-usblp maintainer suggests to use cups instead of cups-usblp. Searching with google, it appears that other people don't have problems with this printer, cups, and archlinux. But I do. Cups' web interface doesn't detect it.
    Well, this is how are the things now:
    $ lsusb | grep Samsung
    Bus 002 Device 004: ID 04e8:326c Samsung Electronics Co., Ltd ML-2010P Mono Laser Printer
    $ ls -l /dev/bus/usb/002/004
    crw-rw-r-- 1 root lp 189, 131 mar  4 09:56 /dev/bus/usb/002/004
    $ grep usb /lib/udev/rules.d/50-udev-default.rules
    # 'libusb' device nodes
    SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", MODE="0664"
    SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", IMPORT{builtin}="usb_id"
    SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{ID_USB_INTERFACES}=="*:0701??:*", GROUP="lp"
    $ sudo grep SystemGroup /etc/cups/cupsd.conf
    SystemGroup sys root lp
    $ groups
    lp wheel games video audio optical storage scanner power users
    $ cat /etc/modprobe.d/blacklist.conf
    blacklist usblp
    $ lsmod | grep usblp
    (no output)
    $ cat /etc/udev/rules.d/10-cups_device_link.rules
    KERNEL=="lp[0-9]", SYMLINK+="%k", GROUP="lp"
    $ cat /etc/udev/rules.d/10-usbprinter.rules
    ATTR{idVendor}=="04e8", ATTR{idProduct}=="326c", MODE:="0660", GROUP:="lp"
    $ rc.d status cupsd
    :: Checking cupsd status                                                                                                   [STARTED]
    $ pacman -Q cups ghostscript gsfonts gutenprint foomatic-db foomatic-db-engine foomatic-db-nonfree foomatic-filters splix
    cups 1.5.2-1
    ghostscript 9.05-1
    gsfonts 1.0.7pre44-3
    gutenprint 5.2.7-3
    foomatic-db 1:4.0.7_20110707-1
    foomatic-db-engine 1:4.0.7_20110707-1
    foomatic-db-nonfree 1:4.0.7_20110707-1
    foomatic-filters 1:4.0.7_20110707-1
    splix 2.0.0-11
    I open http://localhost:631 in my browser, click "add new printer" and I get just "Serial printer #1"
    at "local printers". There isn't my printer. I use KDE, and KDE's tool for adding printers doesn's detect it either.
    I miss archlinux, but I need to print.
    What may be wrong? What may be I am missing?
    Thanks a lot for your comments and help.
    Last edited by felihommen (2012-03-04 20:33:39)

    Solved!
    Restarting cupsd didn't work.
    But reinstalling cups...
    $ sudo pacman -Rdc cups (it is a dependency of kdeadmin-system-config-printer-kde which I had installed)
    $ sudo rm -r /etc/cups/*
    I realize cupsd is already running:
    $ ps aux | grep cupsd
    root      1549  0.0  0.1  75548  4080 ?        Ss   21:04   0:00 cupsd -C /etc/cups/cupsd.conf
    felipe    1690  0.0  0.0   8416  1028 pts/1    S+   21:13   0:00 grep cups
    I kill it
    $ sudo -SIGKILL 1549
    $ ps aux | grep cupsd
    felipe    1694  0.0  0.0   8416  1024 pts/1    S+   21:13   0:00 grep cups
    Ok. Reinstall cups
    $ sudo pacman -S cups
    Start cups daemon:
    $ sudo rc.d start cupsd
    Open firefox. Go to web interface, bla, bla, bla.... And it's there!
    I feel really silly. It was a fresh install, so I didn't think about reinstalling.
    Printed some jobs and worked perfectly. I used the gutenprint driver.
    Thanks a lot, pyther.  I thought yours wasn't a very useful suggestion, but it really was. I'm so happy. I owe you.

  • Disc stuck in disc drive but computer doesn't detect disc

    I put it in and it's stuck, and I tried a bunch of methods, but the computer doesn't detect the disc and I can't get it out. Help please!!!!

       If you have not tried any of these steps, try it.
       1. Restart the computer and hold the trackpad down.
       2. Launch iTunes and eject from there.
       3. Launch Terminal.
        Applications > Utilities > Terminal
        Type in   drutil eject internal
       Press enter.

  • IMac Doesn't Detect Headphones

    I have a ~year old 24" iMac (2.8 GHz Core 2 Duo) that I just suddenly started having a problem with. I use headphones pretty regularly and they are almost always plugged into the headphone jack. Recently, I lent my headphones to someone and, when I plugged them back in, the machine doesn't detect them. The audio works just fine coming out of the internal speakers, it's just that it always comes out of the internal speakers, no matter if the headphones are plugged in or not (the headphones also work fine when plugged in somewhere else). I took a look at the Sound Preferences panel and, sure enough, it doesn't detect the headphones as plugged in. Does anyone have any suggestions on troubleshooting?
    I'm not sure it matters, but I did just recently upgraded to 10.5.6. The headphones worked after the upgrade, but it may be that this is the first time they were replugged in after the upgrade.

    It sounds like the head phone jack has been damaged. If they were connected to a port they weren't meant for, that can happen. And that in turn, can damage your audio output port.
    Try disconnecting everything but the keyboard and mouse and reboot the iMac. See if that makes a difference.
    Resetting the SMC only provides this kind of support:
    -Telling the computer when to turn on, turn off, sleep, wake, idle, and so forth.
    -Handling system resets from various commands.
    -Controlling the fans. so I doubt it can fix the audio issue.
    Check the headphone port really close, make sure there isn't any dust or link or anything that might keep the jack from connecting properly.
    Carolyn

Maybe you are looking for

  • Mail step in workflow is in infinite loop.

    Dear All,        I have created a workflow with deadline monitoring feature.In the workflow created,I have defined a mail step in a loop with loop condition priority = 8 and three minute for deadline.When the workflow gets triggered , the mail step i

  • Implementing bullet list in JTextPane

    I found an example here: http://forum.java.sun.com/thread.jsp?forum=4&thread=162662 .. which describes how to create a TextAction for implementing bullet lists with a HTMLEditorKit. The problem is that I use StyledEditorKit. Anyone know how to implem

  • Importing Slideshow into DW

    I am a newbie to FW. I have created several slideshows of my photography. I have yet to figure out how to import these shows into DW. Help is appreciated.

  • All audio disappears after exporting to .mov file

    I'm creating a short 'montage' piece, and all audio is muted except for a song which I added into the timeline. I've tried exporting it several times, even replacing the source file for the song, but nothing seems to work. The audio is visible and pl

  • L do not see an orange line in the browser for clips that are in the timeline.  What do I do?

    How do I get the orange line to show in the brewer for clips that are in the timeline.  Mine doesn't show it.