geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark <delafran_j...@hotmail.com>
Subject Re: Deployment EJB with Mail Resource References
Date Wed, 02 Mar 2005 13:11:01 GMT
I'll adjust the plan and then submit a patch.

Mark

David Jencks wrote:

> It looks like despite all the work on mail lately no one remembered 
> to  put a mail gbean in the j2ee-server-plan.xml or anywhere else.
>
> Adding something like this to your app plan or j2ee-server-plan.xml  
> should help:
>
>     <gbean namePart="mail/MailSession"  
> class="org.apache.geronimo.mail.MailGBean">
>         <attribute name="properties">
>             mail.smtp.host=mail.apache.com
>         </attribute>
>     </gbean>
>
> thanks
> david jencks
>
> On Mar 1, 2005, at 11:39 AM, Mark wrote:
>
>> Hello,
>>
>> I tried to deploy a simple ejb with a javax.mail.Session 
>> Resource-ref,  but it fails with the error message below.  (Also see 
>> deployment  descriptor below)
>>
>> Are there any documents that describe how to configure (pre  
>> deployment, post deployment) a mail session so it can be wired to a  
>> resource ref?
>>
>> Thanks.
>> Mark
>>
>> <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise
>> JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
>>
>> <ejb-jar>
>> <display-name>Mail</display-name>
>> <enterprise-beans>
>>  <session>
>>   <ejb-name>Mail</ejb-name>
>>   <home>examples.MailHome</home>
>>   <remote>examples.Mail</remote>
>>   <local-home>examples.MailLocalHome</local-home>
>>   <local>examples.MailLocal</local>
>>   <ejb-class>examples.MailBean</ejb-class>
>>   <session-type>Stateless</session-type>
>>   <transaction-type>Container</transaction-type>
>>   <resource-ref>
>>    <description>A description for ResourceRefName</description>
>>    <res-ref-name>mail/mymailserver</res-ref-name>
>>    <res-type>javax.mail.Session</res-type>
>>    <res-auth>Container</res-auth>
>>    <res-sharing-scope>Shareable</res-sharing-scope>
>>   </resource-ref>
>>  </session>
>> </enterprise-beans>
>> </ejb-jar>
>>
>>
>> Deployment failed
>>  Server reports: org.apache.geronimo.common.DeploymentException:  
>> Unknown
>> or ambiguous resource name query: geronimo.ser
>> ver: 
>> j2eeType=JavaMailResource,J2EEServer=geronimo,J2EEApplication=null,name 
>> =mail/mymailserver,*
>> match count: 0
>> org.apache.geronimo.kernel.InternalKernelException:
>> org.apache.geronimo.common.DeploymentException: Unknown or ambiguous
>> resource name query:
>> geronimo.server: 
>> j2eeType=JavaMailResource,J2EEServer=geronimo,J2EEApplication=null,name 
>> =mail/mymai
>> lserver,* match count: 0
>>        at
>> org.apache.geronimo.kernel.jmx.KernelDelegate.invoke(KernelDelegate.jav 
>> a:232)
>>        at
>> org.apache.geronimo.deployment.plugin.local.AbstractDeployCommand.doDep 
>> loy(AbstractDeployCommand.java:92)
>>        at
>> org.apache.geronimo.deployment.plugin.local.DistributeCommand.run(Distr 
>> ibuteCommand.java:71)
>>        at java.lang.Thread.run(Thread.java:534)
>> Caused by: org.apache.geronimo.common.DeploymentException: Unknown or
>> ambiguous resource name query: geronimo.server:j2e
>> eType=JavaMailResource,J2EEServer=geronimo,J2EEApplication=null,name=ma 
>> il/mymailserver,*
>> match count: 0
>>        at
>> org.apache.geronimo.j2ee.deployment.RefContext.locateUniqueName(RefCont 
>> ext.java:444)
>>        at
>> org.apache.geronimo.j2ee.deployment.RefContext.getConnectionFactoryCont 
>> ainerId(RefContext.java:280)
>>        at
>> org.apache.geronimo.naming.deployment.ENCConfigBuilder.getResourceConta 
>> inerId(ENCConfigBuilder.java:219)
>>        at
>> org.apache.geronimo.naming.deployment.ENCConfigBuilder.addResourceRefs( 
>> ENCConfigBuilder.java:201)
>>        at
>> org.apache.geronimo.naming.deployment.ENCConfigBuilder.buildComponentCo 
>> ntext(ENCConfigBuilder.java:677)
>>        at
>> org.openejb.deployment.SessionBuilder.processEnvironmentRefs(SessionBui 
>> lder.java:143)
>>        at
>> org.openejb.deployment.SessionBuilder.addEJBContainerGBean(SessionBuild 
>> er.java:227)
>>        at
>> org.openejb.deployment.SessionBuilder.buildBeans(SessionBuilder.java: 
>> 158)
>>        at
>> org.openejb.deployment.OpenEJBModuleBuilder.addGBeans(OpenEJBModuleBuil 
>> der.java:489)
>>        at
>> org.openejb.deployment.OpenEJBModuleBuilder$$FastClassByCGLIB$$11bd7b20 
>> .invoke(<generated>)
>>        at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53)
>>        at
>> org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke(FastMethodIn 
>> voker.java:38)
>>        at
>> org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation. 
>> java:118)
>>        at
>> org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.ja 
>> va:710)
>>        at
>> org.apache.geronimo.gbean.runtime.RawInvoker.invoke(RawInvoker.java:57)
>>        at
>> org.apache.geronimo.kernel.proxy.RawOperationInvoker.invoke(RawOperatio 
>> nInvoker.java:36)
>>        at
>> org.apache.geronimo.kernel.proxy.ProxyMethodInterceptor.intercept(Proxy 
>> MethodInterceptor.java:92)
>>        at
>> org.apache.geronimo.j2ee.deployment.ModuleBuilder$$EnhancerByCGLIB$$380 
>> f6faf.addGBeans(<generated>)
>>        at
>> org.apache.geronimo.j2ee.deployment.EARConfigBuilder.buildConfiguration 
>> (EARConfigBuilder.java:351)
>>        at
>> org.apache.geronimo.j2ee.deployment.EARConfigBuilder$$FastClassByCGLIB$ 
>> $38e56ec6.invoke(<generated>)
>>        at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53)
>>        at
>> org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke(FastMethodIn 
>> voker.java:38)
>>        at
>> org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation. 
>> java:118)
>>        at
>> org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.ja 
>> va:710)
>>        at
>> org.apache.geronimo.gbean.runtime.RawInvoker.invoke(RawInvoker.java:57)
>>        at
>> org.apache.geronimo.kernel.proxy.RawOperationInvoker.invoke(RawOperatio 
>> nInvoker.java:36)
>>        at
>> org.apache.geronimo.kernel.proxy.ProxyMethodInterceptor.intercept(Proxy 
>> MethodInterceptor.java:92)
>>        at
>> org.apache.geronimo.deployment.ConfigurationBuilder$$EnhancerByCGLIB$$6 
>> 61d6fa5.buildConfiguration(<generated>
>> )
>>        at
>> org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:172)
>>        at  
>> org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:85)
>>        at
>> org.apache.geronimo.deployment.Deployer$$FastClassByCGLIB$$734a235d.inv 
>> oke(<generated>)
>>        at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53)
>>        at
>> org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke(FastMethodIn 
>> voker.java:38)
>>        at
>> org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation. 
>> java:118)
>>        at
>> org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.ja 
>> va:745)
>>        at org.apache.geronimo.kernel.Kernel.invoke(Kernel.java:299)
>>        at
>> org.apache.geronimo.kernel.KernelGBean.invoke(KernelGBean.java:121)
>>        at
>> org.apache.geronimo.kernel.KernelGBean$$FastClassByCGLIB$$1cccefc9.invo 
>> ke(<generated>)
>>        at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53)
>>        at
>> org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke(FastMethodIn 
>> voker.java:38)
>>        at
>> org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation. 
>> java:118)
>>        at
>> org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.ja 
>> va:745)
>>        at org.apache.geronimo.kernel.Kernel.invoke(Kernel.java:299)
>>        at
>> org.apache.geronimo.kernel.jmx.MBeanServerDelegate.invoke(MBeanServerDe 
>> legate.java:117)
>>        at
>> mx4j.remote.rmi.RMIConnectionInvoker.invoke(RMIConnectionInvoker.java: 
>> 219)
>>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>        at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.ja 
>> va:39)
>>        at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccesso 
>> rImpl.java:25)
>>        at java.lang.reflect.Method.invoke(Method.java:324)
>>        at
>> mx4j.remote.rmi.RMIConnectionProxy.invoke(RMIConnectionProxy.java:34)
>>        at
>> mx4j.remote.rmi.RMIConnectionSubjectInvoker.chain(RMIConnectionSubjectI 
>> nvoker.java:99)
>>        at
>> mx4j.remote.rmi.RMIConnectionSubjectInvoker.access$000(RMIConnectionSub 
>> jectInvoker.java:31)
>>        at
>> mx4j.remote.rmi.RMIConnectionSubjectInvoker$1.run(RMIConnectionSubjectI 
>> nvoker.java:90)
>>        at java.security.AccessController.doPrivileged(Native Method)
>>        at javax.security.auth.Subject.doAsPrivileged(Subject.java:500)
>>        at
>> mx4j.remote.MX4JRemoteUtils.subjectInvoke(MX4JRemoteUtils.java:163)
>>        at
>> mx4j.remote.rmi.RMIConnectionSubjectInvoker.subjectInvoke(RMIConnection 
>> SubjectInvoker.java:86)
>>        at
>> mx4j.remote.rmi.RMIConnectionSubjectInvoker.invoke(RMIConnectionSubject 
>> Invoker.java:80)
>>        at $Proxy0.invoke(Unknown Source)
>>        at
>> javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl. 
>> java:221)
>>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>        at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.ja 
>> va:39)
>>        at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccesso 
>> rImpl.java:25)
>>        at java.lang.reflect.Method.invoke(Method.java:324)
>>        at
>> sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
>>        at sun.rmi.transport.Transport$1.run(Transport.java:148)
>>        at java.security.AccessController.doPrivileged(Native Method)
>>        at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
>>        at
>> sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java: 
>> 460)
>>        at
>> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.j 
>> ava:701)
>>        ... 1 more
>>
>> Here's the deployment descriptor for the bean.
>>
>>
>
>
> .
>


Mime
View raw message