JCA 1.5: EndpointFactory is currently not available when activating MDB

Hi all?br>

I have already developed a JCA 1.5 connector, implementing Message Inflow contract which will allow a MDB endpoint to asynchronously receive JMS messages from Oracle AQ EIS.

Actually when I deploy the MDB endpoint in my application server instance (SJSAS 9), the method 揺ndpointActivation(MessageEndpointFactory, ActivationSpec)?on the JCA connector is called with the appropriate properties configured in the MDB endpoint deployment descriptor, like this:

<sun-ejb-jar>

<enterprise-beans>

<name>AQMDBListenerEndpoint</name>

<unique-id>239732644</unique-id>

<ejb>

<ejb-name>AQReader</ejb-name>

<mdb-resource-adapter>

<resource-adapter-mid>OracleAQConnector</resource-adapter-mid>

<activation-config>

<activation-config-property>

<activation-config-property-name>aqTopicName</activation-config-proper ty-name>

<activation-config-property-value>UPDATE_QUEUE</activation-config-prop erty-value>

</activation-config-property>

<activation-config-property>

<activation-config-property-name>aqTopicUser</activation-config-proper ty-name>

<activation-config-property-value>DISPATCH</activation-config-property -value>

</activation-config-property>

<activation-config-property>

<activation-config-property-name>aqSubscriptionId</activation-config-p roperty-name>

<activation-config-property-value>DispactchAQReader</activation-config -property-value>

</activation-config-property>

</activation-config>

</mdb-resource-adapter>

</ejb>

</enterprise-beans>

</sun-ejb-jar>

Now, when executing this sentence in the 揺ndpointActivation?method body:

messageEndpointFactory.createEndpoint(activation);

The Resource Adapter thread stay blocked for a while and eventually claims with the following errors in the server log:

MDB deployment is still happening. Cannot create end point now.

EndpointFactory is currently not available

at com.sun.enterprise.connectors.inflow.ConnectorMessageBeanClient.createEndpoint( ConnectorMessageBeanClient.java:346)

at com.deu.oracleaqra.OracleAQResourceAdapter.endpointActivation(OracleAQResourceA dapter.java:49)

at com.sun.enterprise.connectors.inflow.ConnectorMessageBeanClient.setup(Connector MessageBeanClient.java:239)

at com.sun.ejb.containers.MessageBeanContainer.<init>(MessageBeanContainer.j ava:194)

at com.sun.ejb.containers.ContainerFactoryImpl.createContainer(ContainerFactoryImp l.java:539)

at com.sun.enterprise.server.AbstractLoader.loadEjbs(AbstractLoader.java:486)

at com.sun.enterprise.server.EJBModuleLoader.load(EJBModuleLoader.java:158)

at com.sun.enterprise.server.StandAloneEJBModulesManager.moduleDeployed(StandAlone EJBModulesManager.java:219)

at com.sun.enterprise.server.StandAloneEJBModulesManager.moduleDeployed(StandAlone EJBModulesManager.java:174)

at com.sun.enterprise.server.StandAloneEJBModulesManager.moduleDeployed(StandAlone EJBModulesManager.java:406)

at com.sun.enterprise.admin.event.AdminEventMulticaster.invokeModuleDeployEventLis tener(AdminEventMulticaster.java:954)

at com.sun.enterprise.admin.event.AdminEventMulticaster.handleModuleDeployEvent(Ad minEventMulticaster.java:941)

at com.sun.enterprise.admin.event.AdminEventMulticaster.processEvent(AdminEventMul ticaster.java:448)

at com.sun.enterprise.admin.event.AdminEventMulticaster.multicastEvent(AdminEventM ulticaster.java:160)

at com.sun.enterprise.admin.server.core.DeploymentNotificationHelper.multicastEven t(DeploymentNotificationHelper.java:296)

at com.sun.enterprise.deployment.phasing.DeploymentServiceUtils.multicastEvent(Dep loymentServiceUtils.java:203)

at com.sun.enterprise.deployment.phasing.ServerDeploymentTarget.sendStartEvent(Ser verDeploymentTarget.java:285)

at com.sun.enterprise.deployment.phasing.ApplicationStartPhase.runPhase(Applicatio nStartPhase.java:119)

at com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPh ase.java:95)

at com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDeplo ymentService.java:871)

