You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by Peter Petersson <pe...@pmb.mine.nu> on 2006/09/29 11:50:23 UTC

Mailing from geronimo

Hi all!

I quite new to Geronimo (using 1.1.1) and have some problems geting mail 
to work from a geronimo-quartz job.
As I understand it I need to set up a gbean or do some other 
configuration for javamail to work (?).
The example i have folowed for the Quartz Scheduler Plugin over at 
http://gplugins.sourceforge.net/ have a nice setup including mailing (in 
the "Deployable Jobs Example" section) but it dose not go into details 
on howto set up mailing (its not the scope of the example).

What do I need to do to get it to work? as it is now i get this exception

MessagingException Unable to locate provider for protocol: smtp

Anny good pointer out there to get mailing working in Geronimo ?

Cheers
  Peter

Re: Mailing from geronimo

Posted by Rick McGuire <ri...@gmail.com>.
Peter Petersson wrote:
> Thanks Rick for your quick response on my question.
>
> Unfortunatly I can not use the syntax you suggest (below) as Im 
> working with a qeronimo-quartz plan
>
> http://gplugins.sourceforge.net/schemas/geronimo-quartz-0.2.xsd
I'm afraid I don't have any experience with quartz, and there are a 
number of things in that example that puzzle me.  It would have been 
nice if
they had showed the GBean configuration for their MailSession.  Let's 
try a couple of things (see below).

>
> Basicly Im trying to figger out just how to translate what you points 
> me to in the context of this deploiment plan.
> For instance dose the dependency injection of
>            <dependency>
>               <groupId>geronimo</groupId>
>               <artifactId>javamail</artifactId>
>               <version>1.1.1</version>
>            </dependency>
> correspond to the module line below ? I tryed it out but still gets 
> the same error so i guess it dossent.
Try

        <dependency>
            <groupId>org.apache.geronimo.configs</groupId>
            <artifactId>javamail</artifactId>
            <version>1.1.1</version>
            <type>car</type>
        </dependency>

If that doesn't work, you might try creating your own example mail 
session.  I don't have a good copy of 1.1.1 on hand at the moment, so 
I'm sort of shooting from the hip on the dependencies (they've changed 
significantly in the current trunk build):

<?xml version="1.0" encoding="UTF-8"?>

<module xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1">
  <dep:environment 
xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2">
    <dep:moduleId>
      <dep:groupId>example</dep:groupId>
      <dep:artifactId>javamail-server</dep:artifactId>
    </dep:moduleId>
    <dep:dependencies>
      <dep:dependency>
        <dep:groupId>geronimo</dep:groupId>
        <dep:artifactId>geronimo-mail</dep:artifactId>
        <dep:version>1.1.1</dep:version>
        <dep:type>jar</dep:type>
        <dep:import>classes</dep:import>
      </dep:dependency>
      <dep:dependency>
        <dep:groupId>geronimo</dep:groupId>
        <dep:artifactId>geronimo-javamail-transport</dep:artifactId>
        <dep:version>1.1.1</dep:version>
        <dep:type>jar</dep:type>
        <dep:import>classes</dep:import>
      </dep:dependency>
      <dep:dependency>
        <dep:groupId>org.apache.geronimo.configs</dep:groupId>
        <dep:artifactId>rmi-naming</dep:artifactId>
        <dep:type>car</dep:type>
      </dep:dependency>
    </dep:dependencies>
    <dep:hidden-classes/>
    <dep:non-overridable-classes/>
  </dep:environment>
  <gbean name="mail/MailSession" class="org.apache.geronimo.mail.MailGBean">
    <attribute name="transportProtocol">smtp</attribute>
  </gbean>
  <gbean name="SMTPTransport" 
class="org.apache.geronimo.mail.SMTPTransportGBean">
    <attribute name="host">localhost</attribute>
    <attribute name="port">25</attribute>
  </gbean>
</module>



>
> Cheers
>   Peter
>
> Rick McGuire skrev:
>> Peter Petersson wrote:
>>> Hi all!
>>>
>>> I quite new to Geronimo (using 1.1.1) and have some problems geting 
>>> mail to work from a geronimo-quartz job.
>>> As I understand it I need to set up a gbean or do some other 
>>> configuration for javamail to work (?).
>> Yes, your application needs to have a dependency on the javamail 
>> config to ensure you're getting all of the correct jar files on your 
>> classpath.  The protocol problem you cite below is a symptom of not 
>> having that.  Adding the following to your deployment plan should be 
>> sufficient:
>>
>>    <module name="org.apache.geronimo.configs/javamail/1.1.1/car"/>
>>
>> That should be sufficient to get the classes on your classpath and 
>> allow you do drive everything from your code.  Additionally, you can 
>> do some basic session configuration in the plan (as opposed to 
>> keeping the configuration in your code) by using:
>>
>>    <module name="org.apache.geronimo.configs/javamail/1.1.1/car">
>>        <gbean name="SMTPTransport">
>>            <attribute name="host">smtp.myisp.com</attribute>
>>            <attribute name="port">25</attribute>
>>        </gbean>
>>    </module>
>>
>> Then in your application, create the mail Session instance using
>>
>>    InitialContext ic = new InitialContext();    Session mailSession = 
>> (Session) ic.lookup("java:comp/env/mail/MailSession");
>>
>> When you request the transport instance from this session, this will 
>> pick up the SMTP configuration from the plan.
>>
>> Rick
>>
>>
>>> The example i have folowed for the Quartz Scheduler Plugin over at 
>>> http://gplugins.sourceforge.net/ have a nice setup including mailing 
>>> (in the "Deployable Jobs Example" section) but it dose not go into 
>>> details on howto set up mailing (its not the scope of the example).
>>>
>>> What do I need to do to get it to work? as it is now i get this 
>>> exception
>>>
>>> MessagingException Unable to locate provider for protocol: smtp
>>>
>>> Anny good pointer out there to get mailing working in Geronimo ?
>>>
>>> Cheers
>>>  Peter
>>>
>>
>


Re: Mailing from geronimo

Posted by Peter Petersson <pe...@pmb.mine.nu>.
Thanks Rick for your quick response on my question.

Unfortunatly I can not use the syntax you suggest (below) as Im working 
with a qeronimo-quartz plan

http://gplugins.sourceforge.net/schemas/geronimo-quartz-0.2.xsd

Basicly Im trying to figger out just how to translate what you points me 
to in the context of this deploiment plan.
For instance dose the dependency injection of
            <dependency>
               <groupId>geronimo</groupId>
               <artifactId>javamail</artifactId>
               <version>1.1.1</version>
            </dependency>
correspond to the module line below ? I tryed it out but still gets the 
same error so i guess it dossent.

Cheers
   Peter

Rick McGuire skrev:
> Peter Petersson wrote:
>> Hi all!
>>
>> I quite new to Geronimo (using 1.1.1) and have some problems geting 
>> mail to work from a geronimo-quartz job.
>> As I understand it I need to set up a gbean or do some other 
>> configuration for javamail to work (?).
> Yes, your application needs to have a dependency on the javamail 
> config to ensure you're getting all of the correct jar files on your 
> classpath.  The protocol problem you cite below is a symptom of not 
> having that.  Adding the following to your deployment plan should be 
> sufficient:
>
>    <module name="org.apache.geronimo.configs/javamail/1.1.1/car"/>
>
> That should be sufficient to get the classes on your classpath and 
> allow you do drive everything from your code.  Additionally, you can 
> do some basic session configuration in the plan (as opposed to keeping 
> the configuration in your code) by using:
>
>    <module name="org.apache.geronimo.configs/javamail/1.1.1/car">
>        <gbean name="SMTPTransport">
>            <attribute name="host">smtp.myisp.com</attribute>
>            <attribute name="port">25</attribute>
>        </gbean>
>    </module>
>
> Then in your application, create the mail Session instance using
>
>    InitialContext ic = new InitialContext();    Session mailSession = 
> (Session) ic.lookup("java:comp/env/mail/MailSession");
>
> When you request the transport instance from this session, this will 
> pick up the SMTP configuration from the plan.
>
> Rick
>
>
>> The example i have folowed for the Quartz Scheduler Plugin over at 
>> http://gplugins.sourceforge.net/ have a nice setup including mailing 
>> (in the "Deployable Jobs Example" section) but it dose not go into 
>> details on howto set up mailing (its not the scope of the example).
>>
>> What do I need to do to get it to work? as it is now i get this 
>> exception
>>
>> MessagingException Unable to locate provider for protocol: smtp
>>
>> Anny good pointer out there to get mailing working in Geronimo ?
>>
>> Cheers
>>  Peter
>>
>

RE: Custom Login Module .LDAPLoginModule and Exception

Posted by "Wolff, Dave" <Da...@letu.edu>.
Can you post the settings you're using for the Geronimo LDAPLoginModule?

Dave 

-----Original Message-----
From: sreepriya ramakrishnan [mailto:sreepriya_ramakrishnan@yahoo.com] 
Sent: Monday, October 02, 2006 9:31 AM
To: user@geronimo.apache.org
Subject: Custom Login Module .LDAPLoginModule and Exception

Hi all,

I have configured the LDAPLoginModule provided by Geronimo and another
custom login module in a stacked manner in Geronimo V1.0. I have my own
callbackHandler class implemented and I try to invoke the configured
modules in a Servlet Filter in the following manner:

lc = new Logincontext("myrealmnam",mycallbackhandler);

I get the followign exception:

Login failed:
javax.security.auth.login.LoginException: Error filling callback list


I have configured teh LDAPLoginModule as the first one in the stack and
if it is successful, the second module will be called.

There seems to be no further details. Can someone please let me know
what is the meaning of teh exception?

Thanks,
Priya





__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 

Custom Login Module .LDAPLoginModule and Exception

Posted by sreepriya ramakrishnan <sr...@yahoo.com>.
Hi all,

I have configured the LDAPLoginModule provided by
Geronimo and another custom login module in a stacked
manner in Geronimo V1.0. I have my own callbackHandler
class implemented and I try to invoke the configured
modules in a Servlet Filter in the following manner:

lc = new Logincontext("myrealmnam",mycallbackhandler);

I get the followign exception:

Login failed:
javax.security.auth.login.LoginException: Error
filling callback list


I have configured teh LDAPLoginModule as the first one
in the stack and if it is successful, the second
module will be called.

There seems to be no further details. Can someone
please let me know what is the meaning of teh
exception?

Thanks,
Priya





__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: Custom Login Modules

Posted by Vamsavardhana Reddy <c1...@gmail.com>.
geronimo-web.xml should have a tag like the following.

 <security-realm-name>myrealmname</security-realm-name>

-Vamsi

