Results 1 to 4 of 4

Thread: Datasource problem

  1. #1
    Join Date
    Sep 2004
    Posts
    346

    Default Datasource problem

    I am getting error in applicationContext.xml

    nested propertyAccessExceptions are: [org.springframework.beans.TypeMismatchException: Failed to convert property value of type [org.enhydra.jdbc.oracle.OracleXADataSource] to required type [javax.sql.DataSource] for property 'dataSource']
    at org.springframework.beans.BeanWrapperImpl.doTypeCo nversionIfNecessary(BeanWr
    apperImpl.java:905)
    at org.springframework.beans.BeanWrapperImpl.setPrope rtyValue(BeanWrapperImpl.j
    ava:673)
    at org.springframework.beans.BeanWrapperImpl.setPrope rtyValue(BeanWrapperImpl.j
    ava:588)
    at org.springframework.beans.BeanWrapperImpl.setPrope rtyValue(BeanWrapperImpl.j
    ava:720)
    at org.springframework.beans.BeanWrapperImpl.setPrope rtyValues(BeanWrapperImpl.
    java:747)
    at org.springframework.beans.BeanWrapperImpl.setPrope rtyValues(BeanWrapperImpl.
    java:736)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory
    .applyPropertyValues(AbstractAutowireCapableBeanFa ctory.java:840)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory
    .populateBean(AbstractAutowireCapableBeanFactory.j ava:662)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory
    .createBean(AbstractAutowireCapableBeanFactory.jav a:270)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory
    .createBean(AbstractAutowireCapableBeanFactory.jav a:205)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(Abstra
    ctBeanFactory.java:204)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(Abstra
    ctBeanFactory.java:136)
    at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInst
    antiateSingletons(DefaultListableBeanFactory.java: 230)
    at org.springframework.context.support.AbstractApplic ationContext.refresh(Abstr
    actApplicationContext.java:284)
    at org.springframework.web.context.support.XmlWebAppl icationContext.refresh(Xml
    WebApplicationContext.java:131)
    at org.springframework.web.context.ContextLoader.crea teWebApplicationContext(Co
    ntextLoader.java:156)
    at org.springframework.web.context.ContextLoader.init WebApplicationContext(Cont
    extLoader.java:97)
    at org.springframework.web.context.ContextLoaderServl et.init(ContextLoaderServl
    et.java:80)
    at javax.servlet.GenericServlet.init(GenericServlet.j ava:256)
    at org.mortbay.jetty.servlet.ServletHolder.start(Serv letHolder.java:219)
    at org.mortbay.jetty.servlet.ServletHandler.initializ eServlets(ServletHandler.j
    ava:436)
    at org.mortbay.jetty.servlet.WebApplicationHandler.in itializeServlets(WebApplic
    ationHandler.java:150)
    at org.mortbay.jetty.servlet.WebApplicationContext.st art(WebApplicationContext.
    java:449)
    at org.mortbay.jetty.plus.PlusWebAppContext.start(Plu sWebAppContext.java:57)
    at org.mortbay.http.HttpServer.start(HttpServer.java: 663)
    at org.mortbay.jetty.plus.Server.start(Server.java:13 1)
    at com.iw.plugins.jettyrunner.PluginRunner.launchWith XML(PluginRunner.java:171)
    at com.iw.plugins.jettyrunner.PluginRunner.main(Plugi nRunner.java:131)


    org.enhydra.jdbc.oracle.OracleXADataSource does implement javax.sql.DataSource

    My applicationContext.xml
    Code:
    <bean id="myDataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
      <property name="jndiName">
        <value>java&#58;comp/env/jdbc/OlbDataSource</value>
      </property>
    </bean>
    My jettyplus Jetty-4.2.11 is set up as follows:

    Code:
      <Call name="addService">
        <Arg>
          <New class="org.mortbay.jetty.plus.JotmService">
            <Call name="addDataSource">
                 <Arg>jdbc/OlbDataSource</Arg>
                 <Arg>
    			   <New class="org.enhydra.jdbc.oracle.OracleXADataSource">
                     <Set name="DriverName">oracle.jdbc.driver.OracleDriver</Set>
                     <Set name="Url">jdbc&#58;oracle&#58;thin&#58;@xxx&#58;1521&#58;xxx</Set>
                     <Set name="User">xxx</Set>
                     <Set name="Password">xxx</Set>
                   </New>
                 </Arg>
            </Call>
         </New>
       </Arg>
      </Call>

  2. #2
    Join Date
    Aug 2004
    Location
    Toronto, Canada
    Posts
    736

    Default

    Are you sure that org.enhydra.jdbc.oracle.OracleXADataSource really derives from a real DataSource, javax.sql.DataSource?

    If so, there may be some sort of classloading issue, where the javax.sql.DataSource class known to Spring is not the one in classloader used to get the OracleXADatasource...
    Colin Sampaleanu
    SpringSource - http://www.springsource.com

  3. #3
    Join Date
    Aug 2004
    Location
    Montréal, Canada
    Posts
    845

    Default

    Colin,

    I checked this before and found that org.enhydra.jdbc.oracle.OracleXADataSource does implement DataSource. Unfortunately I could not reproduce this problem on my platform.
    Omar Irbouh

    Spring Modules Team
    http://irbouh.blogspot.com/

  4. #4
    Join Date
    Sep 2004
    Posts
    346

    Default What happened on your platform?

    What happened on your platform?

Similar Threads

  1. Replies: 13
    Last Post: Feb 5th, 2010, 12:31 AM
  2. Replies: 0
    Last Post: Aug 16th, 2005, 11:23 AM
  3. Odd behaviour when injecting TransactionTemplate
    By damon311 in forum Container
    Replies: 3
    Last Post: Jul 23rd, 2005, 11:21 AM
  4. Datasource problem
    By too_many_details in forum Data
    Replies: 1
    Last Post: Jun 22nd, 2005, 04:10 AM
  5. Replies: 5
    Last Post: May 4th, 2005, 10:49 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •