7 Replies Latest reply: Mar 14, 2012 1:43 PM by René van Wijk RSS

    WebLogic Send Mail Error

    the_assface
      I am trying to set up a simple diag module to send mail when a particular event is seen in the logs. Currently I have the Mail Session setup and then the diag module with a notification and watch to bascially send me an email when the server goes to running. The managed server has nothing deployed right now but apparently does not like my configuration as the server goes to "ADMIN' lifecyle when it is started. I can start it by hitting 'RESUME" but it clearly has a problem and when I remove the mail diag fromthe server it starts fine. Any ideas?

      Log error here:

      <Error> <Diagnostics> <BEA-320052> <Error occurred while initializing a SMTP notification:
      javax.naming.NameNotFoundException: Unable to resolve 'mailSessionST'. Resolved ''; remaining name 'mailSessionST'
           at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:1139)
           at weblogic.jndi.internal.BasicNamingNode.lookupHere(BasicNamingNode.java:252)
           at weblogic.jndi.internal.ServerNamingNode.lookupHere(ServerNamingNode.java:182)
           at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:206)
           at weblogic.jndi.internal.WLEventContextImpl.lookup(WLEventContextImpl.java:254)
           Truncated. see log file for complete stacktrace
      >
      <Mar 12, 2012 10:54:24 AM CDT> <Error> <Deployer> <BEA-149231> <Unable to set the activation state to true for the application 'DiagMSRunning'.
      weblogic.application.FatalModuleException:
           at weblogic.diagnostics.module.WLDFModule.activate(WLDFModule.java:293)
           at weblogic.application.internal.flow.ModuleListenerInvoker.activate(ModuleListenerInvoker.java:227)
           at weblogic.application.internal.flow.DeploymentCallbackFlow$2.next(DeploymentCallbackFlow.java:415)
           at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:83)
           at weblogic.application.internal.flow.DeploymentCallbackFlow.activate(DeploymentCallbackFlow.java:75)
           Truncated. see log file for complete stacktrace

      Caused By: javax.naming.NameNotFoundException: Unable to resolve 'mailSessionST'. Resolved ''; remaining name 'mailSessionST'
           at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:1139)
           at weblogic.jndi.internal.BasicNamingNode.lookupHere(BasicNamingNode.java:252)
           at weblogic.jndi.internal.ServerNamingNode.lookupHere(ServerNamingNode.java:182)
           at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:206)
           at weblogic.jndi.internal.WLEventContextImpl.lookup(WLEventContextImpl.java:254)
           Truncated. see log file for complete stacktrace
        • 1. Re: WebLogic Send Mail Error
          René van Wijk
          What the JNDI name of your configured mail session (javax.naming.NameNotFoundException: Unable to resolve 'mailSessionST)

          The server is unable to find the resource. Did you target the mail session to the admin server?

          Also check the JNDI tree of the admin server, which can be found in environment, servers, admin server, and see if the resource is present.
          • 2. Re: WebLogic Send Mail Error
            the_assface
            mailSessionST is the name of the mail session created and yes, it shows up in the JNDI tree of the admin server correctly. It is targeted to the admin server. When I create the watch and notification they are targeted to the server I want to monitor the error on. I deleted the watch and notification (the entire diag module for it) and just have the mail session configured to the admin server and that seems to work now without any errors. So from there I started doing one step at a time and restart the targeted server before each activation. It SEEMS that the problem is during the creation of the notification. It hangs the console for quite a while and when I try to 'undo the changes' it tells me that it can't that there is an active 'pending' change. I removed that from the domain 'pending' folder and then restart the admin service but it seems pretty consistent in hanging there during the creation of the notification. No matter how general it is the creation of the notification never finishes and hangs the console and change never clears the pending folder. Any ideas?
            • 3. Re: WebLogic Send Mail Error
              René van Wijk
              Can you check the relevant log files, to see if there are any errors occuring?

              An example configuration can be found here: http://middlewaremagic.com/weblogic/?p=6016 (section watching and notifying).
              The example uses JMS but can be changed with a mail-session.
              • 4. Re: WebLogic Send Mail Error
                the_assface
                UPDATE: I changed the target of the mail session to the managed server and it seemed to work fine, no error in the log. Previous meesage said it could not find the jndi name, which as stated previously, was seen under the admin server jndi tree.

                Next question on this sendmail....it worked when I trapped a rule expression of MSGID and the code for a running managed server, but this was a test. What I really want a notification on is when I get a stuck thread. These really have no message ID though.

                I tried using MESSAGE rather than MSGID and trapping the expression of 'STUCK' but it didn't send me an email on this event. Is this the correct parameter for getting a stuck thread to notify me?


                Thanks!!
                • 5. Re: WebLogic Send Mail Error
                  René van Wijk
                  You can create a harvester based on the WorkManagerRuntimeMBean. This Mbean has an attribute StuckThreadCount.

                  Next, you can use the notification you already have in a watch you can base on the same WorkManagerRuntimeMBean,
                  and set a watch rule StuckThreadCount > 0.

                  Steps are described in detail here: http://middlewaremagic.com/weblogic/?p=6016 (look in the watches and notification section
                  that provides an example for the JVMRuntimeMBean and the CurrentHeapFree attribute).
                  • 6. Re: WebLogic Send Mail Error
                    the_assface
                    Thanks Rene'. Still curious though, what does the 'message' rule expression trap then? I can't seem to find much on this and it would be very handy to be able to trap just about any message or set of words you see in a log and then send an email.

                    Also, do you know of a way to have a diag set to a specific log file? That would be a nice one to have as well...

                    Thanks again
                    • 7. Re: WebLogic Send Mail Error
                      René van Wijk
                      There is some information provided here: http://docs.oracle.com/cd/E21764_01/web.1111/e13714/appendix_query.htm#i1054848

                      You can create watch rules on the server log (http://docs.oracle.com/cd/E21764_01/web.1111/e13714/appendix_query.htm#i1055052)

                      An example of using the WLDF query language can be found here: Re: Why isn't my log watch matching and sending me email?