Exception: ...required property 'bundleContext' has not been set [message #654595] |
Wed, 16 February 2011 07:54  |
Eclipse User |
|
|
|
Hi all,
I am using the same projects, sometimes there isn't problem, sometimes there is.
I am using virgo 2.1.0 with spring-osgi-* 1.2.1, gemini.web* 1.1.0, gemini.blueprint.* 1.0.0.M1.., spring 3.0.5.release..
In attached logs differents are started at line 65(no exception) , 61(exception)
Thanks in advance,
Iv
Attachment: log.zip
(Size: 7.75KB, Downloaded 344 times)
|
|
|
|
|
|
|
|
|
Re: Exception: ...required property 'bundleContext' has not been set [message #656431 is a reply to message #656169] |
Fri, 25 February 2011 10:42   |
Eclipse User |
|
|
|
Hi,
I've been having a look through it all and I think we are on the right track. In your web.xml why have you specified the contextClass twice, both globally and specifically for the dispatcher servlet. You should only need it globally.
Also, what are you using to build this, could you attach a built bundle, I want to have a look inside it. I've often had problems where the source is fine but my build is putting things in the wrong place (or not at all).
Although we aren't there yet, I think you will also need to move the osgi:reference line into the applicationContext.xml file. I'm not sure but I think the 'ServerOsgiBundleXmlWebApplicationContext' will only be able to wire OSGi services in as beans to the application context but not individual servlet contexts.
Finally, it wouldn't hurt to tidy up the namespace declarations. If you move the osgi reference as I say then you should only need the following for the applicationContext.xml.
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:osgi="http://www.springframework.org/schema/osgi"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
and then for springmvc-servlet.xml
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
I've mainly made this suggestion as I've never used the JEE namespace before and I don't know what effect it will have. Also, if I'm right the servlet context won't know what to do with the osgi namespace.
If you attach the built bundles I'll have a look at those and in the mean time you can try out some of my suggestions above.
Thanks for looking at Virgo,
Chris.
|
|
|
Re: Exception: ...required property 'bundleContext' has not been set [message #656757 is a reply to message #656431] |
Mon, 28 February 2011 08:03   |
Eclipse User |
|
|
|
I will test what you said.
I said "sometimes this works", that is what I don't understand. Sometimes when I start osgi, and call http://localhost:8080/peradetlic/hello_world.ivana, I will see in explorer window message from bundle service1. I wouldn't see that if controller wasn't be able to see service/bean from service1 bundle, right? That scanning, catching service was putted in springmvc-servlet.xml.
Sometimes there was exception not recognizing osgi namespace in springmvc-servlet.xml, you was right about that, but sometimes it works fine. Why?.. That is question.. That is maybe question for gemini team?
About build bundles, for these test-projects I just export project as plugin. In application which is more serious we use maven plugins for bundling our projects.
Thank you for time and patience, I will try what you said, and I hope that problem will be solved.
Ivana
Attachment: test3.rar
(Size: 20.76KB, Downloaded 317 times)
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.57914 seconds