AuthFilter implementation class gives ClassCastException - Weblogic

This is a discussion on AuthFilter implementation class gives ClassCastException - Weblogic ; Since AuthFilter (although deprecated) is the only way to perform pre processing and post processing with FORM based authentication, I created a class extending AuthFilter. But When I deploy it on Weblogic 8.1 by copying the war file, it gives ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: AuthFilter implementation class gives ClassCastException

  1. AuthFilter implementation class gives ClassCastException


    Since AuthFilter (although deprecated) is the only way to perform pre processing
    and post processing with FORM based authentication, I created a class extending
    AuthFilter. But When I deploy it on Weblogic 8.1 by copying the war file, it gives
    a ClassCastException on deployment.
    The class is there in the war under WEB-INF\classes folder and it is also there
    in weblogic.xml in xml element.

    defined filter: test.MyAuthServletFilter.
    java.lang.ClassCastException
    at weblogic.servlet.internal.WebAppServletContext.reg isterFilter(WebAppS
    ervletContext.java:2834)
    at weblogic.servlet.internal.WebAppServletContext.ini tFilters(WebAppServ
    letContext.java:2810)
    at weblogic.servlet.internal.WebAppServletContext.pre loadResources(WebAp
    pServletContext.java:3112)
    at weblogic.servlet.internal.WebAppServletContext.set Started(WebAppServl
    etContext.java:5559)
    at weblogic.servlet.internal.WebAppModule.start(WebAp pModule.java:853)
    at weblogic.j2ee.J2EEApplicationContainer.start(J2EEA pplicationContainer
    java:2012)
    at weblogic.j2ee.J2EEApplicationContainer.activate(J2 EEApplicationContai
    ner.java:2053)
    at weblogic.management.deploy.slave.SlaveDeployer$Com ponentActivateTask.
    activateContainer(SlaveDeployer.java:2558)
    at weblogic.management.deploy.slave.SlaveDeployer$Act ivateTask.doCommit(
    SlaveDeployer.java:2483)
    at weblogic.management.deploy.slave.SlaveDeployer$Tas k.commit(SlaveDeplo
    yer.java:2308)
    at weblogic.management.deploy.slave.SlaveDeployer$Tas k.checkAutoCommit(S
    laveDeployer.java:2390)
    at weblogic.management.deploy.slave.SlaveDeployer$Tas k.prepare(SlaveDepl
    oyer.java:2302)
    at weblogic.management.deploy.slave.SlaveDeployer$Act ivateTask.prepare(S
    laveDeployer.java:2455)
    at weblogic.management.deploy.slave.SlaveDeployer.pro cessPrepareTask(Sla
    veDeployer.java:829)
    at weblogic.management.deploy.slave.SlaveDeployer.pre pareDelta(SlaveDepl
    oyer.java:538)
    at weblogic.management.deploy.slave.SlaveDeployer.pre pareUpdate(SlaveDep
    loyer.java:496)
    at weblogic.drs.internal.SlaveCallbackHandler$1.execu te(SlaveCallbackHan
    dler.java:25)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThrea d.java:178)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.ja va:151)

  2. Re: AuthFilter implementation class gives ClassCastException


    Actually I fixed this issue, but now I have another one. When I go to a page for
    the first time and since whole of the application is protected the user is directed
    to login jsp, but at the same time I see all the three methods doPreAuth, doSuccessAuth,
    doFailAuth (overriden in my custom class which extends AuthFilter) being called.
    Shouldn't preAuth be called when i make a call to j_security_check and doSuccessAuth
    or do FailAuth be called based on the results of authentication after j_security_check
    finishes authentication.


    -Njs


    "njs" wrote:
    >
    >Since AuthFilter (although deprecated) is the only way to perform pre
    >processing
    >and post processing with FORM based authentication, I created a class
    >extending
    >AuthFilter. But When I deploy it on Weblogic 8.1 by copying the war file,
    >it gives
    >a ClassCastException on deployment.
    >The class is there in the war under WEB-INF\classes folder and it is
    >also there
    >in weblogic.xml in xml element.
    >
    > >load user
    >defined filter: test.MyAuthServletFilter.
    >java.lang.ClassCastException
    > at weblogic.servlet.internal.WebAppServletContext.reg isterFilter(WebAppS
    >ervletContext.java:2834)
    > at weblogic.servlet.internal.WebAppServletContext.ini tFilters(WebAppServ
    >letContext.java:2810)
    > at weblogic.servlet.internal.WebAppServletContext.pre loadResources(WebAp
    >pServletContext.java:3112)
    > at weblogic.servlet.internal.WebAppServletContext.set Started(WebAppServl
    >etContext.java:5559)
    > at weblogic.servlet.internal.WebAppModule.start(WebAp pModule.java:853)
    > at weblogic.j2ee.J2EEApplicationContainer.start(J2EEA pplicationContainer
    >.java:2012)
    > at weblogic.j2ee.J2EEApplicationContainer.activate(J2 EEApplicationContai
    >ner.java:2053)
    > at weblogic.management.deploy.slave.SlaveDeployer$Com ponentActivateTask.
    >activateContainer(SlaveDeployer.java:2558)
    > at weblogic.management.deploy.slave.SlaveDeployer$Act ivateTask.doCommit(
    >SlaveDeployer.java:2483)
    > at weblogic.management.deploy.slave.SlaveDeployer$Tas k.commit(SlaveDeplo
    >yer.java:2308)
    > at weblogic.management.deploy.slave.SlaveDeployer$Tas k.checkAutoCommit(S
    >laveDeployer.java:2390)
    > at weblogic.management.deploy.slave.SlaveDeployer$Tas k.prepare(SlaveDepl
    >oyer.java:2302)
    > at weblogic.management.deploy.slave.SlaveDeployer$Act ivateTask.prepare(S
    >laveDeployer.java:2455)
    > at weblogic.management.deploy.slave.SlaveDeployer.pro cessPrepareTask(Sla
    >veDeployer.java:829)
    > at weblogic.management.deploy.slave.SlaveDeployer.pre pareDelta(SlaveDepl
    >oyer.java:538)
    > at weblogic.management.deploy.slave.SlaveDeployer.pre pareUpdate(SlaveDep
    >loyer.java:496)
    > at weblogic.drs.internal.SlaveCallbackHandler$1.execu te(SlaveCallbackHan
    >dler.java:25)
    > at weblogic.kernel.ExecuteThread.execute(ExecuteThrea d.java:178)
    > at weblogic.kernel.ExecuteThread.run(ExecuteThread.ja va:151)



+ Reply to Thread