Virgo Web Bundle Help [message #989800] |
Fri, 07 December 2012 21:22 |
Daniel Dutrow 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
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02348 seconds