Maven2 and option /? restartApplication

Hello,

First of all congratulations for your framework. For now I use vaadin for testing.
I find it very interesting Linux and Windows the possibility to reload the application
with /? restartApplication. I then built Maven2 and now I can not do /? restartApplication

Is this normal?

Best regards,

Pierre-Bruno

My first guess would be that your application is flagged to be in production mode - and not in development mode which allows restartApplication. You probably don’t want your customers using restartApplication so Vaadin gives you the ability to turn those off. You’ll do this in the web.xml - usually found in the folder WEB-INF/

Look for this snippet:

<context-param>
  <description>Vaadin production mode</description>
  <param-name>productionMode</param-name>
  <param-value>false</param-value>
</context-param>

check if your param-value is set to true. Don’t know is true or false default, if that code is not defined at all, but you’ll want ‘false’

Hello,

Thank you for your reply. But this changes nothing.

For info here’s my pom.xml



<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>com.vaadin.ui</groupId>
	<artifactId>VaadinProject</artifactId>
	<packaging>war</packaging>
	<name>VaadinProject</name>
	<version>0.0.1-SNAPSHOT</version>
	<description>Vaadin web testing</description>
	<dependencies>
		<dependency>
			<groupId>com.vaadin</groupId>
			<artifactId>vaadin</artifactId>
			<version>6.1.1</version>
			<scope>compile</scope>
		</dependency>

		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>3.8.1</version>
			<scope>test</scope>
		</dependency>
		
		 <dependency>
            <groupId>com.google.gwt</groupId>
            <artifactId>gwt-user</artifactId>
            <version>1.7.0</version>
            <scope>provided</scope>
        </dependency>
	</dependencies>
	<build>
		<finalName>simple-webapp</finalName>
		<plugins>
			<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<configuration>
					<source>1.5</source>
					<target>1.5</target>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.mortbay.jetty</groupId>
				<artifactId>maven-jetty-plugin</artifactId>
			</plugin>
		</plugins>
	</build>
</project>

and my web.xml



<?xml version="1.0" encoding="UTF-8"?>
<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">
	<display-name>VaadinTesting</display-name>
	<context-param>
		<description>
		Vaadin production mode</description>
		<param-name>productionMode</param-name>
		<param-value>false</param-value>
	</context-param>
	<servlet>
		<servlet-name>Vaadintesting Application</servlet-name>
		<servlet-class>
		com.vaadin.terminal.gwt.server.ApplicationServlet</servlet-class>
		<init-param>
			<description>
			Vaadin application class to start</description>
			<param-name>application</param-name>
			<param-value>com.example.vaadintesting.VaadintestingApplication</param-value>
		</init-param>
	</servlet>
	<servlet-mapping>
		<servlet-name>Vaadintesting Application</servlet-name>
		<url-pattern>/*</url-pattern>
	</servlet-mapping>
	<welcome-file-list>
		<welcome-file>index.html</welcome-file>
		<welcome-file>index.htm</welcome-file>
		<welcome-file>index.jsp</welcome-file>
		<welcome-file>default.html</welcome-file>
		<welcome-file>default.htm</welcome-file>
		<welcome-file>default.jsp</welcome-file>
	</welcome-file-list>
</web-app>

My page works, but after modifying the java code and launch /? RestartApplication. Nothing changes.

PS: My conf: 32-bit Linux Ubuntu + jdk 1.6.0.16

Regards,

Pierre-Bruno

Hmm… hard to say… Just a quick check, the correct format is with no space after the questionmark, and with a little r. As in http://localhost:9090/myApp?restartApplication. Just wanted to make sure as you wrote ? RestartApplication.

Other than that, it’s hard to say. Hope some one else could help out on this.

Hello,

I am using the correct syntax, ie: /?restartApplication

this does not work with maven (I may be forgetting something?).

This is surprising because the same application (with the /?restartApplication) created using dynamic web project using eclipse
works

Regards,

Pierre-Bruno

Sounds really strange - restartApplication parameter is built into ApplicationServlet and thus should not be related to build environment. The parameters is just a normal GET parameter, so you could pass it to your application in many ways:

http://me.com/myapp/?restartApplication
http://me.com/myapp/?restartApplication=foo
http://me.com/myapp/#someurifragment?someOtherParam=2&restartApplication

(Sorry for disturbing, but this shouldn’t be in the “News & Announcements” forum :))

Thank you for your responses.

In fact my goal is not to stop my web server and not redeploy my war with each change (development mode)

Example:

I modify a java class, I recompile my project and then I start http://localhost:8080/VaadinProject/?restartApplication
and my changes appear. It is more time to develop.

So I managed to make my starting job in maven (jetty is my web server) in debug mode using eclipse.

Regards,

Pierre-Bruno

PS :

If want more detail on this operation, I can make a tutorial video ?

Hello

Indeed, a shift in the general category. But how ?

Regards,

Pierre-Bruno