On 10/2/06, sreepriya ramakrishnan <sr...@yahoo.com> wrote:
>
> Can you show me an example How do I do this?
>
> --- Vamsavardhana Reddy <c1...@gmail.com> wrote:
>
> > Did you add a reference to this login-module in
> > geronimo-web.xml?
> >
> > Vamsi
> >
> > On 9/30/06, sreepriya ramakrishnan
> > <sr...@yahoo.com> wrote:
> > >
> > > Hi all,
> > >
> > > I have written a Custom Login module and tried to
> > > create my own realm in Geronimo V 1.0 with Tomcat.
> > >
> > > Then I deployed my war file which has a Servlet
> > > Filter. I have coded so that I can invoke the
> > Login
> > > Module from the Servlet Filter.
> > >
> > > eg. logincontext lc = new
> > >
> >
> logincontext("myrealmname',subject,mycallbackhandler);
> > >
> > > lc.login();
> > >
> > > Now at the point when the login module is invoked
> > I
> > > get this exception.
> > >
> > > Login failed:
> > > javax.security.auth.login.LoginException:
> > > org.apache.geronimo.comm
> > > on.GeronimoSecurityException: Unable to
> > instantiate
> > > login module
> > >
> > >
> > > Can some one please point out where I am going
> > wrong?
> > >
> > > Thanks,
> > > Priya
> > >
> > > __________________________________________________
> > > Do You Yahoo!?
> > > Tired of spam?  Yahoo! Mail has the best spam
> > protection around
> > > http://mail.yahoo.com
> > >
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>

Re: Custom Login Modules

Posted by sreepriya ramakrishnan <sr...@yahoo.com>.
Can you show me an example How do I do this?

--- Vamsavardhana Reddy <c1...@gmail.com> wrote:

> Did you add a reference to this login-module in
> geronimo-web.xml?
> 
> Vamsi
> 
> On 9/30/06, sreepriya ramakrishnan
> <sr...@yahoo.com> wrote:
> >
> > Hi all,
> >
> > I have written a Custom Login module and tried to
> > create my own realm in Geronimo V 1.0 with Tomcat.
> >
> > Then I deployed my war file which has a Servlet
> > Filter. I have coded so that I can invoke the
> Login
> > Module from the Servlet Filter.
> >
> > eg. logincontext lc = new
> >
>
logincontext("myrealmname',subject,mycallbackhandler);
> >
> > lc.login();
> >
> > Now at the point when the login module is invoked
> I
> > get this exception.
> >
> > Login failed:
> > javax.security.auth.login.LoginException:
> > org.apache.geronimo.comm
> > on.GeronimoSecurityException: Unable to
> instantiate
> > login module
> >
> >
> > Can some one please point out where I am going
> wrong?
> >
> > Thanks,
> > Priya
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam
> protection around
> > http://mail.yahoo.com
> >
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: Custom Login Modules

Posted by Vamsavardhana Reddy <c1...@gmail.com>.
Did you add a reference to this login-module in geronimo-web.xml?

Vamsi

On 9/30/06, sreepriya ramakrishnan <sr...@yahoo.com> wrote:
>
> Hi all,
>
> I have written a Custom Login module and tried to
> create my own realm in Geronimo V 1.0 with Tomcat.
>
> Then I deployed my war file which has a Servlet
> Filter. I have coded so that I can invoke the Login
> Module from the Servlet Filter.
>
> eg. logincontext lc = new
> logincontext("myrealmname',subject,mycallbackhandler);
>
> lc.login();
>
> Now at the point when the login module is invoked I
> get this exception.
>
> Login failed:
> javax.security.auth.login.LoginException:
> org.apache.geronimo.comm
> on.GeronimoSecurityException: Unable to instantiate
> login module
>
>
> Can some one please point out where I am going wrong?
>
> Thanks,
> Priya
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>

Custom Login Modules

Posted by sreepriya ramakrishnan <sr...@yahoo.com>.
Hi all,

I have written a Custom Login module and tried to
create my own realm in Geronimo V 1.0 with Tomcat.

Then I deployed my war file which has a Servlet
Filter. I have coded so that I can invoke the Login
Module from the Servlet Filter.

eg. logincontext lc = new
logincontext("myrealmname',subject,mycallbackhandler);

lc.login();

Now at the point when the login module is invoked I
get this exception.

Login failed:
javax.security.auth.login.LoginException:
org.apache.geronimo.comm
on.GeronimoSecurityException: Unable to instantiate
login module


Can some one please point out where I am going wrong?

Thanks,
Priya

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: Geronimo and LDAP

Posted by Hernan Cunico <hc...@gmail.com>.
I just got to that error, not sure why it's happening, I didn't see it before. I'll keep digging and let you know.

Cheers!
Hernan

sreepriya ramakrishnan wrote:
> Hi ,
> 
> Thank so much for your help . Iwas able to deploy the
> realm.
> 
> I then created a war file and tried to deploy that and
> this is the error I get
> 
> java.lang.IllegalStateException: Cannot retrieve the
> value for non-persistent at
> tribute containerName when GBeanInstance is DESTROYED
> 
> I have another question. what is the purpose of the
> .ldif file? We connect to the LDAP server directly to
> run the example, so why do we need the .ldif file?
> 
> Appreciate your help,
> 
> Thanks,
> priya
> 
> --- Hernan Cunico <hc...@gmail.com> wrote:
> 
>> Hi Sreepriya,
>> if you use the ldap-realm.xml file provided with the
>> zip you should be OK.
>> I've been able to reproduce the error by copying and
>> pasting the content listed in the doc into a new xml
>> file. 
>> When I put that example in the doc I had to break
>> some long lines into multiple lines, for instance
>>
>>         <reference name="LoginService">
>>            
>>
> <gbean-name>geronimo.server:J2EEApplication=null,J2EEModule=org/apache/geronimo/Security,
>>                                        
>>
> J2EEServer=geronimo,j2eeType=JaasLoginService,name=JaasLoginService
>>             </gbean-name>
>>
>> If the <gbean-name> islisted in a single line you
>> should not have any problems deploying this realm.
>> Just in case, I attached the realm.xml
>>
>> Let me know if you still see this problem.
>>
>> HTH
>>
>> Cheers!
>> Hernan
>>
>> sreepriya ramakrishnan wrote:
>>> We are using version 1.0  and I am trying to
>> follow
>>> http://cwiki.apache.org/GMOxDOC10/ldap-realm.html
>>>
>>> but when I try to deploy the realm I get:
>>>
> org.apache.geronimo.gbean.InvalidConfigurationException:
>>> Could not load class or
>>> g.apache.geronimo.security.jaas.LoginModuleGBean
>>>
>>> Can you let me know what I am doing wrong
>>>
>>> Appreciate your help
>>>
>>> Thanks,
>>> priya
>>> --- Hernan Cunico <hc...@gmail.com> wrote:
>>>
>>>> Hi Sreepriya,
>>>> what version of Geronimo are you using? 
>>>> If you are using v1.1 check this article
>>>>
>>>> http://cwiki.apache.org/GMOxDOC11/ldap-realm.html
>>>>
>>>> Cheers!
>>>> Hernan
>>>>
>>>> sreepriya ramakrishnan wrote:
>>>>> Hi,
>>>>>
>>>>> I am trying to run the example provided
>> ldap-jetty
>>>>> under geronimo V1.0
>>>>> when I try to deploy the realm, I get this
>>>> exception
>>>>> Could not load class
>>>>>
>> org.apache.geronimo.security.jaas.LoginModuleGBean
>>>>> Can anyone tell me how to fix this?
>>>>>
>>>>> Thansk,
>>>>> priya
>>>>>
>>>>>
>> __________________________________________________
>>>>> Do You Yahoo!?
>>>>> Tired of spam?  Yahoo! Mail has the best spam
>>>> protection around 
>>>>> http://mail.yahoo.com 
>>>>>
>>>
>>> __________________________________________________
>>> Do You Yahoo!?
>>> Tired of spam?  Yahoo! Mail has the best spam
>> protection around 
>>> http://mail.yahoo.com 
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>> <configuration
>>    
>> xmlns="http://geronimo.apache.org/xml/ns/deployment"
>>     configId="org/apache/geronimo/ldap-secure">
>>
>>    <gbean name="ldap-login"
>>        
>>
> class="org.apache.geronimo.security.jaas.LoginModuleGBean">
>>         <attribute
>>
> name="loginModuleClass">org.apache.geronimo.security.realm.providers.LDAPLoginModule</attribute>
>>         <attribute
>> name="serverSide">true</attribute>
>>         <attribute name="options">
>> 	
>>
> initialContextFactory=com.sun.jndi.ldap.LdapCtxFactory
>> 		connectionURL=ldap://localhost:1389
>> 		connectionUsername=uid=admin,ou=system
>> 		connectionPassword=secret
>> 		connectionProtocol=
>> 		authentication=simple
>> 		userBase=ou=users,ou=system
>> 		userSearchMatching=uid={0}
>> 		userSearchSubtree=false
>> 		roleBase=ou=groups,ou=system
>> 		roleName=cn
>> 		roleSearchMatching=(uniqueMember={0})
>> 		roleSearchSubtree=false
>> 		userRoleName=
>> 	  </attribute>
>>         <attribute
>> name="loginDomainName">ldap-realm</attribute>
>>     </gbean>
>>
>>     <gbean name="ldap-realm"
>>
> class="org.apache.geronimo.security.realm.GenericSecurityRealm">
>>         <attribute
>> name="realmName">ldap-realm</attribute>
>>         <reference name="LoginModuleConfiguration">
>>             	<name>ldap-login</name>
>>         </reference> 
>>         <reference name="ServerInfo">
>>            
>> <module>org/apache/geronimo/System</module>
>>             <name>ServerInfo</name>
>>         </reference>
>>         <!-- Add -->
>>         <reference name="LoginService">
>>            
>>
> <gbean-name>geronimo.server:J2EEApplication=null,J2EEModule=org/apache/geronimo/Security,J2EEServer=geronimo,j2eeType=JaasLoginService,name=JaasLoginService</gbean-name>
>>          </reference>
>>     </gbean>
>>
>>     <gbean name="ldap-login"
>>
> class="org.apache.geronimo.security.jaas.JaasLoginModuleUse">
>>         <attribute
>> name="controlFlag">REQUIRED</attribute>
>>         <reference name="LoginModule">
>>             <name>ldap-login</name>
>>         </reference>
>>     </gbean>
>>     
>>      <gbean name="ldaptest"
>>        
>>
> class="org.apache.geronimo.security.jaas.ServerRealmConfigurationEntry">
>>         <attribute
>> name="applicationConfigName">ldaptest</attribute>
>>         <attribute
>> name="realmName">ldap-realm</attribute>
>>         <reference
>>
> name="LoginService"><gbean-name>geronimo.server:J2EEApplication=null,J2EEModule=org/apache/geronimo/Security,J2EEServer=geronimo,j2eeType=JaasLoginService,name=JaasLoginService</gbean-name></reference>
>>     </gbean>
>>
>>
>> </configuration>
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> 

Re: Geronimo and LDAP

Posted by sreepriya ramakrishnan <sr...@yahoo.com>.
Hi ,

Thank so much for your help . Iwas able to deploy the
realm.

I then created a war file and tried to deploy that and
this is the error I get

java.lang.IllegalStateException: Cannot retrieve the
value for non-persistent at
tribute containerName when GBeanInstance is DESTROYED

I have another question. what is the purpose of the
.ldif file? We connect to the LDAP server directly to
run the example, so why do we need the .ldif file?

Appreciate your help,

Thanks,
priya

--- Hernan Cunico <hc...@gmail.com> wrote:

> Hi Sreepriya,
> if you use the ldap-realm.xml file provided with the
> zip you should be OK.
> I've been able to reproduce the error by copying and
> pasting the content listed in the doc into a new xml
> file. 
> When I put that example in the doc I had to break
> some long lines into multiple lines, for instance
> 
>         <reference name="LoginService">
>            
>
<gbean-name>geronimo.server:J2EEApplication=null,J2EEModule=org/apache/geronimo/Security,
>                                        
>
J2EEServer=geronimo,j2eeType=JaasLoginService,name=JaasLoginService
>             </gbean-name>
> 
> If the <gbean-name> islisted in a single line you
> should not have any problems deploying this realm.
> Just in case, I attached the realm.xml
> 
> Let me know if you still see this problem.
> 
> HTH
> 
> Cheers!
> Hernan
> 
> sreepriya ramakrishnan wrote:
> > We are using version 1.0  and I am trying to
> follow
> > http://cwiki.apache.org/GMOxDOC10/ldap-realm.html
> > 
> > but when I try to deploy the realm I get:
> >
>
org.apache.geronimo.gbean.InvalidConfigurationException:
> > Could not load class or
> > g.apache.geronimo.security.jaas.LoginModuleGBean
> > 
> > Can you let me know what I am doing wrong
> > 
> > Appreciate your help
> > 
> > Thanks,
> > priya
> > --- Hernan Cunico <hc...@gmail.com> wrote:
> > 
> >> Hi Sreepriya,
> >> what version of Geronimo are you using? 
> >> If you are using v1.1 check this article
> >>
> >> http://cwiki.apache.org/GMOxDOC11/ldap-realm.html
> >>
> >> Cheers!
> >> Hernan
> >>
> >> sreepriya ramakrishnan wrote:
> >>> Hi,
> >>>
> >>> I am trying to run the example provided
> ldap-jetty
> >>> under geronimo V1.0
> >>> when I try to deploy the realm, I get this
> >> exception
> >>> Could not load class
> >>>
> org.apache.geronimo.security.jaas.LoginModuleGBean
> >>>
> >>> Can anyone tell me how to fix this?
> >>>
> >>> Thansk,
> >>> priya
> >>>
> >>>
> __________________________________________________
> >>> Do You Yahoo!?
> >>> Tired of spam?  Yahoo! Mail has the best spam
> >> protection around 
> >>> http://mail.yahoo.com 
> >>>
> > 
> > 
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam
> protection around 
> > http://mail.yahoo.com 
> > 
> > <?xml version="1.0" encoding="UTF-8"?>
> 
> <configuration
>    
> xmlns="http://geronimo.apache.org/xml/ns/deployment"
>     configId="org/apache/geronimo/ldap-secure">
> 
>    <gbean name="ldap-login"
>        
>
class="org.apache.geronimo.security.jaas.LoginModuleGBean">
>         <attribute
>
name="loginModuleClass">org.apache.geronimo.security.realm.providers.LDAPLoginModule</attribute>
>         <attribute
> name="serverSide">true</attribute>
>         <attribute name="options">
> 	
>
initialContextFactory=com.sun.jndi.ldap.LdapCtxFactory
> 		connectionURL=ldap://localhost:1389
> 		connectionUsername=uid=admin,ou=system
> 		connectionPassword=secret
> 		connectionProtocol=
> 		authentication=simple
> 		userBase=ou=users,ou=system
> 		userSearchMatching=uid={0}
> 		userSearchSubtree=false
> 		roleBase=ou=groups,ou=system
> 		roleName=cn
> 		roleSearchMatching=(uniqueMember={0})
> 		roleSearchSubtree=false
> 		userRoleName=
> 	  </attribute>
>         <attribute
> name="loginDomainName">ldap-realm</attribute>
>     </gbean>
> 
>     <gbean name="ldap-realm"
>
class="org.apache.geronimo.security.realm.GenericSecurityRealm">
>         <attribute
> name="realmName">ldap-realm</attribute>
>         <reference name="LoginModuleConfiguration">
>             	<name>ldap-login</name>
>         </reference> 
>         <reference name="ServerInfo">
>            
> <module>org/apache/geronimo/System</module>
>             <name>ServerInfo</name>
>         </reference>
>         <!-- Add -->
>         <reference name="LoginService">
>            
>
<gbean-name>geronimo.server:J2EEApplication=null,J2EEModule=org/apache/geronimo/Security,J2EEServer=geronimo,j2eeType=JaasLoginService,name=JaasLoginService</gbean-name>
>          </reference>
>     </gbean>
> 
>     <gbean name="ldap-login"
>
class="org.apache.geronimo.security.jaas.JaasLoginModuleUse">
>         <attribute
> name="controlFlag">REQUIRED</attribute>
>         <reference name="LoginModule">
>             <name>ldap-login</name>
>         </reference>
>     </gbean>
>     
>      <gbean name="ldaptest"
>        
>
class="org.apache.geronimo.security.jaas.ServerRealmConfigurationEntry">
>         <attribute
> name="applicationConfigName">ldaptest</attribute>
>         <attribute
> name="realmName">ldap-realm</attribute>
>         <reference
>
name="LoginService"><gbean-name>geronimo.server:J2EEApplication=null,J2EEModule=org/apache/geronimo/Security,J2EEServer=geronimo,j2eeType=JaasLoginService,name=JaasLoginService</gbean-name></reference>
>     </gbean>
> 
> 
> </configuration>


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: Geronimo and LDAP

Posted by sreepriya ramakrishnan <sr...@yahoo.com>.
Hi ,

I ran the example even though I got the error. I got
the hello.html page instead of the page saying LDAP
configuration is working. Is this right? I ahve
Geronimo with Tomcat installed.

Please let me know if I am in the right track.

Thanks,
priya

--- Hernan Cunico <hc...@gmail.com> wrote:

> Hi Sreepriya,
> if you use the ldap-realm.xml file provided with the
> zip you should be OK.
> I've been able to reproduce the error by copying and
> pasting the content listed in the doc into a new xml
> file. 
> When I put that example in the doc I had to break
> some long lines into multiple lines, for instance
> 
>         <reference name="LoginService">
>            
>
<gbean-name>geronimo.server:J2EEApplication=null,J2EEModule=org/apache/geronimo/Security,
>                                        
>
J2EEServer=geronimo,j2eeType=JaasLoginService,name=JaasLoginService
>             </gbean-name>
> 
> If the <gbean-name> islisted in a single line you
> should not have any problems deploying this realm.
> Just in case, I attached the realm.xml
> 
> Let me know if you still see this problem.
> 
> HTH
> 
> Cheers!
> Hernan
> 
> sreepriya ramakrishnan wrote:
> > We are using version 1.0  and I am trying to
> follow
> > http://cwiki.apache.org/GMOxDOC10/ldap-realm.html
> > 
> > but when I try to deploy the realm I get:
> >
>
org.apache.geronimo.gbean.InvalidConfigurationException:
> > Could not load class or
> > g.apache.geronimo.security.jaas.LoginModuleGBean
> > 
> > Can you let me know what I am doing wrong
> > 
> > Appreciate your help
> > 
> > Thanks,
> > priya
> > --- Hernan Cunico <hc...@gmail.com> wrote:
> > 
> >> Hi Sreepriya,
> >> what version of Geronimo are you using? 
> >> If you are using v1.1 check this article
> >>
> >> http://cwiki.apache.org/GMOxDOC11/ldap-realm.html
> >>
> >> Cheers!
> >> Hernan
> >>
> >> sreepriya ramakrishnan wrote:
> >>> Hi,
> >>>
> >>> I am trying to run the example provided
> ldap-jetty
> >>> under geronimo V1.0
> >>> when I try to deploy the realm, I get this
> >> exception
> >>> Could not load class
> >>>
> org.apache.geronimo.security.jaas.LoginModuleGBean
> >>>
> >>> Can anyone tell me how to fix this?
> >>>
> >>> Thansk,
> >>> priya
> >>>
> >>>
> __________________________________________________
> >>> Do You Yahoo!?
> >>> Tired of spam?  Yahoo! Mail has the best spam
> >> protection around 
> >>> http://mail.yahoo.com 
> >>>
> > 
> > 
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam
> protection around 
> > http://mail.yahoo.com 
> > 
> > <?xml version="1.0" encoding="UTF-8"?>
> 
> <configuration
>    
> xmlns="http://geronimo.apache.org/xml/ns/deployment"
>     configId="org/apache/geronimo/ldap-secure">
> 
>    <gbean name="ldap-login"
>        
>
class="org.apache.geronimo.security.jaas.LoginModuleGBean">
>         <attribute
>
name="loginModuleClass">org.apache.geronimo.security.realm.providers.LDAPLoginModule</attribute>
>         <attribute
> name="serverSide">true</attribute>
>         <attribute name="options">
> 	
>
initialContextFactory=com.sun.jndi.ldap.LdapCtxFactory
> 		connectionURL=ldap://localhost:1389
> 		connectionUsername=uid=admin,ou=system
> 		connectionPassword=secret
> 		connectionProtocol=
> 		authentication=simple
> 		userBase=ou=users,ou=system
> 		userSearchMatching=uid={0}
> 		userSearchSubtree=false
> 		roleBase=ou=groups,ou=system
> 		roleName=cn
> 		roleSearchMatching=(uniqueMember={0})
> 		roleSearchSubtree=false
> 		userRoleName=
> 	  </attribute>
>         <attribute
> name="loginDomainName">ldap-realm</attribute>
>     </gbean>
> 
>     <gbean name="ldap-realm"
>
class="org.apache.geronimo.security.realm.GenericSecurityRealm">
>         <attribute
> name="realmName">ldap-realm</attribute>
>         <reference name="LoginModuleConfiguration">
>             	<name>ldap-login</name>
>         </reference> 
>         <reference name="ServerInfo">
>            
> <module>org/apache/geronimo/System</module>
>             <name>ServerInfo</name>
>         </reference>
>         <!-- Add -->
>         <reference name="LoginService">
>            
>
<gbean-name>geronimo.server:J2EEApplication=null,J2EEModule=org/apache/geronimo/Security,J2EEServer=geronimo,j2eeType=JaasLoginService,name=JaasLoginService</gbean-name>
>          </reference>
>     </gbean>
> 
>     <gbean name="ldap-login"
>
class="org.apache.geronimo.security.jaas.JaasLoginModuleUse">
>         <attribute
> name="controlFlag">REQUIRED</attribute>
>         <reference name="LoginModule">
>             <name>ldap-login</name>
>         </reference>
>     </gbean>
>     
>      <gbean name="ldaptest"
>        
>
class="org.apache.geronimo.security.jaas.ServerRealmConfigurationEntry">
>         <attribute
> name="applicationConfigName">ldaptest</attribute>
>         <attribute
> name="realmName">ldap-realm</attribute>
>         <reference
>
name="LoginService"><gbean-name>geronimo.server:J2EEApplication=null,J2EEModule=org/apache/geronimo/Security,J2EEServer=geronimo,j2eeType=JaasLoginService,name=JaasLoginService</gbean-name></reference>
>     </gbean>
> 
> 
> </configuration>


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: Geronimo and LDAP

Posted by Hernan Cunico <hc...@gmail.com>.
Hi Sreepriya,
if you use the ldap-realm.xml file provided with the zip you should be OK.
I've been able to reproduce the error by copying and pasting the content listed in the doc into a new xml file. 
When I put that example in the doc I had to break some long lines into multiple lines, for instance

        <reference name="LoginService">
            <gbean-name>geronimo.server:J2EEApplication=null,J2EEModule=org/apache/geronimo/Security,
                                        J2EEServer=geronimo,j2eeType=JaasLoginService,name=JaasLoginService
            </gbean-name>

If the <gbean-name> islisted in a single line you should not have any problems deploying this realm. Just in case, I attached the realm.xml

Let me know if you still see this problem.

HTH

Cheers!
Hernan

sreepriya ramakrishnan wrote:
> We are using version 1.0  and I am trying to follow
> http://cwiki.apache.org/GMOxDOC10/ldap-realm.html
> 
> but when I try to deploy the realm I get:
> org.apache.geronimo.gbean.InvalidConfigurationException:
> Could not load class or
> g.apache.geronimo.security.jaas.LoginModuleGBean
> 
> Can you let me know what I am doing wrong
> 
> Appreciate your help
> 
> Thanks,
> priya
> --- Hernan Cunico <hc...@gmail.com> wrote:
> 
>> Hi Sreepriya,
>> what version of Geronimo are you using? 
>> If you are using v1.1 check this article
>>
>> http://cwiki.apache.org/GMOxDOC11/ldap-realm.html
>>
>> Cheers!
>> Hernan
>>
>> sreepriya ramakrishnan wrote:
>>> Hi,
>>>
>>> I am trying to run the example provided ldap-jetty
>>> under geronimo V1.0
>>> when I try to deploy the realm, I get this
>> exception
>>> Could not load class
>>> org.apache.geronimo.security.jaas.LoginModuleGBean
>>>
>>> Can anyone tell me how to fix this?
>>>
>>> Thansk,
>>> priya
>>>
>>> __________________________________________________
>>> Do You Yahoo!?
>>> Tired of spam?  Yahoo! Mail has the best spam
>> protection around 
>>> http://mail.yahoo.com 
>>>
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> 

Re: Geronimo and LDAP

Posted by sreepriya ramakrishnan <sr...@yahoo.com>.
We are using version 1.0  and I am trying to follow
http://cwiki.apache.org/GMOxDOC10/ldap-realm.html

but when I try to deploy the realm I get:
org.apache.geronimo.gbean.InvalidConfigurationException:
Could not load class or
g.apache.geronimo.security.jaas.LoginModuleGBean

Can you let me know what I am doing wrong

Appreciate your help

Thanks,
priya
--- Hernan Cunico <hc...@gmail.com> wrote:

> Hi Sreepriya,
> what version of Geronimo are you using? 
> If you are using v1.1 check this article
> 
> http://cwiki.apache.org/GMOxDOC11/ldap-realm.html
> 
> Cheers!
> Hernan
> 
> sreepriya ramakrishnan wrote:
> > Hi,
> > 
> > I am trying to run the example provided ldap-jetty
> > under geronimo V1.0
> > when I try to deploy the realm, I get this
> exception
> > 
> > Could not load class
> > org.apache.geronimo.security.jaas.LoginModuleGBean
> > 
> > Can anyone tell me how to fix this?
> > 
> > Thansk,
> > priya
> > 
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam
> protection around 
> > http://mail.yahoo.com 
> > 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: Geronimo and LDAP

Posted by Hernan Cunico <hc...@gmail.com>.
Hi Sreepriya,
what version of Geronimo are you using? 
If you are using v1.1 check this article

http://cwiki.apache.org/GMOxDOC11/ldap-realm.html

Cheers!
Hernan

sreepriya ramakrishnan wrote:
> Hi,
> 
> I am trying to run the example provided ldap-jetty
> under geronimo V1.0
> when I try to deploy the realm, I get this exception
> 
> Could not load class
> org.apache.geronimo.security.jaas.LoginModuleGBean
> 
> Can anyone tell me how to fix this?
> 
> Thansk,
> priya
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> 

Geronimo and LDAP

Posted by sreepriya ramakrishnan <sr...@yahoo.com>.
Hi,

I am trying to run the example provided ldap-jetty
under geronimo V1.0
when I try to deploy the realm, I get this exception

Could not load class
org.apache.geronimo.security.jaas.LoginModuleGBean

Can anyone tell me how to fix this?

Thansk,
priya

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: Mailing from geronimo

Posted by Aaron Mulder <am...@alumni.princeton.edu>.
Rick, I'm confused about the syntax you posted.  I think there are
several problems:

 * It looks like something out of config.xml, which does not work in a
deployment plan
 * It uses a groupId of org.apache.geronimo.* which is not valid for
Geronimo 1.1.x.
 * You're claiming that something can be looked up in java:comp/env
but you didn't use e.g. a resource ref, so nothing mail-related will
be in java:comp/env

Can you take another stab at your Geroinmo 1.1.1 mail example for Peter?

Thanks,
     Aaron

On 9/29/06, Rick McGuire <ri...@gmail.com> wrote:
> Peter Petersson wrote:
> > Hi all!
> >
> > I quite new to Geronimo (using 1.1.1) and have some problems geting
> > mail to work from a geronimo-quartz job.
> > As I understand it I need to set up a gbean or do some other
> > configuration for javamail to work (?).
> Yes, your application needs to have a dependency on the javamail config
> to ensure you're getting all of the correct jar files on your
> classpath.  The protocol problem you cite below is a symptom of not
> having that.  Adding the following to your deployment plan should be
> sufficient:
>
>     <module name="org.apache.geronimo.configs/javamail/1.1.1/car"/>
>
> That should be sufficient to get the classes on your classpath and allow
> you do drive everything from your code.  Additionally, you can do some
> basic session configuration in the plan (as opposed to keeping the
> configuration in your code) by using:
>
>     <module name="org.apache.geronimo.configs/javamail/1.1.1/car">
>         <gbean name="SMTPTransport">
>             <attribute name="host">smtp.myisp.com</attribute>
>             <attribute name="port">25</attribute>
>         </gbean>
>     </module>
>
> Then in your application, create the mail Session instance using
>
>     InitialContext ic = new InitialContext();
>     Session mailSession = (Session)
> ic.lookup("java:comp/env/mail/MailSession");
>
> When you request the transport instance from this session, this will
> pick up the SMTP configuration from the plan.
>
> Rick
>
>
> > The example i have folowed for the Quartz Scheduler Plugin over at
> > http://gplugins.sourceforge.net/ have a nice setup including mailing
> > (in the "Deployable Jobs Example" section) but it dose not go into
> > details on howto set up mailing (its not the scope of the example).
> >
> > What do I need to do to get it to work? as it is now i get this exception
> >
> > MessagingException Unable to locate provider for protocol: smtp
> >
> > Anny good pointer out there to get mailing working in Geronimo ?
> >
> > Cheers
> >  Peter
> >
>
>

Re: Mailing from geronimo

Posted by Rick McGuire <ri...@gmail.com>.
Peter Petersson wrote:
> Hi all!
>
> I quite new to Geronimo (using 1.1.1) and have some problems geting 
> mail to work from a geronimo-quartz job.
> As I understand it I need to set up a gbean or do some other 
> configuration for javamail to work (?).
Yes, your application needs to have a dependency on the javamail config 
to ensure you're getting all of the correct jar files on your 
classpath.  The protocol problem you cite below is a symptom of not 
having that.  Adding the following to your deployment plan should be 
sufficient:

    <module name="org.apache.geronimo.configs/javamail/1.1.1/car"/>

That should be sufficient to get the classes on your classpath and allow 
you do drive everything from your code.  Additionally, you can do some 
basic session configuration in the plan (as opposed to keeping the 
configuration in your code) by using:

    <module name="org.apache.geronimo.configs/javamail/1.1.1/car">
        <gbean name="SMTPTransport">
            <attribute name="host">smtp.myisp.com</attribute>
            <attribute name="port">25</attribute>
        </gbean>
    </module>

Then in your application, create the mail Session instance using

    InitialContext ic = new InitialContext(); 
    Session mailSession = (Session) 
ic.lookup("java:comp/env/mail/MailSession");

When you request the transport instance from this session, this will 
pick up the SMTP configuration from the plan.

Rick


> The example i have folowed for the Quartz Scheduler Plugin over at 
> http://gplugins.sourceforge.net/ have a nice setup including mailing 
> (in the "Deployable Jobs Example" section) but it dose not go into 
> details on howto set up mailing (its not the scope of the example).
>
> What do I need to do to get it to work? as it is now i get this exception
>
> MessagingException Unable to locate provider for protocol: smtp
>
> Anny good pointer out there to get mailing working in Geronimo ?
>
> Cheers
>  Peter
>


Re: Mailing from geronimo

Posted by Peter Petersson <pe...@pmb.mine.nu>.
Here is a simple sample app and plans.

I will also test this at home tomorrow to make sure I dont have annyting 
strange going on on my workcomp and thanks for all support ;).

Installation instruktions.
1) Get Geronimo 1.1.1 and install the Quarts scheduler (0.2) and Quarts 
deployer (0.2) plugins (simple as pie).
2) Pack the test class into a jar file and optionally the 
geronimo-quartz.xml plan file into META-INF/geronimo-quarts.xml
3) Deploy the "mail-server" using the mail-server plan.
4) Deploy the jar containing the test class using the geronimo-quarts plan.

