Angelo Fuchs
Angelo Fuchs

Reputation: 9941

Whats wrong with @ConnectionFactoryDefinition (in WildFly) and what should I use instead?

In my development setup I deployed a Resource Adapter to Wildfly 10. It seems to be working fine so far, yet I get a warning like this:

14:57:44,007 WARN  [org.jboss.as.connector.deployment]
   (MSC service thread 1-2)
   WFLYJCA0028: @ConnectionFactoryDefinition will have limited management:
   java:comp/env/eis/TestRAConnectionFactory

Searching after WFLYJCA0028 I found out that it used to be JBAS010427 and searching after that, brought up this post from 2014 of Jesper Pedersen:

Because @ConnectionFactoryDefinition is a broken concept, and is only meant for development. All the settings for the JCA container isn't/can't be exposed, and hence it is limited in the management view too (use :resource-adapters: instead).

Do NOT use @ConnectionFactoryDefinition for production environments ! You have been warned

Unfortunately beyond "Its a broken concept" it does not explain the problems (or I don't understand it) and I couldn't find any more detailed explanation on what potential problems could be and how to properly create a JCA connection factory instead.

Upvotes: 2

Views: 328

Answers (1)

searchengine27
searchengine27

Reputation: 1471

I hesitated for a moment to even put this as an answer, because I feel as though an answer should definitively answer the question with very explicit details, which I can't give. What I can give is some minor insight into anyone else who might have stumbled across JBoss not liking the ConnectionFactoryDefinition annotation.

It appears as though (at least in JBoss 8 Wildfly, where I personally experienced this) that JBoss will actually prevent a ResourceAdapter from even starting when using the ConnectionFactoryDefinition annotation. As a result, the rar will deploy "successfully", and subsequently deployed EJBs that are similarly annotation driven (i.e. MessageDriven, ActivationConfigProperty) which are dependent on inbound JCA will start failing during the EAR deployment, complaining that the ear_name#rar_name is not available.

Related to the final point in the question

and how to properly create a JCA connection factory

I finally made a breakthrough through trial-and-error, using a ra.xml and ironjacamar.xml to define the information otherwise specified in annotations for ConnectionFactoryDefinition, Connection, and ConnectionDefinition. After transcribing the information to those files in the corresponding areas, I was able to get my ResourceAdapter to start again.

I wish I could give more information that that, but I'm just as confused as to why JBoss would restrict that annotation as well. I hope at least this points someone else in the right direction and they don't waste the same amount of time I did figuring out it was the annotation that JBoss doesn't like and not your code.

Upvotes: 1

Related Questions