Not building a war file that can be deployed

This may not strictly be a Vaadin question, but it has to do with getting a simple Vaadin project to launch. I am using Vaadin 6.8.2. I’m running in Eclipse (Juno) as a Maven project. (None of the web app projects seemed apropos.) I am trying to build a war file that will then be used be a Tomcat plugin to run the web app. My problem is that I can’t get a war file that will deploy correctly to Tomcat. I even pick up the war file and deploy it to an external Tomcat server and I get the same error. The error is in the browser:

HTTP Status 404 - /vaadin-test/

type Status report

message /vaadin-test/

description The requested resource (/vaadin-test/) is not available.

I can change the URL to whatever I want or let it default; it doesn’t matter, it still fails.

My web.xml looks like this:

	<servlet>
		<servlet-name>myservlet</servlet-name>
		<servlet-class>com.vaadin.terminal.gwt.server.ApplicationServlet</servlet-class>
		
		<init-param>
			<param-name>application</param-name>
			<param-value>com.catalystitservices.vaadin.TestApp</param-value>
		</init-param>
	</servlet>
	
	<servlet-mapping>
		<servlet-name>myservlet</servlet-name>
		<url-pattern>/test-app</url-pattern> <!-- I can change this to anything or leave it out -->
	</servlet-mapping>

The part of the POM file that controls to war file looks like this:

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-war-plugin</artifactId>
				<version>2.2</version>
				
				<configuration>
					<packagingExcludes>WEB-INF/web.xml</packagingExcludes>
					<warName>vaadin-test</warName>

					<webResources>
						<resource>
							<directory>src/main/webapp/</directory>
							<filtering>true</filtering>

							<includes>
								<include>**/*.xml</include>
							</includes>
						</resource>
					</webResources>
				</configuration>
			</plugin>

Any ideas?

The problem was in the servlet-mapping in the web.xml. Not really a problem, but I have to add that to my URL, like so.

http://localhost:9090/vaadin-test/test-app

Then I get a new error, but that’s another post.

Vaadin widgetset not being found?

If so, see section 4.8.3 of the
BoV chapter about your app environment
.

Cheers,
Bobby

How did you know? I was changed the servlet-mapping url-pattern in web.xml to this:

	<servlet-mapping>
	    <servlet-name>myservlet</servlet-name>
	    <url-pattern>/*</url-pattern>
	</servlet-mapping>

:slight_smile: Just guessed based on the servlet mapping you had originally. We’ve all been there at least once!

Cheers,
Bobby