You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by Edson Carlos Ericksson Richter <ed...@brinformatica.srv.br> on 2006/01/22 04:56:57 UTC

Creating JavaMail resource

How could I create a JavaMail resource (I see it's not possible using 
web console because Portlet isn't ready)?
But how could I do it using a *.xml of some kind?

I could not find any documentation about this... either on FAQ or wiki 
pages.

Thanks,

Richter


Re: Creating JavaMail resource

Posted by Aaron Mulder <am...@alumni.princeton.edu>.
If you're putting the gbean in a web application, then you probably
need to add the Geronimo mail JAR as a dependency for that web app. 
Something like:

<dependency><uri>geronimo/mail/1.0/jar</uri></dependency>

Thanks,
    Aaron

On 1/21/06, Edson Carlos Ericksson Richter
<ed...@brinformatica.srv.br> wrote:
> Ok, I get it. But now, I have another problem. When deploy, I get:
>
> org.apache.geronimo.gbean.InvalidConfigurationException: Could not load class org.apache.geronimo.mail.MailGBean
> Could not load class org.apache.geronimo.mail.MailGBean
> org.apache.geronimo.mail.MailGBean
>
> My geronimo-web.xml is:
>
> <?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="BiblioConfig">
>
>   <context-root>/biblio</context-root>
>   <context-priority-classloader>true</context-priority-classloader>
>
>   <security-realm-name>BiblioRealm</security-realm-name>
>   <security>
>     <default-principal>
>       <principal name="anonymous"
>
> class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal"/>
>     </default-principal>
>     <role-mappings>
>       <role role-name="admin">
>         <principal name="administrators" designated-run-as="true"
>
> class="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal"/>
>         <principal name="root"
>
> class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal"/>
>       </role>
>     </role-mappings>
>   </security>
>
>   <naming:resource-ref>
>     <naming:ref-name>jdbc/Biblio</naming:ref-name>
>     <naming:resource-link>jdbc/Biblio</naming:resource-link>
>   </naming:resource-ref>
>
>   <gbean name="mail/Biblio"
>          class="org.apache.geronimo.mail.MailGBean" />
>   <gbean name="mail/Biblio"
>          class="org.apache.geronimo.mail.SMTPTransportGBean">
>         <attribute name="host">127.0.0.1</attribute>
>         <attribute name="port">25</attribute>
>     </gbean>
> </web-app>
>
>
>
>
> Aaron Mulder escreveu:
>
> >There were two mail threads about this just recently -- one called
> >"where is gbean for java mail?" and one called "javamail" -- your best
> >best is probably to check the archives.  You need to write a
> >deplyoment plan for the mail resource and the various messages in
> >those threads have the details.  I'm not sure whether everything will
> >work at the end of the day or not -- there was some report of silent
> >failures in the SMTP provider.
> >
> >If worst comes to worst, it's also possible to use Sun's JavaMail
> >implementation instead of ours, but I'm not sure how to set that up --
> >I believe that's been covered before on the mailing list, but not as
> >recently.
> >
> >Thanks,
> >    Aaron
> >
> >
> >
>
>

Re: Creating JavaMail resource

Posted by Edson Carlos Ericksson Richter <ed...@brinformatica.srv.br>.
Ok, I get it. But now, I have another problem. When deploy, I get:

org.apache.geronimo.gbean.InvalidConfigurationException: Could not load class org.apache.geronimo.mail.MailGBean
Could not load class org.apache.geronimo.mail.MailGBean
org.apache.geronimo.mail.MailGBean

My geronimo-web.xml is:

<?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="BiblioConfig">

  <context-root>/biblio</context-root>
  <context-priority-classloader>true</context-priority-classloader>

  <security-realm-name>BiblioRealm</security-realm-name>
  <security>
    <default-principal>
      <principal name="anonymous"
      
class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal"/>
    </default-principal>
    <role-mappings>
      <role role-name="admin">
        <principal name="administrators" designated-run-as="true"
        
class="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal"/>
        <principal name="root"
        
class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal"/>
      </role>
    </role-mappings>
  </security>

  <naming:resource-ref>
    <naming:ref-name>jdbc/Biblio</naming:ref-name>
    <naming:resource-link>jdbc/Biblio</naming:resource-link>
  </naming:resource-ref>
 
  <gbean name="mail/Biblio"
         class="org.apache.geronimo.mail.MailGBean" />
  <gbean name="mail/Biblio"
         class="org.apache.geronimo.mail.SMTPTransportGBean">
        <attribute name="host">127.0.0.1</attribute>
        <attribute name="port">25</attribute>
    </gbean> 
</web-app>




Aaron Mulder escreveu:

>There were two mail threads about this just recently -- one called
>"where is gbean for java mail?" and one called "javamail" -- your best
>best is probably to check the archives.  You need to write a
>deplyoment plan for the mail resource and the various messages in
>those threads have the details.  I'm not sure whether everything will
>work at the end of the day or not -- there was some report of silent
>failures in the SMTP provider.
>
>If worst comes to worst, it's also possible to use Sun's JavaMail
>implementation instead of ours, but I'm not sure how to set that up --
>I believe that's been covered before on the mailing list, but not as
>recently.
>
>Thanks,
>    Aaron
>
>  
>


Re: Creating JavaMail resource

Posted by Aaron Mulder <am...@alumni.princeton.edu>.
There were two mail threads about this just recently -- one called
"where is gbean for java mail?" and one called "javamail" -- your best
best is probably to check the archives.  You need to write a
deplyoment plan for the mail resource and the various messages in
those threads have the details.  I'm not sure whether everything will
work at the end of the day or not -- there was some report of silent
failures in the SMTP provider.

If worst comes to worst, it's also possible to use Sun's JavaMail
implementation instead of ours, but I'm not sure how to set that up --
I believe that's been covered before on the mailing list, but not as
recently.

Thanks,
    Aaron

On 1/21/06, Edson Carlos Ericksson Richter
<ed...@brinformatica.srv.br> wrote:
> How could I create a JavaMail resource (I see it's not possible using
> web console because Portlet isn't ready)?
> But how could I do it using a *.xml of some kind?
>
> I could not find any documentation about this... either on FAQ or wiki
> pages.
>
> Thanks,
>
> Richter
>
>