重新编译后WebLogic 10.3.3中的java.lang.ClassCastException

发布于 2024-10-06 21:25:02 字数 3313 浏览 2 评论 0原文

在编辑一些代码时,开发人员在 Weblogic 10.3.3 中重新编译后注意到此错误。底层对象是 DimensionLabel。我们在 Weblogic 9.2 中尝试了这一点,它工作得很好,没有例外。开发人员只需重新编译调用 DimensionLabel SearchServiceProcessor 的类并重新运行应用程序。

net.nrj.service.SearchServiceProcessor java.lang.ClassCastException: net.nrj.alf.DimensionLabel
java.lang.ClassCastException: net.nrj.alf.DimensionLabel
    at net.nrj.service.SearchServiceProcessor.setRefinements(SearchServiceProcessor.java:911)
    at net.nrj.service.SearchServiceProcessor.process(SearchServiceProcessor.java:134)
    at net.nrj.service.ServiceController.processRequest(ServiceController.java:323)
    at net.nrj.service.ServiceController.doGet(ServiceController.java:307)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:821)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:184)
    at weblogic.servlet.internal.RequestDispatcherImpl.invokeServlet(RequestDispatcherImpl.java:529)
    at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:253)
    at weblogic.servlet.internal.ServletResponseImpl.sendError(ServletResponseImpl.java:719)
    at weblogic.servlet.internal.ServletResponseImpl.sendError(ServletResponseImpl.java:591)
    at weblogic.servlet.FileServlet.findSource(FileServlet.java:270)
    at weblogic.servlet.FileServlet.doGetHeadPost(FileServlet.java:191)
    at weblogic.servlet.FileServlet.service(FileServlet.java:173)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:821)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:184)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.doIt(WebAppServletContext.java:3686)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3650)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2268)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2174)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1446)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)

这是我的代码:

DimensionLabel dimLabel = (DimensionLabel);
dimensionLabel.get(currentDimension.getName());
currentRefinementDimension = new Refinement(); // Exception here
currentRefinementDimension.setExpanded(true);

我调试了代码,并且散列表维度标签中有一个维度标签。

While editing some code a developer noticed this error after a recompile in Weblogic 10.3.3. And the underlying object is a DimensionLabel. And we tried this in Weblogic 9.2 and it works fine with no exception. The developer simply recompiled the class calling the DimensionLabel the SearchServiceProcessor and reran the application.

net.nrj.service.SearchServiceProcessor java.lang.ClassCastException: net.nrj.alf.DimensionLabel
java.lang.ClassCastException: net.nrj.alf.DimensionLabel
    at net.nrj.service.SearchServiceProcessor.setRefinements(SearchServiceProcessor.java:911)
    at net.nrj.service.SearchServiceProcessor.process(SearchServiceProcessor.java:134)
    at net.nrj.service.ServiceController.processRequest(ServiceController.java:323)
    at net.nrj.service.ServiceController.doGet(ServiceController.java:307)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:821)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:184)
    at weblogic.servlet.internal.RequestDispatcherImpl.invokeServlet(RequestDispatcherImpl.java:529)
    at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:253)
    at weblogic.servlet.internal.ServletResponseImpl.sendError(ServletResponseImpl.java:719)
    at weblogic.servlet.internal.ServletResponseImpl.sendError(ServletResponseImpl.java:591)
    at weblogic.servlet.FileServlet.findSource(FileServlet.java:270)
    at weblogic.servlet.FileServlet.doGetHeadPost(FileServlet.java:191)
    at weblogic.servlet.FileServlet.service(FileServlet.java:173)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:821)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:184)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.doIt(WebAppServletContext.java:3686)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3650)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2268)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2174)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1446)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)

Here is my code :

DimensionLabel dimLabel = (DimensionLabel);
dimensionLabel.get(currentDimension.getName());
currentRefinementDimension = new Refinement(); // Exception here
currentRefinementDimension.setExpanded(true);

I debugged into the code and the hashtable dimensionLabel has a DimensionLabel in it.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

柠檬色的秋千 2024-10-13 21:25:02

如果您可以调试代码,请检查您的类是从哪里调用的。通常你需要调用

this.getClass().getProtectionDomain().getCodeSource().getLocation()

这会告诉你加载类的jar。检查是否存在jar冲突(旧jar等)

If you can debug into the code then check from where your class is being called from. Generally you need to call

this.getClass().getProtectionDomain().getCodeSource().getLocation()

This will tell you the jar from which your classes are loaded. Check if there is a jar conflict(old jar etc.)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文