Great finally you append another testcase which I can reproduce the
error, but I can never see any problems with the one you appended
with
SMX4-1003, I think the difference is that the testcase appended with
SMX4-1003 use blueprint configuration to publish endpoint but your
new
testcase use spring-dm to publish endpoint. That's a big advantage
that blueprint have, it's more suitable for async container which is
the basic nature for OSGi,
Anyway, the problem you encountered here is a timing issue which is
caused by bundle start sequence, the root cause isn't that you're
offline, the router cause is that when your customer bundle started,
the cxf-bundle which contain local jaxrs.xsd not fully started yet,
that's why your customer bundle can't use the local jaxrs.xsd from
cxf-
bundle, and hence you saw such error.
You have two options to work around this issue,
Option 1. a lit bit complex but reliable one
In your customer bundle(test-spring-cxf-rs) configuration you can
import an OSGi service which is exported by cxf-bundle, you can use
ls cxf-bundle-id
from console to see what OSGi services cxf-bundle exported(it
export a
bunch actually), and from your customer bundle just hold anyone
reference, although you don't need use that service. This just
ensure
that your customer bundle can get started after cxf-bundle fully
started.
Option2. simple one
Assume you are use using SMX 4.4.0, then edit
./system/org/apache/cxf/karaf/apache-cxf/2.4.4/apache-cxf-2.4.4-
features.xml
change
<bundle>mvn:org.apache.cxf/cxf-bundle/2.4.4</bundle>
to
<bundle start-level='45'>mvn:org.apache.cxf/cxf-bundle/2.4.4</bundle>
This can make cxf-bundle get started earlier than your customer
bundle, that can resolve the problem you encounter here in most
cases,
however, IIRC, due to the async nature of OSGi, it can't guarantee
that cxf-bundle fully started(all start process is done) before your
customer bundle begin to start, so you MAY still see the problem.
AFAIK, the only reliable way to specify the start sequence is
Option 1
I mentioned here, just hold OSGi reference from another bundle can
ensure it.
But option2 works in most cases, I use this way and restart dozens of
time in offline mode, and it always works. It MIGHT be an issue why
you have a very powerful machine which have multiple cpus which can
most take advantage of OSGi async nature, but it works in most cases.
Hope this helps.
Freeman
On 2011-12-18, at 下午6:05, Ge@@ru wrote:
Same issue on smx-4.4.0 with only one different:
- after first restart bundle doesn't work with same error on smx log
as
describe on my previous mail (after second restart).
Bye
---------------------------------------------
Freeman Fang
FuseSource
Email:[email protected]
Web: fusesource.com
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com