7 Replies Latest reply on Sep 3, 2002 4:15 PM by mhandwork

    chapter 11 example of email forwarding

    mhandwork

      I’m trying to get the example in chapter 11 up and running and I’m not having much luck. In the documentation I’m using I’ve followed the directions exactly as they’re stated and I’m still having a problem.

      I’m using Jboss-2.4.8_Tomcat-4.0.4
      Ant 1.5
      Working with Windows 2000

      In the build.xml file in the JbossBook-2.4.x\examples directory I changed the value in line 11 to the right versions of the Jboss/Tomcat (Jboss-2.4.8_Tomcat-4.0.4)
      and in the same file I changed line 15 to read …}/Catalina/common/lib/servlet.jar

      In the build.xml file in \examples\src\main\org\jboss\chap11 I changed line 17 to read conf/catalina instead of conf/tomcat

      I start the application using the run_with_catalina.bat file and can bring up a the webpage to edit my email account information to forward email on. In the log I see that this takes place.

      Right after startup I check the log and see some errors, but some of these appear to be expected. For example, without using the JAAS there is an exception thrown when the defaultconfig is used. I imagine this is expected. what I’m not sure of is how many other exceptions are expected.

      I‘ve looked in some of the source code and see some debug statements that I don’t see in the log. What I see mostly, after startup, is this;

      [19:28:32,065,Connection] PING
      [19:28:32,065,Connection] PONG, serverIL=org.jboss.mq.il.jvm.JVMServerIL@50d124
      [19:29:32,061,Connection] PING
      [19:29:32,061,Connection] PONG, serverIL=org.jboss.mq.il.jvm.JVMServerIL@50d124

      Is this the application sending the JMS command to the queue? I have multiple new emails sitting in my account (Outlook) and nothing gets forwarded. I’ve read through the FAQ and didn’t see anything related to this.

      I’m sure I haven’t provided all the information necessary but have tried to include most of it that I felt was relevant. I’ll check this frequently and answer any other questions that anyone who could help me might have.

      thank you,
      Matt Handwork

        • 1. Re: chapter 11 example of email forwarding
          joelvogt

          the ping pong stuff is just testing the connections are okay. Put some debug in your message consumer and make sure something is making it through

          • 2. Re: chapter 11 example of email forwarding
            mhandwork

            I went through the log and did a search for "exception" then only one I came across was:

            [20:49:04,280,JMSContainerInvoker] destination not found: queue/MailQueue reason: javax.naming.NameNotFoundException: MailQueue not bound

            What can I do to remedy this? Or do I even need to?

            • 3. Re: chapter 11 example of email forwarding
              mhandwork

              I did as joelvogt suggested and put some System.out.println and log.debug statements into the code. I’m not sure where you mean when you say “message consumer” but I put statements in NewMailService, MailHandlerMDB, IMAPMsgManager, and MailAccountBean. Each of the statements I prefaced with “mah-“ and after rebuilding the xml files started the app. I did a search of the log for “mah” and came up with nothing. I looked in the command window and didn’t see any mah there either.

              On another note in the logs I see:

              [07:09:31,172,Engine] jsp: init
              [07:09:42,879,Engine] MailAccountServlet: init
              [07:09:43,099,MailAccountBean] ejbActivate, username=null
              [07:09:43,149,MailAccountBean] ejbLoad, username=mhandwork

              Shouldn’t there be a username in the ejbActivate? I looked in the code and saw that the null is hardcoded in. Is this correct?

              Thanks,
              Matt

              • 4. Re: chapter 11 example of email forwarding
                joelvogt

                Okay firstly the message consumer is most likely your mailHandlerMDB. This will take you jms messages.
                But to get these to go, you will need to fix up the exception you have

                >20:49:04,280,JMSContainerInvoker] destination not found: >queue/MailQueue reason: >javax.naming.NameNotFoundException: MailQueue not bound

                You will need to add this as a queue in the mq section of jboss.jcml. There will be other queues there, just copy paste and change the name to MailQueue. NB you do not need the queue/ part on the front in your config.

                Once this is done, fingers crossed your app will publish messages to your queue and away you go.

                • 5. Re: chapter 11 example of email forwarding
                  mhandwork

                  I did a search for jboss.jcml and found three files. I added the following code to each (not knowing which it was using):
                  <!-- Configure the mailer MailQueue -->


                  The one in /chap11 already had this, the ones in /catalina and /default did not. Now when I start the app I get the following exception:

                  [09:31:30,732,PersistenceManager] Starting
                  [09:31:30,832,PersistenceManager] Stopped
                  java.lang.NullPointerException
                  at org.jboss.mq.pm.rollinglogged.PersistenceManager.restore(PersistenceManager.java:489)

                  I feel like I need to tell you that I have only been working with this app for a couple days and I'm not that familiar with it. I'm having trouble troubleshooting myself.

                  Thanks again,
                  M

                  • 6. Re: chapter 11 example of email forwarding
                    mhandwork

                    I didnt include this error because it came right on the heels of the first, but just in case it is a symptom of something else here goes:

                    [13:27:22,031,ConfigurationService] Unexpected error
                    java.lang.NullPointerException
                    at org.jboss.mq.pm.rollinglogged.PersistenceManager.restore(PersistenceManager.java:489)

                    I'm looking in the jboss.jcml file and at the end there is a line that reads:

                    > <!-- Configure our custom NewMailService MBean -->
                    >

                    does that need to be configured somehow?

                    • 7. Re: chapter 11 example of email forwarding
                      mhandwork

                      I think I've been barking up the wrong tree. I've been using the run_with_catalina.bat and I dont think that utilizes the configs setup for chap11. Now I run the run_mailer.bat and get all kinds of exceptions.
                      -shakes head sadly-
                      not looking good.
                      I'll continue this thread in a new one