1 2 3 Previous Next 38 Replies Latest reply on Jun 5, 2006 9:11 AM by acoliver Go to original post
      • 15. Re: How to begin...2 instances of JB MS, 2 NICS, 1 JB AS
        gohip

        back on this topic, and no ones helping in other forums...

        i can launch two instances, of the server, or just one, by using run -b ip address

        but jboss mail server, or jboss application server, is not truly using just that IP....heres the issue

        was wondering if anyone could help...

        I have two instances of JBoss Application Server, at the moment, only one is set to run, the JBAS is actually running a JBoss Mail server instance

        I have 1 NIC, with ten IP addresses assigned to it.

        Even though I start up JBoss application server using run.bat -b 216.122.145.50

        and it is listening on the correct IP(216.122.145.50) and ports, when it connects to an outside server, i.e. on the internet it actually connects using the ip address of 216.122.145.49

        this is on a windows box

        in the routing table, there is only one interface listed, as stated, I am only using one interface, though there are 10 ip's bound to it

        the one interface, shows it's IP address as 216.122.145.49

        is routing causing the issue? or does jboss boss server, listen on whatever port and IP you tell it too, but communicate to other servers grabbing whatever IP address it can?

        any help, and insight would be greatly appreciated

        • 16. Re: How to begin...2 instances of JB MS, 2 NICS, 1 JB AS
          acoliver

           


          So at moment, is there no way whatsover I can do it? I was going to create an new Enterprise app in Netbeans, import all the source files, and change whatever I needed for the second instance that would conflict.


          The problem is that there is only one instance of "persistence context" allowed ATM. I think the problem is fairly deep.



          "We aim to have this corrected by JBMS 1.0. "
          is that still slated for June/July?


          Yes.


          "Other than that you only need to stick unique instances of each mbean in another jboss-service.xml. I don't generally know why you'd need more copies of the class files in memory other than just seperate configuration."
          But you said with the current release this wont work?


          Let us be REAL clear on what DOES NOT work. Seperate databases for user mailboxes. You can of COURSE have different listeners on different ports/ips/etc. You just have to use the same DB for all.

          Moreover you need to have UNIQUE names for each MBean (And work out the depends tree). The log you posted is a long list of "duplicate" errors. Note that for 1.0 we don't "intend" for most people to have to do this themselves. They'll just use the (to be developed) GUI.


          "Other than that you only need to stick unique instances of each mbean in another jboss-service.xml. I don't generally know why you'd need more copies of the class files in memory other than just seperate configuration."
          But you said with the current release this wont work?


          Actually you could also accomplish this by having TWO mail.ear (obviously the second one named something else). COMPLETELY unique names for MBeans. And a different "persistence context" specified in the jboss-service.xml and mail.ear/mail.par/META-INF/persistence.xml. And parameterize the persistence context in the code (currently we hard code this). That would be the quickest way. We'd take the latter as patches. It just isn't the HIGHEST priority ATM.


          is routing causing the issue? or does jboss boss server, listen on whatever port and IP you tell it too, but communicate to other servers grabbing whatever IP address it can?


          so we put 0.0.0.0 as the default bind address in mail.ear/mail.sar/META-INF/jboss-service.xml. You can CHANGE this to *some other address*. And JBMS will then only LISTEN on the ports on the address you specify. 0.0.0.0 means bind to ALL interface cards.

          However, you've pointed out a bug in that SMTPSenderMBean is not very smart in that it is SENDING OUT based on whatever the default is for a Java socket using the default route or specified DNS route... There ought to be a way to give it an IP to bind to for OUTGOING mail. This will need to be fixed I think. Now if this is LOCAL vs OUTGOING then your OS-level bindings should specify the proper IP/NIC to use and Java should obey that I think.... meaning 192.*.*.* addresses go to NIC1 and everything else to NIC2. Meaning if I go "lynx http://192.168.1.1" at the command prompt...it should go to the nic card bound to 192.168.1.101... if I got to "lynx http://google.com" ... it should go to the other card. Configuring this at the OS level negates the need for the feature I mentioned. However we SHOULD provide that abillity regardless.

          • 17. Re: How to begin...2 instances of JB MS, 2 NICS, 1 JB AS
            gohip

             

            so we put 0.0.0.0 as the default bind address in mail.ear/mail.sar/META-INF/jboss-service.xml. You can CHANGE this to *some other address*. And JBMS will then only LISTEN on the ports on the address you specify. 0.0.0.0 means bind to ALL interface cards.


            yeah, i did this, and also started run.bat with -b XXX.XXX.XXX.XXX

            However, you've pointed out a bug in that SMTPSenderMBean is not very smart in that it is SENDING OUT based on whatever the default is for a Java socket using the default route or specified DNS route... There ought to be a way to give it an IP to bind to for OUTGOING mail. This will need to be fixed I think.


            hmmm, I could find no way to specify it to the JVM, unless it couuld somehow be done through the proxy or socks config...

            my dns, host file, has an entry for the mail servers name and domain as being the IP I want it to use

            so your saying at the heart, it may be java having issues on the system, i.e. 1 interface, with 10 IP's

            Now if this is LOCAL vs OUTGOING then your OS-level bindings should specify the proper IP/NIC to use and Java should obey that I think.... meaning 192.*.*.* addresses go to NIC1 and everything else to NIC2. Meaning if I go "lynx http://192.168.1.1" at the command prompt...it should go to the nic card bound to 192.168.1.101... if I got to "lynx http://google.com" ... it should go to the other card. Configuring this at the OS level negates the need for the feature I mentioned. However we SHOULD provide that abillity regardless.


            I am having issues on outgoing as well as local, I havnt found the/any settings in windows 2003, for the adapter, to specify, which ip's to bind to what, it sucks.

            I tried telnetting into the smtp server from a command prompt locally on the server, then sending a mail to yahoo, or whomever.

            the receiving party, always interprets the mail servers IP to be a different one, though it is always the same, i.e. the only one showin up in routing table

            i also tried telnetting into our mail server from a remote device, and then sending to yahoo, or whoever, mail server is still using wrong outgoing ip to connect

            NOTE: when i manually telnet from the mail server into yahoo mail to send an email manually, i.e. send mail user to mail server, the ip being used is the wrong one. so it is being done at the windows sytem level.

            NOTE: I got this cool idea, i setup a windows SMTP server, i.e. the one preinstalled, i had to create a virtual one, as one already existed. I bound this say to address xxx.xxx.xxx.155. from the local machine, i then sent an email using MS smtp and telnet with mail server IP set to be xxx.xxx.xxx.155, check this out, netstat showed 2 connections during the whole operation...

            TCP 216.122.135.155:3110 4.79.181.135:25 ESTABLISHED

            Note: mail.mydomain.com = 216.122.135.154, and theres a host entry in host file

            and heres the telnet I used...

            Telnet 4.79.181.135 25
            EHLO mail.mydomain.com
            MAIL FROM:<jasong@mail.mydomain.com>
            RCPT TO:<jason.glass@yahoo.com>
            DATA
            X-Priority: 1
            X-MSMail-Priority: High
            Sender: jasong@mail.mydomain.com
            FROM: jasong@mail.mydomain.com
            TO: jasong.glass@yahoo.com
            SUBJECT: Test email from happy 21

            this is another telnet test email

            attempt 15

            .

            So i agree with you andrew, that it seems more like the OS level, or possibly the JVM should allow you to specify, oh, and to support the OS level issue, I did similar tests with our website ip address, even though dns points to one IP addy, and the outside connection is made with that addy, if you say download a file, or request something to be sent, you can see the system, opening another port 80, on the other, infamous ip address.

            i know your more a linux guy, but do you or anyone know, if RAS on windows server would accomplish this? I seem to remember seeing thability in it, to configure routes and port mapping?

            Thanks alot guys, and more info would be greatly appreciated

            Oh, and andrew, right now I am not so worried about the two instances, they should work, even though simplest means is to just launch two jboss containers, i guess. I just trying to resolve the issue with yahoo, and hotmail, sending our mail to spam folders, and it looks like it revolves around the incorrect IP being used to connect, i.e. IP does not match domain name, as well as possibly the SPF entry, so first trying to resolve the ip address issue...





            • 18. Re: How to begin...2 instances of JB MS, 2 NICS, 1 JB AS
              acoliver

              Yeah we will solve the SMTPSender thing shortly. I just need to look at it in more detail. I'm certain there is some solution.

              I can't answer your Windows questions just because I simply don't know. Maybe one of the Windows people here will chime in.

              • 19. Re: How to begin...2 instances of JB MS, 2 NICS, 1 JB AS
                gohip

                thanks andrew! anyone....please? this is hampering our ability to use JBoss Mail server as our production corpoaret mail server (note: we only have a few users)

                thanks...

                • 20. Re: How to begin...2 instances of JB MS, 2 NICS, 1 JB AS
                  osterday

                  Jason,

                  I looked through this thread and didn't see (or missed) why you want to run two JBCS on the same box or same JBAS. I'm curious as to why you want to do this. I guess if you had two domains that JBCS receives mail for with user@domain1.com and user@domain2.com and wanted them both to have "user" as the account name, you'd run into this, but in general, I'm not sure why.

                  • 21. Re: How to begin...2 instances of JB MS, 2 NICS, 1 JB AS
                    gohip

                    Hi osterday, this thread had begun, as the "tale of two instances", I had them running concurrenlty before, with no problems...I.e. we wanted a corporate mail server instance, as well as an website/application mail instance, with complete separation between the two.

                    I kinda got that working, but on a related issue, and relating to my last couple posts, I am having issues with either JBoss, or JBoss amil server, or Java, grabbong the wrong inet address, when it makes the outgoing connection

                    If you have any ideas, or at least where to start trying to configure it in code, heck i dont mind even hardcoding the damn thing, I will try it, or if you happen to know if it could be just setup within windows RAS, please xplain further

                    Andrew, note with above posts, how I said windows itself, when using telnet, grabbed the wrong IP, and yahoo rejected it...well I just installed Ipswitch Mail server, and while it is binding to more IP's than it is supposed to, the mail it sent, with same settings as JBoss mail server, DID NOT GO TO YAHOO BULK FOLDER

                    so we have an issue, obviously the windows .net brats, know how to choose the correct inet address, but javas having issues

                    i glanced online, and found this link for jboss mail server smtp service, but Andrew, it is unrelated, correct? you said SMTP sender was the issue, would it be possible to hard code the IP in there? It sounds like java is doing the usual, getInetAddress, but unfortunately, theres ten of em, and it's grabbing the first in the list...

                    I was happy, and hoping Ipswitch mail would fail also, but alas it did not, so If i want to get JBoss mail server up and going in our corporate prod env, instead of exchanmge or some other beast, I need to come up with a way to fix this....as I said, i dont mind recompiling the code or anything...

                    thanks guys...

                    • 22. Re: How to begin...2 instances of JB MS, 2 NICS, 1 JB AS
                      gohip

                      Nice, okay, I got EHLO working, with correct IP

                      it was doing

                      try
                       {
                       //per spec we first do ehlo
                       //jay fix for binding one instance correctly to specific ip address
                       //protocol.ehlo(InetAddress.getLocalHost());
                       protocol.ehlo(InetAddress.getByName("mail.mydomain.com"));
                      
                       //log.info("**********JAYS DEBUG:SMTPSender:sendForDomain:Try EHLO:InetAdress.getLocalHost=" + InetAddress.getLocalHost());
                       }
                       catch (SMTPException e)
                       {
                       //jay fix for binding one instance correctly to specific ip address
                       //protocol.ehlo(InetAddress.getLocalHost());
                       protocol.ehlo(InetAddress.getByName("mail.mydomain.com"));
                      
                       //log.info("**********JAYS DEBUG:SMTPSender:sendForDomain:Caught use HeLO:InetAdress.getLocalHost=" + InetAddress.getLocalHost());
                       }


                      now the other mail server, correctly identifies in the EHLO using domain name and IP address i.e. mail.mydomain.com/216.122.35.122

                      but for some reason, the outgoing connection, looks as if it is still being made using the other, bad, ip address, I imagine somewhere, some java class when it actually comes to creating the socket connection, is also doing getLocalHost()

                      anyone have a clue as to where to look next?





                      • 24. Re: How to begin...2 instances of JB MS, 2 NICS, 1 JB AS
                        acoliver

                        (meaning ristretto needs to be patched)

                        • 25. Re: How to begin...2 instances of JB MS, 2 NICS, 1 JB AS
                          gohip

                          Thanks man, and I began to get that far when I ran into protocol.openPort

                          all my debug, dissappears there

                          damn, I guess I'll get a copy of Ristretto, and try to compile it to tweak the SMTPProtocol class, thanks

                          so your basically saying,right now, we create the protocol, with just the host as an arguement, i.e. the remote mail server host, we also need to pass it an arguement of our name/ip

                          that makes sense

                          i try it, after this, do yeah think it'll work? seems like it...

                          heres some of the output, and others can see how it drops off...

                          14:23:37,250 INFO [ConnectionHandler] ConnectionHandler finished
                          14:23:51,781 INFO [SMTPSender] **********protocol.openPort(returns server name)
                          14:23:51,781 INFO [SMTPSender] **********JAYS DEBUG:SMTPSender:sendForDomain:Try:opened port
                          14:23:51,781 INFO [SMTPSender] **********JAYS DEBUG:SMTPProtocolInfo:
                          14:23:51,781 INFO [SMTPSender] **************************************
                          14:23:51,781 INFO [SMTPSender] **********protocol.getHostName=mx3.mail.yahoo.com.
                          14:23:51,781 INFO [SMTPSender] **********protocol.getService=smtp
                          14:23:51,781 INFO [SMTPSender] **********protocol.getState=0
                          14:23:51,781 INFO [SMTPSender] **************************************
                          14:23:51,781 INFO [SMTPSender] **********JAYS DEBUG:SMTPSender:BEGIN creating protocol with host=mx3.mail.yahoo.com.
                          14:23:51,781 INFO [SMTPSender] **********JAYS DEBUG:SMTPSender:FINISH creatingprotocol with host=mx3.mail.yahoo.com.
                          14:23:51,796 INFO [SMTPSender] **********JAYS DEBUG:SMTPSender:sendForDomain:for:Try:server name/host=mx3.mail.yahoo.com.
                          14:23:52,000 INFO [STDOUT] S:220 mta115.mail.mud.yahoo.com ESMTP YSmtp service ready14:23:52,015 INFO [SMTPSender] **********protocol.openPort(returns server name)=mta115.mail.mud.yahoo.com just called


                          the bolded section, it appears, is where all control goes to ristretto
                          is this correct andrew, openPort cause's actual connection to be made?


                          • 26. Re: How to begin...2 instances of JB MS, 2 NICS, 1 JB AS
                            acoliver

                            AFAIK yes. I didn't do most of the ristretto integration stuff. Mike Barker did. I just did a few bug fixes here and there.

                            • 27. Re: How to begin...2 instances of JB MS, 2 NICS, 1 JB AS
                              gohip

                              Thank you, got ristretto code to compile, before I tweaked it, so ready to go, I let you know how it goes...

                              • 28. Re: How to begin...2 instances of JB MS, 2 NICS, 1 JB AS
                                gohip

                                Okay, Andrew, or Mike, or anyone willing to help...

                                I recompiled the ristretto, jar, with no errors, after adding

                                public String openPort() throws IOException, SMTPException {
                                 try {
                                 //jay
                                 if(localHost!=null && localPort>=-1)
                                 {
                                 //remoteHost is str, localHost is InetAddress
                                 System.out.println("**********Jays Debug:org.columba.ristretto.smtp.SMTPProtocol:openPort:Using Jays Enhaned Socket");
                                 System.out.println("**********Jays Debug:SocketSettings:localHost=" + localHost);
                                 System.out.println("**********Jays Debug:SocketSettings:=localPort" + localPort);
                                 System.out.println("**********Jays Debug:SocketSettings:=remoteHost" + remoteHost);
                                 System.out.println("**********Jays Debug:SocketSettings:=remotePort" + remotePort);
                                 socket = new Socket(remoteHost, remotePort, localHost, localPort);
                                 System.out.println("**********Jays Debug:Socket Created");
                                 }
                                 else
                                 {
                                 System.out.println("**********Jays Debug:org.columba.ristretto.smtp.SMTPProtocol:openPort:NOT Using Jays Enhaned Socket");
                                 System.out.println("**********Jays Debug:SocketSettings:=remoteHost" + remoteHost);
                                 System.out.println("**********Jays Debug:SocketSettings:=remotePort" + remotePort);
                                 socket = new Socket(remoteHost, remotePort);
                                 System.out.println("**********Jays Debug:Generic Socket Created");
                                 }
                                 //jay
                                
                                 socket.setSoTimeout(RistrettoConfig.getInstance().getTimeout());
                                
                                 createStreams();
                                .
                                .
                                .


                                to SMTPProtocol

                                but now I get this error,

                                Is it becasue, I only touched SMTPSender.java, and Not SMTPSenderMBean.java?

                                Or do I have to copy the new ristretto jar to more locations than just mail.ear/mail.sar/Ristretto-1.0-all.jar

                                2006-06-02 18:47:13,203 INFO [org.jboss.mail.smtp.sender.SMTPSender] **********JAYS DEBUG:SMTPSender:BEGIN creating protocol with host=mx1.mail.yahoo.com.
                                2006-06-02 18:47:13,203 INFO [org.jboss.mail.smtp.sender.SMTPSender] **********JAYS DEBUG:SMTPSender:Begin creating ENHANCED protocol with host=mx1.mail.yahoo.com.
                                2006-06-02 18:47:13,203 ERROR [org.jboss.ejb.plugins.LogInterceptor] TransactionRolledbackLocalException in method: public abstract void javax.jms.MessageListener.onMessage(javax.jms.Message), causedBy:
                                javax.management.RuntimeMBeanException
                                ... 36 more
                                Caused by: java.lang.NoSuchMethodError: org.columba.ristretto.smtp.SMTPProtocol.<init>(Ljava/lang/String;ILjava/net/InetAddress;I)V
                                 at org.jboss.mail.smtp.sender.SMTPSender.sendForDomain(SMTPSender.java:545)
                                 at org.jboss.mail.smtp.sender.SMTPSender.send(SMTPSender.java:427)
                                 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:585)
                                 at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                                 at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                                 at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
                                 at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:260)
                                 at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                                 at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:190)
                                 at $Proxy101.send(Unknown Source)
                                 at org.jboss.mail.mailhandler.remote.RemoteDelivery.deliver(RemoteDelivery.java:137)
                                 at org.jboss.mail.mailhandler.remote.RemoteDelivery.send(RemoteDelivery.java:81)
                                 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:585)
                                 at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                                 ... 48 more
                                2006-06-02 18:47:13,390 DEBUG [org.jboss.mail.delivery.DeliveryMDB] Passing mail to delivery chain
                                2006-06-02 18:47:13,390 DEBUG [org.jboss.mail.mailhandler.remote.RemoteDelivery] deliver - exclude:[Lorg.jboss.mail.message.MailAddress;@13d76d5
                                2006-06-02 18:47:13,390 INFO [org.jboss.mail.smtp.sender.SMTPSender] **********JAYS DEBUG:SMTPSender:send constructor one called
                                2006-06-02 18:47:13,406 DEBUG [org.jboss.mail.smtp.sender.SMTPSender] sender - exclude:[Lorg.jboss.mail.message.MailAddress;@13d76d5


                                so it looks like it cant find the code in the new ristretto jar

                                i put the new ristretto jar in
                                D:\JBossMailServer\versions\1.0M5_Corporate\server\default\deploy\mail.ear\mail.sar

                                are there other locations I need to distribute it too? It compiled and distributed fine using the and build...

                                • 29. Re: How to begin...2 instances of JB MS, 2 NICS, 1 JB AS
                                  gohip

                                  sorry, what I added to JBoss mail SMTPSender.sendForDomain(), looks like this...

                                  //protocol = new SMTPProtocol(host); //and catch below
                                   //log.info("**********JAYS DEBUG:SMTPSender:FINISH creating protocol with host=" + host);
                                  
                                   log.info("**********JAYS DEBUG:SMTPSender:Begin creating ENHANCED protocol with host=" + host);
                                   protocol = new SMTPProtocol(host, 25, InetAddress.getByName("mail.celleport.com"), 10952); //and catch below
                                   log.info("**********JAYS DEBUG:SMTPSender:FINISH creating ENHANCED protocol");