我正在使用war文件在Tomcat 6上部署应用程序.我在同一台机器上编译了供应商提供的源代码,然后将war文件移到{tomcat-home}/webapps /
当我启动应用程序时,我看到一条错误消息:
The SystemInformationService could not be retrieved from the container. Therefore very limited information is available in this error report.
The SystemInformationService could not be retrieved due to the following error: java.lang.IllegalStateException: Spring Application context has not been set
Cause
java.lang.RuntimeException: Unable to instantiate VelocityEngine!
at com.opensymphony.webwork.views.velocity.VelocityManager.newVelocityEngine(VelocityManager.java:333)
Stack Trace:[hide]
java.lang.RuntimeException: Unable to instantiate VelocityEngine!
at com.opensymphony.webwork.views.velocity.VelocityManager.newVelocityEngine(VelocityManager.java:333)
at com.opensymphony.webwork.views.velocity.VelocityManager.init(VelocityManager.java:146)
at com.opensymphony.webwork.dispatcher.VelocityResult.doExecute(VelocityResult.java:61)
Run Code Online (Sandbox Code Playgroud)
我在另一台机器上执行相同的步骤并正确安装.
我不明白错误告诉我的是什么.
我可以丢失jar文件吗?(但编译得很好).
我忘记设置环境变量了吗?
我不知道该怎么做,我不知道VelocityEngine是什么,或者是什么.
我有大量不同的独立(无状态)Web服务,用Java编写并编译为WAR文件.我想将它们部署到单个Web应用程序服务器.
如果每个WAR文件中的服务处理的URI都以我可以用作Web应用程序名称的前缀开头,那么这很容易.例如,我可以
SALES WAR FILE:包含以下代码:
GET http://example.com/sales/widgets
POST http://example.com/sales/widgets
GET http://example.com/sales/sky-hooks营销战争文件:包含以下代码:
获取http://example.com/marketing/widgets
PUT http://example.com/marketing/sky-hooks
...在这种情况下,我只需在名称"sales"和"marketing"下部署两个WAR文件.但是,我不是那么幸运.相反,组件处理的URI路径重叠.像这样的东西:
SALES WAR FILE:包含以下代码:
GET http://example.com/widgets/sales
POST http://example.com/widgets/sales
GET http://example.com/sky-hooks/sales营销战争文件:包含以下代码:
获取http://example.com/widgets/marketing
PUT http://example.com/sky-hooks/marketing
我的问题是如何(如果有的话)我可以在单个Web应用程序服务器上部署它们.
我愿意接受需要大量工作的建议.例如,我最好的想法是在常规URI路径之前构建期望组件名称前缀的服务,然后通过不同的服务器管理所有传入流量,该服务器知道每个URI模式属于哪个组件并将URI修改为添加该前缀.这种方法的难点在于,像Swagger这样的工具读取我的源代码会误解URI的样子.
有任何想法吗?
我使用 Java 开发了一个 Web 应用程序。当我将它部署到我的应用程序服务器(Jetty、Tomcat、JBoss、GlassFish 等)时会引发错误。我可以在堆栈跟踪中看到此错误消息:
java.lang.ClassNotFoundException
Run Code Online (Sandbox Code Playgroud)
或者
java.lang.NoClassDefFoundError
Run Code Online (Sandbox Code Playgroud)
这是什么意思,我该如何解决?