Ciao

Thanks for you suggestions: I'll look deeply at the links you suggested

But in any case I'd like to know howto create a service with
servicemix-osgi-cxf-wsdl-first-archetype that can get/put data in a
database.

what is wrong/missing in my package/smx4?

Thanks in advance
Matteo


Freeman Fang wrote:
> 
> Hi,
> If you want to port cxf-wsdl-first(bc + se) example to osgi bundle in 
> smx4, then you shouldn't use servicemix-osgi-cxf-wsdl-first-archetype, 
> since this archetype generate cxf endpoint deployed in smx4 using osgi 
> http service transport directly, which means in this case there's no cxf 
> bc + se get involved at all, it's a cxf endpoint deployed in smx4  which 
> can talk directly to outside client.
> To port smx3 cxf-wsdl-first example to osgi bundle in smx4, what you 
> need do is change the JBI package style(SA+SU) to spring dm enabled osgi 
> bundle package style, Gert already add a wiki[1] to demostrate how to do 
> it with servicemix-bean endpoint, and I'm going to add an example for 
> cxf-wsdl-frist using spring dm osgi bundle package very soon, [2] track 
> this issue
> 
> [1]http://cwiki.apache.org/confluence/display/SMX4/Creating+an+OSGi+bundle+for+deploying+JBI+endpoints
> [2]https://issues.apache.org/activemq/browse/SMX4-292
> 
> Freeman
> 
> Matteo Redaelli wrote
>> 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
>>   
> 
> 
> -- 
> Freeman Fang
> ------------------------
> Open Source SOA: http://fusesource.com
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/sample-cxf-wsdl-first-jdbc-as-OSGI-package-tp23820077p23827321.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Reply via email to