我正在尝试将 OpenBravo3.0 的自定义构建部署到 JBoss Wildfly wildfly-9.0.2.Final。
OpenBravo 源代码在http://wiki.openbravo.com/wiki/Installation/Custom/Download_Tarball下载,我通过发出 ant compile.complete.deploy 进行了 ant 构建。ant 命令在 lib/ 目录中输出一个名为 openbravo.war 的战争版本。
但是,由于此错误,无法部署战争:
12:23:59,959 INFO [org.jboss.weld.deployer] (MSC service thread 1-4) WFLYWELD0009: Starting weld service for deployment openbravo.war
12:24:03,368 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-6) MSC000001: Failed to start service jboss.undertow.deployment.default-server.default-host./openbravo.UndertowDeploymentInfoService: org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./openbravo.UndertowDeploymentInfoService: Failed to start service
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1904)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalArgumentException: UT010009: Servlet P037C0E9B93984960BABB84F35C38975E of type class org.openbravo.erpCommon.ad_process.KillSession does not implement javax.servlet.Servlet
at io.undertow.servlet.api.ServletInfo.<init>(ServletInfo.java:98)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService.createServletConfig(UndertowDeploymentInfoService.java:695)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService.start(UndertowDeploymentInfoService.java:265)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
... 3 more
12:24:03,377 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "openbravo.war")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.undertow.deployment.default-server.default-host./openbravo.UndertowDeploymentInfoService" => "org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./openbravo.UndertowDeploymentInfoService: Failed to start service
Caused by: java.lang.IllegalArgumentException: UT010009: Servlet P037C0E9B93984960BABB84F35C38975E of type class org.openbravo.erpCommon.ad_process.KillSession does not implement javax.servlet.Servlet"}}
是否可以使用非 servlet 类(如 KillSession)作为 servlet?
package org.openbravo.erpCommon.ad_process;
import org.openbravo.dal.service.OBDal;
import org.openbravo.erpCommon.utility.OBError;
import org.openbravo.model.ad.access.Session;
import org.openbravo.scheduling.Process;
import org.openbravo.scheduling.ProcessBundle;
/**
* This process kills the session passed in the AD_Session_ID parameter.
*
*/
public class KillSession implements Process {
...
...
}
package org.openbravo.scheduling;
/**
* All Openbravo Processes that require scheduling through the {@link OBScheduler} or monitoring
* through the {@link ProcessMonitor} are required to implement this interface.
*
* @author awolski
*
*/
public interface Process {
...
...
}
<servlet>
<display-name>
org.openbravo.erpCommon.ad_process.KillSession
</display-name>
<servlet-name>
P037C0E9B93984960BABB84F35C38975E
</servlet-name>
<servlet-class>
org.openbravo.erpCommon.ad_process.KillSession
</servlet-class>
</servlet>