Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Virgo Web Bundle Help(Configuring a Web Bundle with Spring and without Maven)
Virgo Web Bundle Help [message #989800] Fri, 07 December 2012 21:22 Go to next message
Daniel Dutrow is currently offline Daniel DutrowFriend
Messages: 1
Registered: December 2012
Junior Member
Starting with a novice understanding of OSGi and Spring, I am attempting to configure and build a Virgo Web Bundle using only Virgo Tooling. I didn't want to get into Maven and Felix quite yet, if possible.

I've created several bundles with the parent/api/core/web pattern. I think all of my bundling is done correctly. I am now trying to work on my Virgo Web Bundle using Spring MVC.

When I go to localhost:8080/tacdogs, my index.jsp loads just fine. However, when I try to access parts of my servlet that are defined through an annotated Spring controller, I run into problems. At one time, I was getting stack-traces with ClassNotFoundExceptions, but adding them to my MANIFEST.MF seems to resolve those issues. Now I'm getting more puzzling issues I can't seem to resolve since everything seems to be configured as shown in Virgo documentation and Greenpages. Can you take a look at my source code and log files to see if anything jumps out at you?

Thanks much,
Dan

--More Detail--

I am attempting to run a servlet at localhost:8080/tacdogs/svc/web and getting:
An HTTP 404: description The requested resource () is not available.
And also debug messages that says it cannot resolve my URL mapping.
[2012-12-07 15:55:20.759] DEBUG http-apr-8080-exec-3 org.springframework.web.servlet.DispatcherServlet DispatcherServlet with name 'tacdogs' processing GET request for [/tacdogs/svc/web]
[2012-12-07 15:55:20.774] WARN http-apr-8080-exec-3 org.springframework.web.servlet.PageNotFound No mapping found for HTTP request with URI [/tacdogs/svc/web] in DispatcherServlet with name 'tacdogs'
[2012-12-07 15:55:20.774] DEBUG http-apr-8080-exec-3 org.springframework.web.servlet.DispatcherServlet Successfully completed request
[2012-12-07 15:55:20.774] DEBUG http-apr-8080-exec-3 o.s.beans.factory.support.DefaultListableBeanFactory Returning cached instance of singleton bean 'org.eclipse.virgo.server.applicationContextShutdownBean'

Web.xml defines
A welcome page (which works with no problems)
A servlet named tacdogs using org.springframework.web.servlet.DispatcherServlet
A servlet mapping with the url-pattern /svc/*
org.eclipse.virgo.web.dm.ServerOsgiBundleXmlWebApplicationContext
org.springframework.web.context.ContextLoaderListener

tacdogs-servlet.xml defines
<mvc:annotation-driven /> which is the new way Virgo does it
<context:component-scan base-package="edu.jhuapl.tacdogs.web" /> which scans for my beans, Spring is finding them and putting them in my list of Spring Elements
The view resolver, below, although this represents an attempt to fix the problem which existed beforehand:
<bean id="viewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver">
<property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>
<property name="prefix" value="/WEB-INF/jsp/"/>
<property name="suffix" value=".jsp"/>
</bean>

applicationContext.xml defines
reference to edu.jhuapl.tacdogs.api TacdogsPersistence, although this is not referenced anywhere else yet. I figured doing the dependency injection stuff would be a later step.

META-INF/MANIFEST.MF contains all of my dependencies

TacdogsWebController.java defines
@Controller
@RequestMapping("/web")
public class TacdogsWebController {

/*
@Autowired
TacdogsPersistence data;
*/

// Return a string that says hello
@RequestMapping(method = RequestMethod.GET)
@ResponseBody
public String get() {
return "hello";
}

// Return a page called hello.jsp within WEB-INF/jsp/, configured by tacdogs-servlet.xml
@RequestMapping("/hello")
public String hello() {
return "hello";
}


[Updated on: Sun, 09 December 2012 16:37]

Report message to a moderator

Re: Virgo Web Bundle Help [message #991317 is a reply to message #989800] Tue, 18 December 2012 14:12 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
All I can suggest is to pare your application down to something absolutely minimal which still doesn't work. Often people find their problems that way.
Re: Virgo Web Bundle Help [message #991319 is a reply to message #989800] Tue, 18 December 2012 14:15 Go to previous message
Seth Helstrip is currently offline Seth HelstripFriend
Messages: 22
Registered: September 2012
Junior Member
I second that - when I started using OSGi, I jumped in at the deep end, expecting to sink, then float shortly afterward - however this is a completely different beast, and has to be handled carefully, at least at the beginning. Start with something minimal, then build it up.
Previous Topic:3.6.0.RC1 available
Next Topic:Creation of logback LoggerContext within library fails
Goto Forum:
  


Current Time: Fri Apr 19 06:10:26 GMT 2024

Powered by FUDForum. Page generated in 0.02348 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top