Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Can't deploy simple WAR(Trying to deploy WAR to Virgo, won't start up)
Can't deploy simple WAR [message #669632] Wed, 11 May 2011 01:17 Go to next message
rshelley  is currently offline rshelley Friend
Messages: 59
Registered: April 2010
Member
It's taken some fighting with Eclipse, Maven and STS, but I finally have a WAR that Java, Eclipse, Maven and Virgo don't complain about. Unfortunately, I still can't seem to pull up a simple HTML file from it. Here's the run down of the app (I'll trying out the obvious bits):

WAR Structure:
http://screencast.com/t/r3iNxpLXCI

Virgo Bundle report (I have to obfuscate bits - call it "com.test.app"):
http://screencast.com/t/aVLZyugQ
http://screencast.com/t/6r21iCY2

When I go to http://localhost:8080/webshell/ I get nothing (I have an "index.htm" file in there, and I have it defined in the web.xml). When I try to go to the servlet, same thing.
http://screencast.com/t/i2mtf6pkZ

I can't for the life of me figure out what I'm doing wrong. I've looked at the admin WAR file and the GreenPages WAR, compared and tweaked, but to no avail. The logs don't show any errors about Tomcat or the WAR. In fact, Virgo shows it starting ok:
[2011-05-10 17:28:42.347] TCP Connection(57)-127.0.0.1 <DE0004I> Starting bundle 'com.test.app.webshell' version '0.1.0'. 
[2011-05-10 17:28:42.469] Thread-4                     <WE0000I> Starting web bundle 'com.test.app.webshell' version '0.1.0' with context path '/webshell'. 
[2011-05-10 17:28:42.717] Thread-4                     <WE0001I> Started web bundle 'com.test.app.webshell' version '0.1.0' with context path '/webshell'. 
[2011-05-10 17:28:42.720] start-signalling-6           <DE0005I> Started bundle 'com.test.app.webshell' version '0.1.0'. 
[2011-05-10 17:28:42.725] TCP Connection(57)-127.0.0.1 <DE0008I> Refreshed bundle 'com.test.app.webshell' version '0.1.0'. 


However, something must not be kosher if I can't even get the HTM file at the root of the webapp to come back.

Here are snippets of the main files, let me know if it would help to see more of something. I'd really like to get this working. I think OSGI is going to be the ticket I need for this project to be successful, so any help would be greatly appreciated. Thanks!

--------------------


template.mf -> generates into src/main/resources/META-INF/MANIFEST.MF -> copied to WEB-INF/classes/META-INF
(see below for the generated manifeset file)
Excluded-Exports: 
 *.internal*
Unversioned-Imports: 
 *
Import-Bundle: com.springsource.javax.servlet;version="[2.5.0,2.5.0]",
 com.springsource.javax.servlet.jsp;version="[1.1.2,2.1.0]",
 com.springsource.javax.servlet.jsp.jstl;version="[1.1.2,1.1.2]"
Web-ContextPath: /webshell
Webapp-Context: /webshell
Bundle-ClassPath: .,WEB-INF/classes
Bundle-Version: 0.1
Bundle-SymbolicName: com.test.app
Bundle-ManifestVersion: 2
Import-Package: 
 javax.servlet.jsp.jstl.core;version="[1.1.2,2.1.0]",
 org.apache.taglibs.standard;version="[1.1.2,2.0.0)",
 ...
 org.apache.taglibs.standard.tlv;version="[1.1.2,2.0.0)"
Require-TldBundle: org.apache.taglibs.standard.glassfish;version="[1.1.2,2)"
Import-Template: 
 javax.management.*;version=0,
 javax.servlet.*;version="[2.5.0,2.5.0]",
 javax.xml.stream.*;version=0,
 org.osgi.framework.*;version=0,
 org.osgi.service.cm.*;version=0,
 org.slf4j;version="[1.6.1,1.6.1]",
 org.springframework.*;version="[2.5.6,3.0.0.RELEASE]",
 org.springframework.js.*;version="[2.0.8.RELEASE,2.0.8.RELEASE]"
Import-Library: org.springframework.spring;version="[3.0.0.RELEASE,3.0.0.RELEASE]"


WEB-INF/web.xml
<web-app id="WebApp_ID" version="2.4"
	xmlns="http://java.sun.com/xml/ns/j2ee"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

  <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>index.htm</welcome-file>
  </welcome-file-list>

  <servlet>
    <servlet-name>webshell</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
  </servlet>

  <servlet-mapping>
    <servlet-name>webshell</servlet-name>
    <url-pattern>/webshell/*</url-pattern>
  </servlet-mapping>
</web-app>


WEB-INF/webshell-servlet.xml
	<context:component-scan  base-package="com.test.app"  />
	
		<!-- VIEW CONFIG  -->
	
	<bean id="topViewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
		<property name="prefix" value="/WEB-INF/jsp/" />
		<property name="suffix" value=".jsp" />
	</bean>


HelloWorld.java
package com.test.app.webshell;
import ...;
@Controller
public class HelloWorld {

	public HelloWorld() {
	}

	@RequestMapping("/api/home.htm")
	public ModelAndView home(HttpServletRequest request){
		ModelAndView mav = new ModelAndView("home");
		System.out.println("This is a test");
		return mav;
	}
}


MANIFEST.MF
Manifest-Version: 1.0
Export-Package: com.test.app.webshell;version="0.1";uses:="javax.ser
 vlet.http,org.springframework.stereotype,org.springframework.web.bind
 .annotation,org.springframework.web.servlet"
Webapp-Context: /webshell
Unversioned-Imports: *
Bundle-ClassPath: .,WEB-INF/classes
Tool: Bundlor 1.0.0.RELEASE
Import-Library: org.springframework.spring;version="[3.0.0.RELEASE,3.0
 .0.RELEASE]"
Web-ContextPath: /webshell
Import-Bundle: com.springsource.javax.servlet;version="[2.5.0,2.5.0]",
 com.springsource.javax.servlet.jsp;version="[1.1.2,2.1.0]",com.spring
 source.javax.servlet.jsp.jstl;version="[1.1.2,1.1.2]"
Require-TldBundle: org.apache.taglibs.standard.glassfish;version="[1.1
 .2,2)"
Bundle-Version: 0.1
Bundle-ManifestVersion: 2
Bundle-SymbolicName: com.test.app.webshell
Import-Package: javax.servlet.http;version="[2.5.0,2.5.0]",javax.servl
 et.jsp.jstl.core;version="[1.1.2,2.1.0]",org.apache.taglibs.standard;
 version="[1.1.2,2.0.0)",org.apache.taglibs.standard.extra.spath;versi
 on="[1.1.2,2.0.0)",org.apache.taglibs.standard.functions;version="[1.
 1.2,2.0.0)",org.apache.taglibs.standard.lang.jstl;version="[1.1.2,2.0
 .0)",org.apache.taglibs.standard.lang.jstl.parser;version="[1.1.2,2.0
 .0)",org.apache.taglibs.standard.lang.jstl.test;version="[1.1.2,2.0.0
 )",org.apache.taglibs.standard.lang.jstl.test.beans;version="[1.1.2,2
 .0.0)",org.apache.taglibs.standard.lang.support;version="[1.1.2,2.0.0
 )",org.apache.taglibs.standard.resources;version="[1.1.2,2.0.0)",org.
 apache.taglibs.standard.tag.common.core;version="[1.1.2,2.0.0)",org.a
 pache.taglibs.standard.tag.common.fmt;version="[1.1.2,2.0.0)",org.apa
 che.taglibs.standard.tag.common.sql;version="[1.1.2,2.0.0)",org.apach
 e.taglibs.standard.tag.common.xml;version="[1.1.2,2.0.0)",org.apache.
 taglibs.standard.tag.el.core;version="[1.1.2,2.0.0)",org.apache.tagli
 bs.standard.tag.el.fmt;version="[1.1.2,2.0.0)",org.apache.taglibs.sta
 ndard.tag.el.sql;version="[1.1.2,2.0.0)",org.apache.taglibs.standard.
 tag.el.xml;version="[1.1.2,2.0.0)",org.apache.taglibs.standard.tag.rt
 .core;version="[1.1.2,2.0.0)",org.apache.taglibs.standard.tag.rt.fmt;
 version="[1.1.2,2.0.0)",org.apache.taglibs.standard.tag.rt.sql;versio
 n="[1.1.2,2.0.0)",org.apache.taglibs.standard.tag.rt.xml;version="[1.
 1.2,2.0.0)",org.apache.taglibs.standard.tei;version="[1.1.2,2.0.0)",o
 rg.apache.taglibs.standard.tlv;version="[1.1.2,2.0.0)",org.springfram
 ework.stereotype;version="[2.5.6,3.0.0.RELEASE]",org.springframework.
 web.bind.annotation;version="[2.5.6,3.0.0.RELEASE]",org.springframewo
 rk.web.servlet;version="[2.5.6,3.0.0.RELEASE]"

[Updated on: Wed, 11 May 2011 01:22]

Report message to a moderator

Re: Can't deploy simple WAR [message #669643 is a reply to message #669632] Wed, 11 May 2011 02:38 Go to previous messageGo to next message
rshelley  is currently offline rshelley Friend
Messages: 59
Registered: April 2010
Member
I should also note that I've dropped in GreenPages, and I have the same problem... this is driving me batty... I could have had this WAR in basic Tomcat in 5 minutes, but this is definitely not going in as smoothly as I'd hoped!

I got GreenPages from http://eclipse.org/virgo/download/ and this is what I get:
http://screencast.com/t/dbZFsHCJY
http://screencast.com/t/PtanoFoM (I tried with /greenpages as well, same result)

Here is my OS/JVM/Virgo Info:
http://screencast.com/t/2emog7LL
Re: Can't deploy simple WAR [message #669821 is a reply to message #669643] Wed, 11 May 2011 16:27 Go to previous messageGo to next message
rshelley  is currently offline rshelley Friend
Messages: 59
Registered: April 2010
Member
I dropped my WAR into a plain Tomcat instance and it starts up ok. I can get the index.htm file, however, I can't get the servlet. I'll have to play with that some more, but it doesn't answer why I can't get the HTM file via Virgo with the exact same WAR file.
Re: Can't deploy simple WAR [message #669822 is a reply to message #669821] Wed, 11 May 2011 17:00 Go to previous messageGo to next message
rshelley  is currently offline rshelley Friend
Messages: 59
Registered: April 2010
Member
Correction, I CAN hit my servlet with the WAR in plain Tomcat (I just had the path wrong), so the index.htm and servlet work fine in plain Tomcat, but does not work in Virgo...

[Updated on: Wed, 11 May 2011 17:18]

Report message to a moderator

[RESOLVED] Re: Can't deploy simple WAR [message #669827 is a reply to message #669632] Wed, 11 May 2011 17:44 Go to previous message
rshelley  is currently offline rshelley Friend
Messages: 59
Registered: April 2010
Member
The issue was in template.mf:

Import-Bundle: com.springsource.javax.servlet;version="[2.5.0,2.5.0]",
 com.springsource.javax.servlet.jsp;version="[1.1.2,2.1.0]",
 com.springsource.javax.servlet.jsp.jstl;version="[1.1.2,1.1.2]"


I had to remove these three libraries from the WAR for the WAR to work in plain Tomcat (I was seeing an error in the Tomcat logs about the ServletContext class being ignored because it clashed). When I removed those JARs from the WAR and restarted Tomcat, it worked fine. So I then took the modified WAR and dropped it back in Virgo and it started working. I then looked in template.mf and found those three imported bundles and removed them.

So, my next question is, since I found the problem in plain Tomcat's logs, but couldn't find that same message in Virgo's logs, why? Is there a way to get Tomcat's full logging to write out somewhere? I also tried writing to STDOUT and can't find it output in any log files in Virgo but I can get that in Tomcat.

[Updated on: Wed, 11 May 2011 18:13]

Report message to a moderator

Previous Topic:Expanding Environment Variables For Watch Folders
Next Topic:more then one servlet
Goto Forum:
  


Current Time: Sun Dec 08 18:47:17 GMT 2024

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

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

Back to the top