Matteo,

Could you do an osgi/headers for the mysql to see what imports it
requires?  Perhaps that gives us an idea on what constraint it is
talking about...

Regards,

Gert Vanthienen
------------------------
Open Source SOA: http://fusesource.com
Blog: http://gertvanthienen.blogspot.com/



2009/6/1 Matteo Redaelli <matteo.redae...@libero.it>:
>
> Hello
>
> In smx4 I'm tring to convert the JBI example cxf-wsdl-first-jdbc
> (http://matteoredaelli.wordpress.com/2009/05/30/connecting-to-a-database-with-a-webservice-cxf-deployed-jbi-in-servicemix/)
> with a similar OSGI project.
>
> I created a project using
>
>  mvn archetype:create \
>        -DarchetypeGroupId=org.apache.servicemix.tooling \
>        -DarchetypeArtifactId=servicemix-osgi-cxf-wsdl-first-archetype  \
>        -DarchetypeVersion=2008.01-SNAPSHOT \
>        -DgroupId=com.yourcompany \
>        -DartifactId=test-wsdl-first-osgi \
>        -Dversion=1.0-SNAPSHOT \
>        
> -DremoteRepositories=http://people.apache.org/repo/m2-snapshot-repository/
>
> Than I added osgi wraps for spring-jdnc and mysql with
>
> osgi/install  wrap mvn:org.springframework/spring-jdbc/2.5.6
> osgi/install  wrap mvn:mysql/mysql-connector-java/5.0.8
>
> [ 181] [Active     ] [       ] [   60] Spring JDBC (2.5.6)
> [ 272] [Active     ] [       ] [   60] mvn:mysql/mysql-connector-java/5.0.8
>
> MY changes in pom.xml are:
>
>                <dependency>
>                        <groupId>mysql</groupId>
>                        <artifactId>mysql-connector-java</artifactId>
>                        <version>5.0.8</version>
>                </dependency>
>                <dependency>
>                        <groupId>org.springframework</groupId>
>                        <artifactId>spring-jdbc</artifactId>
>                        <version>2.5.6</version>
>                </dependency>
>                ...
>                 <Import-Package>
>                            ...
>                            org.springframework.jdbc.datasource,
>                            com.mysql.jdbc, *
>                  </Import-Package>
>                  ...
>                  <DynamicImport-Package>*</DynamicImport-Package>
>
> MY beans.xml
>         ...
>         <bean id="moodleDB"
>
> class="org.springframework.jdbc.datasource.DriverManagerDataSource">
>                <property name="driverClassName"
> value="com.mysql.jdbc.Driver" />
>                <property name="url"
>                        value="jdbc:mysql://localhost:3306/moodle" />
>                <property name="username" value="root" />
>                <property name="password" value="" />
>        </bean>
>        ...
>
>
> Questions:
>
> 1) how can load properly mysql jar in smx?
>
> I have the error
>
> s...@root:/> osgi/start 292
> ERROR CommandLineExecutionFailed:
> org.apache.geronimo.gshell.command.CommandException:
> org.osgi.framework.BundleException: Unresolved constraint in bundle 292:
> package; (package=com.mysql.jdbc)
>
> In a camel tutorial I found
>
>    <feature name="jdbc-driver">
>        ...
>
> <bundle>mvn:com.mysql.jdbc/com.springsource.com.mysql.jdbc/5.1.6</bundle>
>    </feature>
>
> but osgi/install  wrap
> mvn:com.mysql.jdbc/com.springsource.com.mysql.jdbc/5.1.6 doesn't work
>
>
> 2) the file beans.xml generated by maven archetype is quite different from
> the one of cxf-wsdl-first. where/how can I add the "property datasource" ?
>
> I see
>
>        <jaxws:endpoint id="HTTPEndpoint"
>            implementor="org.apache.servicemix.samples.wsdl_first.PersonImpl"
>            address="/PersonService"
>            wsdlLocation="wsdl/person.wsdl"
>            endpointName="e:soap"
>            serviceName="s:PersonService"
>            xmlns:e="http://servicemix.apache.org/samples/wsdl-first";
>        xmlns:s="http://servicemix.apache.org/samples/wsdl-first"/>
>
> Thanks in advance
> Matteo
> --
> View this message in context: 
> http://www.nabble.com/sample-cxf-wsdl-first-jdbc-as-OSGI-package-tp23820077p23820077.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>

Reply via email to