Check the geronimo.log and you will se log messages every 30 secs from 
the test class and if you are lucky you gona send som mail ;) or you 
will get javax.mail.NoSuchProviderException: Unable to locate provider 
for protocol: smtp as I do.

geronimo-quarts.xml

<?xml version="1.0" encoding="UTF-8"?>
<jobs xmlns="http://geronimo.apache.org/xml/ns/plugins/quartz-0.2">
   <environment xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1">
             <moduleId>
               <groupId>test</groupId>
               <artifactId>TestingMailingFromQuarz</artifactId>
             </moduleId>
         <dependencies>
           <dependency>
                <groupId>test</groupId>
                <artifactId>javamail-server</artifactId>
           </dependency>
       </dependencies>
   </environment>
   <job>
       <job-name>Job name</job-name>
       <job-class>com.acme.test.QuartzMailTest</job-class>
       <cron-expression>0/30 * * * * ?</cron-expression>

       </resource-ref>
             <resource-ref>
           <property>MailSession</property>
           <res-type>javax.mail.Session</res-type>
           <res-auth>Container</res-auth>
           <res-sharing-scope>Shareable</res-sharing-scope>
           <pattern>
                <name>mail/MailSession</name>
           </pattern>
       </resource-ref>    
    </job> 
</jobs>

Sample test code (fix import and string variables to your liking ):

package com.acme.test;

import javamail stuff;
import logging stuff; 

public class QuartzMailTest implements Job {
   private final static Log logger = LogFactory.getLog(UsedAllotmentSendJob.class);

   //seter for resource MailSession
   private Session mailSession;

   public void setDatabase(DataSource ds) {
       dataSource = ds;
   }

   public void setMailSession(Session s) {
       mailSession = s;
   }        

   public void execute(JobExecutionContext jobcontext) throws JobExecutionException {
       logger.info("QuartzMailTest Started");
       //trying with added autentication
       String smtphost="thednsaddress";
       String username="thelogginname";
       String password="thelogginpassword";

       Message message = new MimeMessage(mailSession);
       try{
       InternetAddress from = new InternetAddress("the_sender_addr");
       InternetAddress to = new InternetAddress("the_resiver_addr");

       String mailer = "smtpsend";
       message.setHeader("X-Mailer", mailer);
       message.setSentDate(new Date());
       message.setFrom(from);
       message.addRecipient(Message.RecipientType.TO, to);
       message.setSubject("The subject");
       message.setText("The message");

       Transport tr = mailSession.getTransport("smtp");
       tr.connect(smtphost, username, password);
       //tr.connect(); //no extra params just the gbean settings (host,port)
       message.saveChanges(); // don't forget this
       tr.sendMessage(message, message.getAllRecipients());
       tr.close();

       //replaced with the settup above
       //mailSession.getTransport("smtp");
       //Transport.send(message);
       }catch(AddressException aex){
           logger.error("execute got a AddressException "+aex.getMessage());
       }catch(MessagingException mex){
           logger.error("execute got a MessagingException "+mex.getMessage(),mex);
       }    
    }
}

Here is the mail-server plan:

<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1">
<dep:environment xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.1">
  <dep:moduleId>
    <dep:groupId>test</dep:groupId>
    <dep:artifactId>javamail-server</dep:artifactId>
  </dep:moduleId>
 
  <dep:dependencies>
    <dep:dependency>
      <dep:groupId>geronimo</dep:groupId>
      <dep:artifactId>geronimo-mail</dep:artifactId>
      <dep:version>1.1.1</dep:version>
      <dep:type>jar</dep:type>
      <dep:import>classes</dep:import>
    </dep:dependency>
    <dep:dependency>
      <dep:groupId>geronimo</dep:groupId>
      <dep:artifactId>geronimo-javamail-transport</dep:artifactId>
      <dep:version>1.1.1</dep:version>
      <dep:type>jar</dep:type>
      <dep:import>classes</dep:import>
    </dep:dependency>
    <dep:dependency>
      <dep:groupId>geronimo</dep:groupId>
      <dep:artifactId>rmi-naming</dep:artifactId>
      <dep:type>car</dep:type>
    </dep:dependency>
  </dep:dependencies>
  <dep:hidden-classes/>
  <dep:non-overridable-classes/>
</dep:environment>

<gbean name="SMTPTransport" class="org.apache.geronimo.mail.SMTPTransportGBean">
  <attribute name="host">removed dns name</attribute>
  <attribute name="port">25</attribute>
</gbean>
<gbean name="mail/MailSession" class="org.apache.geronimo.mail.MailGBean">
  <attribute name="transportProtocol">smtp</attribute>
  <attribute name="debug">true</attribute>
  <reference name="Protocols">
     <name>SMTPTransport</name>
  </reference>
</gbean>
</module>

You may want to take a look at the following addresses for additional 
information.
http://www.geronimoplugins.com/category_Scheduling.php
http://gplugins.sourceforge.net/

Cheers
   Peter

