6 Replies Latest reply on Mar 11, 2010 12:19 PM by mwexcell

    FileNotFoundException w/ NotifyEmail in JBoss-ESB 4.7

    mwexcell

      I'm trying to use NotifyEmail in JBossESB 4.7 on JBossAS 5.1GA. The notification setup in jboss-esb.xml is:

       

      <target class="NotifyEmail"
                                      host="localhost"
                                  port="25"
                                  from="changedemail@changed.com"
                                   sendTo="changedemail@changed.com"
                                   subject="Your Inventory">
                                </target>

       

       

      I keep getting the following:

       

      2010-03-03 17:38:41,468 ERROR [org.jboss.soa.esb.notification.NotificationList] (pool-29-thread-1) Can't instantiate target <target auth="false" class="NotifyEmail" from="changedemail@changed.com" host="localhost" port="25" sendTo="changedemail@changed.com" subject="Your Inventory">                          
                                </target>


      org.jboss.soa.esb.notification.NotificationException: Exception while trying to send email
          at org.jboss.soa.esb.notification.NotifyEmail.sendNotification(NotifyEmail.java:121)
          at org.jboss.soa.esb.notification.NotificationList.notifyAll(NotificationList.java:164)
          at org.jboss.soa.esb.actions.Notifier.notifyOK(Notifier.java:93)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:597)
          at org.jboss.soa.esb.listeners.message.ActionProcessorMethodInfo.processSuccess(ActionProcessorMethodInfo.java:165)
          at org.jboss.soa.esb.listeners.message.OverriddenActionLifecycleProcessor.processSuccess(OverriddenActionLifecycleProcessor.java:108)
          at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.notifySuccess(ActionProcessingPipeline.java:950)
          at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.processPipeline(ActionProcessingPipeline.java:724)
          at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.processPipeline(ActionProcessingPipeline.java:586)
          at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.process(ActionProcessingPipeline.java:420)
          at org.jboss.soa.esb.listeners.message.MessageAwareListener$TransactionalRunner.run(MessageAwareListener.java:540)
          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
          at java.lang.Thread.run(Thread.java:619)
      Caused by: org.jboss.soa.esb.listeners.message.MessageDeliverException: MessageingException while trying to send email
          at org.jboss.soa.esb.actions.routing.email.Emailer.sendEmail(Emailer.java:150)
          at org.jboss.soa.esb.actions.routing.email.Emailer.sendEmail(Emailer.java:105)
          at org.jboss.soa.esb.notification.NotifyEmail.sendNotification(NotifyEmail.java:117)
          ... 16 more
      Caused by: javax.mail.MessagingException:  (No such file or directory);
        nested exception is:
          java.io.FileNotFoundException:  (No such file or directory)
          at org.jboss.soa.esb.helpers.Email.<init>(Email.java:218)
          at org.jboss.soa.esb.actions.routing.email.Emailer.createEmailInstance(Emailer.java:264)
          at org.jboss.soa.esb.actions.routing.email.Emailer.sendEmail(Emailer.java:171)
          at org.jboss.soa.esb.actions.routing.email.Emailer.sendEmail(Emailer.java:141)
          ... 18 more
      Caused by: java.io.FileNotFoundException:  (No such file or directory)
          at java.io.RandomAccessFile.open(Native Method)
          at java.io.RandomAccessFile.<init>(RandomAccessFile.java:212)
          at org.jboss.security.plugins.FilePassword.toCharArray(FilePassword.java:110)
          at org.jboss.soa.esb.services.security.PasswordUtil.getPasswordAsString(PasswordUtil.java:69)
          at org.jboss.soa.esb.helpers.Email.initMailServerSession(Email.java:481)
          at org.jboss.soa.esb.helpers.Email.<init>(Email.java:214)
          ... 21 more

       

      This looks like it might be the same issue as reported here:

       

      https://jira.jboss.org/jira/browse/SOA-1631

       

      Have I configured something wrong?

       

      Is there a way for me to configure this so I can use an email notification with the current stable version of JBossESB?

       

      Thanks!

        • 1. Re: FileNotFoundException w/ NotifyEmail in JBoss-ESB 4.7
          mwexcell

          I get the same thing (can't find file x in this case) with:

           

          <action name="send-email" class="org.jboss.soa.esb.actions.routing.email.EmailRouter">
                                      <property name="unwrap" value="true" />
                                      <property name="host" value="localhost" />
                                      <property name="port" value="25" />
                                      <property name="auth" value="false" />
                                      <property name="username" value="realuser" />
                                      <property name="password" value="x" />
                                      <property name="from" value="jbossesb@realdomain.com" />
                                      <property name="sendTo" value="realuser@realdomain.com" />
                                      <property name="subject" value="Important message" />
                                  </action>

           

          That happens whether auth is true or false. If I leave an empty string in password or take password and username out completely, then I just get:

           

          2010-03-09 21:56:40,540 WARN  [org.jboss.soa.esb.listeners.message.ActionProcessingPipeline] (pool-41-thread-1) No fault address defined for fault message! To: JMSEpr [ PortReference < <wsa:Address jms:0.0.0.0:1099#queue/truescale_tbg_inv_export_esb/>, <wsa:ReferenceProperties jbossesb:java.naming.factory.initial : org.jnp.interfaces.NamingContextFactory/>, <wsa:ReferenceProperties jbossesb:java.naming.provider.url : 0.0.0.0:1099/>, <wsa:ReferenceProperties jbossesb:java.naming.factory.url.pkgs : org.jnp.interfaces/>, <wsa:ReferenceProperties jbossesb:destination-type : queue/>, <wsa:ReferenceProperties jbossesb:destination-name : queue/truescale_tbg_inv_export_esb/>, <wsa:ReferenceProperties jbossesb:specification-version : 1.1/>, <wsa:ReferenceProperties jbossesb:connection-factory : ConnectionFactory/>, <wsa:ReferenceProperties jbossesb:persistent : true/>, <wsa:ReferenceProperties jbossesb:acknowledge-mode : AUTO_ACKNOWLEDGE/>, <wsa:ReferenceProperties jbossesb:transacted : false/>, <wsa:ReferenceProperties jbossesb:type : urn:jboss/esb/epr/type/jms/> > ] MessageID: 374fa2bf-07cd-4b6b-b4ff-60e6164e439a RelatesTo: jms:correlationID#374fa2bf-07cd-4b6b-b4ff-60e6164e439a
          2010-03-09 21:56:41,324 DEBUG [org.jboss.jms.server.remoting.JMSServerInvocationHandler] (pool-41-thread-1) adding callback handler ServerInvokerCallbackHandler[a725r4g-kulk86-g6l7yue0-1-g6l8qwgt-hs+a725r4g-kulk86-g6l7yue0-1-g6l8qwh7-hv]
          2010-03-09 21:56:41,324 DEBUG [org.jboss.jms.server.remoting.JMSServerInvocationHandler] (pool-41-thread-1) found calllback handler for remoting session ...-g6l8qwgt-hs UID=a725r4g-kulk86-g6l7yue0-1-g6l8qwgt-hs
          2010-03-09 21:56:41,324 DEBUG [org.jboss.jms.server.connectionmanager.SimpleConnectionManager] (pool-41-thread-1) registered connection ConnectionEndpoint[yh-8hwq8l6g-1-0euy7l6g-68kluk-g4r527a] as ...-g6l8qwgt-hs
          2010-03-09 21:56:41,333 DEBUG [org.jboss.jms.server.jbosssx.JBossASSecurityMetadataStore] (pool-41-thread-1) No SecurityMetadadata was available for DeadMessageQueue, using default security config

           

          I have search these forums, and googled the various pieces of this. Could someone please point me at a working example configuration or tell me where to look? Is there more information in the fault message that isn't getting delivered, and how can I see inside of it?

           

          Thanks for your help!

          • 2. Re: FileNotFoundException w/ NotifyEmail in JBoss-ESB 4.7
            mwexcell

            Ok - I did get it working. At least in my situation, I had to point the value of the password property to the absolute pathname of a file. I generated the file with a command like:

             

            java -cp ../../../common/lib/jbosssx.jar org.jboss.security.plugins.FilePassword thisisnotmyrealsalt 12 thepass esb.password

             

            That created a file named esb.password.

             

            I then used an action configuration similar to this:

             

            <action name="send-email" class="org.jboss.soa.esb.actions.routing.email.EmailRouter">
                            <property name="unwrap" value="true" />
                            <property name="host" value="localhost" />
                            <property name="port" value="25" />
                            <property name="auth" value="false" />
                            <property name="user" value="none" />
                            <property name="password" value="/usr/local/jboss/server/default/conf/esb.password" />
                            <property name="from" value="jbossesb@realdomain.com" />
                            <property name="sendTo" value="realuser@realdomain.com" />
                            <property name="subject" value="Important message" />
                        </action>

             

            The message actually goes out.

             

            Seems like a bug - the docs seem to say that the username and password would be the actual username and password sent to the smtp server.

             

            I also found one more MAJOR issue to get it working.  I had a jbr-listener set up. The port I had it configured to listen on somehow found its way into the host string in the Emailer!

             

            Initialising mail server sesson. Properties: {mail.smtp.port=25, mail.smtp.auth=false, mail.smtp.host=localhost:9898}

             

            The 9898 is the port of the jbr listener! I commented it out - thank heavens that I didn't actually need it for this particular service - and it started working.

            • 3. Re: FileNotFoundException w/ NotifyEmail in JBoss-ESB 4.7
              mikefinnx

              Matthew,

              I had seen this issue as well. Good find. According to the jira, it's fixed in 5.0, but it's not clear to me what or where the fix is (no svn link in the jira), or if the fix will be backported to 4.x branch. Do you know?

              Mike

              • 4. Re: FileNotFoundException w/ NotifyEmail in JBoss-ESB 4.7
                mwexcell

                I don't know. Maybe someone from JBoss could chime in on this?

                 

                Matt

                • 5. Re: FileNotFoundException w/ NotifyEmail in JBoss-ESB 4.7
                  beve

                  Hi,

                   

                  JBESB-2994 was committed to this branch: http://anonsvn.jboss.org/repos/labs/labs/jbossesb/branches/JBESB_4_7_CP/ .

                  This branch is going to be merged with trunk in the next few days.

                   

                  Regards,

                   

                  /Daniel

                  1 of 1 people found this helpful
                  • 6. Re: FileNotFoundException w/ NotifyEmail in JBoss-ESB 4.7
                    mwexcell
                    Thanks for the info.