3
我有一個Vaadin項目,我正在嘗試創建兩個UI 我有2個類。第一:Vaadin 2 servlets - 運行在Tomcat7
ConfirmUI.java
@Theme("dm")
@SuppressWarnings("serial")
public class ConfirmUI extends UI{
private static final long serialVersionUID = 8015006014121297134L;
@WebServlet(value = {"/confirm/*", "/VAADIN/*"}, asyncSupported = true)
// @WebServlet(value = {"/dm/*", "/VAADIN/*"}, asyncSupported = true)
@VaadinServletConfiguration(productionMode = false, ui = ConfirmUI.class, widgetset = "m4team.dm.widgetset.DmWidgetset")
public static class Servlet extends VaadinServlet {
private static final long serialVersionUID = 5269739354418135390L;
}
@Override
protected void init(VaadinRequest request) {
Page.getCurrent().setTitle("DM | Register");
}
}
其次:
DmUI.java
@Theme("dm")
@JavaScript("http://www.google.com/recaptcha/api/js/recaptcha_ajax.js")
public class DmUI extends UI {
// @WebServlet(value = "/*", asyncSupported = true)
@WebServlet(value = {"/dm/*", "/VAADIN/*"}, asyncSupported = true)
@VaadinServletConfiguration(productionMode = false, ui = DmUI.class, widgetset = "m4team.dm.widgetset.DmWidgetset")
public static class Servlet extends VaadinServlet {
}
@Override
protected void init(final VaadinRequest request) {
Page.getCurrent().setTitle("DM");
@Override
public void afterViewChange(ViewChangeEvent event) {
// TODO Auto-generated method stub
}
});
}
}
當他們單獨運行它的工作原理(當其中一個被註釋掉)。 但當我都取消註釋,並嘗試在Tomcat的7運行它們,我得到這樣一個錯誤:
Server Tomcat v7.0 Server at localhost failed to start.
和:
SEVERE: A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/DM]]
at java.uti
l.concurrent.FutureTask$Sync.innerGet(Unknown Source)
at java.util.concurrent.FutureTask.get(Unknown Source)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1123)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:800)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/DM]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
... 7 more
Caused by: java.lang.IllegalArgumentException: The servlets named [m4team.dm.ui.view.ConfirmUI$Servlet] and [m4team.dm.ui.view.DmUI$Servlet] are both mapped to the url-pattern [/VAADIN/*] which is not permitted
at org.apache.catalina.deploy.WebXml.addServletMapping(WebXml.java:335)
at org.apache.catalina.startup.ContextConfig.processAnnotationWebServlet(ContextConfig.java:2466)
at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2148)
at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:2109)
at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:2102)
at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:2102)
at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:2102)
at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:2102)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1293)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:878)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:376)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5322)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 7 more
,所以我認爲這個問題可能會在這裏:
Caused by: java.lang.IllegalArgumentException: The servlets named [m4team.dm.ui.view.ConfirmUI$Servlet] and [m4team.dm.ui.view.DmUI$Servlet] are both mapped to the url-pattern [/VAADIN/*] which is not permitted
有沒有人有任何解決方案?
的問題與此類似16270619但我沒有web.xml中
,但我有一個映射/ VAADIN/*和它不工作 - URL模式[/ VAADIN/*]這是不允許的。 – m4koon
在代碼中,你有兩個。 –
好的我看到問題在哪裏,謝謝你的幫助 – m4koon