我正在尝试将我的web服务从Tomcat8.5迁移到Weblogic 12c。我的项目在Tomcat上运行得很好,所以我预计它也会很好,因为他们都在使用相同版本的Java。
在我使用Weblogic部署了我的WAR之后,它说它的状态很好并且正在运行。但是当我用Chrome连接到它时,它总是给出错误500。即使我深入到Weblogic的日志中,也很难猜出到底出了什么问题。
<Error> <HTTP> <AdminServer> <[ACTIVE] ExecuteThread: '10' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <f21f82c8-a7fe-4d00-9ead-58094613f623-00000045> <1513072074680> <[severity-value: 8] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <BEA-101020> <[ServletContext@715231355[app:testCMS module:testCMS.war path:null spec-version:3.1]] Servlet failed with an Exception
java.lang.NullPointerException
at weblogic.servlet.internal.ServletRequestImpl$CookieKey.hashCode(ServletRequestImpl.java:2084)
at java.util.HashMap.hash(HashMap.java:338)
at java.util.HashMap.get(HashMap.java:556)
at weblogic.servlet.internal.ServletRequestImpl$SessionHelper.getSessionIDFromMap(ServletRequestImpl.java:2819)
at weblogic.servlet.internal.ServletRequestImpl$SessionHelper._getSessionInternal(ServletRequestImpl.java:2902)
at weblogic.servlet.internal.ServletRequestImpl$SessionHelper.getSessionInternal(ServletRequestImpl.java:2869)
at weblogic.servlet.internal.ServletRequestImpl$SessionHelper.getSession(ServletRequestImpl.java:2859)
at weblogic.servlet.internal.ServletRequestImpl.getSession(ServletRequestImpl.java:1513)
at weblogic.servlet.internal.ServletResponseImpl.encodeURL(ServletResponseImpl.java:690)
at weblogic.servlet.internal.ServletResponseImpl.encodeRedirectURL(ServletResponseImpl.java:673)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2226)
at weblogic.servlet.internal.ServletRequestImpl.runInternal(ServletRequestImpl.java:1691)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1651)
at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:270)
at weblogic.invocation.ComponentInvocationContextManager._runAs(ComponentInvocationContextManager.java:348)
at weblogic.invocation.ComponentInvocationContextManager.runAs(ComponentInvocationContextManager.java:333)
at weblogic.work.LivePartitionUtility.doRunWorkUnderContext(LivePartitionUtility.java:54)
at weblogic.work.PartitionUtility.runWorkUnderContext(PartitionUtility.java:41)
at weblogic.work.SelfTuningWorkManagerImpl.runWorkUnderContext(SelfTuningWorkManagerImpl.java:640)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:406)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:346)
有人能告诉我如何解决这个奇怪的问题吗?
发布于 2017-12-25 19:58:53
好吧,我自己找到答案了。
JSP网站似乎需要一个带有weblogic.xml的website文件夹中的web.xml,所以您可以在Weblogic上正确地部署WAR。
我不知道为什么Weblogic部署需要该文件,但其他人(例如:WAS/etc)暂时没有时间找出原因。
如果weblogic.xml上的其他新手像我一样面对这个问题,我会在这里发布weblogic.xml内容,如果您需要像我这样的例子的话。
<?xml version="1.0" encoding="UTF-8"?>
<wls:weblogic-web-app xmlns:wls="http://xmlns.oracle.com/weblogic/weblogic-web-app" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd http://xmlns.oracle.com/weblogic/weblogic-web-app http://xmlns.oracle.com/weblogic/weblogic-web-app/1.9/weblogic-web-app.xsd">
<wls:weblogic-version>12.2.1.2</wls:weblogic-version>
<wls:context-root>testCMS</wls:context-root>
</wls:weblogic-web-app>
https://stackoverflow.com/questions/47769966
复制