You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by olamalam <il...@aspone.co.uk> on 2010/04/14 17:51:18 UTC

CXF DOSGI problem while running Spring DM demo

Hi to all,

I'm trying to run Spring DM demo.
I've installed necessary bundles for dosgi and created a bundle
(springdmdemo) with Pax and installed on karaf 1.4 : 
[79] [Active] [] [          ] [60] Distributed OSGi Distribution Software
Single-Bundle Distribution (1.1)
[80] [Active] [] [          ] [60] osgi.cmpn (4.2.0.200908310645)
[81] [Active] [] [Started] [60] [springdmdemo] (0.1)

Even if springdmdemo bundle seems active I get this error just after
installing it:
*ERROR* Cannot use Factory configuration for org.apache.felix.fileinstall
requested by bundle
mvn:org.apache.cxf.dosgi/cxf-dosgi-ri-singlebundle-distribution/1.1 but
belongs to mvn:org.apache.felix/org.apache.felix.fileinstall/2.0.8
...
Exception in thread "SpringOsgiExtenderThread-2"
java.lang.IllegalStateException: BeanFactory not initialized or already
closed - call 'refresh' before accessing beans via the ApplicationContext

And I couldn't get any response when I hit:
http://localhost:9000/com/aspone/trh/springdmdemo/ExampleService?wsdl

My spring xml file is:
...
<osgi:service interface="com.aspone.trh.springdmdemo.ExampleService">
	<osgi:service-properties>
		<entry key="osgi.remote.interfaces" value="*" />
	</osgi:service-properties>
	<bean class="com.aspone.trh.springdmdemo.internal.ExampleServiceImpl" />
</osgi:service>
...

Does anyone have any idea about what I'm doing wrong?

Thanks in advance
Ilker 
-- 
View this message in context: http://old.nabble.com/CXF-DOSGI-problem-while-running-Spring-DM-demo-tp28244542p28244542.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: CXF DOSGI problem while running Spring DM demo

Posted by olamalam <il...@aspone.co.uk>.
And when I try to run spring dm demo with single-bundle dist. I saw these
lines on the karaf log:
  
