users@glassfish.java.net

Re: EndpointFactory is currently not available

From: <glassfish_at_javadesktop.org>
Date: Sat, 16 Aug 2008 04:03:39 PDT

Hi,

The proposed fix is somewhat based from this article:
"http://www.javaworld.com/javaworld/jw-06-2005/jw-0606-jca.html?page=3"

It suggests that you can create the endpoint from "endpointActivation" method (to use only one instance of MDB), or create it from the scheduled "Work" (to take advantage of MDB pool when multiple messages must be processed concurrently).

But you may found problems when creating the endpoint in the "endpointActivation", because section "12.4.4 Application Server" of JCA specification (version 1.5), says:

"...
Note, a resource adapter may attempt to deliver messages during the [b]endpointActivation[/b] method call. It is up to the application server to decide whether to allow message delivery before activation is completed. If the application server chooses to prevent message delivery during endpoint activation, it may block the createEndpoint method call until the activation is completed or throw an [b]UnavailableException[/b].
..."

And some application servers like GlassFish and WebLogic, follow the second option (throwing the UnavailableException because the factory is still not ready within "endpointActivation" method).

On the other hand, if you try to "take advantage" of MDB pool (as suggested in the previous article), you may found with other issues ...
(that are also explained in section "12.4.4 Application Server" of JCA 1.5 specification, and noticed for older SunOne application server version in this blog: "http://weblogs.java.net/blog/schaefa/archive/2004/09/jca_15_choices.html").

So, if you won't deal with too many messages to be processed concurrently, you may want to start with creating only one MDB instance (i.e: when "endPoint" is null in "XAResourceImpl.startCall").
[Message sent by forum member 'jmarine' (jmarine)]

http://forums.java.net/jive/thread.jspa?messageID=293697