cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <dk...@apache.org>
Subject Re: About dcxf multi-bundle distro launching
Date Wed, 02 Jan 2013 19:18:42 GMT

On Dec 31, 2012, at 5:22 AM, Christian Schneider <chris@die-schneider.net> wrote:

> I was able to start the cxf dosgi multi bundle distro by using the
> settings from karaf.
> I copied the jre.properties into the config.properties. The resulting
> config looks like this. https://gist.github.com/4418746
> 
> The problem is that this is a lot of configuration. So I am pretty sure
> most of it is unnecessary and it is also hard to maintain when cxf
> changes. So the question is how far can we slim this down?
> Is the stream package the only one we need to modify?
> Can we define the settings for the stream packages without enumerating
> the rest of the packages to export?
> 
> Tang already asked about the package from servicemix stax api. I am also
> unsure about it. Do we need the stax package from servicemix or is the
> jre one ok for us? If we do not need the package from servicemix we
> could simply
> not load the stax api jar.

Kind of "depends".   If you don't use the servicemix stax-api and use the in-jdk version,
you end up with non-OSGi aware factories and thus would only get the StAX impl built into
the JDK.   From CXF's standpoint, that is "ok", but not ideal.   Woodstox is a much faster
stax processor and we'd definitely prefer grabbing it if possible.     Likewise for all the
other "*-api" bundles.   Also, since you are using in-jdk versions, your app behavior will
become more JDK dependent.   If you update from one version of the JDK to another, or move
from one OS to another, or from Oracle JDK to IBM or similar, your entire app behavior could
change.    That's why with the CXF+Karaf setups we do, we strongly recommend not exporting
those packages from the system and instead use the bundles. (or with Karaf 2.3.x, we endorse
osgi aware versions in lib/endorsed)

Dan



> 
> Christian
> 
> On 26.12.2012 04:14, Tang Yong wrote:
>> Deeply,
>> 
>> Firstly, "Import-Package" section of cxf-api-2.7.1.jar's MANIFEST.MF
>> needs to be modified in order to use javax.xml.stream package from
>> org.apache.servicemix.specs.stax-api-1.0-2.1.0.jar rather than system
>> package,
>> 
>> [Before modification]
>> Import-Package: ...,javax.xml.stream;version="[0.0,2)",...
>> 
>> [After modification]
>> Import-Package: ...,javax.xml.stream;version="[1.0.1,2)",...
>> 
>> Secondly, once finishing the above modification and re-launching felix
>> 4.0.3, another similar error happened:
>> 
>> ERROR: Bundle org.apache.cxf.cxf-api [53] Error starting
>> file:/E:/gfv4/apachedcxf/distribution/multi-bundle/target/cxf-dosgi-ri-multibundle-distribution-1.4-SNAPSHOT-dir/apache-cxf-dosgi-ri-1.4-SNAPSHOT/dosgi_bundles/cxf-api-2.7.1.jar
>> (org.osgi.framework.BundleException: Uses constraint violation. Unable
>> to resolve bundle revision org.apache.cxf.cxf-api [53.0] because it is
>> exposed to package 'javax.xml.stream' from bundle revisions
>> org.apache.servicemix.specs.stax-api-1.0 [22.0] and
>> org.apache.felix.framework [0] via two dependency chains.
>> 
>> Chain 1:
>>  org.apache.cxf.cxf-api [53.0]
>>    import:
>> (&(osgi.wiring.package=javax.xml.stream)(version>=1.0.1)(!(version>=2.0.0)))
>>     |
>>    export: osgi.wiring.package=javax.xml.stream
>>  org.apache.servicemix.specs.stax-api-1.0 [22.0]
>> 
>> Chain 2:
>>  org.apache.cxf.cxf-api [53.0]
>>    import: (osgi.wiring.package=javax.xml.transform.stax)
>>     |
>>    export: osgi.wiring.package=javax.xml.transform.stax;
>> uses:=javax.xml.stream
>>    export: osgi.wiring.package=javax.xml.stream
>>  org.apache.felix.framework [0])
>> 
>> For such a problem, I made a *temp* confirmation/fixing: modify
>> felix.jar/default.properties
>> 
>> 
> 

-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com


Mime
View raw message