Exception: ...required property 'bundleContext' has not been set [message #654595] |
Wed, 16 February 2011 12:54 |
Ivana Missing name Messages: 14 Registered: December 2010 |
Junior Member |
|
|
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 329 times)
|
|
|
|
|
|
|
Re: Exception: ...required property 'bundleContext' has not been set [message #655968 is a reply to message #655692] |
Wed, 23 February 2011 15:20 |
|
Hi,
I've tried downloading the zip twice and it keeps unzipping to 'test1.zip.cpgz' which I can't do anything with. Will take a copy from Glyn tomorrow if he still has one.
You are indeed right about the extender racing Virgo. You must keep all osgi context files in the META-INF/spring folder otherwise there are problems with both the spring-dm extender trying to create an application context and Gemini Web trying to configure the servlet container at the same time. (META-INF may suffice but I can't quite remember.)
Chris
------------------------------------------------
Chris Frost, Twitter @cgfrost
Springsource, a divison of VMware.
|
|
|
|
Re: Exception: ...required property 'bundleContext' has not been set [message #656431 is a reply to message #656169] |
Fri, 25 February 2011 15:42 |
|
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.
------------------------------------------------
Chris Frost, Twitter @cgfrost
Springsource, a divison of VMware.
|
|
|
Re: Exception: ...required property 'bundleContext' has not been set [message #656757 is a reply to message #656431] |
Mon, 28 February 2011 13:03 |
Ivana Missing name Messages: 14 Registered: December 2010 |
Junior Member |
|
|
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 308 times)
|
|
|
|
|
|
Re: Exception: ...required property 'bundleContext' has not been set [message #657030 is a reply to message #656808] |
Tue, 01 March 2011 12:00 |
|
Hi,
I've had a go at deploying your bundles and this is where I got to.
Your using 3.0.2 of the springframework, just as it's quicker for me I changed your manifests to 3.0.0 rather than putting 3.0.2 in my Virgo install. I see no reason for this to be causing you problems. The services bundle now deployed with no problems.
In the web bundle I had to move the 'webHibernate' package to a new directory in WEB-INF called classes. This is the normal place for class files in War files and it hasn't changed for OSGi. The manifest couldn't find the activator otherwise. The bundle now gets further but the Activator fails during startup with a class not found. You are being correctly wired to a bundle provinding the 'org.apache.log4j' package but it dosn't provide the 'PropertyConfigurator' class which your activator needs. I would need to do further work to find out how this works but I thought I'd made some progress at least and you might just know how to fix this last problem.
The bundles I changed are attached for you to have a look at. Let me know if this helps.
Chris.
-
Attachment: bundles.zip
(Size: 8.14KB, Downloaded 527 times)
------------------------------------------------
Chris Frost, Twitter @cgfrost
Springsource, a divison of VMware.
|
|
|
Powered by
FUDForum. Page generated in 0.02878 seconds