6 Replies Latest reply on Sep 8, 2003 2:02 PM by wgunadi

    How to see System.out messages inside onMessage()

    wgunadi Newbie

      Hi,
      I've got a couple of System.out.println's in my onMessage(), when I test it, I don't see them, at first I thought my client can't send the message.

      But when I debug it (using JPDA), I can see that my onMessage() *is* being called, however, i can't see any of my System.out's

      I've seen a couple of postings in which Adrian was telling the people to 'enable TRACE' for some class. Is this what I should do?

      Would someone please be kind enough to tell me how to enable the TRACE for onMessage()

      Thanks,
      Will

        • 1. Re: How to see System.out messages inside onMessage()
          Adrian Brock Master

          The will appear on the console where you started jboss
          or in log/server.log
          They are INFO level messages in log4j

          Regards,
          Adrian

          • 2. Re: How to see System.out messages inside onMessage()
            wgunadi Newbie

            That's the funny thing, though, I *never* see my messages.

            Not on the console, neither it is in the server.log

            What am I missing?

            • 3. Re: How to see System.out messages inside onMessage()
              Raja Master

               

              "raja05" wrote:
              Do you have this in your log4j.xml in the <JBossConfig>/conf directory

              <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
              <param name="Threshold" value="INFO"/>
              <param name="Target" value="System.out"/>



              • 4. Re: How to see System.out messages inside onMessage()
                wgunadi Newbie

                Yes, this to be exact:






                <!-- The default pattern: Date Priority [Category] Message\n -->



                • 5. Re: How to see System.out messages inside onMessage()
                  dumber168 Newbie

                  hi wgunadi,

                  it's really odd to hear that System.out.println does not
                  show any on your console. it should show something
                  if the process really goes through your onMessage()
                  method.

                  if you wouldn't mind, please post your onMessage()
                  code so that we could see what really is happening
                  inside.

                  perhaps, your MDB is not actually called during
                  process. or your MDB is not properly mapped to
                  listen to your Queue.

                  cheers.

                  • 6. Re: How to see System.out messages inside onMessage()
                    wgunadi Newbie

                    If my MDB is not properly setup, how come I can put a breakpoint in it and the debugger actually stopped at the breakpoint, allows me to step through the code until it throws exception.

                    I'm not sure what else can be gathered from looking at the onMessage(), but thanks for helping (NOTE: Search for "==>" to find some clarifications in the code):

                    public void onMessage(Message msg) {

                    String strXml = null;
                    try {
                    System.out.println("got here"); ==> This one doesn't show up either in console nor server.log
                    TextMessage txtMsg = (TextMessage)msg;
                    strXml = txtMsg.getText();
                    TpCtrl tpctrl = TpCtrlParser.parseThis(strXml);
                    System.out.println("---- docid is: " + tpctrl.getDocId());

                    ServerEjbManager jndiMgr = ServerEjbManager.getInstance();
                    if (tpctrl.getDocId().equals("858")) {
                    jndiMgr.getReleaseController().processReleaseFromEdi(strXml, createUser());
                    } else if (tpctrl.getDocId().equals("850")) {
                    jndiMgr.getPoController().processPoFromEdi(tpctrl, strXml, createUser());
                    }
                    } catch (Exception ex) {
                    log.error("[CDATA[" + getStackTraceAsString(ex) + "]]" + strXml, ex); ==> This is not org.jboss.log, it's our own wrapper for log4j
                    }
                    }