+ Répondre à la discussion
Affichage des résultats 1 à 2 sur 2
  1. #1
    Membre du Club
    Inscrit en
    mai 2003
    Messages
    257
    Détails du profil
    Informations forums :
    Inscription : mai 2003
    Messages : 257
    Points : 43
    Points
    43

    Par défaut JDev Weblogic Error 401--Unauthorized

    J'ai un souci avec ma connexion dans jdev.
    J'ai crées une page de connexion et je me connecte à travers la methode
    Code :
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
        public String doLogin()  throws LoginException{
            String un = _username;
            byte[] pw = _password.getBytes();
            FacesContext ctx = FacesContext.getCurrentInstance();
            HttpServletRequest request = (HttpServletRequest)ctx.getExternalContext().getRequest();
            Subject mySubject;
            try {
                 mySubject = Authentication.login(new URLCallbackHandler(un, pw));
                 ServletAuthentication.runAs(mySubject, request);
                 ServletAuthentication.generateNewSessionID(request);
                 String loginUrl = "/adfAuthentication?success_url=/faces/protectedPage.jspx";
                 //String loginUrl = "AdfAuthentication?success_url=/faces/protectedPage.jspx";
                 HttpServletResponse response = (HttpServletResponse)ctx.getExternalContext().getResponse();
                 RequestDispatcher dispatcher = request.getRequestDispatcher(loginUrl);
                 dispatcher.forward(request, response);
            } catch (FailedLoginException e) {
                 FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_ERROR,"Username or Password Invalid","Username or Password Invalid");
                 ctx.addMessage(null, msg);
            } catch (Exception e) {
            }
            return null;
        }
    qui se trouve dans un java bean.
    Mapage de connexion est
    Code :
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1" xmlns:f="http://java.sun.com/jsf/core"
              xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
        <jsp:directive.page contentType="text/html;charset=UTF-8"/>
        <f:view>
            <af:document title="Login.jspx" id="d1">
                <af:form id="f1" defaultCommand="cb1">
                    <af:panelFormLayout id="pfl1">
                        <f:facet name="footer">
                            <af:group id="g1">
                                <af:activeOutputText value="Login" id="aot1"
                                                     inlineStyle="color:rgb(0,107,165); font-size:large; font-weight:bold; text-align:left;"/>
                                <af:separator id="s1"/>
                                <af:outputText value="Enter your Login and Password to connect" id="ot1"
                                               inlineStyle="text-align:center; font-weight:bold;"/>
                                <af:inputText label="Username :" id="it1" value="#{Login.username}"/>
                                <af:inputText label="Password :" id="it2" value="#{Login.password}"/>
                                <af:commandButton text="Login" id="cb1" action="#{Login.doLogin}"/>
                            </af:group>
                        </f:facet>
                    </af:panelFormLayout>
                </af:form>
            </af:document>
        </f:view>
    </jsp:root>
    Et à l'exécution, j'ai le message d'erreur:
    Error 401--Unauthorized
    From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1:
    10.4.2 401 Unauthorized

    The request requires user authentication. The response MUST include a WWW-Authenticate header field (section 14.46) containing a challenge applicable to the requested resource. The client MAY repeat the request with a suitable Authorization header field (section 14.8). If the request already included Authorization credentials, then the 401 response indicates that authorization has been refused for those credentials. If the 401 response contains the same challenge as the prior response, and the user agent has already attempted authentication at least once, then the user SHOULD be presented the entity that was given in the response, since that entity MAY include relevant diagnostic information. HTTP access authentication is explained in section 11.
    et dans le log de Jdev, j'ai:
    Code :
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    <LifecycleImpl> <_handleException> ADF_FACES-60098:Le cycle de vie Faces reçoit des exceptions non traitées en phase RENDER_RESPONSE 6
    java.lang.IllegalStateException: Cannot forward a response that is already committed
    	at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:122)
    	at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:546)
    	at javax.faces.context.ExternalContextWrapper.dispatch(ExternalContextWrapper.java:93)
    	at javax.faces.context.ExternalContextWrapper.dispatch(ExternalContextWrapper.java:93)
    	at oracle.adfinternal.view.faces.config.rich.RecordRequestAttributesDuringDispatch.dispatch(RecordRequestAttributesDuringDispatch.java:44)
    	at javax.faces.context.ExternalContextWrapper.dispatch(ExternalContextWrapper.java:93)
    	at javax.faces.context.ExternalContextWrapper.dispatch(ExternalContextWrapper.java:93)
    	at javax.faces.context.ExternalContextWrapper.dispatch(ExternalContextWrapper.java:93)
    	at org.apache.myfaces.trinidadinternal.context.FacesContextFactoryImpl$OverrideDispatch.dispatch(FacesContextFactoryImpl.java:167)
    	at com.sun.faces.application.view.JspViewHandlingStrategy.executePageToBuildView(JspViewHandlingStrategy.java:363)
    	at com.sun.faces.application.view.JspViewHandlingStrategy.buildView(JspViewHandlingStrategy.java:154)
    	at org.apache.myfaces.trinidadinternal.application.ViewDeclarationLanguageFactoryImpl$ChangeApplyingVDLWrapper.buildView(ViewDeclarationLanguageFactoryImpl.java:341)
    	at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._renderResponse(LifecycleImpl.java:982)
    	at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:334)
    	at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:232)
    	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:313)
    	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.TailFilter.doFilter(TailFilter.java:26)
    	at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    	at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:173)
    	at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    	at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:122)
    	at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
    	at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
    	at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
    	at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:293)
    	at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:199)
    	at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
    	at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    	at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:111)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
    	at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
    	at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:94)
    	at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:161)
    	at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
    	at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    	at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:136)
    	at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    	at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
    	at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    	at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
    	at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
    	at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    	at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
    	at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
    	at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
    	at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
    	at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    	at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    <24 avr. 2012 08 h 36 GMT> <Error> <HTTP> <BEA-101020> <[ServletContext@24883180[app:ADFLogin module:ADFLogin-View-context-root path:/ADFLogin-View-context-root spec-version:2.5]] Servlet failed with Exception
    java.lang.IllegalStateException: Cannot forward a response that is already committed
    	at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:122)
    	at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:546)
    	at javax.faces.context.ExternalContextWrapper.dispatch(ExternalContextWrapper.java:93)
    	at javax.faces.context.ExternalContextWrapper.dispatch(ExternalContextWrapper.java:93)
    	at oracle.adfinternal.view.faces.config.rich.RecordRequestAttributesDuringDispatch.dispatch(RecordRequestAttributesDuringDispatch.java:44)
    	Truncated. see log file for complete stacktrace
    > 
    <24 avr. 2012 08 h 36 GMT> <Notice> <Diagnostics> <BEA-320068> <Watch 'UncheckedException' with severity 'Notice' on server 'DefaultServer' has triggered at 24 avr. 2012 08 h 36 GMT. Notification details: 
    WatchRuleType: Log 
    WatchRule: (SEVERITY = 'Error') AND ((MSGID = 'WL-101020') OR (MSGID = 'WL-101017') OR (MSGID = 'WL-000802') OR (MSGID = 'BEA-101020') OR (MSGID = 'BEA-101017') OR (MSGID = 'BEA-000802')) 
    WatchData: DATE = 24 avr. 2012 08 h 36 GMT SERVER = DefaultServer MESSAGE = [ServletContext@24883180[app:ADFLogin module:ADFLogin-View-context-root path:/ADFLogin-View-context-root spec-version:2.5]] Servlet failed with Exception
    java.lang.IllegalStateException: Cannot forward a response that is already committed
    	at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:122)
    	at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:546)
    	at javax.faces.context.ExternalContextWrapper.dispatch(ExternalContextWrapper.java:93)
    	at javax.faces.context.ExternalContextWrapper.dispatch(ExternalContextWrapper.java:93)
    	at oracle.adfinternal.view.faces.config.rich.RecordRequestAttributesDuringDispatch.dispatch(RecordRequestAttributesDuringDispatch.java:44)
    	at javax.faces.context.ExternalContextWrapper.dispatch(ExternalContextWrapper.java:93)
    	at javax.faces.context.ExternalContextWrapper.dispatch(ExternalContextWrapper.java:93)
    	at javax.faces.context.ExternalContextWrapper.dispatch(ExternalContextWrapper.java:93)
    	at org.apache.myfaces.trinidadinternal.context.FacesContextFactoryImpl$OverrideDispatch.dispatch(FacesContextFactoryImpl.java:167)
    	at com.sun.faces.application.view.JspViewHandlingStrategy.executePageToBuildView(JspViewHandlingStrategy.java:363)
    	at com.sun.faces.application.view.JspViewHandlingStrategy.buildView(JspViewHandlingStrategy.java:154)
    	at org.apache.myfaces.trinidadinternal.application.ViewDeclarationLanguageFactoryImpl$ChangeApplyingVDLWrapper.buildView(ViewDeclarationLanguageFactoryImpl.java:341)
    	at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._renderResponse(LifecycleImpl.java:982)
    	at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:334)
    	at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:232)
    	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:313)
    	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.TailFilter.doFilter(TailFilter.java:26)
    	at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    	at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:173)
    	at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    	at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:122)
    	at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
    	at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
    	at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
    	at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:293)
    	at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:199)
    	at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
    	at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    	at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:111)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
    	at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
    	at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:94)
    	at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:161)
    	at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
    	at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    	at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:136)
    	at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    	at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
    	at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    	at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
    	at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
    	at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    	at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
    	at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
    	at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
    	at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
    	at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    	at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
     SUBSYSTEM = HTTP USERID = <WLS Kernel> SEVERITY = Error THREAD = [ACTIVE] ExecuteThread: '5' for queue: 'weblogic.kernel.Default (self-tuning)' MSGID = BEA-101020 MACHINE = Islam TXID =  CONTEXTID = e1cb8fb022f7fc61:680c809c:136e33469e7:-8000-00000000000000ea TIMESTAMP = 1335256597570  
    WatchAlarmType: AutomaticReset 
    WatchAlarmResetPeriod: 30000 
    > 
    <24 avr. 2012 08 h 36 GMT> <Alert> <Diagnostics> <BEA-320016> <Creating diagnostic image in c:\users\root\appdata\roaming\jdeveloper\system11.1.2.1.38.60.81\defaultdomain\servers\defaultserver\adr\diag\ofm\defaultdomain\defaultserver\incident\incdir_27 with a lockout minute period of 1.>

  2. #2
    Membre du Club
    Inscrit en
    mai 2003
    Messages
    257
    Détails du profil
    Informations forums :
    Inscription : mai 2003
    Messages : 257
    Points : 43
    Points
    43

    Par défaut

    Ok, j'ai fini par trouvé la solution pour ceux que ça interresserait.
    il faut supprimer dans le jazn-data.xml les lignes suivantes:
    Code :
    1
    2
    3
    4
    5
    <app-role>
                <name>anonymous-role</name>
                <class>oracle.security.jps.internal.core.principals.JpsAnonymousRoleImpl</class>
                <display-name>anonymous-role</display-name>
              </app-role>

+ Répondre à la discussion
Cette discussion est résolue.

Liens sociaux

Règles de messages

  • Vous ne pouvez pas créer de nouvelles discussions
  • Vous ne pouvez pas envoyer des réponses
  • Vous ne pouvez pas envoyer des pièces jointes
  • Vous ne pouvez pas modifier vos messages
  •