5 Replies Latest reply on Aug 12, 2002 12:15 PM by palob

    Expecting a ConnectionFactory but getting a DataSource

    xavier

      Hey guys,
      I'm a recovering JRun user so bear with me here if I say something blatently foolish ;o)

      I have JCA resource adapter that uses a CCI to facilitate the manipulation of a .properties file.

      the rar deploys without errors. As does the stateless session bean I am using to interact with the adapter.

      When running my console based client however I get the following error:

      java.lang.ClassCastException: org.jboss.resource.adapter.jdbc.local.LocalDataSource

      My JNDI lookup is successful but I am expecting an object that is castable to a ConnectionFactory and instead I am getting a Datasource.

      The rar I am deploying is refered to as PropertiesFileAdapter in the log. all the Hello references are related to my session bean thats trying to use the adapter.

      I am almost possitive this is a descriptor issue.

      The relevant portions of the log follow:

      14:34:50,451 INFO [MainDeployer] Adding deployer: org.jboss.web.catalina.EmbeddedCatalinaServiceSX@9cd75a
      14:34:53,275 INFO [STDOUT] Apache Tomcat/4.0.3
      14:34:53,305 INFO [Engine] HttpConnector Opening server socket on all host IP addresses
      14:34:53,305 INFO [Engine] HttpConnector[8080] Starting background thread
      14:34:53,906 INFO [Engine] HttpProcessor[8080][0] Starting background thread
      14:34:53,916 INFO [Engine] HttpProcessor[8080][1] Starting background thread
      14:34:53,916 INFO [Engine] HttpProcessor[8080][2] Starting background thread
      14:34:53,916 INFO [EmbeddedCatalinaServiceSX] OK
      14:34:53,926 INFO [EmbeddedCatalinaServiceSX] Started
      14:34:53,926 INFO [MainDeployer] Successfully completed deployment of package: file:/C:/jboss-3.0.0_tomcat-4.0.3/server/experimental/deploy/tomcat4-service.xml
      14:34:53,936 INFO [MainDeployer] Starting deployment of package: file:/C:/jboss-3.0.0_tomcat-4.0.3/server/experimental/deploy/user-service.xml
      14:34:54,076 INFO [MainDeployer] Successfully completed deployment of package: file:/C:/jboss-3.0.0_tomcat-4.0.3/server/experimental/deploy/user-service.xml
      14:34:54,076 INFO [MainDeployer] Starting deployment of package: file:/C:/jboss-3.0.0_tomcat-4.0.3/server/experimental/deploy/adapter.rar
      14:34:54,406 WARN [ServiceController] jboss.jca:service=RARDeployment,name=1C JCA Adapter does not implement any Service methods
      14:34:54,506 INFO [MainDeployer] Successfully completed deployment of package: file:/C:/jboss-3.0.0_tomcat-4.0.3/server/experimental/deploy/adapter.rar
      14:34:54,506 INFO [MainDeployer] Starting deployment of package: file:/C:/jboss-3.0.0_tomcat-4.0.3/server/experimental/deploy/jboss-local-jdbc.rar
      14:34:54,647 WARN [ServiceController] jboss.jca:service=RARDeployment,name=JBoss LocalTransaction JDBC Wrapper does not implement any Service methods
      14:34:54,647 WARN [ServiceController] jboss.jca:service=LocalTxDS,name=hsqldbDS does not implement any Service methods
      14:34:54,647 INFO [LocalTxConnectionManager] Creating
      14:34:54,767 INFO [LocalTxConnectionManager] Created
      14:34:54,767 WARN [ServiceController] jboss.jca:service=LocalTxDS,name=MySqlDS does not implement any Service methods
      14:34:54,767 INFO [LocalTxConnectionManager] Creating
      14:34:54,777 INFO [LocalTxConnectionManager] Created
      14:34:54,787 INFO [LocalTxConnectionManager] Starting
      14:34:55,217 INFO [DefaultDS] Bound connection factory for resource adapter 'JBoss LocalTransaction JDBC Wrapper' to JNDI name 'java:/DefaultDS'
      14:34:55,217 INFO [LocalTxConnectionManager] Started
      14:34:55,217 INFO [LocalTxConnectionManager] Starting
      14:34:55,538 INFO [MySqlDS] Bound connection factory for resource adapter 'JBoss LocalTransaction JDBC Wrapper' to JNDI name 'java:/MySqlDS'
      14:34:55,538 INFO [LocalTxConnectionManager] Started
      14:34:55,538 INFO [MainDeployer] Successfully completed deployment of package: file:/C:/jboss-3.0.0_tomcat-4.0.3/server/experimental/deploy/jboss-local-jdbc.rar
      14:34:55,538 INFO [MainDeployer] Starting deployment of package: file:/C:/jboss-3.0.0_tomcat-4.0.3/server/experimental/deploy/jboss-xa.rar
      14:34:55,608 INFO [RARMetaData] Loading Minerva Resource Adapter for JDBC 2 XA drivers
      14:34:55,608 INFO [RARMetaData] Required license terms present. See deployment descriptor.
      14:34:55,678 WARN [ServiceController] jboss.jca:service=RARDeployment,name=Minerva JDBC XATransaction ResourceAdapter does not implement any Service methods
      14:34:55,698 INFO [MainDeployer] Successfully completed deployment of package: file:/C:/jboss-3.0.0_tomcat-4.0.3/server/experimental/deploy/jboss-xa.rar
      14:34:55,698 INFO [MainDeployer] Starting deployment of package: file:/C:/jboss-3.0.0_tomcat-4.0.3/server/experimental/deploy/jms-ra.rar
      14:34:56,019 WARN [ServiceController] jboss.jca:service=RARDeployment,name=JMS Adapter does not implement any Service methods
      14:34:56,019 WARN [ServiceController] jboss.jca:service=XaTxDS,name=jmsra does not implement any Service methods
      14:34:56,019 INFO [XATxConnectionManager] Creating
      14:34:56,029 INFO [XATxConnectionManager] Created
      14:34:56,039 INFO [XATxConnectionManager] Starting
      14:34:56,069 INFO [JaasSecurityManagerService] Created securityMgr=org.jboss.security.plugins.JaasSecurityManager@57ea52
      14:34:56,069 INFO [JaasSecurityManagerService] setCachePolicy, c=org.jboss.util.TimedCachePolicy@d8d39f
      14:34:56,079 INFO [JaasSecurityManagerService] Added JmsXARealm, org.jboss.security.plugins.SecurityDomainContext@2d95b3 to map
      14:34:56,569 INFO [JmsXA] Bound connection factory for resource adapter 'JMS Adapter' to JNDI name 'java:/JmsXA'
      14:34:56,569 INFO [XATxConnectionManager] Started
      14:34:56,569 INFO [MainDeployer] Successfully completed deployment of package: file:/C:/jboss-3.0.0_tomcat-4.0.3/server/experimental/deploy/jms-ra.rar
      14:34:56,589 INFO [MainDeployer] Starting deployment of package: file:/C:/jboss-3.0.0_tomcat-4.0.3/server/experimental/deploy/myjca.rar
      14:34:56,800 WARN [ServiceController] jboss.jca:service=RARDeployment,name=MyJCA does not implement any Service methods
      14:34:56,810 INFO [MainDeployer] Successfully completed deployment of package: file:/C:/jboss-3.0.0_tomcat-4.0.3/server/experimental/deploy/myjca.rar
      14:34:56,840 INFO [MainDeployer] Starting deployment of package: file:/C:/jboss-3.0.0_tomcat-4.0.3/server/experimental/deploy/PropertiesFileAdapter.rar
      14:34:57,010 WARN [ServiceController] jboss.jca:service=RARDeployment,name=Properties File Adapter does not implement any Service methods
      14:34:57,030 INFO [MainDeployer] Successfully completed deployment of package: file:/C:/jboss-3.0.0_tomcat-4.0.3/server/experimental/deploy/PropertiesFileAdapter.rar
      14:34:57,040 INFO [MainDeployer] Starting deployment of package: file:/C:/jboss-3.0.0_tomcat-4.0.3/server/experimental/deploy/ejb-management.jar
      14:34:58,532 INFO [EjbModule] Creating
      14:34:58,602 INFO [EjbModule] Deploying MEJB
      14:35:00,204 INFO [EjbModule] Created
      14:35:00,204 INFO [EjbModule] Starting
      14:35:00,355 INFO [EjbModule] Started
      14:35:00,355 INFO [MainDeployer] Successfully completed deployment of package: file:/C:/jboss-3.0.0_tomcat-4.0.3/server/experimental/deploy/ejb-management.jar
      14:35:00,375 INFO [MainDeployer] Starting deployment of package: file:/C:/jboss-3.0.0_tomcat-4.0.3/server/experimental/deploy/ejbs.jar
      14:35:00,645 INFO [EjbModule] Creating
      14:35:00,665 INFO [EjbModule] Deploying Hello
      14:35:00,695 INFO [EjbModule] Created
      14:35:00,695 INFO [EjbModule] Starting
      14:35:00,745 INFO [EjbModule] Started
      14:35:00,745 INFO [MainDeployer] Successfully completed deployment of package: file:/C:/jboss-3.0.0_tomcat-4.0.3/server/experimental/deploy/ejbs.jar
      14:35:00,745 INFO [MainDeployer] Starting deployment of package: file:/C:/jboss-3.0.0_tomcat-4.0.3/server/experimental/deploy/jmx-ejb-adaptor.jar
      14:35:00,965 INFO [EjbModule] Creating
      14:35:00,996 INFO [EjbModule] Deploying jmx/ejb/Adaptor
      14:35:01,046 INFO [EjbModule] Created
      14:35:01,046 INFO [EjbModule] Starting
      14:35:01,176 INFO [EjbModule] Started
      14:35:01,176 INFO [MainDeployer] Successfully completed deployment of package: file:/C:/jboss-3.0.0_tomcat-4.0.3/server/experimental/deploy/jmx-ejb-adaptor.jar
      14:35:01,206 INFO [MainDeployer] Starting deployment of package: file:/C:/jboss-3.0.0_tomcat-4.0.3/server/experimental/deploy/mm.mysql-2.0.4-bin.jar
      14:35:01,246 INFO [MainDeployer] Successfully completed deployment of package: file:/C:/jboss-3.0.0_tomcat-4.0.3/server/experimental/deploy/mm.mysql-2.0.4-bin.jar
      14:35:01,256 INFO [URLDeploymentScanner] Started
      14:35:01,256 INFO [MainDeployer] Successfully completed deployment of package: file:/C:/jboss-3.0.0_tomcat-4.0.3/server/experimental/conf/jboss-service.xml
      14:35:01,256 INFO [Server] JBoss (MX MicroKernel) [3.0.0 Date:200205311035] Started in 0m:28s:570ms
      14:36:35,589 INFO [STDOUT] HelloBean::sayHello called
      14:36:35,589 INFO [STDOUT] org.jboss.resource.adapter.jdbc.local.LocalDataSource@ee3aa7
      14:36:35,599 ERROR [STDERR] java.lang.ClassCastException: org.jboss.resource.adapter.jdbc.local.LocalDataSource
      14:36:35,599 ERROR [STDERR] at adapters.propertiesfile.test.HelloBean.sayHello(HelloBean.java:44)
      14:36:35,599 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      14:36:35,599 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      14:36:35,599 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      14:36:35,609 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:324)
      14:36:35,609 ERROR [STDERR] at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:664)
      14:36:35,619 ERROR [STDERR] at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
      14:36:35,629 ERROR [STDERR] at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:77)
      14:36:35,629 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:96)
      14:36:35,639 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:219)
      14:36:35,649 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:61)
      14:36:35,649 ERROR [STDERR] at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:129)
      14:36:35,659 ERROR [STDERR] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:166)
      14:36:35,659 ERROR [STDERR] at org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContainer.java:313)
      14:36:35,669 ERROR [STDERR] at org.jboss.ejb.Container.invoke(Container.java:705)
      14:36:35,669 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
      14:36:35,679 ERROR [STDERR] at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:362)
      14:36:35,679 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      14:36:35,689 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      14:36:35,699 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      14:36:35,709 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:324)
      14:36:35,709 ERROR [STDERR] at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
      14:36:35,709 ERROR [STDERR] at sun.rmi.transport.Transport$1.run(Transport.java:148)
      14:36:35,719 ERROR [STDERR] at java.security.AccessController.doPrivileged(Native Method)
      14:36:35,729 ERROR [STDERR] at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
      14:36:35,729 ERROR [STDERR] at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
      14:36:35,739 ERROR [STDERR] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
      14:36:35,739 ERROR [STDERR] at java.lang.Thread.run(Thread.java:536)

        • 1. Re: Expecting a ConnectionFactory but getting a DataSource
          davidjencks

          I don't see any evidence from the log that you provided the jboss descriptor to deploy an instance of your resource adapter, and it looks like you looked up java:/DefaultDS and got the datasource for the toy hypersonic db that comes with jboss.

          There are lots of examples of descriptors in docs/examples/jca. Right now they are all for jdbc datasources, but the jboss descriptor doesn't care what you are deploying so long as it is a jca adapter. The easiest to start with might be the firebird-service.xml since that is a native jca adapter rather than a wrapper around a jdbc driver.

          You have to select different mbeans in the descriptor depending on the level of transaction support in your adapter.

          If this doesn't help show your ra.xml and whatever you come up with for a *-service.xml file. Also read the jca chapter in the quickstart guide from the sourceforge download page.

          • 2. Re: Expecting a ConnectionFactory but getting a DataSource
            robbi

            Hello,

            I have exactly the same problem with my JCA Adapter - I guess we try to deploy the same example from the JavaPro Magazine under http://www.fawcette.com/javapro/2002_02/magazine/features/tmodi/ ??
            So even if David Jencks do not recommend this example I would like to solve the problem because I think I'm not very far from a solution and the example adapter is really a simple one to learn about JCA.

            Here's the relevant deployment and error message from the JBoss log file, my ra.xml and prop-service.xml:

            17:11:35,018 INFO [Server] JBoss (MX MicroKernel) [3.0.0 Date:200205311035] Started in 0m:27s:539ms
            17:11:45,083 INFO [MainDeployer] Starting deployment of package: file:/D:/Programme/jboss-3.0.0/server/default/deploy/prop-service.xml
            17:11:45,393 WARN [ServiceController] jboss.jca:service=LocalTxDS,name=PropertiesFileAdapter does not implement any Service methods
            17:11:45,393 INFO [JBossManagedConnectionPool] Creating
            17:11:45,403 INFO [JBossManagedConnectionPool] Created
            17:11:45,413 INFO [JBossManagedConnectionPool] Starting
            17:11:45,423 INFO [JBossManagedConnectionPool] Started
            17:11:45,423 INFO [MainDeployer] Successfully completed deployment of package:file:/D:/Programme/jboss-3.0.0/server/default/deploy/prop-service.xml
            17:11:45,443 INFO [MainDeployer] Starting deployment of package: file:/D:/Programme/jboss-3.0.0/server/default/deploy/PropertiesFileAdapter.rar
            17:11:45,513 WARN [ServiceController] jboss.jca:service=RARDeployment,name=PropertiesFileAdapter does not implement any Service methods
            17:11:45,513 WARN [ServiceController] jboss.jca:service=LocalTxDS,name=PropertiesFileAdapter does not implement any Service methods
            17:11:45,533 INFO [LocalTxConnectionManager] Creating
            17:11:45,543 INFO [LocalTxConnectionManager] Created
            17:11:45,553 INFO [LocalTxConnectionManager] Starting
            17:11:45,643 INFO [STDOUT] ManagedConnectionFactoryImpl::Constructor called
            17:11:45,643 INFO [STDOUT] ManagedConnectionFactoryImpl::createConnectionFactory called
            17:11:45,724 INFO [STDOUT] ConnectionFactoryImpl::Constructor called
            17:11:45,724 INFO [STDOUT] A connection managager was provided of class class org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy
            17:11:45,734 INFO [eis/PropertiesFileAdapter] Bound connection factory for resource adapter 'PropertiesFileAdapter' to JNDI name 'java:/eis/PropertiesFileAdapter'
            17:11:45,754 INFO [LocalTxConnectionManager] Started
            17:11:45,764 INFO [MainDeployer] Successfully completed deployment of package:file:/D:/Programme/jboss-3.0.0/server/default/deploy/PropertiesFileAdapter.rar
            17:11:56,269 INFO [STDOUT] HelloBean::sayHello called
            17:11:56,279 ERROR [STDERR] java.lang.ClassCastException: org.jboss.resource.adapter.jdbc.local.LocalDataSource
            17:11:56,279 ERROR [STDERR] at adapters.propertiesfile.test.HelloBean.sayHello(HelloBean.java:37)
            17:11:56,289 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            17:11:56,309 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            17:11:56,319 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            17:11:56,329 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:324)
            17:11:56,339 ERROR [STDERR] at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:664)
            17:11:56,359 ERROR [STDERR] at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
            17:11:56,369 ERROR [STDERR] at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:77)
            17:11:56,379 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:96)
            17:11:56,389 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:219)
            17:11:56,399 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:61)
            17:11:56,409 ERROR [STDERR] at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:129)
            17:11:56,429 ERROR [STDERR] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:166)
            17:11:56,439 ERROR [STDERR] at org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContainer.java:313)
            17:11:56,449 ERROR [STDERR] at org.jboss.ejb.Container.invoke(Container.java:705)
            17:11:56,459 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
            17:11:56,479 ERROR [STDERR] at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:362)
            17:11:56,489 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            17:11:56,499 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

            -----------------------------------------
            ra.xml
            -----------------------------------------
            <?xml version="1.0" encoding="UTF-8"?>
            <!DOCTYPE connector PUBLIC "-//Sun Microsystems, Inc.//DTD Connector 1.0//EN" "http://java.sun.com/dtd/connector_1_0.dtd">

            <display-name>PropertiesFileAdapter</display-name>
            <vendor-name>JR</vendor-name>
            <spec-version>1.0</spec-version>
            <eis-type>Java Properties File</eis-type>
            1.0

            <managedconnectionfactory-class>adapters.propertiesfile.ManagedConnectionFactoryImpl</managedconnectionfactory-class>
            <connectionfactory-interface>javax.resource.cci.ConnectionFactory</connectionfactory-interface>
            <connectionfactory-impl-class>adapters.propertiesfile.ConnectionFactoryImpl</connectionfactory-impl-class>
            <connection-interface>javax.resource.cci.Connection</connection-interface>
            <connection-impl-class>adapters.propertiesfile.ConnectionImpl</connection-impl-class>
            <transaction-support>NoTransaction</transaction-support>
            <config-property>
            <config-property-name>ConnectionURL</config-property-name>
            <config-property-type>java.lang.String</config-property-type>
            <config-property-value>C:/temp/test.properties</config-property-value>
            </config-property>
            <authentication-mechanism>
            <authentication-mechanism-type>BasicPassword</authentication-mechanism-type>
            <credential-interface>javax.resource.security.PasswordCredential</credential-interface>
            </authentication-mechanism>
            <reauthentication-support>false</reauthentication-support>




            -----------------------------------------
            prop-service.xml
            -----------------------------------------
            <?xml version="1.0" encoding="UTF-8"?>

            <!-- ======================================================================-->
            <!-- New ConnectionManager setup for property file adapter example -->
            <!-- ===================================================================== -->

            <depends optional-attribute-name="ManagedConnectionFactoryName">
            <!--embedded mbean-->

            eis/PropertiesFileAdapter



            <!--Below here are advanced properties -->
            <!--hack-->
            <depends optional-attribute-name="OldRarDeployment">jboss.jca:service=RARDeployment,name=PropertiesFileAdapter


            <depends optional-attribute-name="ManagedConnectionPool">
            <!--embedded mbean-->

            0
            50
            5000
            15
            ByContainer


            <depends optional-attribute-name="CachedConnectionManager">jboss.jca:service=CachedConnectionManager
            <depends optional-attribute-name="JaasSecurityManagerService">jboss.security:name=JaasSecurityManager
            java:/TransactionManager
            <!--make the rar deploy! hack till better deployment-->
            jboss.jca:service=RARDeployer





            • 3. Re: Expecting a ConnectionFactory but getting a DataSource
              davidjencks

              I won't have time to look at this in detail for a while. Meanwhile a couple of suggestions:

              1. Check jndiview (port 8082) and see what it says the type of the ConnectionFactory is. If its LocalDataSource...

              2. Try removing all other .rar from the deploy dir and restarting jboss.

              This is extremely odd, since the Local jdbd wrapper and the jms ra peacefully coexist.

              • 4. Re: Expecting a ConnectionFactory but getting a DataSource
                robbi

                My example works now. I forgot to specify a property "ConnectionURL" in prop-service.xml.

                Here's my new prop-service.xml:
                <?xml version="1.0" encoding="UTF-8"?>
                <!-- ===================================================================== -->
                <!-- -->
                <!-- JBoss Server Configuration -->
                <!-- -->
                <!-- ===================================================================== -->

                <!-- ======================================================================-->
                <!-- New ConnectionManager setup for property file adapter example -->
                <!-- ===================================================================== -->

                <depends optional-attribute-name="ManagedConnectionFactoryName">
                <!--embedded mbean-->

                eis/PropertiesFileAdapter


                <config-property name="ConnectionURL" type="java.lang.String">c:/temp/test.properties</config-property>


                <!--Below here are advanced properties -->
                <!--hack-->
                <depends optional-attribute-name="OldRarDeployment">jboss.jca:service=RARDeployment,name=PropertiesFileAdapter


                <depends optional-attribute-name="ManagedConnectionPool">
                <!--embedded mbean-->

                0
                50
                5000
                15
                ByContainer


                <depends optional-attribute-name="CachedConnectionManager">jboss.jca:service=CachedConnectionManager
                <depends optional-attribute-name="JaasSecurityManagerService">jboss.security:name=JaasSecurityManager
                java:/TransactionManager
                <!--make the rar deploy! hack till better deployment-->
                jboss.jca:service=RARDeployer


                • 5. Re: Expecting a ConnectionFactory but getting a DataSource
                  palob

                  Hello everyone,
                  I am struggling with PropertiesFileAdapter and nothing helps. I tried everything depicted above and still ClassCastException persists. I am using JBoss 3.0.1.
                  I tried to use NoTxConnectionManager, but in vain.
                  Please help me.

                  Thanks
                  palob