我想使用嵌入式码头(eclipse luna 内置版本)部署一个 vaadin(版本 7.2.5)Web 应用程序。
目前,我的代码如下所示:
public class Launcher {
private static int httpPort = 8080;
public static void main(String[] args) throws Exception
{
Server server = new Server();
SocketConnector connector = new SocketConnector();
connector.setMaxIdleTime(1000 * 60 * 10);
connector.setSoLingerTime(-1);
connector.setPort(httpPort);
connector.setReuseAddress(false);
QueuedThreadPool pool = new QueuedThreadPool();
pool.setMinThreads(10);
pool.setMaxThreads(100);
server.setConnectors(new Connector[] { connector });
server.setThreadPool(pool);
WebAppContext context = new WebAppContext();
context.setServer(server);
context.setContextPath("/");
context.setWar("ReportWriter.war");
context.setClassLoader(Thread.currentThread().getContextClassLoader());
server.setHandler(context);
try
{
server.start();
} catch (Exception e) {
e.printStackTrace();
}
}
}
我从vaadin 论坛帖子中复制了它。服务器似乎启动了,WAR 实际上被提取了。
将我的浏览器指向http://localhost:8080/
,而不是启动我的 vaadin(版本 7.2.5)应用程序,我看到的是:
以防万一它可能很重要:我在 Eclipse 中的 WAR 项目的目录树:
ReportWriter
| .classpath
| .project
| ivy.xml
| ivysettings.xml
|
+---.settings
| (...)
|
+---build
| \---classes
| +---(...)
| \---META-INF
| persistence.xml
|
+---src
| +---(...)
| \---META-INF
| persistence.xml
|
\---WebContent
| dropDDL.sql
| init.sql
| reportwriter.xml
|
+---META-INF
| MANIFEST.MF
|
+---VAADIN
\---WEB-INF
\---lib
BorderLayout-0.5.jar
confirmdialog-2.0.4.jar
dawn-2.jar
derby.jar
derbynet.jar
derbyrun.jar
derbytools.jar
messagebox-2.0.6.jar
refresher-1.2.1.7.jar
vaadin-jpacontainer-3.1.1-javadoc.jar
vaadin-jpacontainer-3.1.1-sources.jar
vaadin-jpacontainer-3.1.1.jar
wizards-for-vaadin-1.0.1.jar
还有我的 RWRunner(启动器)项目之一:
RWRunner
| .classpath
| .project
| ivy.xml
| ivysettings.xml
| ReportWriter.war <-- The war file generated from the project above
| test.txt
| web.xml
|
+---.settings
| .jsdtscope
| com.vaadin.integration.eclipse.prefs
| org.eclipse.jdt.core.prefs
| org.eclipse.wst.common.component
| org.eclipse.wst.common.project.facet.core.xml
| org.eclipse.wst.jsdt.ui.superType.container
| org.eclipse.wst.jsdt.ui.superType.name
|
+---build
| \---classes
| \---ch
| \---darkspot
| \---rwrunner
| Launcher.class
|
\---src
\---ch
\---darkspot
\---rwrunner
Launcher.java