Look at:
[1] http://fusesource.com/docs/esb/4.1/migration/ESBMigrationFSF.html 
[2]
http://fusesource.com/docs/framework/2.2/deploy_guide/DeployJavaOSGiSamp
le.html

[1] migrates a CXF example from JBI to OSGi and [2] is a basic
discussion of what needs to be done to migrate a plain CXF sample to
OSGi (SMX4).

-----Original Message-----
From: Freeman Fang [mailto:freeman.f...@gmail.com] 
Sent: Tuesday, June 02, 2009 3:07 AM
To: users@servicemix.apache.org
Subject: Re: sample cxf-wsdl-first-jdbc as OSGI package

Hi,
Somehow I can't extract the test-wsdl-first-osgi.tgz you append on my
linux box.
I guess you are using Mac, right? Would you please append your testcase
as zip file?
Freeman

Matteo Redaelli wrote:
> 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+b
>> undle+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-data
>>> base-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-repos
>>> itory/
>>>
>>> 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
>>
>>
>>
>>     
>
>   


--
Freeman Fang
------------------------
Open Source SOA: http://fusesource.com

Reply via email to