1 Reply Latest reply on Jun 10, 2004 6:24 AM by 807574

    Using GenericPortlet sublcass .. cannot get any log messages to come out.

      Hi all ..

      I'm having a lot of problems getting any exceptions or log messages dumped from my portlet to help me debug.

      I'm currently using subclass of javax.portlet.GenericPortlet and not a sublcass of com.sun.portal.providers.jsp.JSPProvider. Does that matter? Anyone know if there are issues that I might be running into here?

      More details ..

      I've tried making nice PortletException wrappers around all sorts of other exceptions .. and even using the API call:

      GenericPortlet.getPortletContext().log(<msg>,<throwable> )

      I've tweaked every debug/log/show exception config setting I can find .. including setting logger.log.level=ALL in:

      It'll mostly fail with nada .. zilch .. zero. No hint or reason why. Occasionally I'll get something useful and I'll see an exception I made .. but the other 95% of the time I get no hint.

      I've a script that searches for any file touched in /opt/SUNW*, /var/opt/SUNW* and /etc/opt/SUNW*. I regularly get the following files touched:


      Can anyone tell me where I should expect to see PortletExceptions logged? How do I turn that feature on .. just in case I've missed the config I need to change? Has anyone had any luck using the PortletContext.log(<msg>,<throwable) API calls? Is there some config that controls where that goes? (I would've assumed it all goes in the <myportlet>.log file .. but not for me.)

      Many thanks for your time ..

      p.s. Below is an example of some of the messages I do see.

      One instance I get "ERROR: Content not available" .. I get a series of
      rather unhelpful internal exceptions that (for example) complain the portlet threw an exception of some sort. If only the root cause had been printed out it would be possible to nail exactly what's going on in my code that's the issue. Unfortunately this style of "black box" debugging is taking me 10 times (literally .. honestly!) longer than it should. I have to comment out stuff and slowly add it back in again .. if only I could've seen the exception.

      (NOTE: I modifed PrefPortlet.java example .. still called the same at the minute :-) )

      From log file /var/opt/SUNWam/debug/desktop.debug ..

      06/09/2004 09:25:08:066 PM PDT: Thread[Thread-76,5,main]
      ERROR: ProviderCaller.run(): exception thrown from PrefPortlet
      com.sun.portal.providers.ProviderException: PortletWindowProvider.getContent():container exc
      eptioncom.sun.portal.container.ContainerException: PortletContainer.getMarkup():getting cont
      ent com.sun.portal.container.ContentException: PortletContainer.getMarkup(): Cannot get cont
      at com.sun.portal.providers.portletwindow.PortletWindowProvider.getContent(PortletWi
      at com.sun.portal.desktop.context.ReusableProviderCaller.run(ReusableProviderCaller.
      com.sun.portal.container.ContainerException: PortletContainer.getMarkup():getting content co
      m.sun.portal.container.ContentException: PortletContainer.getMarkup(): Cannot get content
      at com.sun.portal.container.portlet.impl.PortletContainer.getMarkup(PortletContainer

      (not much help really)

      From the file /var/opt/SUNWam/debug/<myportlet>.log (my specific portlet log) ..

      2004/06/09 21:25:08.058 PDT | Curtis First Port | SEVERE | Thread-76 | Portle
      tAppEngineServlet.HandleError()() - Error: null | LifecycleManagerImpl.getPortlet(),
      can not get portlet.
      x -----------------------------------------------------------------------------
      X javax.portlet.PortletException: LifecycleManagerImpl.getPortlet(), can not get por
      X at com.sun.portal.portletappengine.impl.LifecycleManagerImpl.getPortlet(Life
      X at com.sun.portal.portletappengine.PortletAppEngineServlet.service(PortletAp
      X at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

      (still not much help)

      Note .. i sometimes get useful exceptions dumped to that last file .. but
      it's rare .. I just can't seem to spot the pattern when they will and won't
      get printed.

      From file /var/opt/SUNWam/debug/portletcontainer.log

      2004/06/09 21:25:07.414 PDT | null | INFO | Thread-76 | Portle
      tContainer.invokePAE(): invoking:
      app name /<myportlet>
      portlet name PrefPortlet
      action RENDER | -
      2004/06/09 21:25:08.063 PDT | null | SEVERE | Thread-76 | Portle
      tContainer:executeAction(): Exception thrown from render() of <myportlet>|PrefPortlet
      |PrefPortlet | -


      (the least helpful of all!!)

      When I simply comment out the new code I added, recompile, and view the portlet again .. it works fine. If I could only see the root cause exception!!
        • 1. Re: Using GenericPortlet sublcass .. cannot get any log messages to come out.
          Ok .. weirder and weirder ...

          I left this for a while .. and then went back to my xterms where I was working .. and one of them I saw this:

          # Jun 9 21:55:14 troy server1 appservd[7440]: [ID 702911 daemon.alert] SEVERE ( 7440): hefalump - Problem setting up PAL array!
          Jun 9 21:55:14 troy java.io.FileNotFoundException: http://pie1.some.thing.com/portal/arraylist.xml
          Jun 9 21:55:14 troy at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:789)
          Jun 9 21:55:14 troy at java.net.URL.openStream(URL.java:913)
          Jun 9 21:55:14 troy at com.tarantella.portal.bell.test.WebtopHostFinder.<init>(WebtopHostFinder.java:42)
          Jun 9 21:55:14 troy at com.some.portal.test.PrefPortlet.init(PrefPortlet.java:72)
          Jun 9 21:55:14 troy at com.sun.portal.portletappengine.impl.LifecycleManagerImpl.createPortlets(LifecycleManagerImpl.java:329)
          Jun 9 21:55:14 troy at com.sun.portal.portletappengine.impl.LifecycleManagerContextListenerImpl.contextInitialized(LifecycleManagerContextListenerImpl.java:13)
          Jun 9 21:55:14 troy at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3255)
          Jun 9 21:55:14 troy at org.apache.catalina.core.StandardContext.reload(StandardContext.java:2525
          Jun 9 21:55:14 troy at com.sun.portal.portletappengine.impl.LifecycleManagerImpl.init(LifecycleManagerImpl.java:109)

          That is exactly the information I'm looking for!!!

          I've no idea how it got there .. I think the appservd process just dumped it there .. after I saw this I grep'ed the entire set of files in /opt/SUNW* /var/opt/SUNW* /etc/opt/SUNW* for "hefalump" (my unique 'log' key) and it's not in any log file.

          Anyone know what's going on?