geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark <delafran_j...@hotmail.com>
Subject Deployment EJB with Mail Resource References
Date Tue, 01 Mar 2005 19:39:02 GMT
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.java:232)
        at
org.apache.geronimo.deployment.plugin.local.AbstractDeployCommand.doDeploy(AbstractDeployCommand.java:92)
        at
org.apache.geronimo.deployment.plugin.local.DistributeCommand.run(DistributeCommand.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=mail/mymailserver,*
 match count: 0
        at
org.apache.geronimo.j2ee.deployment.RefContext.locateUniqueName(RefContext.java:444)
        at
org.apache.geronimo.j2ee.deployment.RefContext.getConnectionFactoryContainerId(RefContext.java:280)
        at
org.apache.geronimo.naming.deployment.ENCConfigBuilder.getResourceContainerId(ENCConfigBuilder.java:219)
        at
org.apache.geronimo.naming.deployment.ENCConfigBuilder.addResourceRefs(ENCConfigBuilder.java:201)
        at
org.apache.geronimo.naming.deployment.ENCConfigBuilder.buildComponentContext(ENCConfigBuilder.java:677)
        at
org.openejb.deployment.SessionBuilder.processEnvironmentRefs(SessionBuilder.java:143)
        at
org.openejb.deployment.SessionBuilder.addEJBContainerGBean(SessionBuilder.java:227)
        at
org.openejb.deployment.SessionBuilder.buildBeans(SessionBuilder.java:158)
        at
org.openejb.deployment.OpenEJBModuleBuilder.addGBeans(OpenEJBModuleBuilder.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(FastMethodInvoker.java:38)
        at
org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:118)
        at
org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:710)
        at
org.apache.geronimo.gbean.runtime.RawInvoker.invoke(RawInvoker.java:57)
        at
org.apache.geronimo.kernel.proxy.RawOperationInvoker.invoke(RawOperationInvoker.java:36)
        at
org.apache.geronimo.kernel.proxy.ProxyMethodInterceptor.intercept(ProxyMethodInterceptor.java:92)
        at
org.apache.geronimo.j2ee.deployment.ModuleBuilder$$EnhancerByCGLIB$$380f6faf.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(FastMethodInvoker.java:38)
        at
org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:118)
        at
org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:710)
        at
org.apache.geronimo.gbean.runtime.RawInvoker.invoke(RawInvoker.java:57)
        at
org.apache.geronimo.kernel.proxy.RawOperationInvoker.invoke(RawOperationInvoker.java:36)
        at
org.apache.geronimo.kernel.proxy.ProxyMethodInterceptor.intercept(ProxyMethodInterceptor.java:92)
        at
org.apache.geronimo.deployment.ConfigurationBuilder$$EnhancerByCGLIB$$661d6fa5.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.invoke(<generated>)
        at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53)
        at
org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke(FastMethodInvoker.java:38)
        at
org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:118)
        at
org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java: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.invoke(<generated>)
        at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53)
        at
org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke(FastMethodInvoker.java:38)
        at
org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:118)
        at
org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:745)
        at org.apache.geronimo.kernel.Kernel.invoke(Kernel.java:299)
        at
org.apache.geronimo.kernel.jmx.MBeanServerDelegate.invoke(MBeanServerDelegate.java:117)
        at
mx4j.remote.rmi.RMIConnectionInvoker.invoke(RMIConnectionInvoker.java:219)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.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(RMIConnectionSubjectInvoker.java:99)
        at
mx4j.remote.rmi.RMIConnectionSubjectInvoker.access$000(RMIConnectionSubjectInvoker.java:31)
        at
mx4j.remote.rmi.RMIConnectionSubjectInvoker$1.run(RMIConnectionSubjectInvoker.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(RMIConnectionSubjectInvoker.java:86)
        at
mx4j.remote.rmi.RMIConnectionSubjectInvoker.invoke(RMIConnectionSubjectInvoker.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.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.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.java:701)
        ... 1 more

Here's the deployment descriptor for the bean.



Mime
View raw message