I use smx4.0. with a clean smx4.0

osgi/install wrap:mvn:mysql/mysql-connector-java/5.0.8
osgi/start 128

and it become active but not started.

[ 128] [Active     ] [       ] [   60]
wrap_mvn_mysql_mysql-connector-java_5.0.8 (0)

is it enough?

ps. Jbi packaging could be slow but at the moment it is easy how to add
dependences)


Freeman Fang wrote:
> 
> Hi Matteo,
> Which smx4 version are you using?
> I tried with both Apache Servicemix 4.0 release and FUSE ESB 4.1 release 
> with
> osgi/install wrap:mvn:mysql/mysql-connector-java/5.0.8
> But bundle status is
> [ 158] [Resolved   ] [       ] [   60] 
> wrap_mvn_mysql_mysql-connector-java_5.0.8 (0)
> which means it's not started, but from your mail, you mention your 
> bundle can start like
> [ 272] [Active ] [ ] [ 60] mvn:mysql/mysql-connector-java/5.0.8
> I'm wondering how it could be.
> You can use wrap your normal jar as osgi bundle, but you will have to 
> have all dependent packages available as bundles in the container 
> already, I don't think all mysql needed package already available as 
> bundles.
> Could you please tell me exactly your process?
> Freeman
> 
> Matteo Redaelli wrote:
>> I use linux debian. In any case. here is my project in zip file
>>
>> http://www.nabble.com/file/p23827756/test-wsdl-first-osgi.zip
>> test-wsdl-first-osgi.zip 
>>
>> Regards
>> Matteo
>>
>>
>>
>> Freeman Fang wrote:
>>   
>>> 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+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
>>>>>
>>>>>
>>>>>
>>>>>     
>>>>>         
>>>>   
>>>>       
>>> -- 
>>> Freeman Fang
>>> ------------------------
>>> Open Source SOA: http://fusesource.com
>>>
>>>
>>>
>>>     
>>
>>   
> 
> 
> -- 
> 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-tp23820077p23840708.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Reply via email to