Rick McGuire wrote:
> Peter Petersson wrote:
>> Okey here comes the plans and a code snippet illustrating what im 
>> trying to do when i get the
>> javax.mail.NoSuchProviderException: Unable to locate provider for 
>> protocol: smtp
>>       at javax.mail.Session.getProvider(Session.java:227)
>>       at javax.mail.Session.getTransport(Session.java:336)
>>
>> Anny suggestions ?
> The NoSuchProviderException usually occurs because the 
> javamail-transport jar file isn't in the classpath, but you have the 
> correct dependency there, so this should be working.  I'm going to 
> have to investigate this a little more.  Any chance you can send me 
> your sample app (with any special usage/setup instructions) so I can 
> try to sort this out?
>
> Rick
>
>
>>
>> The execute method below hass the intresting mailing part (its a bit 
>> messy as I have tryed diffrent approaches
>> Code snippet:
>> public class UsedAllotmentSendJob implements Job {
>>
>>    private final static Log logger = 
>> LogFactory.getLog(UsedAllotmentSendJob.class);
>>    private DataSource dataSource;
>>    private Session mailSession;
>>
>>    public void setDatabase(DataSource ds) {
>>        dataSource = ds;
>>    }
>>
>>    public void setMailSession(Session s) {
>>        mailSession = s;
>>    }        public void execute(JobExecutionContext jobcontext) 
>> throws JobExecutionException {
>>        //trying with added autentication
>>        String smtphost="thednsaddress";
>>        String username="thelogginname";
>>        String password="thelogginpassword";
>>              Message message = new MimeMessage(mailSession);
>>        try{
>>        InternetAddress from = new InternetAddress("the_sender_addr");
>>        InternetAddress to = new InternetAddress("the_resiver_addr");
>>
>>        String mailer = "smtpsend";
>>        message.setHeader("X-Mailer", mailer);
>>        message.setSentDate(new Date());
>>        message.setFrom(from);
>>        message.addRecipient(Message.RecipientType.TO, to);
>>        message.setSubject("The subject");
>>        message.setText("The message");
>>             Transport tr = mailSession.getTransport("smtp");
>>        tr.connect(smtphost, username, password);
>>        //tr.connect(); //no extra params just the gbean settings 
>> (host,port)
>>        message.saveChanges(); // don't forget this
>>        tr.sendMessage(message, message.getAllRecipients());
>>        tr.close();
>>        //replaced with the settup above
>>        //mailSession.getTransport("smtp");
>>        //Transport.send(message);
>>
>>        }catch(AddressException aex){
>>            logger.error("execute got a AddressException 
>> "+aex.getMessage());
>>        }catch(MessagingException mex){
>>            logger.error("execute got a MessagingException 
>> "+mex.getMessage(),mex);
>>        }    }
>> }
>>
>>
>> Geronimo Quartz Plan
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <jobs xmlns="http://geronimo.apache.org/xml/ns/plugins/quartz-0.2">
>>    <environment 
>> xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1">
>>              <moduleId>
>>            <groupId>test</groupId>
>>            <artifactId>ReportSendJobs</artifactId>
>>        </moduleId>
>>                     <dependencies>
>>            <dependency>
>>                 <groupId>test</groupId>
>>                 <artifactId>javamail-server</artifactId>
>>            </dependency>
>>                      <dependency>
>>                 <groupId>console.dbpool</groupId>
>>                 <artifactId>MySqlDB_report_sender</artifactId>
>>             </dependency>
>>        </dependencies>               </environment>
>>      <job>
>>        <job-name>Job name</job-name>
>>        <job-class>classpath to jobb class</job-class>
>>        <cron-expression>0/30 * * * * ?</cron-expression>
>>              <resource-ref>
>>            <property>Database</property>
>>            <res-type>javax.sql.DataSource</res-type>
>>            <res-auth>Container</res-auth>
>>            <res-sharing-scope>Shareable</res-sharing-scope>
>>            <pattern>
>>                <name>MySqlDB_report_sender</name>
>>            </pattern>
>>        </resource-ref>
>>              <resource-ref>
>>            <property>MailSession</property>
>>            <res-type>javax.mail.Session</res-type>
>>            <res-auth>Container</res-auth>
>>            <res-sharing-scope>Shareable</res-sharing-scope>
>>            <pattern>
>>                <name>mail/MailSession</name>
>>            </pattern>
>>        </resource-ref>    </job> </jobs>
>>
>>
>> The "mail-server" plan (slightly moddyfied version of what I got from 
>> Rick):
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>>
>> <module xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1">
>> <dep:environment 
>> xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.1">
>>   <dep:moduleId>
>>     <dep:groupId>test</dep:groupId>
>>     <dep:artifactId>javamail-server</dep:artifactId>
>>   </dep:moduleId>
>>  
>>   <dep:dependencies>
>>     <dep:dependency>
>>       <dep:groupId>geronimo</dep:groupId>
>>       <dep:artifactId>geronimo-mail</dep:artifactId>
>>       <dep:version>1.1.1</dep:version>
>>       <dep:type>jar</dep:type>
>>       <dep:import>classes</dep:import>
>>     </dep:dependency>
>>     <dep:dependency>
>>       <dep:groupId>geronimo</dep:groupId>
>>       <dep:artifactId>geronimo-javamail-transport</dep:artifactId>
>>       <dep:version>1.1.1</dep:version>
>>       <dep:type>jar</dep:type>
>>       <dep:import>classes</dep:import>
>>     </dep:dependency>
>>     <dep:dependency>
>>       <dep:groupId>geronimo</dep:groupId>
>>       <dep:artifactId>rmi-naming</dep:artifactId>
>>       <dep:type>car</dep:type>
>>     </dep:dependency>
>>   </dep:dependencies>
>>   <dep:hidden-classes/>
>>   <dep:non-overridable-classes/>
>> </dep:environment>
>>
>> <gbean name="SMTPTransport" 
>> class="org.apache.geronimo.mail.SMTPTransportGBean">
>>   <attribute name="host">removed dns name</attribute>
>>   <attribute name="port">25</attribute>
>> </gbean>
>> <gbean name="mail/MailSession" 
>> class="org.apache.geronimo.mail.MailGBean">
>>   <attribute name="transportProtocol">smtp</attribute>
>>   <attribute name="debug">true</attribute>
>>   <reference name="Protocols">
>>      <name>SMTPTransport</name>
>>   </reference>
>> </gbean>
>> </module>
>>
>>
>> Peter Petersson skrev:
>>> It is a remote SMTP server (in our lan) and autentication shuld not 
>>> be needed from inside our LAN (I have sucsessfully accessed the SMTP 
>>> server from within a vanila tomcat5 web app without autentication).
>>> Could a autentication faliur result in a NoSuchProviderException ?
>>> I have tryed setting the Transport attributes (smtphost, username, 
>>> password) from within the code
>>>
>>> Transport tr = mailSession.getTransport("smtp");
>>> tr.connect(smtphost, username, password);
>>> and also tryed a GBean via the attributes (host,port).
>>> The Gbean is from a sligtly moddified version of the "example mail 
>>> session" that Rick posted (he did a farly good shoot from the hip ;)).
>>>
>>> I but regardles of a lott of testing with different setups i still get
>>>
>>> javax.mail.NoSuchProviderException: Unable to locate provider for 
>>> protocol: smtp
>>>        at javax.mail.Session.getProvider(Session.java:227)
>>>        at javax.mail.Session.getTransport(Session.java:336)
>>>
>>>
>>> Im testing this on a fresh install of Geronimo 1.1.1
>>>
>>> Anny suggestions ?
>>>
>>> Cheers
>>>   Peter
>>>
>>> Aaron Mulder skrev:
>>>> Does your localhost have a mail server running?  Or are you trying to
>>>> send through a remote SMTP server?  Is the mail server open or do you
>>>> need to authenticate to it?
>>>>
>>>> Thanks,
>>>>     Aaron
>>>>
>>>> On 9/29/06, Peter Petersson <pe...@pmb.mine.nu> wrote:
>>>>> Hi all!
>>>>>
>>>>> I quite new to Geronimo (using 1.1.1) and have some problems 
>>>>> geting mail
>>>>> to work from a geronimo-quartz job.
>>>>> As I understand it I need to set up a gbean or do some other
>>>>> configuration for javamail to work (?).
>>>>> The example i have folowed for the Quartz Scheduler Plugin over at
>>>>> http://gplugins.sourceforge.net/ have a nice setup including 
>>>>> mailing (in
>>>>> the "Deployable Jobs Example" section) but it dose not go into 
>>>>> details
>>>>> on howto set up mailing (its not the scope of the example).
>>>>>
>>>>> What do I need to do to get it to work? as it is now i get this 
>>>>> exception
>>>>>
>>>>> MessagingException Unable to locate provider for protocol: smtp
>>>>>
>>>>> Anny good pointer out there to get mailing working in Geronimo ?
>>>>>
>>>>> Cheers
>>>>>   Peter
>>>>>
>>
>


Re: Mailing from geronimo

Posted by Aaron Mulder <am...@alumni.princeton.edu>.
I was going to suggest adding a dependency on the existing JavaMail
module (which I think is something like geronimo/javamail/1.1.1/car),
though you'd have to override the SMTP server in config.xml.  I
haven't had a chance to try an example to get the specific syntax
together, though.  I'll try to do that this weekend.

Rick, for what it's worth, the Quartz plan takes a <environment>
element like any other Geronimo plan, so either JAR or module
dependencies should be able to be added there.

Thanks,
     Aaron

On 9/30/06, Rick McGuire <ri...@gmail.com> wrote:
> Peter Petersson wrote:
> > Okey here comes the plans and a code snippet illustrating what im
> > trying to do when i get the
> > javax.mail.NoSuchProviderException: Unable to locate provider for
> > protocol: smtp
> >       at javax.mail.Session.getProvider(Session.java:227)
> >       at javax.mail.Session.getTransport(Session.java:336)
> >
> > Anny suggestions ?
> The NoSuchProviderException usually occurs because the
> javamail-transport jar file isn't in the classpath, but you have the
> correct dependency there, so this should be working.  I'm going to have
> to investigate this a little more.  Any chance you can send me your
> sample app (with any special usage/setup instructions) so I can try to
> sort this out?
>
> Rick
>
>
> >
> > The execute method below hass the intresting mailing part (its a bit
> > messy as I have tryed diffrent approaches
> > Code snippet:
> > public class UsedAllotmentSendJob implements Job {
> >
> >    private final static Log logger =
> > LogFactory.getLog(UsedAllotmentSendJob.class);
> >    private DataSource dataSource;
> >    private Session mailSession;
> >
> >    public void setDatabase(DataSource ds) {
> >        dataSource = ds;
> >    }
> >
> >    public void setMailSession(Session s) {
> >        mailSession = s;
> >    }        public void execute(JobExecutionContext jobcontext) throws
> > JobExecutionException {
> >        //trying with added autentication
> >        String smtphost="thednsaddress";
> >        String username="thelogginname";
> >        String password="thelogginpassword";
> >              Message message = new MimeMessage(mailSession);
> >        try{
> >        InternetAddress from = new InternetAddress("the_sender_addr");
> >        InternetAddress to = new InternetAddress("the_resiver_addr");
> >
> >        String mailer = "smtpsend";
> >        message.setHeader("X-Mailer", mailer);
> >        message.setSentDate(new Date());
> >        message.setFrom(from);
> >        message.addRecipient(Message.RecipientType.TO, to);
> >        message.setSubject("The subject");
> >        message.setText("The message");
> >             Transport tr = mailSession.getTransport("smtp");
> >        tr.connect(smtphost, username, password);
> >        //tr.connect(); //no extra params just the gbean settings
> > (host,port)
> >        message.saveChanges(); // don't forget this
> >        tr.sendMessage(message, message.getAllRecipients());
> >        tr.close();
> >        //replaced with the settup above
> >        //mailSession.getTransport("smtp");
> >        //Transport.send(message);
> >
> >        }catch(AddressException aex){
> >            logger.error("execute got a AddressException
> > "+aex.getMessage());
> >        }catch(MessagingException mex){
> >            logger.error("execute got a MessagingException
> > "+mex.getMessage(),mex);
> >        }    }
> > }
> >
> >
> > Geronimo Quartz Plan
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> > <jobs xmlns="http://geronimo.apache.org/xml/ns/plugins/quartz-0.2">
> >    <environment xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1">
> >              <moduleId>
> >            <groupId>test</groupId>
> >            <artifactId>ReportSendJobs</artifactId>
> >        </moduleId>
> >                     <dependencies>
> >            <dependency>
> >                 <groupId>test</groupId>
> >                 <artifactId>javamail-server</artifactId>
> >            </dependency>
> >                      <dependency>
> >                 <groupId>console.dbpool</groupId>
> >                 <artifactId>MySqlDB_report_sender</artifactId>
> >             </dependency>
> >        </dependencies>               </environment>
> >      <job>
> >        <job-name>Job name</job-name>
> >        <job-class>classpath to jobb class</job-class>
> >        <cron-expression>0/30 * * * * ?</cron-expression>
> >              <resource-ref>
> >            <property>Database</property>
> >            <res-type>javax.sql.DataSource</res-type>
> >            <res-auth>Container</res-auth>
> >            <res-sharing-scope>Shareable</res-sharing-scope>
> >            <pattern>
> >                <name>MySqlDB_report_sender</name>
> >            </pattern>
> >        </resource-ref>
> >              <resource-ref>
> >            <property>MailSession</property>
> >            <res-type>javax.mail.Session</res-type>
> >            <res-auth>Container</res-auth>
> >            <res-sharing-scope>Shareable</res-sharing-scope>
> >            <pattern>
> >                <name>mail/MailSession</name>
> >            </pattern>
> >        </resource-ref>    </job> </jobs>
> >
> >
> > The "mail-server" plan (slightly moddyfied version of what I got from
> > Rick):
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> >
> > <module xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1">
> > <dep:environment
> > xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.1">
> >   <dep:moduleId>
> >     <dep:groupId>test</dep:groupId>
> >     <dep:artifactId>javamail-server</dep:artifactId>
> >   </dep:moduleId>
> >
> >   <dep:dependencies>
> >     <dep:dependency>
> >       <dep:groupId>geronimo</dep:groupId>
> >       <dep:artifactId>geronimo-mail</dep:artifactId>
> >       <dep:version>1.1.1</dep:version>
> >       <dep:type>jar</dep:type>
> >       <dep:import>classes</dep:import>
> >     </dep:dependency>
> >     <dep:dependency>
> >       <dep:groupId>geronimo</dep:groupId>
> >       <dep:artifactId>geronimo-javamail-transport</dep:artifactId>
> >       <dep:version>1.1.1</dep:version>
> >       <dep:type>jar</dep:type>
> >       <dep:import>classes</dep:import>
> >     </dep:dependency>
> >     <dep:dependency>
> >       <dep:groupId>geronimo</dep:groupId>
> >       <dep:artifactId>rmi-naming</dep:artifactId>
> >       <dep:type>car</dep:type>
> >     </dep:dependency>
> >   </dep:dependencies>
> >   <dep:hidden-classes/>
> >   <dep:non-overridable-classes/>
> > </dep:environment>
> >
> > <gbean name="SMTPTransport"
> > class="org.apache.geronimo.mail.SMTPTransportGBean">
> >   <attribute name="host">removed dns name</attribute>
> >   <attribute name="port">25</attribute>
> > </gbean>
> > <gbean name="mail/MailSession"
> > class="org.apache.geronimo.mail.MailGBean">
> >   <attribute name="transportProtocol">smtp</attribute>
> >   <attribute name="debug">true</attribute>
> >   <reference name="Protocols">
> >      <name>SMTPTransport</name>
> >   </reference>
> > </gbean>
> > </module>
> >
> >
> > Peter Petersson skrev:
> >> It is a remote SMTP server (in our lan) and autentication shuld not
> >> be needed from inside our LAN (I have sucsessfully accessed the SMTP
> >> server from within a vanila tomcat5 web app without autentication).
> >> Could a autentication faliur result in a NoSuchProviderException ?
> >> I have tryed setting the Transport attributes (smtphost, username,
> >> password) from within the code
> >>
> >> Transport tr = mailSession.getTransport("smtp");
> >> tr.connect(smtphost, username, password);
> >> and also tryed a GBean via the attributes (host,port).
> >> The Gbean is from a sligtly moddified version of the "example mail
> >> session" that Rick posted (he did a farly good shoot from the hip ;)).
> >>
> >> I but regardles of a lott of testing with different setups i still get
> >>
> >> javax.mail.NoSuchProviderException: Unable to locate provider for
> >> protocol: smtp
> >>        at javax.mail.Session.getProvider(Session.java:227)
> >>        at javax.mail.Session.getTransport(Session.java:336)
> >>
> >>
> >> Im testing this on a fresh install of Geronimo 1.1.1
> >>
> >> Anny suggestions ?
> >>
> >> Cheers
> >>   Peter
> >>
> >> Aaron Mulder skrev:
> >>> Does your localhost have a mail server running?  Or are you trying to
> >>> send through a remote SMTP server?  Is the mail server open or do you
> >>> need to authenticate to it?
> >>>
> >>> Thanks,
> >>>     Aaron
> >>>
> >>> On 9/29/06, Peter Petersson <pe...@pmb.mine.nu> wrote:
> >>>> Hi all!
> >>>>
> >>>> I quite new to Geronimo (using 1.1.1) and have some problems geting
> >>>> mail
> >>>> to work from a geronimo-quartz job.
> >>>> As I understand it I need to set up a gbean or do some other
> >>>> configuration for javamail to work (?).
> >>>> The example i have folowed for the Quartz Scheduler Plugin over at
> >>>> http://gplugins.sourceforge.net/ have a nice setup including
> >>>> mailing (in
> >>>> the "Deployable Jobs Example" section) but it dose not go into details
> >>>> on howto set up mailing (its not the scope of the example).
> >>>>
> >>>> What do I need to do to get it to work? as it is now i get this
> >>>> exception
> >>>>
> >>>> MessagingException Unable to locate provider for protocol: smtp
> >>>>
> >>>> Anny good pointer out there to get mailing working in Geronimo ?
> >>>>
> >>>> Cheers
> >>>>   Peter
> >>>>
> >
>
>

Geronimo-web.xml - Please help

Posted by sreepriya ramakrishnan <sr...@yahoo.com>.
Hi all,

Sorry to infiltrate your inboxes with these messages.
Please see below a copy of my geronimo-web.xml.

I have included my login modules in a jar file
test-1.0.jar and put it in the repository. If the
application deploys I am assuming , it has found the
jar dependency. But,I find that geronimo still says
that the Login Module cannot be found. Please let me
know waht I am doing wrong here.

<?xml version="1.0" encoding="UTF-8"?>
 <web-app
    xmlns="http://geronimo.apache.org/xml/ns/web"
   
xmlns:naming="http://geronimo.apache.org/xml/ns/naming"
    configId="MyConfigName">

    <dependency>
	<uri>login/Test/1.0/jar</uri>
    </dependency>

    <context-root>/testapplication</context-root>
   
<context-priority-classloader>true</context-priority-classloader>
<security-realm-name>TestRealm</security-realm-name>


    <gbean name="TestRealm"
class="org.apache.geronimo.security.realm.GenericSecurityRealm">
        <attribute
name="realmName">TestRealm</attribute>
        <reference name="ServerInfo">
           
<gbean-name>geronimo.server:J2EEApplication=null,J2EEModule=geronimo/j2ee-system/1.0/car,J2EEServer=geronimo,j2eeType=GBean,name=ServerInfo</gbean-name>
        </reference>
        <reference name="LoginService">
           
<gbean-name>geronimo.server:J2EEApplication=null,J2EEModule=geronimo/j2ee-security/1.0/car,J2EEServer=geronimo,j2eeType=JaasLoginService,name=JaasLoginService</gbean-name>
        </reference>
        <xml-reference
name="LoginModuleConfiguration">
            <log:login-config
xmlns:log="http://geronimo.apache.org/xml/ns/loginconfig-1.0">
                <log:login-module
control-flag="OPTIONAL" server-side="true"
wrap-principals="false">
                   
<log:login-domain-name>LDAPLoginManager</log:login-domain-name>
                   
<log:login-module-class>org.apache.geronimo.security.realm.providers.LDAPLoginModule</log:login-module-class>
                    <log:option
name="connectionProtocol"/>
                    <log:option
name="roleSearchMatching">(uniqueMember={0})</log:option>
                    <log:option
name="userSearchSubtree">false</log:option>
                    <log:option
name="roleName">cn</log:option>
                    <log:option
name="roleBase">ou=groups,ou=system</log:option>
                    <log:option name="userRoleName"/>
                    <log:option
name="authentication">simple</log:option>
                    <log:option
name="connectionURL">ldap://localhost:1389</log:option>
                    <log:option
name="connectionUsername">uid=admin,ou=system</log:option>
                    <log:option
name="userBase">ou=users,ou=system</log:option>
                    <log:option
name="initialContextFactory">com.sun.jndi.ldap.LdapCtxFactory</log:option>
                    <log:option
name="roleSearchSubtree">false</log:option>
                    <log:option
name="connectionPassword">secret</log:option>
                    <log:option
name="userSearchMatching">uid={0}</log:option>
                </log:login-module>
                <log:login-module
control-flag="SUFFICIENT" server-side="true"
wrap-principals="false">
                   
<log:login-domain-name>DBLoginManager</log:login-domain-name>
                   
<log:login-module-class>com.test.TestLoginModule</log:login-module-class>
                </log:login-module>
            </log:login-config>
        </xml-reference>
    </gbean>


 </web-app>


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: Geronimo and CustomLoginModules- not able to find jar

Posted by sreepriya ramakrishnan <sr...@yahoo.com>.
Hi I added the dependency in the geronimo-web.xml like
the following and I put the jar in a folder called
login/jars which I created under
Geronimo1.0/repository. I get the following exception:

org.apache.geronimo.kernel.repository.MissingDependencyException:
uri login/jars/Test.jar not found in repository
uri login/jars/Test.jar not found in repository

Thanks,
Priya

<?xml version="1.0" encoding="UTF-8"?>
 <web-app
    xmlns="http://geronimo.apache.org/xml/ns/web"
   
xmlns:naming="http://geronimo.apache.org/xml/ns/naming"
    configId="MyConfigName">

    <dependency>
	<uri>login/jars/Test.jar</uri>
    </dependency>

    <context-root>/testapplication</context-root>
   
<context-priority-classloader>true</context-priority-classloader>
 </web-app>

--- Vamsavardhana Reddy <c1...@gmail.com> wrote:

> You will add the dependency to geronimo-web.xml
> 
> Vamsi
> 
> On 10/3/06, sreepriya ramakrishnan
> <sr...@yahoo.com> wrote:
> >
> > Hi all,
> >
> > I have written my own custom login module and I
> > created and deployed the realm in Geronimo V1.0
> > console.
> >
> > Now, when I run my application it says it cannot
> find
> > the Login module class.
> >
> > The documentation asks me to create a jar and put
> it
> > in the repository ( I am assuming this means :
> > geronimos installation folder/repository- create
> > folders here and reference it)
> >
> > If I have only a web application , how do I add
> the
> > jar to teh classpath. All examples point to adding
> the
> > information in a geronimo-application.xml file.
> What
> > if I dont have this?
> >
> > Can some one please walk me through the procedure?
> >
> > Thanks,
> > Priya
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam
> protection around
> > http://mail.yahoo.com
> >
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: Geronimo and CustomLoginModules

Posted by Vamsavardhana Reddy <c1...@gmail.com>.
You will add the dependency to geronimo-web.xml

Vamsi

On 10/3/06, sreepriya ramakrishnan <sr...@yahoo.com> wrote:
>
> Hi all,
>
> I have written my own custom login module and I
> created and deployed the realm in Geronimo V1.0
> console.
>
> Now, when I run my application it says it cannot find
> the Login module class.
>
> The documentation asks me to create a jar and put it
> in the repository ( I am assuming this means :
> geronimos installation folder/repository- create
> folders here and reference it)
>
> If I have only a web application , how do I add the
> jar to teh classpath. All examples point to adding the
> information in a geronimo-application.xml file. What
> if I dont have this?
>
> Can some one please walk me through the procedure?
>
> Thanks,
> Priya
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>

Re: Geronimo and Base 64

Posted by sreepriya ramakrishnan <sr...@yahoo.com>.
Thanks for your help Rick. That solved it.


--- Rick McGuire <ri...@gmail.com> wrote:

> sreepriya ramakrishnan wrote:
> > Hi all,
> >
> > Can anyone tell me of any available class in
> Geronimo
> > package jars that can help me to decode Base 64
> > encoded strings?
> >
> > I tried using the MimeUtility.decode method in
> > geronimo-javamail_1.3.1_spec-1.0.jar file, but it
> did
> > not work.
> >
> >   
> Not surprising.  MimeUtiltiy.decode() is specific to
> some mail RFC 
> conventions, and is not a real base64 decoder. 
> There are some base 64 
> encoder/decoder classes in the geronimo-util module.
> 
> Rick
> 
> > Appreciate your help.
> >
> > Thanks,
> > Priya
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam
> protection around 
> > http://mail.yahoo.com 
> >
> >   
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Geronimo and CustomLoginModules

Posted by sreepriya ramakrishnan <sr...@yahoo.com>.
Hi all,

I have written my own custom login module and I
created and deployed the realm in Geronimo V1.0
console.

Now, when I run my application it says it cannot find
the Login module class. 

The documentation asks me to create a jar and put it
in the repository ( I am assuming this means :
geronimos installation folder/repository- create
folders here and reference it)

If I have only a web application , how do I add the
jar to teh classpath. All examples point to adding the
information in a geronimo-application.xml file. What
if I dont have this? 

Can some one please walk me through the procedure?

Thanks,
Priya

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: Geronimo and Base 64

Posted by Rick McGuire <ri...@gmail.com>.
sreepriya ramakrishnan wrote:
> Hi all,
>
> Can anyone tell me of any available class in Geronimo
> package jars that can help me to decode Base 64
> encoded strings?
>
> I tried using the MimeUtility.decode method in
> geronimo-javamail_1.3.1_spec-1.0.jar file, but it did
> not work.
>
>   
Not surprising.  MimeUtiltiy.decode() is specific to some mail RFC 
conventions, and is not a real base64 decoder.  There are some base 64 
encoder/decoder classes in the geronimo-util module.

Rick

> Appreciate your help.
>
> Thanks,
> Priya
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
>
>   


Geronimo and Base 64

Posted by sreepriya ramakrishnan <sr...@yahoo.com>.
Hi all,

Can anyone tell me of any available class in Geronimo
package jars that can help me to decode Base 64
encoded strings?

I tried using the MimeUtility.decode method in
geronimo-javamail_1.3.1_spec-1.0.jar file, but it did
not work.

Appreciate your help.

Thanks,
Priya

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: Mailing from geronimo

Posted by Peter Petersson <pe...@pmb.mine.nu>.
My attempt to mail from within a quart job is now working ;)
During correspondance with Rick McGuire that cindly dedicated som of his 
time to help me out, he sugested
moving the transport retriving to the setMailSession method and wrap it 
up within a classloader call and it did the trick ;)
Here is the code snippet:

   public void setMailSession(Session s) {
       mailSession = s;
       ClassLoader old = Thread.currentThread().getContextClassLoader();
       Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader()); 
       try {            
           tr = mailSession.getTransport("smtp");
       }catch(NoSuchProviderException pex){
           logger.error("setMailSession got a exeption trying to get the smtp transport "+pex.getMessage());
       }
       finally {
           Thread.currentThread().setContextClassLoader(old);
       }    
} 

Cheers
   Peter

Peter Petersson skrev:
> Hi again!
>
> Im just wondering if anyone is having a try on this ? It would be 
> really appreciated as im cind off stuck here.
>
> It would really be nice to get geronimo-mail runing but if it's not 
> gona happen maybe I will have beter luck with  suns JavaMail so Is 
> there a way to replace the mail service to use suns JavaMail ?
> Its vital for me to get any cind of mailing running in Geronimo so all 
> help/ideas is welcome and appreciated.
>
> Event though I set debug lever to ALL i cant trace down whats going 
> wrong with my mailing setup Is it posible to enable even more trace 
> information in Geronimo (mail).
>
> Thanks,
> Peter
>
> Peter Petersson skrev:
>> Here is a attatched simple tar.gz packed sample app with plans that 
>> uses a ant build.xml file to build the jar for you.
>> I have tested it at home and I get the same error as before.
>>
>> Appreciate all help on geting maling runing in it !
>>
>> Setup:
>> 1) Install geronimo 1.1.1 (if you dont allreddy have it)
>> 2) Install the Quartz Scheduler (0.2) and Quartz Job Deployer (0.2) 
>> plugins available from console/plugins.
>> 3) Pack up the tar.gz file and do some initial edits:
>>    QuartzMailTest.java -- fix mail addresses etc.
>>    mail-server.xml -- fix smtp address.
>>    build.xml -- set geronimo home.
>>    If you are using eclipse you can probably just import the proj 
>> after unpacking it.
>> 4) Build with:  ant dist -- and you will have a deploable test app in 
>> the "dist" dir.
>>
>> Deploy the apps and check geronimo.log It will put out somting from 
>> the job every 30 secs.
>>
>> Thanks
>>   Peter
>>
>> Rick McGuire wrote:
>>> Peter Petersson wrote:
>>>> Okey here comes the plans and a code snippet illustrating what im 
>>>> trying to do when i get the
>>>> javax.mail.NoSuchProviderException: Unable to locate provider for 
>>>> protocol: smtp
>>>>       at javax.mail.Session.getProvider(Session.java:227)
>>>>       at javax.mail.Session.getTransport(Session.java:336)
>>>>
>>>> Anny suggestions ?
>>> The NoSuchProviderException usually occurs because the 
>>> javamail-transport jar file isn't in the classpath, but you have the 
>>> correct dependency there, so this should be working.  I'm going to 
>>> have to investigate this a little more.  Any chance you can send me 
>>> your sample app (with any special usage/setup instructions) so I can 
>>> try to sort this out?
>>>
>>> Rick
>>>
>>>
>>>>
>>>> The execute method below hass the intresting mailing part (its a 
>>>> bit messy as I have tryed diffrent approaches
>>>> Code snippet:
>>>> public class UsedAllotmentSendJob implements Job {
>>>>
>>>>    private final static Log logger = 
>>>> LogFactory.getLog(UsedAllotmentSendJob.class);
>>>>    private DataSource dataSource;
>>>>    private Session mailSession;
>>>>
>>>>    public void setDatabase(DataSource ds) {
>>>>        dataSource = ds;
>>>>    }
>>>>
>>>>    public void setMailSession(Session s) {
>>>>        mailSession = s;
>>>>    }        public void execute(JobExecutionContext jobcontext) 
>>>> throws JobExecutionException {
>>>>        //trying with added autentication
>>>>        String smtphost="thednsaddress";
>>>>        String username="thelogginname";
>>>>        String password="thelogginpassword";
>>>>              Message message = new MimeMessage(mailSession);
>>>>        try{
>>>>        InternetAddress from = new InternetAddress("the_sender_addr");
>>>>        InternetAddress to = new InternetAddress("the_resiver_addr");
>>>>
>>>>        String mailer = "smtpsend";
>>>>        message.setHeader("X-Mailer", mailer);
>>>>        message.setSentDate(new Date());
>>>>        message.setFrom(from);
>>>>        message.addRecipient(Message.RecipientType.TO, to);
>>>>        message.setSubject("The subject");
>>>>        message.setText("The message");
>>>>             Transport tr = mailSession.getTransport("smtp");
>>>>        tr.connect(smtphost, username, password);
>>>>        //tr.connect(); //no extra params just the gbean settings 
>>>> (host,port)
>>>>        message.saveChanges(); // don't forget this
>>>>        tr.sendMessage(message, message.getAllRecipients());
>>>>        tr.close();
>>>>        //replaced with the settup above
>>>>        //mailSession.getTransport("smtp");
>>>>        //Transport.send(message);
>>>>
>>>>        }catch(AddressException aex){
>>>>            logger.error("execute got a AddressException 
>>>> "+aex.getMessage());
>>>>        }catch(MessagingException mex){
>>>>            logger.error("execute got a MessagingException 
>>>> "+mex.getMessage(),mex);
>>>>        }    }
>>>> }
>>>>
>>>>
>>>> Geronimo Quartz Plan
>>>>
>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>> <jobs xmlns="http://geronimo.apache.org/xml/ns/plugins/quartz-0.2">
>>>>    <environment 
>>>> xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1">
>>>>              <moduleId>
>>>>            <groupId>test</groupId>
>>>>            <artifactId>ReportSendJobs</artifactId>
>>>>        </moduleId>
>>>>                     <dependencies>
>>>>            <dependency>
>>>>                 <groupId>test</groupId>
>>>>                 <artifactId>javamail-server</artifactId>
>>>>            </dependency>
>>>>                      <dependency>
>>>>                 <groupId>console.dbpool</groupId>
>>>>                 <artifactId>MySqlDB_report_sender</artifactId>
>>>>             </dependency>
>>>>        </dependencies>               </environment>
>>>>      <job>
>>>>        <job-name>Job name</job-name>
>>>>        <job-class>classpath to jobb class</job-class>
>>>>        <cron-expression>0/30 * * * * ?</cron-expression>
>>>>              <resource-ref>
>>>>            <property>Database</property>
>>>>            <res-type>javax.sql.DataSource</res-type>
>>>>            <res-auth>Container</res-auth>
>>>>            <res-sharing-scope>Shareable</res-sharing-scope>
>>>>            <pattern>
>>>>                <name>MySqlDB_report_sender</name>
>>>>            </pattern>
>>>>        </resource-ref>
>>>>              <resource-ref>
>>>>            <property>MailSession</property>
>>>>            <res-type>javax.mail.Session</res-type>
>>>>            <res-auth>Container</res-auth>
>>>>            <res-sharing-scope>Shareable</res-sharing-scope>
>>>>            <pattern>
>>>>                <name>mail/MailSession</name>
>>>>            </pattern>
>>>>        </resource-ref>    </job> </jobs>
>>>>
>>>>
>>>> The "mail-server" plan (slightly moddyfied version of what I got 
>>>> from Rick):
>>>>
>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>>
>>>> <module xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1">
>>>> <dep:environment 
>>>> xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.1">
>>>>   <dep:moduleId>
>>>>     <dep:groupId>test</dep:groupId>
>>>>     <dep:artifactId>javamail-server</dep:artifactId>
>>>>   </dep:moduleId>
>>>>  
>>>>   <dep:dependencies>
>>>>     <dep:dependency>
>>>>       <dep:groupId>geronimo</dep:groupId>
>>>>       <dep:artifactId>geronimo-mail</dep:artifactId>
>>>>       <dep:version>1.1.1</dep:version>
>>>>       <dep:type>jar</dep:type>
>>>>       <dep:import>classes</dep:import>
>>>>     </dep:dependency>
>>>>     <dep:dependency>
>>>>       <dep:groupId>geronimo</dep:groupId>
>>>>       <dep:artifactId>geronimo-javamail-transport</dep:artifactId>
>>>>       <dep:version>1.1.1</dep:version>
>>>>       <dep:type>jar</dep:type>
>>>>       <dep:import>classes</dep:import>
>>>>     </dep:dependency>
>>>>     <dep:dependency>
>>>>       <dep:groupId>geronimo</dep:groupId>
>>>>       <dep:artifactId>rmi-naming</dep:artifactId>
>>>>       <dep:type>car</dep:type>
>>>>     </dep:dependency>
>>>>   </dep:dependencies>
>>>>   <dep:hidden-classes/>
>>>>   <dep:non-overridable-classes/>
>>>> </dep:environment>
>>>>
>>>> <gbean name="SMTPTransport" 
>>>> class="org.apache.geronimo.mail.SMTPTransportGBean">
>>>>   <attribute name="host">removed dns name</attribute>
>>>>   <attribute name="port">25</attribute>
>>>> </gbean>
>>>> <gbean name="mail/MailSession" 
>>>> class="org.apache.geronimo.mail.MailGBean">
>>>>   <attribute name="transportProtocol">smtp</attribute>
>>>>   <attribute name="debug">true</attribute>
>>>>   <reference name="Protocols">
>>>>      <name>SMTPTransport</name>
>>>>   </reference>
>>>> </gbean>
>>>> </module>
>>>>
>>>>
>>>> Peter Petersson skrev:
>>>>> It is a remote SMTP server (in our lan) and autentication shuld 
>>>>> not be needed from inside our LAN (I have sucsessfully accessed 
>>>>> the SMTP server from within a vanila tomcat5 web app without 
>>>>> autentication).
>>>>> Could a autentication faliur result in a NoSuchProviderException ?
>>>>> I have tryed setting the Transport attributes (smtphost, username, 
>>>>> password) from within the code
>>>>>
>>>>> Transport tr = mailSession.getTransport("smtp");
>>>>> tr.connect(smtphost, username, password);
>>>>> and also tryed a GBean via the attributes (host,port).
>>>>> The Gbean is from a sligtly moddified version of the "example mail 
>>>>> session" that Rick posted (he did a farly good shoot from the hip 
>>>>> ;)).
>>>>>
>>>>> I but regardles of a lott of testing with different setups i still 
>>>>> get
>>>>>
>>>>> javax.mail.NoSuchProviderException: Unable to locate provider for 
>>>>> protocol: smtp
>>>>>        at javax.mail.Session.getProvider(Session.java:227)
>>>>>        at javax.mail.Session.getTransport(Session.java:336)
>>>>>
>>>>>
>>>>> Im testing this on a fresh install of Geronimo 1.1.1
>>>>>
>>>>> Anny suggestions ?
>>>>>
>>>>> Cheers
>>>>>   Peter
>>>>>
>>>>> Aaron Mulder skrev:
>>>>>> Does your localhost have a mail server running?  Or are you 
>>>>>> trying to
>>>>>> send through a remote SMTP server?  Is the mail server open or do 
>>>>>> you
>>>>>> need to authenticate to it?
>>>>>>
>>>>>> Thanks,
>>>>>>     Aaron
>>>>>>
>>>>>> On 9/29/06, Peter Petersson <pe...@pmb.mine.nu> wrote:
>>>>>>> Hi all!
>>>>>>>
>>>>>>> I quite new to Geronimo (using 1.1.1) and have some problems 
>>>>>>> geting mail
>>>>>>> to work from a geronimo-quartz job.
>>>>>>> As I understand it I need to set up a gbean or do some other
>>>>>>> configuration for javamail to work (?).
>>>>>>> The example i have folowed for the Quartz Scheduler Plugin over at
>>>>>>> http://gplugins.sourceforge.net/ have a nice setup including 
>>>>>>> mailing (in
>>>>>>> the "Deployable Jobs Example" section) but it dose not go into 
>>>>>>> details
>>>>>>> on howto set up mailing (its not the scope of the example).
>>>>>>>
>>>>>>> What do I need to do to get it to work? as it is now i get this 
>>>>>>> exception
>>>>>>>
>>>>>>> MessagingException Unable to locate provider for protocol: smtp
>>>>>>>
>>>>>>> Anny good pointer out there to get mailing working in Geronimo ?
>>>>>>>
>>>>>>> Cheers
>>>>>>>   Peter
>>>>>>>
>>>>
>>>
>>

Re: Mailing from geronimo

Posted by Peter Petersson <pe...@pmb.mine.nu>.
Hi again!

Im just wondering if anyone is having a try on this ? It would be really 
appreciated as im cind off stuck here.

It would really be nice to get geronimo-mail runing but if it's not gona 
happen maybe I will have beter luck with  suns JavaMail so Is there a 
way to replace the mail service to use suns JavaMail ?
Its vital for me to get any cind of mailing running in Geronimo so all 
help/ideas is welcome and appreciated.

Event though I set debug lever to ALL i cant trace down whats going 
wrong with my mailing setup Is it posible to enable even more trace 
information in Geronimo (mail).

Thanks,
 Peter

Peter Petersson skrev:
> Here is a attatched simple tar.gz packed sample app with plans that 
> uses a ant build.xml file to build the jar for you.
> I have tested it at home and I get the same error as before.
>
> Appreciate all help on geting maling runing in it !
>
> Setup:
> 1) Install geronimo 1.1.1 (if you dont allreddy have it)
> 2) Install the Quartz Scheduler (0.2) and Quartz Job Deployer (0.2) 
> plugins available from console/plugins.
> 3) Pack up the tar.gz file and do some initial edits:
>    QuartzMailTest.java -- fix mail addresses etc.
>    mail-server.xml -- fix smtp address.
>    build.xml -- set geronimo home.
>    If you are using eclipse you can probably just import the proj 
> after unpacking it.
> 4) Build with:  ant dist -- and you will have a deploable test app in 
> the "dist" dir.
>
> Deploy the apps and check geronimo.log It will put out somting from 
> the job every 30 secs.
>
> Thanks
>   Peter
>
> Rick McGuire wrote:
>> Peter Petersson wrote:
>>> Okey here comes the plans and a code snippet illustrating what im 
>>> trying to do when i get the
>>> javax.mail.NoSuchProviderException: Unable to locate provider for 
>>> protocol: smtp
>>>       at javax.mail.Session.getProvider(Session.java:227)
>>>       at javax.mail.Session.getTransport(Session.java:336)
>>>
>>> Anny suggestions ?
>> The NoSuchProviderException usually occurs because the 
>> javamail-transport jar file isn't in the classpath, but you have the 
>> correct dependency there, so this should be working.  I'm going to 
>> have to investigate this a little more.  Any chance you can send me 
>> your sample app (with any special usage/setup instructions) so I can 
>> try to sort this out?
>>
>> Rick
>>
>>
>>>
>>> The execute method below hass the intresting mailing part (its a bit 
>>> messy as I have tryed diffrent approaches
>>> Code snippet:
>>> public class UsedAllotmentSendJob implements Job {
>>>
>>>    private final static Log logger = 
>>> LogFactory.getLog(UsedAllotmentSendJob.class);
>>>    private DataSource dataSource;
>>>    private Session mailSession;
>>>
>>>    public void setDatabase(DataSource ds) {
>>>        dataSource = ds;
>>>    }
>>>
>>>    public void setMailSession(Session s) {
>>>        mailSession = s;
>>>    }        public void execute(JobExecutionContext jobcontext) 
>>> throws JobExecutionException {
>>>        //trying with added autentication
>>>        String smtphost="thednsaddress";
>>>        String username="thelogginname";
>>>        String password="thelogginpassword";
>>>              Message message = new MimeMessage(mailSession);
>>>        try{
>>>        InternetAddress from = new InternetAddress("the_sender_addr");
>>>        InternetAddress to = new InternetAddress("the_resiver_addr");
>>>
>>>        String mailer = "smtpsend";
>>>        message.setHeader("X-Mailer", mailer);
>>>        message.setSentDate(new Date());
>>>        message.setFrom(from);
>>>        message.addRecipient(Message.RecipientType.TO, to);
>>>        message.setSubject("The subject");
>>>        message.setText("The message");
>>>             Transport tr = mailSession.getTransport("smtp");
>>>        tr.connect(smtphost, username, password);
>>>        //tr.connect(); //no extra params just the gbean settings 
>>> (host,port)
>>>        message.saveChanges(); // don't forget this
>>>        tr.sendMessage(message, message.getAllRecipients());
>>>        tr.close();
>>>        //replaced with the settup above
>>>        //mailSession.getTransport("smtp");
>>>        //Transport.send(message);
>>>
>>>        }catch(AddressException aex){
>>>            logger.error("execute got a AddressException 
>>> "+aex.getMessage());
>>>        }catch(MessagingException mex){
>>>            logger.error("execute got a MessagingException 
>>> "+mex.getMessage(),mex);
>>>        }    }
>>> }
>>>
>>>
>>> Geronimo Quartz Plan
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <jobs xmlns="http://geronimo.apache.org/xml/ns/plugins/quartz-0.2">
>>>    <environment 
>>> xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1">
>>>              <moduleId>
>>>            <groupId>test</groupId>
>>>            <artifactId>ReportSendJobs</artifactId>
>>>        </moduleId>
>>>                     <dependencies>
>>>            <dependency>
>>>                 <groupId>test</groupId>
>>>                 <artifactId>javamail-server</artifactId>
>>>            </dependency>
>>>                      <dependency>
>>>                 <groupId>console.dbpool</groupId>
>>>                 <artifactId>MySqlDB_report_sender</artifactId>
>>>             </dependency>
>>>        </dependencies>               </environment>
>>>      <job>
>>>        <job-name>Job name</job-name>
>>>        <job-class>classpath to jobb class</job-class>
>>>        <cron-expression>0/30 * * * * ?</cron-expression>
>>>              <resource-ref>
>>>            <property>Database</property>
>>>            <res-type>javax.sql.DataSource</res-type>
>>>            <res-auth>Container</res-auth>
>>>            <res-sharing-scope>Shareable</res-sharing-scope>
>>>            <pattern>
>>>                <name>MySqlDB_report_sender</name>
>>>            </pattern>
>>>        </resource-ref>
>>>              <resource-ref>
>>>            <property>MailSession</property>
>>>            <res-type>javax.mail.Session</res-type>
>>>            <res-auth>Container</res-auth>
>>>            <res-sharing-scope>Shareable</res-sharing-scope>
>>>            <pattern>
>>>                <name>mail/MailSession</name>
>>>            </pattern>
>>>        </resource-ref>    </job> </jobs>
>>>
>>>
>>> The "mail-server" plan (slightly moddyfied version of what I got 
>>> from Rick):
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>>
>>> <module xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1">
>>> <dep:environment 
>>> xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.1">
>>>   <dep:moduleId>
>>>     <dep:groupId>test</dep:groupId>
>>>     <dep:artifactId>javamail-server</dep:artifactId>
>>>   </dep:moduleId>
>>>  
>>>   <dep:dependencies>
>>>     <dep:dependency>
>>>       <dep:groupId>geronimo</dep:groupId>
>>>       <dep:artifactId>geronimo-mail</dep:artifactId>
>>>       <dep:version>1.1.1</dep:version>
>>>       <dep:type>jar</dep:type>
>>>       <dep:import>classes</dep:import>
>>>     </dep:dependency>
>>>     <dep:dependency>
>>>       <dep:groupId>geronimo</dep:groupId>
>>>       <dep:artifactId>geronimo-javamail-transport</dep:artifactId>
>>>       <dep:version>1.1.1</dep:version>
>>>       <dep:type>jar</dep:type>
>>>       <dep:import>classes</dep:import>
>>>     </dep:dependency>
>>>     <dep:dependency>
>>>       <dep:groupId>geronimo</dep:groupId>
>>>       <dep:artifactId>rmi-naming</dep:artifactId>
>>>       <dep:type>car</dep:type>
>>>     </dep:dependency>
>>>   </dep:dependencies>
>>>   <dep:hidden-classes/>
>>>   <dep:non-overridable-classes/>
>>> </dep:environment>
>>>
>>> <gbean name="SMTPTransport" 
>>> class="org.apache.geronimo.mail.SMTPTransportGBean">
>>>   <attribute name="host">removed dns name</attribute>
>>>   <attribute name="port">25</attribute>
>>> </gbean>
>>> <gbean name="mail/MailSession" 
>>> class="org.apache.geronimo.mail.MailGBean">
>>>   <attribute name="transportProtocol">smtp</attribute>
>>>   <attribute name="debug">true</attribute>
>>>   <reference name="Protocols">
>>>      <name>SMTPTransport</name>
>>>   </reference>
>>> </gbean>
>>> </module>
>>>
>>>
>>> Peter Petersson skrev:
>>>> It is a remote SMTP server (in our lan) and autentication shuld not 
>>>> be needed from inside our LAN (I have sucsessfully accessed the 
>>>> SMTP server from within a vanila tomcat5 web app without 
>>>> autentication).
>>>> Could a autentication faliur result in a NoSuchProviderException ?
>>>> I have tryed setting the Transport attributes (smtphost, username, 
>>>> password) from within the code
>>>>
>>>> Transport tr = mailSession.getTransport("smtp");
>>>> tr.connect(smtphost, username, password);
>>>> and also tryed a GBean via the attributes (host,port).
>>>> The Gbean is from a sligtly moddified version of the "example mail 
>>>> session" that Rick posted (he did a farly good shoot from the hip ;)).
>>>>
>>>> I but regardles of a lott of testing with different setups i still get
>>>>
>>>> javax.mail.NoSuchProviderException: Unable to locate provider for 
>>>> protocol: smtp
>>>>        at javax.mail.Session.getProvider(Session.java:227)
>>>>        at javax.mail.Session.getTransport(Session.java:336)
>>>>
>>>>
>>>> Im testing this on a fresh install of Geronimo 1.1.1
>>>>
>>>> Anny suggestions ?
>>>>
>>>> Cheers
>>>>   Peter
>>>>
>>>> Aaron Mulder skrev:
>>>>> Does your localhost have a mail server running?  Or are you trying to
>>>>> send through a remote SMTP server?  Is the mail server open or do you
>>>>> need to authenticate to it?
>>>>>
>>>>> Thanks,
>>>>>     Aaron
>>>>>
>>>>> On 9/29/06, Peter Petersson <pe...@pmb.mine.nu> wrote:
>>>>>> Hi all!
>>>>>>
>>>>>> I quite new to Geronimo (using 1.1.1) and have some problems 
>>>>>> geting mail
>>>>>> to work from a geronimo-quartz job.
>>>>>> As I understand it I need to set up a gbean or do some other
>>>>>> configuration for javamail to work (?).
>>>>>> The example i have folowed for the Quartz Scheduler Plugin over at
>>>>>> http://gplugins.sourceforge.net/ have a nice setup including 
>>>>>> mailing (in
>>>>>> the "Deployable Jobs Example" section) but it dose not go into 
>>>>>> details
>>>>>> on howto set up mailing (its not the scope of the example).
>>>>>>
>>>>>> What do I need to do to get it to work? as it is now i get this 
>>>>>> exception
>>>>>>
>>>>>> MessagingException Unable to locate provider for protocol: smtp
>>>>>>
>>>>>> Anny good pointer out there to get mailing working in Geronimo ?
>>>>>>
>>>>>> Cheers
>>>>>>   Peter
>>>>>>
>>>
>>
>

Re: Mailing from geronimo

Posted by Peter Petersson <pe...@pmb.mine.nu>.
Here is a attatched simple tar.gz packed sample app with plans that uses 
a ant build.xml file to build the jar for you.
I have tested it at home and I get the same error as before.

Appreciate all help on geting maling runing in it !

Setup:
1) Install geronimo 1.1.1 (if you dont allreddy have it)
2) Install the Quartz Scheduler (0.2) and Quartz Job Deployer (0.2) 
plugins available from console/plugins.
3) Pack up the tar.gz file and do some initial edits:
    QuartzMailTest.java -- fix mail addresses etc.
    mail-server.xml -- fix smtp address.
    build.xml -- set geronimo home.
    If you are using eclipse you can probably just import the proj after 
