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

时间:2010-12-10 14:23:30

标签: java java-ee weblogic-10.x weblogic11g weblogic9.x

在编辑某些代码时,开发人员在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);

我调试了代码,哈希表dimensionLabel中有一个DimensionLabel。

1 个答案:

答案 0 :(得分:0)

如果您可以调试代码,那么请检查您的类的调用位置。通常你需要打电话

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

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