geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Neal Sanche <n...@nsdev.org>
Subject JavaMail Redux
Date Sat, 01 Oct 2005 01:24:01 GMT
Hi Guys,

A long while ago, I asked about getting JavaMail working in Geronimo. 
Here's what I have done, and the current result:

My geronimo-application.xml:

<application
       xmlns="http://geronimo.apache.org/xml/ns/j2ee/application"
       configId="org/acme/mailverifier">
      
  <gbean name="mail/MailSession"
    class="org.apache.geronimo.mail.SMTPTransportGBean">
      <attribute name="host">mail.example.com</attribute>
  </gbean>

</application>

A resource-ref in a session bean that looks like:

         <resource-ref >
            <description><![CDATA[JavaMail Resource]]></description>
            <res-ref-name>mail/MailSession</res-ref-name>
            <res-type>javax.mail.Session</res-type>
            <res-auth>Container</res-auth>
            <res-sharing-scope>Shareable</res-sharing-scope>
         </resource-ref>

I've edited the j2ee-server-plan.xml to add:

    <dependency>
      <uri>javamail/jars/activation.jar</uri>
    </dependency>
    <dependency>
      <uri>javamail/jars/mail.jar</uri>
    </dependency>

    <dependency>
      <uri>geronimo/jars/geronimo-mail-1.0-SNAPSHOT.jar</uri>
    </dependency>

But I get the following error:

18:08:16,044 ERROR [Deployer] Deployment failed due to
org.apache.geronimo.gbean.InvalidConfigurationException: Could not load 
class or
g.apache.geronimo.mail.SMTPTransportGBean
        at 
org.apache.geronimo.gbean.GBeanInfo.getGBeanInfo(GBeanInfo.java:56)
        at 
org.apache.geronimo.deployment.service.ServiceConfigBuilder.addGBeanD
ata(ServiceConfigBuilder.java:293)
        at 
org.apache.geronimo.deployment.service.ServiceConfigBuilder.addGBeans
(ServiceConfigBuilder.java:288)
        at 
org.apache.geronimo.j2ee.deployment.EARConfigBuilder.buildConfigurati
on(EARConfigBuilder.java:339)
        at 
org.apache.geronimo.j2ee.deployment.EARConfigBuilder$$FastClassByCGLI
B$$38e56ec6.invoke(<generated>)
        at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53)
        at 
org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke(FastMethod
Invoker.java:38)

If I change my geronimo-application.xml to:

<application
       xmlns="http://geronimo.apache.org/xml/ns/j2ee/application"
       configId="org/acme/PhoneBook">

    <dependency>
        <uri>geronimo/jars/geronimo-mail-1.0-SNAPSHOT.jar</uri>
    </dependency>   
   
    <module>
        <connector>tranql-connector-1.0-SNAPSHOT.rar</connector>
        <alt-dd>mysql-plan.xml</alt-dd>
    </module>
   
    <gbean name="mail/MailSession"
      class="org.apache.geronimo.mail.SMTPTransportGBean">
        <attribute name="host">10.0.0.1</attribute>
        <attribute name="port">25</attribute>
    </gbean>
</application>

That error goes away, but I'm left with:

Deployer operation failed: Unable to resolve resource reference 
'mail/MailSession' (no matching resources found)
org.apache.geronimo.common.DeploymentException: Unable to resolve 
resource reference 'mail/MailSession' (no matching resources found)
    at 
org.apache.geronimo.naming.deployment.ENCConfigBuilder.addResourceRefs(ENCConfigBuilder.java:231)
    at 
org.apache.geronimo.naming.deployment.ENCConfigBuilder.buildComponentContext(ENCConfigBuilder.java:764)
    at 
org.openejb.deployment.SessionBuilder.processEnvironmentRefs(SessionBuilder.java:167)
    at 
org.openejb.deployment.SessionBuilder.addEJBContainerGBean(SessionBuilder.java:296)
    at 
org.openejb.deployment.SessionBuilder.buildBeans(SessionBuilder.java:182)
    at 
org.openejb.deployment.OpenEJBModuleBuilder.addGBeans(OpenEJBModuleBuilder.java:514)
    at 
org.openejb.deployment.OpenEJBModuleBuilder$$FastClassByCGLIB$$11bd7b20.invoke(<generated>)
    at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53)

Any ideas of what I'm doing wrong?

Thanks.

-Neal



Mime
View raw message