at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentSe rvice.java:263)

at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentSe rvice.java:281)

at com.sun.enterprise.admin.mbeans.ApplicationsConfigMBean.deploy(ApplicationsConf igMBean.java:534)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.ja va:25)

at java.lang.reflect.Method.invoke(Method.java:585)

at com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.java:353 )

at com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.java:336 )

at com.sun.enterprise.admin.config.BaseConfigMBean.invoke(BaseConfigMBean.java:448 )

at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(DynamicMetaDataImpl.java:213 )

at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:220)

at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServer Interceptor.java:815)

at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:784)

at sun.reflect.GeneratedMethodAccessor20.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.ja va:25)

at java.lang.reflect.Method.invoke(Method.java:585)

at com.sun.enterprise.admin.util.proxy.ProxyClass.invoke(ProxyClass.java:77)

at $Proxy1.invoke(Unknown Source)

at com.sun.enterprise.admin.server.core.jmx.SunoneInterceptor.invoke(SunoneInterce ptor.java:297)

at com.sun.enterprise.deployment.autodeploy.AutoDeployer.invokeDeploymentService(A utoDeployer.java:413)

at com.sun.enterprise.deployment.autodeploy.AutoDeployer.deploy(AutoDeployer.java: 394)

at com.sun.enterprise.deployment.autodeploy.AutoDeployer.deployAll(AutoDeployer.ja va:253)

at com.sun.enterprise.deployment.autodeploy.AutoDeployControllerImpl$AutoDeployTas k.run(AutoDeployControllerImpl.java:358)

at java.util.TimerThread.mainLoop(Timer.java:512)

at java.util.TimerThread.run(Timer.java:462)

Please any help or comments would be very appreciated.....

Regards

[6798 byte] By [jonren] at [2007-11-26 9:46:36]
# 1

Hi

>

> EndpointFactory is currently not available

> at

> t

> com.sun.enterprise.connectors.inflow.ConnectorMessageB

> eanClient.createEndpoint(ConnectorMessageBeanClient.ja

> va:346)

> at

> t

> com.deu.oracleaqra.OracleAQResourceAdapter.endpointAct

> ivation(OracleAQResourceAdapter.java:49)

> at

> t

> com.sun.enterprise.connectors.inflow.ConnectorMessageB

> eanClient.setup(ConnectorMessageBeanClient.java:239)

This usually means that the deployment of the MDB did not go through fine. Do you see any errors in your server log before this?

Thanks

--Siva

sivakumart at 2007-7-7 0:51:48 > top of Java-index,Application & Integration Servers,Application Servers...
# 2

Hi...

First of all, thank you for you answer...

Yes, there is some logs before refering to a problem in my MDB configuration:

Exception in creating EJB container [java.lang.Exception]

Diagnostic Causes

Problem during ejb container runtime intitialization. See stack trace for more details. Some common causes are global JNDI name conflicts, classnotfound errors, and configuration errors for resources needed by the ejb.

Diagnostic Checks

If the ejb has a Remote view, check that its JNDIname does not clash with any other ejb's JNDI name or any other globalJNDI name. Check that all needed classes are available to the ejb. Also ensure that any resources needed by the ejb are available. If the ejb uses a datasource make sure the corresponding database is running. If it uses a queue makes sure the physical queue has been created.

....

.....

But, there are no JNDI crashes, and there are no needed classes in my MDB, but the interface I am implementing (deplyed with my RA).

My annotations and deplyment descriptors looks like this:

<sun-ejb-jar>

<enterprise-beans>

<ejb>

<ejb-name>AQRAEndpoint</ejb-name>

<mdb-resource-adapter>

<resource-adapter-mid>OracleAQConnector</resource-adapter-mid>

</mdb-resource-adapter>

</ejb>

</enterprise-beans>

</sun-ejb-jar>

