3 Replies Latest reply on Mar 2, 2004 8:58 PM by Elias Ross

    Message Service: ejb-jar.xml, jboss.xml, jboss-web.xml, web.

    Richard Bottoms Newbie

      Can someone provide the needed changes to mail-service.xml, ejb-jar.xml, jboss.xml, jboss-web.xml, web.xml to get JavaMail working in a .JSP under JBoss.

      I've come across various fragments but no overall tutorial to get it up and running. Folks have been asking in the forums as far back as 2002 so there seems to be some need.

        • 1. Re: principalsQuery fails
          Elias Ross Master

          My error after all

          login-config.xml was:

           <login-module code = "org.jboss.security.auth.spi.DatabaseServerLoginModule" flag = "required"/>
           <module-option name="dsJndiName">java:/DefaultDS</module-option>
           <module-option name="principalsQuery">select user_passwd from Login_Schema.Registration where user_id = ?</module-option>
           <module-option name="rolesQuery">select user_role, 'Roles' from Login_Schema.User_Roles where user_id = ?</module-option>
          
          



          but should have been

           <login-module code = "org.jboss.security.auth.spi.DatabaseServerLoginModule" flag = "required">
           <module-option name="dsJndiName">java:/DefaultDS</module-option>
           <module-option name="principalsQuery">select user_passwd from Login_Schema.Registration where user_id = ?</module-option>
           <module-option name="rolesQuery">select user_role, 'Roles' from Login_Schema.User_Roles where user_id = ?</module-option>
           </login-module>
          
          



          Don't worry, I gave myself a good kicking.

          Cheers
          -raj

          • 2. Re: Message Service: ejb-jar.xml, jboss.xml, jboss-web.xml,
            Elias Ross Master


            Please enter the JBoss version, what steps you took to tried to get it working, what works, what you expect, etc.

            Have you tried this?

            import javax.naming.InitialContext;
            import javax.mail.Session;

            Session s = (Session)new InitialContext().lookup("java:/Mail");


            This isn't even remotely related to JMS so I wonder why you thought to ask this here?

            • 3. Re: Message Service: ejb-jar.xml, jboss.xml, jboss-web.xml,
              Richard Bottoms Newbie

              >Please enter the JBoss version

              3.2Have you tried this?

              >import javax.naming.InitialContext;
              >import javax.mail.Session;
              >
              >Session s = (Session)new InitialContext().lookup("java:/Mail"); .3

              Yes. My question was about what changes I need to make to the .xml files listed above to make it work.

              >This isn't even remotely related to JMS so I wonder why you thought to >ask this here?

              Because this seemed like the forum most closely related to email based on searching the forums for questions going back 2 years on exactly the same topic.

              Becasue I have everything else working including database connectivity and I've never tried email with JBoss before

              Because I thought I might get pointed in the right direction. If you have a suggestion of where to post I am open to hear it.