由于 SRVE0303E,WAS 8.5.5.9 无法启动 web 应用程序 [英] WAS 8.5.5.9 cannot start webapplication because of SRVE0303E
问题描述
我有以下问题:
在我的 web.xml 中,我定义了如何像这样提供图片:
In my web.xml I define how to serve pictures like so:
<servlet-mapping>
<servlet-name>default</servlet-name>
<url-pattern>*.css</url-pattern>
<url-pattern>*.png</url-pattern>
<url-pattern>*.jpg</url-pattern>
</servlet-mapping>
在 Tomcat 上这工作正常,但在 IBM Websphere 8.5.5.9 上我收到以下错误:
On Tomcat this works fine but on IBM Websphere 8.5.5.9 I get the following error:
SRVE0303E:无法找到 servlet 映射 *.css 的 servlet 名称."
"SRVE0303E: Servlet name for the servlet mapping *.css could not be found."
在另一个站点上,我已经找到了解决此问题的方法(https://www.ibm.com/developerworks/community/forums/html/topic?id=5f4420ba-0754-43fe-8c87-91acc588d9fc)所以我也创建了ibm-web-ext.xml 与他们的解决方案完全相同,但错误仍然存在.
On another site I already found a solution for this issue (https://www.ibm.com/developerworks/community/forums/html/topic?id=5f4420ba-0754-43fe-8c87-91acc588d9fc) so I also created the ibm-web-ext.xml exactly the same as in their solution but the error still persists.
有人知道我可以做些什么不同的事情吗?
Does anyone know what I could do differently?
推荐答案
我找到了问题的答案,感谢 @MigratedPigeon,因为他让我思考了我的默认 servlet 的类.
I found the answer to my problem, thanks to @MigratedPigeon because he got me thinking about the class of my default servlet.
tomcat 服务器有一个默认的 servlet,tomcats 默认的 servlet 的类是
A tomcat server has a default servlet, the class for tomcats default servlet is
org.apache.catalina.servlets.DefaultServlet
org.apache.catalina.servlets.DefaultServlet
另一方面,Websphere 没有默认的 servlet,这就是我收到错误找不到 Servlet 名称"的原因.
Websphere on the other hand does not have a default servlet, thats why I get the error "Servlet Name could not be found".
正如我在原始问题中链接的答案一样,websphere 可以使用 web-ext.xml 文件激活静态文件服务,但这仍然没有解决我的 web.xml 文件具有默认"的问题小服务程序.
As in the answer I linked in the original question, static file serving can be activated by websphere by using the web-ext.xml file but that still did not solve the issue of my web.xml file having a "default" servlet.
在我们的应用程序中,我们使用 spring,所以最后我用 springs 调度程序 servlet 替换了 web.xml 中的默认 servlet,现在我的 web.xml 文件对 tomcat 和 websphere 都有效.
In our application we use spring, so in the end I replaced the default servlet in web.xml with springs dispatcher servlet and now my web.xml file is valid for both, tomcat and websphere.
这篇关于由于 SRVE0303E,WAS 8.5.5.9 无法启动 web 应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!