unpacking it.
4) Build with:  ant dist -- and you will have a deploable test app in 
the "dist" dir.
 
Deploy the apps and check geronimo.log It will put out somting from the 
job every 30 secs.

Thanks
   Peter

Rick McGuire wrote:
> Peter Petersson wrote:
>> Okey here comes the plans and a code snippet illustrating what im 
>> trying to do when i get the
>> javax.mail.NoSuchProviderException: Unable to locate provider for 
>> protocol: smtp
>>       at javax.mail.Session.getProvider(Session.java:227)
>>       at javax.mail.Session.getTransport(Session.java:336)
>>
>> Anny suggestions ?
> The NoSuchProviderException usually occurs because the 
> javamail-transport jar file isn't in the classpath, but you have the 
> correct dependency there, so this should be working.  I'm going to 
> have to investigate this a little more.  Any chance you can send me 
> your sample app (with any special usage/setup instructions) so I can 
> try to sort this out?
>
> Rick
>
>
>>
>> The execute method below hass the intresting mailing part (its a bit 
>> messy as I have tryed diffrent approaches
>> Code snippet:
>> public class UsedAllotmentSendJob implements Job {
>>
>>    private final static Log logger = 
>> LogFactory.getLog(UsedAllotmentSendJob.class);
>>    private DataSource dataSource;
>>    private Session mailSession;
>>
>>    public void setDatabase(DataSource ds) {
>>        dataSource = ds;
>>    }
>>
>>    public void setMailSession(Session s) {
>>        mailSession = s;
>>    }        public void execute(JobExecutionContext jobcontext) 
>> throws JobExecutionException {
>>        //trying with added autentication
>>        String smtphost="thednsaddress";
>>        String username="thelogginname";
>>        String password="thelogginpassword";
>>              Message message = new MimeMessage(mailSession);
>>        try{
>>        InternetAddress from = new InternetAddress("the_sender_addr");
>>        InternetAddress to = new InternetAddress("the_resiver_addr");
>>
>>        String mailer = "smtpsend";
>>        message.setHeader("X-Mailer", mailer);
>>        message.setSentDate(new Date());
>>        message.setFrom(from);
>>        message.addRecipient(Message.RecipientType.TO, to);
>>        message.setSubject("The subject");
>>        message.setText("The message");
>>             Transport tr = mailSession.getTransport("smtp");
>>        tr.connect(smtphost, username, password);
>>        //tr.connect(); //no extra params just the gbean settings 
>> (host,port)
>>        message.saveChanges(); // don't forget this
>>        tr.sendMessage(message, message.getAllRecipients());
>>        tr.close();
>>        //replaced with the settup above
>>        //mailSession.getTransport("smtp");
>>        //Transport.send(message);
>>
>>        }catch(AddressException aex){
>>            logger.error("execute got a AddressException 
>> "+aex.getMessage());
>>        }catch(MessagingException mex){
>>            logger.error("execute got a MessagingException 
>> "+mex.getMessage(),mex);
>>        }    }
>> }
>>
>>
>> Geronimo Quartz Plan
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <jobs xmlns="http://geronimo.apache.org/xml/ns/plugins/quartz-0.2">
>>    <environment 
>> xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1">
>>              <moduleId>
>>            <groupId>test</groupId>
>>            <artifactId>ReportSendJobs</artifactId>
>>        </moduleId>
>>                     <dependencies>
>>            <dependency>
>>                 <groupId>test</groupId>
>>                 <artifactId>javamail-server</artifactId>
>>            </dependency>
>>                      <dependency>
>>                 <groupId>console.dbpool</groupId>
>>                 <artifactId>MySqlDB_report_sender</artifactId>
>>             </dependency>
>>        </dependencies>               </environment>
>>      <job>
>>        <job-name>Job name</job-name>
>>        <job-class>classpath to jobb class</job-class>
>>        <cron-expression>0/30 * * * * ?</cron-expression>
>>              <resource-ref>
>>            <property>Database</property>
>>            <res-type>javax.sql.DataSource</res-type>
>>            <res-auth>Container</res-auth>
>>            <res-sharing-scope>Shareable</res-sharing-scope>
>>            <pattern>
>>                <name>MySqlDB_report_sender</name>
>>            </pattern>
>>        </resource-ref>
>>              <resource-ref>
>>            <property>MailSession</property>
>>            <res-type>javax.mail.Session</res-type>
>>            <res-auth>Container</res-auth>
>>            <res-sharing-scope>Shareable</res-sharing-scope>
>>            <pattern>
>>                <name>mail/MailSession</name>
>>            </pattern>
>>        </resource-ref>    </job> </jobs>
>>
>>
>> The "mail-server" plan (slightly moddyfied version of what I got from 
>> Rick):
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>>
>> <module xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1">
>> <dep:environment 
>> xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.1">
>>   <dep:moduleId>
>>     <dep:groupId>test</dep:groupId>
>>     <dep:artifactId>javamail-server</dep:artifactId>
>>   </dep:moduleId>
>>  
>>   <dep:dependencies>
>>     <dep:dependency>
>>       <dep:groupId>geronimo</dep:groupId>
>>       <dep:artifactId>geronimo-mail</dep:artifactId>
>>       <dep:version>1.1.1</dep:version>
>>       <dep:type>jar</dep:type>
>>       <dep:import>classes</dep:import>
>>     </dep:dependency>
>>     <dep:dependency>
>>       <dep:groupId>geronimo</dep:groupId>
>>       <dep:artifactId>geronimo-javamail-transport</dep:artifactId>
>>       <dep:version>1.1.1</dep:version>
>>       <dep:type>jar</dep:type>
>>       <dep:import>classes</dep:import>
>>     </dep:dependency>
>>     <dep:dependency>
>>       <dep:groupId>geronimo</dep:groupId>
>>       <dep:artifactId>rmi-naming</dep:artifactId>
>>       <dep:type>car</dep:type>
>>     </dep:dependency>
>>   </dep:dependencies>
>>   <dep:hidden-classes/>
>>   <dep:non-overridable-classes/>
>> </dep:environment>
>>
>> <gbean name="SMTPTransport" 
>> class="org.apache.geronimo.mail.SMTPTransportGBean">
>>   <attribute name="host">removed dns name</attribute>
>>   <attribute name="port">25</attribute>
>> </gbean>
>> <gbean name="mail/MailSession" 
>> class="org.apache.geronimo.mail.MailGBean">
>>   <attribute name="transportProtocol">smtp</attribute>
>>   <attribute name="debug">true</attribute>
>>   <reference name="Protocols">
>>      <name>SMTPTransport</name>
>>   </reference>
>> </gbean>
>> </module>
>>
>>
>> Peter Petersson skrev:
>>> It is a remote SMTP server (in our lan) and autentication shuld not 
>>> be needed from inside our LAN (I have sucsessfully accessed the SMTP 
>>> server from within a vanila tomcat5 web app without autentication).
>>> Could a autentication faliur result in a NoSuchProviderException ?
>>> I have tryed setting the Transport attributes (smtphost, username, 
>>> password) from within the code
>>>
>>> Transport tr = mailSession.getTransport("smtp");
>>> tr.connect(smtphost, username, password);
>>> and also tryed a GBean via the attributes (host,port).
>>> The Gbean is from a sligtly moddified version of the "example mail 
>>> session" that Rick posted (he did a farly good shoot from the hip ;)).
>>>
>>> I but regardles of a lott of testing with different setups i still get
>>>
>>> javax.mail.NoSuchProviderException: Unable to locate provider for 
>>> protocol: smtp
>>>        at javax.mail.Session.getProvider(Session.java:227)
>>>        at javax.mail.Session.getTransport(Session.java:336)
>>>
>>>
>>> Im testing this on a fresh install of Geronimo 1.1.1
>>>
>>> Anny suggestions ?
>>>
>>> Cheers
>>>   Peter
>>>
>>> Aaron Mulder skrev:
>>>> Does your localhost have a mail server running?  Or are you trying to
>>>> send through a remote SMTP server?  Is the mail server open or do you
>>>> need to authenticate to it?
>>>>
>>>> Thanks,
>>>>     Aaron
>>>>
>>>> On 9/29/06, Peter Petersson <pe...@pmb.mine.nu> wrote:
>>>>> Hi all!
>>>>>
>>>>> I quite new to Geronimo (using 1.1.1) and have some problems 
>>>>> geting mail
>>>>> to work from a geronimo-quartz job.
>>>>> As I understand it I need to set up a gbean or do some other
>>>>> configuration for javamail to work (?).
>>>>> The example i have folowed for the Quartz Scheduler Plugin over at
>>>>> http://gplugins.sourceforge.net/ have a nice setup including 
>>>>> mailing (in
>>>>> the "Deployable Jobs Example" section) but it dose not go into 
>>>>> details
>>>>> on howto set up mailing (its not the scope of the example).
>>>>>
>>>>> What do I need to do to get it to work? as it is now i get this 
>>>>> exception
>>>>>
>>>>> MessagingException Unable to locate provider for protocol: smtp
>>>>>
>>>>> Anny good pointer out there to get mailing working in Geronimo ?
>>>>>
>>>>> Cheers
>>>>>   Peter
>>>>>
>>
>


Re: Mailing from geronimo

Posted by Rick McGuire <ri...@gmail.com>.
Peter Petersson wrote:
> Okey here comes the plans and a code snippet illustrating what im 
> trying to do when i get the
> javax.mail.NoSuchProviderException: Unable to locate provider for 
> protocol: smtp
>       at javax.mail.Session.getProvider(Session.java:227)
>       at javax.mail.Session.getTransport(Session.java:336)
>
> Anny suggestions ?
The NoSuchProviderException usually occurs because the 
javamail-transport jar file isn't in the classpath, but you have the 
correct dependency there, so this should be working.  I'm going to have 
to investigate this a little more.  Any chance you can send me your 
sample app (with any special usage/setup instructions) so I can try to 
sort this out?

Rick


>
> The execute method below hass the intresting mailing part (its a bit 
> messy as I have tryed diffrent approaches
> Code snippet:
> public class UsedAllotmentSendJob implements Job {
>
>    private final static Log logger = 
> LogFactory.getLog(UsedAllotmentSendJob.class);
>    private DataSource dataSource;
>    private Session mailSession;
>
>    public void setDatabase(DataSource ds) {
>        dataSource = ds;
>    }
>
>    public void setMailSession(Session s) {
>        mailSession = s;
>    }        public void execute(JobExecutionContext jobcontext) throws 
> JobExecutionException {
>        //trying with added autentication
>        String smtphost="thednsaddress";
>        String username="thelogginname";
>        String password="thelogginpassword";
>              Message message = new MimeMessage(mailSession);
>        try{
>        InternetAddress from = new InternetAddress("the_sender_addr");
>        InternetAddress to = new InternetAddress("the_resiver_addr");
>
>        String mailer = "smtpsend";
>        message.setHeader("X-Mailer", mailer);
>        message.setSentDate(new Date());
>        message.setFrom(from);
>        message.addRecipient(Message.RecipientType.TO, to);
>        message.setSubject("The subject");
>        message.setText("The message");
>             Transport tr = mailSession.getTransport("smtp");
>        tr.connect(smtphost, username, password);
>        //tr.connect(); //no extra params just the gbean settings 
> (host,port)
>        message.saveChanges(); // don't forget this
>        tr.sendMessage(message, message.getAllRecipients());
>        tr.close();
>        //replaced with the settup above
>        //mailSession.getTransport("smtp");
>        //Transport.send(message);
>
>        }catch(AddressException aex){
>            logger.error("execute got a AddressException 
> "+aex.getMessage());
>        }catch(MessagingException mex){
>            logger.error("execute got a MessagingException 
> "+mex.getMessage(),mex);
>        }    }
> }
>
>
> Geronimo Quartz Plan
>
> <?xml version="1.0" encoding="UTF-8"?>
> <jobs xmlns="http://geronimo.apache.org/xml/ns/plugins/quartz-0.2">
>    <environment xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1">
>              <moduleId>
>            <groupId>test</groupId>
>            <artifactId>ReportSendJobs</artifactId>
>        </moduleId>
>                     <dependencies>
>            <dependency>
>                 <groupId>test</groupId>
>                 <artifactId>javamail-server</artifactId>
>            </dependency>
>                      <dependency>
>                 <groupId>console.dbpool</groupId>
>                 <artifactId>MySqlDB_report_sender</artifactId>
>             </dependency>
>        </dependencies>               </environment>
>      <job>
>        <job-name>Job name</job-name>
>        <job-class>classpath to jobb class</job-class>
>        <cron-expression>0/30 * * * * ?</cron-expression>
>              <resource-ref>
>            <property>Database</property>
>            <res-type>javax.sql.DataSource</res-type>
>            <res-auth>Container</res-auth>
>            <res-sharing-scope>Shareable</res-sharing-scope>
>            <pattern>
>                <name>MySqlDB_report_sender</name>
>            </pattern>
>        </resource-ref>
>              <resource-ref>
>            <property>MailSession</property>
>            <res-type>javax.mail.Session</res-type>
>            <res-auth>Container</res-auth>
>            <res-sharing-scope>Shareable</res-sharing-scope>
>            <pattern>
>                <name>mail/MailSession</name>
>            </pattern>
>        </resource-ref>    </job> </jobs>
>
>
> The "mail-server" plan (slightly moddyfied version of what I got from 
> Rick):
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <module xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1">
> <dep:environment 
> xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.1">
>   <dep:moduleId>
>     <dep:groupId>test</dep:groupId>
>     <dep:artifactId>javamail-server</dep:artifactId>
>   </dep:moduleId>
>  
>   <dep:dependencies>
>     <dep:dependency>
>       <dep:groupId>geronimo</dep:groupId>
>       <dep:artifactId>geronimo-mail</dep:artifactId>
>       <dep:version>1.1.1</dep:version>
>       <dep:type>jar</dep:type>
>       <dep:import>classes</dep:import>
>     </dep:dependency>
>     <dep:dependency>
>       <dep:groupId>geronimo</dep:groupId>
>       <dep:artifactId>geronimo-javamail-transport</dep:artifactId>
>       <dep:version>1.1.1</dep:version>
>       <dep:type>jar</dep:type>
>       <dep:import>classes</dep:import>
>     </dep:dependency>
>     <dep:dependency>
>       <dep:groupId>geronimo</dep:groupId>
>       <dep:artifactId>rmi-naming</dep:artifactId>
>       <dep:type>car</dep:type>
>     </dep:dependency>
>   </dep:dependencies>
>   <dep:hidden-classes/>
>   <dep:non-overridable-classes/>
> </dep:environment>
>
> <gbean name="SMTPTransport" 
> class="org.apache.geronimo.mail.SMTPTransportGBean">
>   <attribute name="host">removed dns name</attribute>
>   <attribute name="port">25</attribute>
> </gbean>
> <gbean name="mail/MailSession" 
> class="org.apache.geronimo.mail.MailGBean">
>   <attribute name="transportProtocol">smtp</attribute>
>   <attribute name="debug">true</attribute>
>   <reference name="Protocols">
>      <name>SMTPTransport</name>
>   </reference>
> </gbean>
> </module>
>
>
> Peter Petersson skrev:
>> It is a remote SMTP server (in our lan) and autentication shuld not 
>> be needed from inside our LAN (I have sucsessfully accessed the SMTP 
>> server from within a vanila tomcat5 web app without autentication).
>> Could a autentication faliur result in a NoSuchProviderException ?
>> I have tryed setting the Transport attributes (smtphost, username, 
>> password) from within the code
>>
>> Transport tr = mailSession.getTransport("smtp");
>> tr.connect(smtphost, username, password);
>> and also tryed a GBean via the attributes (host,port).
>> The Gbean is from a sligtly moddified version of the "example mail 
>> session" that Rick posted (he did a farly good shoot from the hip ;)).
>>
>> I but regardles of a lott of testing with different setups i still get
>>
>> javax.mail.NoSuchProviderException: Unable to locate provider for 
>> protocol: smtp
>>        at javax.mail.Session.getProvider(Session.java:227)
>>        at javax.mail.Session.getTransport(Session.java:336)
>>
>>
>> Im testing this on a fresh install of Geronimo 1.1.1
>>
>> Anny suggestions ?
>>
>> Cheers
>>   Peter
>>
>> Aaron Mulder skrev:
>>> Does your localhost have a mail server running?  Or are you trying to
>>> send through a remote SMTP server?  Is the mail server open or do you
>>> need to authenticate to it?
>>>
>>> Thanks,
>>>     Aaron
>>>
>>> On 9/29/06, Peter Petersson <pe...@pmb.mine.nu> wrote:
>>>> Hi all!
>>>>
>>>> I quite new to Geronimo (using 1.1.1) and have some problems geting 
>>>> mail
>>>> to work from a geronimo-quartz job.
>>>> As I understand it I need to set up a gbean or do some other
>>>> configuration for javamail to work (?).
>>>> The example i have folowed for the Quartz Scheduler Plugin over at
>>>> http://gplugins.sourceforge.net/ have a nice setup including 
>>>> mailing (in
>>>> the "Deployable Jobs Example" section) but it dose not go into details
>>>> on howto set up mailing (its not the scope of the example).
>>>>
>>>> What do I need to do to get it to work? as it is now i get this 
>>>> exception
>>>>
>>>> MessagingException Unable to locate provider for protocol: smtp
>>>>
>>>> Anny good pointer out there to get mailing working in Geronimo ?
>>>>
>>>> Cheers
>>>>   Peter
>>>>
>


Re: Mailing from geronimo

Posted by Peter Petersson <pe...@pmb.mine.nu>.
Okey here comes the plans and a code snippet illustrating what im trying 
to do when i get the
javax.mail.NoSuchProviderException: Unable to locate provider for 
protocol: smtp
       at javax.mail.Session.getProvider(Session.java:227)
       at javax.mail.Session.getTransport(Session.java:336)

Anny suggestions ?

The execute method below hass the intresting mailing part (its a bit 
messy as I have tryed diffrent approaches
Code snippet:
public class UsedAllotmentSendJob implements Job {

    private final static Log logger = 
LogFactory.getLog(UsedAllotmentSendJob.class);
    private DataSource dataSource;
    private Session mailSession;

    public void setDatabase(DataSource ds) {
        dataSource = ds;
    }

    public void setMailSession(Session s) {
        mailSession = s;
    }   
   
    public void execute(JobExecutionContext jobcontext) throws 
JobExecutionException {
        //trying with added autentication
        String smtphost="thednsaddress";
        String username="thelogginname";
        String password="thelogginpassword";
       
        Message message = new MimeMessage(mailSession);
        try{
        InternetAddress from = new InternetAddress("the_sender_addr");
        InternetAddress to = new InternetAddress("the_resiver_addr");

        String mailer = "smtpsend";
        message.setHeader("X-Mailer", mailer);
        message.setSentDate(new Date());
        message.setFrom(from);
        message.addRecipient(Message.RecipientType.TO, to);
        message.setSubject("The subject");
        message.setText("The message");
      
        Transport tr = mailSession.getTransport("smtp");
        tr.connect(smtphost, username, password);
        //tr.connect(); //no extra params just the gbean settings 
(host,port)
        message.saveChanges(); // don't forget this
        tr.sendMessage(message, message.getAllRecipients());
        tr.close();
        //replaced with the settup above
        //mailSession.getTransport("smtp");
        //Transport.send(message);

        }catch(AddressException aex){
            logger.error("execute got a AddressException 
"+aex.getMessage());
        }catch(MessagingException mex){
            logger.error("execute got a MessagingException 
"+mex.getMessage(),mex);
        } 
    }
}


Geronimo Quartz Plan

<?xml version="1.0" encoding="UTF-8"?>
<jobs xmlns="http://geronimo.apache.org/xml/ns/plugins/quartz-0.2">
    <environment xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1">
       
        <moduleId>
            <groupId>test</groupId>
            <artifactId>ReportSendJobs</artifactId>
        </moduleId>
              
        <dependencies>
            <dependency>
                 <groupId>test</groupId>
                 <artifactId>javamail-server</artifactId>
            </dependency>
           
            <dependency>
                 <groupId>console.dbpool</groupId>
                 <artifactId>MySqlDB_report_sender</artifactId>
             </dependency>
        </dependencies>      
       
    </environment>
   
    <job>
        <job-name>Job name</job-name>
        <job-class>classpath to jobb class</job-class>
        <cron-expression>0/30 * * * * ?</cron-expression>
       
        <resource-ref>
            <property>Database</property>
            <res-type>javax.sql.DataSource</res-type>
            <res-auth>Container</res-auth>
            <res-sharing-scope>Shareable</res-sharing-scope>
            <pattern>
                <name>MySqlDB_report_sender</name>
            </pattern>
        </resource-ref>
       
        <resource-ref>
            <property>MailSession</property>
            <res-type>javax.mail.Session</res-type>
            <res-auth>Container</res-auth>
            <res-sharing-scope>Shareable</res-sharing-scope>
            <pattern>
                <name>mail/MailSession</name>
            </pattern>
        </resource-ref> 
    </job> 
</jobs>


The "mail-server" plan (slightly moddyfied version of what I got from Rick):

<?xml version="1.0" encoding="UTF-8"?>

<module xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1">
 <dep:environment 
xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.1">
   <dep:moduleId>
     <dep:groupId>test</dep:groupId>
     <dep:artifactId>javamail-server</dep:artifactId>
   </dep:moduleId>
  
   <dep:dependencies>
     <dep:dependency>
       <dep:groupId>geronimo</dep:groupId>
       <dep:artifactId>geronimo-mail</dep:artifactId>
       <dep:version>1.1.1</dep:version>
       <dep:type>jar</dep:type>
       <dep:import>classes</dep:import>
     </dep:dependency>
     <dep:dependency>
       <dep:groupId>geronimo</dep:groupId>
       <dep:artifactId>geronimo-javamail-transport</dep:artifactId>
       <dep:version>1.1.1</dep:version>
       <dep:type>jar</dep:type>
       <dep:import>classes</dep:import>
     </dep:dependency>
     <dep:dependency>
       <dep:groupId>geronimo</dep:groupId>
       <dep:artifactId>rmi-naming</dep:artifactId>
       <dep:type>car</dep:type>
     </dep:dependency>
   </dep:dependencies>
   <dep:hidden-classes/>
   <dep:non-overridable-classes/>
 </dep:environment>
 
 <gbean name="SMTPTransport" 
class="org.apache.geronimo.mail.SMTPTransportGBean">
   <attribute name="host">removed dns name</attribute>
   <attribute name="port">25</attribute>
 </gbean>
 <gbean name="mail/MailSession" class="org.apache.geronimo.mail.MailGBean">
   <attribute name="transportProtocol">smtp</attribute>
   <attribute name="debug">true</attribute>
   <reference name="Protocols">
      <name>SMTPTransport</name>
   </reference>
 </gbean>
</module>


Peter Petersson skrev:
> It is a remote SMTP server (in our lan) and autentication shuld not be 
> needed from inside our LAN (I have sucsessfully accessed the SMTP 
> server from within a vanila tomcat5 web app without autentication).
> Could a autentication faliur result in a NoSuchProviderException ?
> I have tryed setting the Transport attributes (smtphost, username, 
> password) from within the code
>
> Transport tr = mailSession.getTransport("smtp");
> tr.connect(smtphost, username, password);
> and also tryed a GBean via the attributes (host,port).
> The Gbean is from a sligtly moddified version of the "example mail 
> session" that Rick posted (he did a farly good shoot from the hip ;)).
>
> I but regardles of a lott of testing with different setups i still get
>
> javax.mail.NoSuchProviderException: Unable to locate provider for 
> protocol: smtp
>        at javax.mail.Session.getProvider(Session.java:227)
>        at javax.mail.Session.getTransport(Session.java:336)
>
>
> Im testing this on a fresh install of Geronimo 1.1.1
>
> Anny suggestions ?
>
> Cheers
>   Peter
>
> Aaron Mulder skrev:
>> Does your localhost have a mail server running?  Or are you trying to
>> send through a remote SMTP server?  Is the mail server open or do you
>> need to authenticate to it?
>>
>> Thanks,
>>     Aaron
>>
>> On 9/29/06, Peter Petersson <pe...@pmb.mine.nu> wrote:
>>> Hi all!
>>>
>>> I quite new to Geronimo (using 1.1.1) and have some problems geting 
>>> mail
>>> to work from a geronimo-quartz job.
>>> As I understand it I need to set up a gbean or do some other
>>> configuration for javamail to work (?).
>>> The example i have folowed for the Quartz Scheduler Plugin over at
>>> http://gplugins.sourceforge.net/ have a nice setup including mailing 
>>> (in
>>> the "Deployable Jobs Example" section) but it dose not go into details
>>> on howto set up mailing (its not the scope of the example).
>>>
>>> What do I need to do to get it to work? as it is now i get this 
>>> exception
>>>
>>> MessagingException Unable to locate provider for protocol: smtp
>>>
>>> Anny good pointer out there to get mailing working in Geronimo ?
>>>
>>> Cheers
>>>   Peter
>>>

Re: Mailing from geronimo

Posted by Peter Petersson <pe...@pmb.mine.nu>.
It is a remote SMTP server (in our lan) and autentication shuld not be 
needed from inside our LAN (I have sucsessfully accessed the SMTP server 
from within a vanila tomcat5 web app without autentication).
Could a autentication faliur result in a NoSuchProviderException ?
I have tryed setting the Transport attributes (smtphost, username, 
password) from within the code

Transport tr = mailSession.getTransport("smtp");
tr.connect(smtphost, username, password); 

and also tryed a GBean via the attributes (host,port).
The Gbean is from a sligtly moddified version of the "example mail 
session" that Rick posted (he did a farly good shoot from the hip ;)).

I but regardles of a lott of testing with different setups i still get

javax.mail.NoSuchProviderException: Unable to locate provider for protocol: smtp
        at javax.mail.Session.getProvider(Session.java:227)
        at javax.mail.Session.getTransport(Session.java:336)


Im testing this on a fresh install of Geronimo 1.1.1

Anny suggestions ?

Cheers
   Peter

Aaron Mulder skrev:
> Does your localhost have a mail server running?  Or are you trying to
> send through a remote SMTP server?  Is the mail server open or do you
> need to authenticate to it?
>
> Thanks,
>     Aaron
>
> On 9/29/06, Peter Petersson <pe...@pmb.mine.nu> wrote:
>> Hi all!
>>
>> I quite new to Geronimo (using 1.1.1) and have some problems geting mail
>> to work from a geronimo-quartz job.
>> As I understand it I need to set up a gbean or do some other
>> configuration for javamail to work (?).
>> The example i have folowed for the Quartz Scheduler Plugin over at
>> http://gplugins.sourceforge.net/ have a nice setup including mailing (in
>> the "Deployable Jobs Example" section) but it dose not go into details
>> on howto set up mailing (its not the scope of the example).
>>
>> What do I need to do to get it to work? as it is now i get this 
>> exception
>>
>> MessagingException Unable to locate provider for protocol: smtp
>>
>> Anny good pointer out there to get mailing working in Geronimo ?
>>
>> Cheers
>>   Peter
>>

Re: Mailing from geronimo

Posted by Aaron Mulder <am...@alumni.princeton.edu>.
Does your localhost have a mail server running?  Or are you trying to
send through a remote SMTP server?  Is the mail server open or do you
need to authenticate to it?

Thanks,
     Aaron

On 9/29/06, Peter Petersson <pe...@pmb.mine.nu> wrote:
> Hi all!
>
> I quite new to Geronimo (using 1.1.1) and have some problems geting mail
> to work from a geronimo-quartz job.
> As I understand it I need to set up a gbean or do some other
> configuration for javamail to work (?).
> The example i have folowed for the Quartz Scheduler Plugin over at
> http://gplugins.sourceforge.net/ have a nice setup including mailing (in
> the "Deployable Jobs Example" section) but it dose not go into details
> on howto set up mailing (its not the scope of the example).
>
> What do I need to do to get it to work? as it is now i get this exception
>
> MessagingException Unable to locate provider for protocol: smtp
>
> Anny good pointer out there to get mailing working in Geronimo ?
>
> Cheers
>   Peter
>