Hi Romain,

Using class-name allowed it to get past the 'Cannot determine a provider' message, but now I am encountering a new error.

This error occurs when using <Resource id="ra-jrac" class-name"javax.resource.cci.ConnectionFactory"></Resource> in tomee.xml:

SEVERE: FATAL ERROR: Unknown error in Assembler. Please send the following stack trace and this message to us...@openejb.apache.org : org.apache.xbean.recipe.ConstructionException: Class is an interface: javax.resource.cci.ConnectionFactory

When I try to use the concrete implementation (class-name="com.unisys.coms.connector.COMSManagedConnectionFactory") I get the following error:

SEVERE: FATAL ERROR: Unknown error in Assembler. Please send the following stack trace and this message to us...@openejb.apache.org : org.apache.xbean.recipe.ConstructionException: Type class could not be found: com.unisys.coms.connector.COMSConnectionFactory

The resource adapter I am deploying contains that class. The log says that the .rar is loaded before this error occurs. What could be the reason that the Resource definition can't find the class?

Thanks,
Mike

On 07/17/2015 02:04 PM, Romain Manni-Bucau wrote:
Hi

Using class-name in Resource declaration should make it.

That said <ra name as logged>.<property> =<value> in conf/system.properties
should work IIRC.
  Le 17 juil. 2015 20:32, "Mike Spencer" <mspen...@denniskirk.com> a écrit :

Hi all,

I am trying to migrate an application using a resource adapter in a .rar
file from Glassfish to TomEE. The resource adapter needs to be deployed
globally (so multiple application can access it) and make the
javax.resource.cci.ConnectionFactory implementation available via JNDI.

I believe I have deployed the resource adapter to TomEE by adding the line
<Deployments dir="apps" /> in the tomee.xml file. I see the following lines
in the logs afterwards, so I am assuming the .rar is detected and made
available.

INFO: Configuring enterprise application:
/opt/apps/tomee-plume-1.7.1/apps/jrac-tweb.rar
Jul 17, 2015 1:18:08 PM
org.apache.openejb.config.OutputGeneratedDescriptors writeRaXml
INFO: Dumping Generated ra.xml to:
/opt/apps/tomee-plume-1.7.1/temp/ra-6993024062304172339Connector_ID.xml
Jul 17, 2015 1:18:08 PM org.apache.openejb.config.ConfigurationFactory
configureService
INFO: Configuring Service(id=ra-jrac, type=Resource, provider-id=ra-jrac)
Jul 17, 2015 1:18:08 PM org.apache.openejb.config.ConfigurationFactory
configureService
INFO: Configuring Service(id=Connector_ID, type=Resource,
provider-id=Connector_ID)
Jul 17, 2015 1:18:08 PM org.apache.openejb.config.AppInfoBuilder build
INFO: Enterprise application
"/opt/apps/tomee-plume-1.7.1/apps/jrac-tweb.rar" loaded.

However, I cannot figure out how to configure properties on the resource
adapter. I need to specify some configuration properties (username,
password, etc). In Glassfish, I have the connector-connection-pool and
connector-resource elements in the domain.xml where I can configure this
information and set up a JNDI name for the connector.

I tried to add a <Resource> block to the tomee.xml file, but it fails with
the following message:

SEVERE: Failed Configuring Service(id=ra-jrac)
org.apache.openejb.config.NoSuchProviderException: Cannot determine a
provider for Resource(id=ra-jrac,
type=javax.resource.cci.ConnectionFactory, provider=null).

Possible valid configurations might be:
   <Resource id="ra-jrac" type="DataSource"/>
   <Resource id="ra-jrac" type="javax.sql.DataSource"/>
   <Resource id="ra-jrac" type="ActiveMQResourceAdapter"/>
   <Resource id="ra-jrac" type="javax.jms.QueueConnectionFactory"/>
   <Resource id="ra-jrac" type="TopicConnectionFactory"/>
   <Resource id="ra-jrac" type="javax.jms.ConnectionFactory"/>
   <Resource id="ra-jrac" type="javax.jms.TopicConnectionFactory"/>
   <Resource id="ra-jrac" type="QueueConnectionFactory"/>
   <Resource id="ra-jrac" type="javax.jms.Destination"/>
   <Resource id="ra-jrac" type="javax.jms.Queue"/>
   <Resource id="ra-jrac" type="Queue"/>
   <Resource id="ra-jrac" type="javax.jms.Topic"/>
   <Resource id="ra-jrac" type="Topic"/>
   <Resource id="ra-jrac" type="ORB"/>
   <Resource id="ra-jrac" type="org.omg.CORBA.ORB"/>
   <Resource id="ra-jrac" type="javax.mail.Session"/>
   <Resource id="ra-jrac"
type="javax.enterprise.concurrent.ManagedExecutorService"/>
   <Resource id="ra-jrac" type="ManagedExecutorService"/>
   <Resource id="ra-jrac" type="ManagedScheduledExecutorService"/>
   <Resource id="ra-jrac"
type="javax.enterprise.concurrent.ManagedScheduledExecutorService"/>
   <Resource id="ra-jrac"
type="javax.enterprise.concurrent.ManagedThreadFactory"/>
   <Resource id="ra-jrac" type="ManagedThreadFactory"/>
   <Resource id="ra-jrac" type="ContextService"/>
   <Resource id="ra-jrac"
type="javax.enterprise.concurrent.ContextService"/>
     at
org.apache.openejb.config.ConfigurationFactory.configureService(ConfigurationFactory.java:1092)
     at
org.apache.openejb.config.ConfigurationFactory.getOpenEjbConfiguration(ConfigurationFactory.java:484)
     ...

I have also tried setting up a <Resource> in the context.xml file in the
same way that I have database connections configured, hoping that would let
me access the ConnectionFactory via JNDI, but my application fails to find
the JNDI name.

<Resource id="ra-jrac"
               name="foo/bar/baz"
               auth="Container"
               type="javax.resource.cci.ConnectionFactory"
               username="USERNAME"
               password="PASSWORD" />

I am using TomEE-plume 1.7.1. It would be greatly appreciated if anyone
can point me in the correct direction to get this configured.

Thanks,
Mike


Reply via email to