Announcement Announcement Module
Collapse
No announcement yet.
Cannot find class [javax.sql.DataSource] when exposing Datasource as a Service Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Cannot find class [javax.sql.DataSource] when exposing Datasource as a Service

    I'm trying out dm Server, and have built a basic app that has three bundles, a datasource bundle, a model bundle, and a web bundle to access the model. The datasource bundle has no code, only the spring configurations and the MANIFEST importing required packages/bundles.

    Code:
    <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" lazy-init="false">
    		<property name="driverClass" value="org.postgresql.Driver"/> 
    		<property name="jdbcUrl" value="jdbc:postgresql://localhost/springdemo"/> 
    		<property name="user" value="myuser"/> 
    		<property name="password" value="password"/>
    </bean> 
    
    <osgi:service id="osgiDataSource" ref="dataSource" interface="javax.sql.DataSource"/>
    When I install this bundle through the console I get the following:
    Code:
    Artifact Console: 'Deployment Error 'Error creating bean with name 
    'org.springframework.osgi.service.exporter.support.OsgiServiceFactoryBean#0': 
    Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: 
    Failed to convert property value of type 'java.util.LinkedHashSet' to required type 'java.lang.Class[]' 
    for property 'interfaces'; nested exception is java.lang.IllegalArgumentException: Cannot find class 
    [javax.sql.DataSource]''
    If I comment out the line exposing the datasource as a service it has no errors. Whats going on here?

  • #2
    Have you imported the javax.sql package into your bundle?

    Comment

    Working...
    X