Application context successfully refreshed
(OsgiBundleXmlApplicationContext(bundle=com.aspone.trh.springdm-demo,
config=osgibundle:/META-INF/spring/*.xml)) 
Defaulting to pojo configuration type 
Using a default address :
http://localhost:9000/com/aspone/trh/springdmdemo/ExampleService
Creating a com.aspone.trh.springdmdemo.ExampleService endpoint from CXF
PublishHook, address is
http://localhost:9000/com/aspone/trh/springdmdemo/ExampleService
Could not find intent map file /OSGI-INF/cxf/intents/intent-map.xml 
Injected intents: {}

When I hit
http://localhost:9000/com/aspone/trh/springdmdemo/ExampleService?wsdl
I get http 404 error. 
Probably the problem is about "Could not find intent map file
/OSGI-INF/cxf/intents/intent-map.xml"


olamalam wrote:
> 
> Hi David,
> 
> I tried to install multi-bundle distribution according to this url:
> http://cxf.apache.org/dosgi-multi-bundle-setup.html
> 
> I've appended those lines to etc\config.properties file like:
> ...
> felix.auto.start.51=file:C:/apache-cxf-dosgi-ri-1.1/dosgi_bundles/geronimo-annotation_1.0_spec-1.1.1.jar
> felix.auto.start.52=file:C:/apache-cxf-dosgi-ri-1.1/dosgi_bundles/geronimo-activation_1.1_spec-1.0.2.jar
> felix.auto.start.53=file:C:/apache-cxf-dosgi-ri-1.1/dosgi_bundles/geronimo-javamail_1.4_spec-1.2.jar
> ...
> 
> 
> But those bundles weren't installed at start up even if I tweak file paths
> to have correct cxf-dosgi installation path.
> 
> Do you have any idea what did I do wrong?
> 
> ps. I guess it also should have worked with single-bundle distribution.
> http://cxf.apache.org/dosgi-spring-dm-demo-page.html says that:
> It uses the CXF/DOSGi multi bundle distribution since that provides
> Spring-DM as a dependency.
> 
> I've already installed Spring-DM to karaf when I was trying to run this
> demo with single-bundle dist.
> 
> Kind regards
> Ilker
> 
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/CXF-DOSGI-problem-while-running-Spring-DM-demo-tp28244542p28256691.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: CXF DOSGI problem while running Spring DM demo

Posted by olamalam <il...@aspone.co.uk>.
Yes, I've already put that line. I've attached my config file. 

 org.xml.sax, \
 org.xml.sax.ext, \
 org.xml.sax.helpers

 
org.ops4j.pax.web.session.timeout=30
org.osgi.framework.startlevel.beginning=81
felix.auto.start.50=http://repo2.maven.org/maven2/org/osgi/org.osgi.compendium/4.1.0/org.osgi.compendium-4.1.0.jar
    
felix.auto.start.51=file:C:/apache-cxf-dosgi-ri-1.1/dosgi_bundles/geronimo-annotation_1.0_spec-1.1.1.jar
felix.auto.start.52=file:C:/apache-cxf-dosgi-ri-1.1/dosgi_bundles/geronimo-activation_1.1_spec-1.0.2.jar
felix.auto.start.53=file:C:/apache-cxf-dosgi-ri-1.1/dosgi_bundles/geronimo-javamail_1.4_spec-1.2.jar


Please note that I'm using karaf 1.4 and it's config file is under
apache-felix-karaf-1.4.0\etc\ folder.
This tutorial
http://cxf.apache.org/dosgi-multi-bundle-setup.html
is verified with Felix 1.8.0. May be I have to do stg else for karaf 1.4.

ps. I'm convinced that using multi-bundle distro is the better approach here
but I still think that it also should work with single-bundle, I couldn't
understand why it's not working with single-bundle.

Kind regards
Ilker
-- 
View this message in context: http://old.nabble.com/CXF-DOSGI-problem-while-running-Spring-DM-demo-tp28244542p28264362.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: CXF DOSGI problem while running Spring DM demo

Posted by David Bosschaert <da...@gmail.com>.
Hi Ilker,

Did you also put in the following line (which is also in the
felix.config.properties.append file):
  org.osgi.framework.startlevel.beginning=81
This is needed to automatically start bundles with felix.auto.start.XX
where XX can be up to 81 in this case.

BTW having two instances of Spring-DM active at the same time is a
recipe for disaster as they will potentially both instantiate your
Spring beans, so you'll get them twice. This is why the multibundle
distro is generally better to use than the singlebundle distro. The
singlebundle one is only really provided as a way get started
easily...

Hope this helps,

David

On 15 April 2010 14:23, olamalam <il...@aspone.co.uk> wrote:
>
> Hi David,
>
> I tried to install multi-bundle distribution according to this url:
> http://cxf.apache.org/dosgi-multi-bundle-setup.html
>
> I've appended those lines to etc\config.properties file like:
> ...
> felix.auto.start.51=file:C:/apache-cxf-dosgi-ri-1.1/dosgi_bundles/geronimo-annotation_1.0_spec-1.1.1.jar
> felix.auto.start.52=file:C:/apache-cxf-dosgi-ri-1.1/dosgi_bundles/geronimo-activation_1.1_spec-1.0.2.jar
> felix.auto.start.53=file:C:/apache-cxf-dosgi-ri-1.1/dosgi_bundles/geronimo-javamail_1.4_spec-1.2.jar
> ...
>
>
> But those bundles weren't installed at start up even if I tweak file paths
> to have correct cxf-dosgi installation path.
>
> Do you have any idea what did I do wrong?
>
> ps. I guess it also should have worked with single-bundle distribution.
> http://cxf.apache.org/dosgi-spring-dm-demo-page.html says that:
> It uses the CXF/DOSGi multi bundle distribution since that provides
> Spring-DM as a dependency.
>
> I've already installed Spring-DM to karaf when I was trying to run this demo
> with single-bundle dist.
>
> Kind regards
> Ilker
>
>
>
> --
> View this message in context: http://old.nabble.com/CXF-DOSGI-problem-while-running-Spring-DM-demo-tp28244542p28255215.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
>

Re: CXF DOSGI problem while running Spring DM demo

Posted by olamalam <il...@aspone.co.uk>.
Hi David,

I tried to install multi-bundle distribution according to this url:
http://cxf.apache.org/dosgi-multi-bundle-setup.html

I've appended those lines to etc\config.properties file like:
...
felix.auto.start.51=file:C:/apache-cxf-dosgi-ri-1.1/dosgi_bundles/geronimo-annotation_1.0_spec-1.1.1.jar
felix.auto.start.52=file:C:/apache-cxf-dosgi-ri-1.1/dosgi_bundles/geronimo-activation_1.1_spec-1.0.2.jar
felix.auto.start.53=file:C:/apache-cxf-dosgi-ri-1.1/dosgi_bundles/geronimo-javamail_1.4_spec-1.2.jar
...


But those bundles weren't installed at start up even if I tweak file paths
to have correct cxf-dosgi installation path.

Do you have any idea what did I do wrong?

ps. I guess it also should have worked with single-bundle distribution.
http://cxf.apache.org/dosgi-spring-dm-demo-page.html says that:
It uses the CXF/DOSGi multi bundle distribution since that provides
Spring-DM as a dependency.

I've already installed Spring-DM to karaf when I was trying to run this demo
with single-bundle dist.

Kind regards
Ilker



-- 
View this message in context: http://old.nabble.com/CXF-DOSGI-problem-while-running-Spring-DM-demo-tp28244542p28255215.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: CXF DOSGI problem while running Spring DM demo

Posted by David Bosschaert <da...@gmail.com>.
Hi Ilker,

This is because you haven't installed all of the dependencies.
If you look at the multibundle distro, it comes with a bunch of
dependencies, which need to be installed as well. Have a look at the
conf/felix.config.properties.append file. You can append that to your
conf/config.properties file in Felix to have it automatically load all
the required bundles (BTW the .append file will most likely need a
little tweaking to have it contain the right paths for your DOSGi
installation).
The order of the dependencies is (unfortunately) important, but simply
appending this file should take care of that nicely.

You should also be able to create a Karaf feature xml file from the
information in the felix.config.properties.append. Or alternatively,
you can refer to all the jar file using mvn: URLs (actually, it would
be nice to extend the DOSGi release to provide a Karaf feature as
well...)

Hope this helps,

David

On 15 April 2010 10:20, olamalam <il...@aspone.co.uk> wrote:
>
> Hi David,
>
> Yes, you are right. I missed that point.
> Now I'm trying to install multi-bundle distro to karaf but I also have some
> problems about that.
>
> I found dependencies from:
> http://cxf.apache.org/dosgi-releases.html
> and run these commands
> osgi:install -s mvn:org.apache.cxf/cxf-bundle-minimal/2.2.5
> osgi:install -s mvn:org.apache.cxf.dosgi/cxf-dosgi-ri-discovery-local/1.1
> osgi:install -s mvn:org.apache.cxf.dosgi/cxf-dosgi-ri-dsw-cxf/1.1
> but cxf-bundle-minimal isn't installed because of:
> Unresolved constraint in bundle org.apache.cxf.bundle-minimal:package;
> (package=javax.wsdl.extensions.http)
>
> I think I'm running wrong commands. I guess I should install CXF-DOSGi with
> features:install command but I couldn't find the necessary url that includes
> it.
>
> How can I install it?
>
> Thanks
> Ilker
>
>
> David Bosschaert wrote:
>>
>> Hi Ilker,
>>
>> Have a look at the CXF-DOSGi Spring-DM demo documentation:
>> http://cxf.apache.org/dosgi-spring-dm-demo-page.html
>> I see that you're using the single bundle distro, but when using
>> Spring you should really use the multi-bundle distro as CXF-DOSGi
>> itself also uses spring internally, but it doesn't expose the spring
>> packages. Using the multi bundle distro you will use the original
>> spring bundles and it should all work fine... It's also what's used in
>> the page above...
>>
>> Hope this helps,
>>
>> David
>>
>> On 14 April 2010 16:51, olamalam <il...@aspone.co.uk> wrote:
>>>
>>> Hi to all,
>>>
>>> I'm trying to run Spring DM demo.
>>> I've installed necessary bundles for dosgi and created a bundle
>>> (springdmdemo) with Pax and installed on karaf 1.4 :
>>> [79] [Active] [] [          ] [60] Distributed OSGi Distribution Software
>>> Single-Bundle Distribution (1.1)
>>> [80] [Active] [] [          ] [60] osgi.cmpn (4.2.0.200908310645)
>>> [81] [Active] [] [Started] [60] [springdmdemo] (0.1)
>>>
>>> Even if springdmdemo bundle seems active I get this error just after
>>> installing it:
>>> *ERROR* Cannot use Factory configuration for org.apache.felix.fileinstall
>>> requested by bundle
>>> mvn:org.apache.cxf.dosgi/cxf-dosgi-ri-singlebundle-distribution/1.1 but
>>> belongs to mvn:org.apache.felix/org.apache.felix.fileinstall/2.0.8
>>> ...
>>> Exception in thread "SpringOsgiExtenderThread-2"
>>> java.lang.IllegalStateException: BeanFactory not initialized or already
>>> closed - call 'refresh' before accessing beans via the ApplicationContext
>>>
>>> And I couldn't get any response when I hit:
>>> http://localhost:9000/com/aspone/trh/springdmdemo/ExampleService?wsdl
>>>
>>> My spring xml file is:
>>> ...
>>> <osgi:service interface="com.aspone.trh.springdmdemo.ExampleService">
>>>        <osgi:service-properties>
>>>                <entry key="osgi.remote.interfaces" value="*" />
>>>        </osgi:service-properties>
>>>        <bean
>>> class="com.aspone.trh.springdmdemo.internal.ExampleServiceImpl" />
>>> </osgi:service>
>>> ...
>>>
>>> Does anyone have any idea about what I'm doing wrong?
>>>
>>> Thanks in advance
>>> Ilker
>>> --
>>> View this message in context:
>>> http://old.nabble.com/CXF-DOSGI-problem-while-running-Spring-DM-demo-tp28244542p28244542.html
>>> Sent from the cxf-user mailing list archive at Nabble.com.
>>>
>>>
>>
>>
>
> --
> View this message in context: http://old.nabble.com/CXF-DOSGI-problem-while-running-Spring-DM-demo-tp28244542p28253051.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
>

Re: CXF DOSGI problem while running Spring DM demo

Posted by olamalam <il...@aspone.co.uk>.
Hi David,

Yes, you are right. I missed that point. 
Now I'm trying to install multi-bundle distro to karaf but I also have some
problems about that.

I found dependencies from:
http://cxf.apache.org/dosgi-releases.html
and run these commands 
osgi:install -s mvn:org.apache.cxf/cxf-bundle-minimal/2.2.5
osgi:install -s mvn:org.apache.cxf.dosgi/cxf-dosgi-ri-discovery-local/1.1
osgi:install -s mvn:org.apache.cxf.dosgi/cxf-dosgi-ri-dsw-cxf/1.1
but cxf-bundle-minimal isn't installed because of:
Unresolved constraint in bundle org.apache.cxf.bundle-minimal:package;
(package=javax.wsdl.extensions.http)

I think I'm running wrong commands. I guess I should install CXF-DOSGi with 
features:install command but I couldn't find the necessary url that includes
it.

How can I install it?

Thanks
Ilker


David Bosschaert wrote:
> 
> Hi Ilker,
> 
> Have a look at the CXF-DOSGi Spring-DM demo documentation:
> http://cxf.apache.org/dosgi-spring-dm-demo-page.html
> I see that you're using the single bundle distro, but when using
> Spring you should really use the multi-bundle distro as CXF-DOSGi
> itself also uses spring internally, but it doesn't expose the spring
> packages. Using the multi bundle distro you will use the original
> spring bundles and it should all work fine... It's also what's used in
> the page above...
> 
> Hope this helps,
> 
> David
> 
> On 14 April 2010 16:51, olamalam <il...@aspone.co.uk> wrote:
>>
>> Hi to all,
>>
>> I'm trying to run Spring DM demo.
>> I've installed necessary bundles for dosgi and created a bundle
>> (springdmdemo) with Pax and installed on karaf 1.4 :
>> [79] [Active] [] [          ] [60] Distributed OSGi Distribution Software
>> Single-Bundle Distribution (1.1)
>> [80] [Active] [] [          ] [60] osgi.cmpn (4.2.0.200908310645)
>> [81] [Active] [] [Started] [60] [springdmdemo] (0.1)
>>
>> Even if springdmdemo bundle seems active I get this error just after
>> installing it:
>> *ERROR* Cannot use Factory configuration for org.apache.felix.fileinstall
>> requested by bundle
>> mvn:org.apache.cxf.dosgi/cxf-dosgi-ri-singlebundle-distribution/1.1 but
>> belongs to mvn:org.apache.felix/org.apache.felix.fileinstall/2.0.8
>> ...
>> Exception in thread "SpringOsgiExtenderThread-2"
>> java.lang.IllegalStateException: BeanFactory not initialized or already
>> closed - call 'refresh' before accessing beans via the ApplicationContext
>>
>> And I couldn't get any response when I hit:
>> http://localhost:9000/com/aspone/trh/springdmdemo/ExampleService?wsdl
>>
>> My spring xml file is:
>> ...
>> <osgi:service interface="com.aspone.trh.springdmdemo.ExampleService">
>>        <osgi:service-properties>
>>                <entry key="osgi.remote.interfaces" value="*" />
>>        </osgi:service-properties>
>>        <bean
>> class="com.aspone.trh.springdmdemo.internal.ExampleServiceImpl" />
>> </osgi:service>
>> ...
>>
>> Does anyone have any idea about what I'm doing wrong?
>>
>> Thanks in advance
>> Ilker
>> --
>> View this message in context:
>> http://old.nabble.com/CXF-DOSGI-problem-while-running-Spring-DM-demo-tp28244542p28244542.html
>> Sent from the cxf-user mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: http://old.nabble.com/CXF-DOSGI-problem-while-running-Spring-DM-demo-tp28244542p28253051.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: CXF DOSGI problem while running Spring DM demo

Posted by David Bosschaert <da...@gmail.com>.
Hi Ilker,

Have a look at the CXF-DOSGi Spring-DM demo documentation:
http://cxf.apache.org/dosgi-spring-dm-demo-page.html
I see that you're using the single bundle distro, but when using
Spring you should really use the multi-bundle distro as CXF-DOSGi
itself also uses spring internally, but it doesn't expose the spring
packages. Using the multi bundle distro you will use the original
spring bundles and it should all work fine... It's also what's used in
the page above...

Hope this helps,

David

On 14 April 2010 16:51, olamalam <il...@aspone.co.uk> wrote:
>
> Hi to all,
>
> I'm trying to run Spring DM demo.
> I've installed necessary bundles for dosgi and created a bundle
> (springdmdemo) with Pax and installed on karaf 1.4 :
> [79] [Active] [] [          ] [60] Distributed OSGi Distribution Software
> Single-Bundle Distribution (1.1)
> [80] [Active] [] [          ] [60] osgi.cmpn (4.2.0.200908310645)
> [81] [Active] [] [Started] [60] [springdmdemo] (0.1)
>
> Even if springdmdemo bundle seems active I get this error just after
> installing it:
> *ERROR* Cannot use Factory configuration for org.apache.felix.fileinstall
> requested by bundle
> mvn:org.apache.cxf.dosgi/cxf-dosgi-ri-singlebundle-distribution/1.1 but
> belongs to mvn:org.apache.felix/org.apache.felix.fileinstall/2.0.8
> ...
> Exception in thread "SpringOsgiExtenderThread-2"
> java.lang.IllegalStateException: BeanFactory not initialized or already
> closed - call 'refresh' before accessing beans via the ApplicationContext
>
> And I couldn't get any response when I hit:
> http://localhost:9000/com/aspone/trh/springdmdemo/ExampleService?wsdl
>
> My spring xml file is:
> ...
> <osgi:service interface="com.aspone.trh.springdmdemo.ExampleService">
>        <osgi:service-properties>
>                <entry key="osgi.remote.interfaces" value="*" />
>        </osgi:service-properties>
>        <bean class="com.aspone.trh.springdmdemo.internal.ExampleServiceImpl" />
> </osgi:service>
> ...
>
> Does anyone have any idea about what I'm doing wrong?
>
> Thanks in advance
> Ilker
> --
> View this message in context: http://old.nabble.com/CXF-DOSGI-problem-while-running-Spring-DM-demo-tp28244542p28244542.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
>