|
|
|
|
|
| Re: Can Spring be used in host and in snaps? [message #998805 is a reply to message #998785] |
Thu, 10 January 2013 13:11   |
Chris Frost Messages: 222 Registered: January 2010 Location: Southampton, England |
Senior Member |

|
|
I can't build it as I'm missing the parent POM. I have spotted a few things just having a look around.
* I don't know what the 'Webapp-Context: objectverse' manifest entry is for, should be harmless though.
* The host bundle is giving the 'Bundle-Classpath' twice with different values, no way of knowing which one it will actually use.
The host looks to be well setup but the snap has nothing in the web.xml, it's all commented out. I don't know how you expect it to find any of the ***-context.xml files in the snap. I think (if my memory is working) that Blueprint won't look for Spring contexts in the WEB-INF folder and Tomcat won't look for anything as the web.xml is empty. Spring context files should go under META-INF. This may seem annoying but we have to make sure that Blueprint and the Servlet container don't try and read the same context files as you get duplicates/races etc... and it just won't work.
I've also hunted the NPE down, this is a bug on our part but it isn't clear what is causing it. I have raised a bug that you might like to follow,
https://bugs.eclipse.org/bugs/show_bug.cgi?id=397902
Sorry I haven't got a straight fix for you.
Chris.
------------------------------------------------
Chris Frost, Twitter @cgfrost
Springsource, a divison of VMware.
[Updated on: Thu, 10 January 2013 13:12] Report message to a moderator
|
|
|
|
| Re: Can Spring be used in host and in snaps? [message #999069 is a reply to message #998816] |
Fri, 11 January 2013 04:18   |
Bojan Kraut Messages: 22 Registered: July 2009 Location: Maribor |
Junior Member |

|
|
Hi,
Thank you for all your time. I created now a test application, where both host and snaps are working in Spring.
However both also declare Spring configuration. This way Dispatcher Servlet must be defined in all the modules and also the configuration must be specified for each module separately. This is impossible when having lot of modules as I stated in my previous answer.
Is it possible to use shared configuration on modules? And that modules possibly extend the host configuration?
[Updated on: Fri, 11 January 2013 04:19] Report message to a moderator
|
|
|
| Re: Can Spring be used in host and in snaps? [message #999093 is a reply to message #999069] |
Fri, 11 January 2013 05:26  |
Chris Frost Messages: 222 Registered: January 2010 Location: Southampton, England |
Senior Member |

|
|
Hi,
I'm glad you have it working. I have looked again at the docs and Snaps code. To clarify:
The host and all its snaps require all their own setup, it is wrong to force the setup of the host on to the snaps. The servlet contexts of the host and all the snaps are merged but that is a bit of a simplification. Each snap and the host are separate stand-alone web bundles but Snaps hooks in to the servlet contexts of all the snaps to allow resource lookups to propagate up to the host and to dispatch requests against the combined application to the appropriate snap via the host filter. So a snap will 'see' all the resources in the host such as files, tlds etc... but will not inherit any configuration of the servlet context.
So it will not do exactly what you are looking sure but having discussed it I'm not sure how that would even work. I hope this clears things up, I have made a note to improve the Snaps documentation.
Chris.
------------------------------------------------
Chris Frost, Twitter @cgfrost
Springsource, a divison of VMware.
|
|
|
Powered by
FUDForum. Page generated in 0.02406 seconds