0

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.

Valentin Rocher
  • 11,667
  • 45
  • 59
Tom Henricksen
  • 137
  • 4
  • 14
  • what about giving us the code on that line (and around it) – Bozho Dec 10 '10 at 14:30
  • DimensionLabel dimLabel = (DimensionLabel) dimensionLabel.get(currentDimension.getName()); CCE here<< currentRefinementDimension = new Refinement(); currentRefinementDimension.setExpanded(true); I debugged into the code and the hashtable dimensionLabel has a DimensionLabel in it. – Tom Henricksen Dec 10 '10 at 15:55
  • added your comment to the question – Valentin Rocher Dec 10 '10 at 16:30

1 Answers1

0

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.)

Pushkar
  • 7,450
  • 10
  • 38
  • 57
  • This file isn't coming from a JAR it is on the filesystem. I ran the code you suggested: /opt/work/nrj/webapps/jobsearch/WEB-INF/classes/ne/nrj/service/SearchServiceProcessor.class. – Tom Henricksen Dec 10 '10 at 16:31
  • I have seen weblogic 10 caching classes(jars) and picking them from all sorts of location(tmp etc) so maybe you should dig deeper and try to find out where your dimension label class is being picked from? Going to the locations and seeing of this is the class you want etc. – Pushkar Dec 10 '10 at 16:38