@MessageDriven(

messageListenerInterface=com.deu.oracleaqra.OracleAQMessageListener.class,

name="AQRAEndpoint",

activationConfig= {

@ActivationConfigProperty(propertyName="aqTopicName", propertyValue="UPDATE_QUEUE" ),

@ActivationConfigProperty(propertyName="aqTopicUser", propertyValue="DISPATCH" ),

@ActivationConfigProperty(propertyName="aqSubscriptionId", propertyValue="DispactchAQReader" )

}

One more thing, my MDB passes the ActivationSpec properties good to my RA.

Thank you for your help.

P.D. My RA and Endpoint deployment and inflow communication work fine in JBoss 4, but I really need it to work in SJSAS :(

jonren at 2007-7-7 0:51:48 > top of Java-index,Application & Integration Servers,Application Servers...
# 3

> Hi...

>

> Exception in creating EJB container

> [java.lang.Exception]

>

Could you provide me the entire server log snippet associated with this exception? You could mail it to sivakumart AT sun DOT com or post it below.

> But, there are no JNDI crashes, and there are no

> needed classes in my MDB, but the interface I am

> implementing (deplyed with my RA).

>

> @MessageDriven(

> messageListenerInterface=com.deu.oracleaqra.OracleAQMe

> ssageListener.class,

>name="AQRAEndpoint",

>activationConfig= {

>

> ActivationConfigProperty(propertyName="aqTopicName",

> propertyValue="UPDATE_QUEUE" ),

>

> ActivationConfigProperty(propertyName="aqTopicUser",

> propertyValue="DISPATCH" ),

>

> ActivationConfigProperty(propertyName="aqSubscriptionI

> d", propertyValue="DispactchAQReader" )

> }

> more thing, my MDB passes the ActivationSpec

> properties good to my RA.

Your message listener is configured to be

com.deu.oracleaqra.OracleAQMessageListener.class. Is this the interface your MDB implements?

Thanks

--Siva.

sivakumart at 2007-7-7 0:51:48 > top of Java-index,Application & Integration Servers,Application Servers...
# 4
Hello.Yes, the com.deu.oracleaqra.OracleAQMessageListener interface is implemented by my MDB.Thank YouJM
jonren at 2007-7-7 0:51:48 > top of Java-index,Application & Integration Servers,Application Servers...
# 5

FYI to others reading the forum. An email snippet from the original user who asked this question:

Hello all....

First of all, thank you for your kindness when taking your time to read

about my development issues and help me out to finally solve them...

I implemented a Worker thread which tries endpoint creation as Kenneth

suggested before and it worked!!!...

Kenneth Saks wrote:

>>> >>>Hi Siva,

>>> >>>

>>> >>>It doesn't look to be classloading related. This is an old problem

>>> >>>having to do

>>> >>>with the poorly specified initialization sequence in the connector

spec.

>>> >>> The

>>> >>>resource adapter is calling createEndpoint() from within

>>> >>>endpointActivation()

>>> >>>on the same thread on which it was invoked. createEndpoint() will

not

>>> >>>succeed until

>>> >>>all the components in the application have finished initialization,

but >>>that

>>> >>>can't happen until endpointActivation returns.createEndpoint

blocks >>>for

>>> >>>a bit (which has no benefit in this case) and then throws

>>> >>>UnavailableException.

>>> >>>

>>> >>>Technically, resource adapters are supposed to be able to handle

>>> >>>UnavailableException but unless the resource adapter is smart enough

>>> >>>to not only retry createEndpoint but to retry it on a worker thread

>>> >>>it will fail on all the subsequent

>>> >>>attempts as well. Most resource adapters I've seen don't call

>>> >>>createEndpoint

>>> >>>until they are ready to deliver messages, or at least from a

different

>>> >>>thread

>>> >>>than endpointActivation.However, I don't see anything in the spec

that

>>> >>>prohibits calling createEndpoint from within endpointActivation so it

>>> >>>seems

>>> >>>like something that should be looked at in the connector runtime

impl.

>>> >>> Here's

>>> >>>what ConnectorMessageBeanClient says now :

>>> >>>

>>>> >>>>public MessageEndpoint

>>>> >>>>createEndpoint (XAResource xa) throws UnavailableException {

>>>> >>>>

>>>> >>>>// This is a temperory workaround for blocking the the create

>>> >>>enpoint

>>>> >>>> // until the deployment completes. One thread would wait

for

>>>> >>>> maximum a

>>>> >>>> // a minute.

>>> >>>

>>> >>>Might want to investigate moving the blocking into the endpoint

proxy.

>>> >>>

>>> >>> --ken

sivakumart at 2007-7-7 0:51:48 > top of Java-index,Application & Integration Servers,Application Servers...