Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Virgo Snaps question(virgo)
Virgo Snaps question [message #993284] Sun, 23 December 2012 19:36 Go to next message
Bojan Kraut is currently offline Bojan Kraut
Messages: 22
Registered: July 2009
Location: Maribor
Junior Member

I'm new to OSGI and Snaps. I tried to implement modular web application some time ago, but I wanted a core module (platform) and application modules. Our application uses ExtJS, Hibernate, Spring, Spring Security etc...

When I saw Snaps I thought that this is what I need. I successfully implemented a test case but finished with a host module which has web.xml and an application module which has web.xml.

My question is - can I use host module as module, where I have Spring modules, security, JAWR etc and my snaps just have module specific classes and css and javascript files? I don't want to configure each module almost as an independent application. Can I see anywhere an example how to do that?
If snap is not the solution then how can I achieve that?
Re: Virgo Snaps question [message #997192 is a reply to message #993284] Fri, 04 January 2013 06:31 Go to previous messageGo to next message
Chris Frost is currently offline Chris Frost
Messages: 230
Registered: January 2010
Location: Southampton, England
Senior Member

Hi,

A Snaps application has a single Servlet Context, the web.xml files are effectively merged in to a single application. Each Bundle/Snap will still have its own Bundle context though and Snaps manages the integration of all that.

I would expect your use case to be supported but I don't have any experience of what Spring is doing under the covers. I suspect this is where the problems are coming from. I would expect the host and every snap to have a web.xml but there shouldn't be any duplication between them.

If you are willing to submit your test case with a bug then we could have a look at what is going on.

Thanks, Chris.


------------------------------------------------
Chris Frost, Twitter @cgfrost
Springsource, a divison of VMware.
Re: Virgo Snaps question [message #997282 is a reply to message #997192] Fri, 04 January 2013 16:55 Go to previous messageGo to next message
Bojan Kraut is currently offline Bojan Kraut
Messages: 22
Registered: July 2009
Location: Maribor
Junior Member

Here I created complete eclipse workspace, with a test sample. I get this weird error:

java.lang.NullPointerException
	org.eclipse.virgo.snaps.core.internal.webapp.SnapServletContext.getResource(SnapServletContext.java:198)
	org.eclipse.virgo.snaps.core.internal.webapp.StaticResourceServlet.doGet(StaticResourceServlet.java:58)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:735)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
	org.eclipse.virgo.snaps.core.internal.webapp.container.ImmutableFilterChain.doFilter(ImmutableFilterChain.java:47)
	org.eclipse.virgo.snaps.core.internal.webapp.container.StandardVirtualContainerRequestDispatcher$1.doWithClassLoader(StandardVirtualContainerRequestDispatcher.java:104)
	org.eclipse.virgo.snaps.core.internal.webapp.container.StandardVirtualContainerRequestDispatcher$1.doWithClassLoader(StandardVirtualContainerRequestDispatcher.java:1)
	org.eclipse.virgo.snaps.core.internal.webapp.container.StandardVirtualContainerRequestDispatcher.doWithThreadContextClassLoader(StandardVirtualContainerRequestDispatcher.java:121)
	org.eclipse.virgo.snaps.core.internal.webapp.container.StandardVirtualContainerRequestDispatcher.service(StandardVirtualContainerRequestDispatcher.java:101)
	org.eclipse.virgo.snaps.core.internal.webapp.WebAppSnap.handleRequest(WebAppSnap.java:152)
	org.eclipse.virgo.snaps.core.RequestRouter.service(RequestRouter.java:51)
	org.eclipse.virgo.snaps.core.SnapHostFilter.doFilter(SnapHostFilter.java:62)


The project is organized as greenpages example, with a difference that I'm trying to use snaps to modularize my application horizontally not vertically as greenpages is.

I think that module should have all css, js, java contained.

In attached example core is a host and crm is a snap.
Re: Virgo Snaps question [message #997284 is a reply to message #997192] Fri, 04 January 2013 17:08 Go to previous messageGo to next message
Bojan Kraut is currently offline Bojan Kraut
Messages: 22
Registered: July 2009
Location: Maribor
Junior Member

I'm using Spring MVC project templates form my web application. One of those should be host and other snaps. I'm considering host as a platform and other - snaps are modules.

When doing this I get this weird error:

java.lang.NullPointerException
	org.eclipse.virgo.snaps.core.internal.webapp.SnapServletContext.getResource(SnapServletContext.java:198)
	org.eclipse.virgo.snaps.core.internal.webapp.StaticResourceServlet.doGet(StaticResourceServlet.java:58)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:735)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
	org.eclipse.virgo.snaps.core.internal.webapp.container.ImmutableFilterChain.doFilter(ImmutableFilterChain.java:47)
	org.eclipse.virgo.snaps.core.internal.webapp.container.StandardVirtualContainerRequestDispatcher$1.doWithClassLoader(StandardVirtualContainerRequestDispatcher.java:104)
	org.eclipse.virgo.snaps.core.internal.webapp.container.StandardVirtualContainerRequestDispatcher$1.doWithClassLoader(StandardVirtualContainerRequestDispatcher.java:1)
	org.eclipse.virgo.snaps.core.internal.webapp.container.StandardVirtualContainerRequestDispatcher.doWithThreadContextClassLoader(StandardVirtualContainerRequestDispatcher.java:121)
	org.eclipse.virgo.snaps.core.internal.webapp.container.StandardVirtualContainerRequestDispatcher.service(StandardVirtualContainerRequestDispatcher.java:101)
	org.eclipse.virgo.snaps.core.internal.webapp.WebAppSnap.handleRequest(WebAppSnap.java:152)
	org.eclipse.virgo.snaps.core.RequestRouter.service(RequestRouter.java:51)
	org.eclipse.virgo.snaps.core.SnapHostFilter.doFilter(SnapHostFilter.java:62)


My whole test project workspace is accessible on http://www.alcyone.si/fileadmin/download/osgi.7z as I can not post it as an attachment. It's 11 Mb big.
Re: Virgo Snaps question [message #998293 is a reply to message #997284] Wed, 09 January 2013 13:39 Go to previous messageGo to next message
Chris Frost is currently offline Chris Frost
Messages: 230
Registered: January 2010
Location: Southampton, England
Senior Member

Hi,

I see this is the same problem as in the other thread. I'm having trouble unzipping your sample application, what have you used to zip it up?

Chris.


------------------------------------------------
Chris Frost, Twitter @cgfrost
Springsource, a divison of VMware.
Re: Virgo Snaps question [message #998806 is a reply to message #998293] Thu, 10 January 2013 13:13 Go to previous message
Chris Frost is currently offline Chris Frost
Messages: 230
Registered: January 2010
Location: Southampton, England
Senior Member

This conversation is continuing in another thread for anyone that finds this in years to come.

http://www.eclipse.org/forums/index.php/t/446595/


------------------------------------------------
Chris Frost, Twitter @cgfrost
Springsource, a divison of VMware.
Previous Topic:SynchronousBundleListener
Next Topic:Bundle manifest problem since 3.6
Goto Forum:
  


Current Time: Sat Aug 30 06:39:36 EDT 2014

Powered by FUDForum. Page generated in 0.01831 seconds