dev@glassfish.java.net

RE: Non-JMS MDB needs JMS?

From: Frank Kieviet <Frank.Kieviet_at_Sun.COM>
Date: Sun, 27 Jan 2008 18:26:06 -0800

Hi Markus,

The <mdb-resource-adapter> element needs to be in the <ejb> element. Here's
an example:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sun-ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Application
Server 9.0 EJB 3.0//EN"
"http://www.sun.com/software/appserver/dtds/sun-ejb-jar_3_0-0.dtd">
<sun-ejb-jar>
    <enterprise-beans>
        <ejb>
            <ejb-name>com.stc.test.NewJCAMessageBean</ejb-name>
            <bean-pool>
                <steady-pool-size>0</steady-pool-size>
                <resize-quantity>16</resize-quantity>
                <max-pool-size>16</max-pool-size>
 
<pool-idle-timeout-in-seconds>600</pool-idle-timeout-in-seconds>
                <max-wait-time-in-millis>10000</max-wait-time-in-millis>
            </bean-pool>
            <mdb-resource-adapter>
                <resource-adapter-mid>sun-jms-adapter</resource-adapter-mid>
            </mdb-resource-adapter>
        </ejb>
    </enterprise-beans>
</sun-ejb-jar>

Frank


> -----Original Message-----
> From: dev-return-5375-frank.kieviet=sun.com_at_glassfish.dev.java.net
> [mailto:dev-return-5375-frank.kieviet=sun.com_at_glassfish.dev.java.net] On
> Behalf Of Markus KARG
> Sent: Sunday, January 27, 2008 02:04
> To: dev_at_glassfish.dev.java.net
> Subject: Re: Non-JMS MDB needs JMS?
>
> Frank Kieviet schrieb:
> > You need to use a Glassfish specific deployment descriptor (sun-ejb-
> jar.xml)
> > that will tell Glassfish to which resource adapter to bind your MDB. The
> > parameter is called MID and is equal to the name of the resource adapter
> as
> > it shows up in the glassfish console.
> >
> Can you send me a template for that GF specific DD? I never used the
> sun-ejb-jar.xml file before since I thought that with EJB 3.0 the
> vendor-specific DDs are no more needed. :-( So what I did is this, and
> it is not working:
>
> <sun-ejb-jar>
> <enterprise-beans>
> <unique-id>1</unique-id>
> <ejb>
> <ejb-name>MailMessageDrivenBean</ejb-name>
> </ejb>
> <mdb-resource-adapter>
>
> <resource-adapter-mid>mailra-1.0.0-SNAPSHOT</resource-adapter-mid>
> </mdb-resource-adapter>
> </enterprise-beans>
> </sun-ejb-jar>
>
> "mailra-1.0.0-SNAPSHOT" is taken from server's log after deploying the
> connector, so it is correct: "deployed with moduleid =
> mailra-1.0.0-SNAPSHOT(details)"
> <http://localhost:4848/logViewer/logViewer.jsf?instanceName=server&logleve
> l=INFO&logFile=server.log&viewResults=true#>
>
> But as I said, that is not working. Still GF wants to bind to JMS. GF's
> log tells me the following after deploying the MDB:
>
> [MailMessageDrivenBean]: Exception in creating message-driven bean
> container: [com.sun.enterprise.connectors.ConnectorRuntimeException: JMS
> resource not created : ]
>
> So what is the correct way? I do not see that I did a failure, so still
> I think it is a bug in GF.
>
> Since both, RA and MDB are GPL'ed, I can send you the complete ANT based
> project, if you want.
>
> Thanks
> Markus
> >
> >> -----Original Message-----
> >> From: dev-return-5371-frank.kieviet=sun.com_at_glassfish.dev.java.net
> >> [mailto:dev-return-5371-frank.kieviet=sun.com_at_glassfish.dev.java.net]
> On
> >> Behalf Of Markus KARG
> >> Sent: Saturday, January 26, 2008 05:21
> >> To: dev_at_glassfish.dev.java.net
> >> Subject: Non-JMS MDB needs JMS?
> >>
> >> I have installed the Java EE 5 SDK and started the contained Glassfish
> >> server.
> >> Then, I wrote a Resource Adapter that implements a properietary
> >> messaging interface.
> >> Then, I wrote an empty MDB that shall listened not to JMS but to the
> >> RA's proprietary messaging interface.
> >>
> >> When I run GF's veryfier, it does not find any problems. :-)
> >> When I deploy the RA, GF boots it up without any problems. :-)
> >> When I deploy the MDB, GF says it deployed it, but cannot instantiate
> it
> >> since there is no JMS?! :-(
> >>
> >> For what do I need JMS? I do not want to use it and the code clearly
> >> tells GF that no JMS is needed:
> >>
> >> @MessageDriven
> >> public class XMessageDrivenBean implements XMessagelListener {
> >> public void onX(final X x) {
> >> // Do nothing for now.
> >> }
> >> }
> >>
> >> (The RA is providing exactly that XMessageListener, and declares it in
> >> ra.xml)
> >>
> >> Here is the log entry GF posts at deployment:
> >>
> >> UnExpected error occured while creating ejb container
> >> com.sun.enterprise.connectors.ConnectorRuntimeException: JMS resource
> >> not created : at
> >>
> com.sun.enterprise.connectors.system.ActiveJmsResourceAdapter.getPhysicalD
> >> estinationFromConfiguration(ActiveJmsResourceAdapter.java:1546)
> >> at
> >>
> com.sun.enterprise.connectors.system.ActiveJmsResourceAdapter.updateMDBRun
> >> timeInfo(ActiveJmsResourceAdapter.java:1380)
> >> at
> >>
> com.sun.enterprise.connectors.inflow.ConnectorMessageBeanClient.setup(Conn
> >> ectorMessageBeanClient.java:170)
> >> at
> >>
> com.sun.ejb.containers.MessageBeanContainer.<init>(MessageBeanContainer.ja
> >> va:209)
> >> at
> >>
> com.sun.ejb.containers.ContainerFactoryImpl.createContainer(ContainerFacto
> >> ryImpl.java:524)
> >> at
> >>
> com.sun.enterprise.server.AbstractLoader.loadEjbs(AbstractLoader.java:536)
> >> at
> >>
> com.sun.enterprise.server.EJBModuleLoader.doLoad(EJBModuleLoader.java:171)
> >> at
> >> com.sun.enterprise.server.AbstractLoader.load(AbstractLoader.java:244)
> >> at
> >>
> com.sun.enterprise.server.StandAloneEJBModulesManager.moduleDeployed(Stand
> >> AloneEJBModulesManager.java:232)
> >> at
> >>
> com.sun.enterprise.server.StandAloneEJBModulesManager.moduleDeployed(Stand
> >> AloneEJBModulesManager.java:187)
> >> at
> >>
> com.sun.enterprise.server.StandAloneEJBModulesManager.moduleDeployed(Stand
> >> AloneEJBModulesManager.java:419)
> >> at
> >>
> com.sun.enterprise.admin.event.AdminEventMulticaster.invokeModuleDeployEve
> >> ntListener(AdminEventMulticaster.java:974)
> >> at
> >>
> com.sun.enterprise.admin.event.AdminEventMulticaster.handleModuleDeployEve
> >> nt(AdminEventMulticaster.java:961)
> >> at
> >>
> com.sun.enterprise.admin.event.AdminEventMulticaster.processEvent(AdminEve
> >> ntMulticaster.java:464)
> >> at
> >>
> com.sun.enterprise.admin.event.AdminEventMulticaster.multicastEvent(AdminE
> >> ventMulticaster.java:176)
> >> at
> >>
> com.sun.enterprise.admin.server.core.DeploymentNotificationHelper.multicas
> >> tEvent(DeploymentNotificationHelper.java:308)
> >> at
> >>
> com.sun.enterprise.deployment.phasing.DeploymentServiceUtils.multicastEven
> >> t(DeploymentServiceUtils.java:226)
> >> at
> >>
> com.sun.enterprise.deployment.phasing.ServerDeploymentTarget.sendStartEven
> >> t(ServerDeploymentTarget.java:298)
> >> at
> >>
> com.sun.enterprise.deployment.phasing.ApplicationStartPhase.runPhase(Appli
> >> cationStartPhase.java:132)
> >> at
> >>
> com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(Deploym
> >> entPhase.java:108)
> >> at
> >>
> com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PE
> >> DeploymentService.java:919)
> >> at
> >>
> com.sun.enterprise.deployment.phasing.PEDeploymentService.start(PEDeployme
> >> ntService.java:591)
> >> at
> >>
> com.sun.enterprise.deployment.phasing.PEDeploymentService.start(PEDeployme
> >> ntService.java:635)
> >> at
> >>
> com.sun.enterprise.admin.mbeans.ApplicationsConfigMBean.start(Applications
> >> ConfigMBean.java:744)
> >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
> >>
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
> >> 39)
> >> at
> >>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorIm
> >> pl.java:25)
> >> at java.lang.reflect.Method.invoke(Method.java:597) at
> >>
> com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.jav
> >> a:375)
> >> at
> >>
> com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.jav
> >> a:358)
> >> at
> >>
> com.sun.enterprise.admin.config.BaseConfigMBean.invoke(BaseConfigMBean.jav
> >> a:464)
> >> at
> >>
> com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanS
> >> erverInterceptor.java:836)
> >> at
> >> com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
> >> at sun.reflect.GeneratedMethodAccessor12.invoke(Unknown Source) at
> >>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorIm
> >> pl.java:25)
> >> at java.lang.reflect.Method.invoke(Method.java:597) at
> >>
> com.sun.enterprise.admin.util.proxy.ProxyClass.invoke(ProxyClass.java:90)
> >> at $Proxy1.invoke(Unknown Source) at
> >>
> com.sun.enterprise.admin.server.core.jmx.SunoneInterceptor.invoke(SunoneIn
> >> terceptor.java:304)
> >> at
> >>
> com.sun.enterprise.interceptor.DynamicInterceptor.invoke(DynamicIntercepto
> >> r.java:174)
> >> at
> >>
> com.sun.enterprise.deployment.client.DeploymentClientUtils.startApplicatio
> >> n(DeploymentClientUtils.java:145)
> >> at
> >>
> com.sun.enterprise.deployment.client.DeployAction.run(DeployAction.java:53
> >> 7)
> >> at java.lang.Thread.run(Thread.java:619)
> >>
> >>
> >> So is that a bug or why do I need to set up JMS?
> >>
> >>
> >> Thanks
> >> Markus
> >>
> >> --
> >> http://www.xing.com/go/invita/58469
> >>
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> > For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
> >
> >
>
>
> --
> http://www.xing.com/go/invita/58469