JAAS LoginException, error.jsp

When I throw a LoginException in my Custom Login Module that my Custom AuthenticationProvider
and my web.xml file contains
<login-config>
<auth-method>FORM</auth-method>
<form-login-config>
<form-login-page>/login.jsp</form-login-page>
<form-error-page>/error.jsp</form-error-page>
</form-login-config>
</login-config>
How do I get the error message displayed on the error.jsp file that weblogic authomatically
loads
I tried <% exception.getMessage() %> and I get an exception stating that exception
doesn't exist.
thanks for any help
Chad

After processing your servlet ,forward it to JSP page and set that exception in object from servlet and accces it in JSP Page and display it.
Example:
//Servlet
String errorMessage;
if error occurs set errorMessage to that error.
request.setAttribute("Message",errorMessage);
//JSP
Acces Message string from request Object and display it imn JSP page using
String errorMessage=request.getAttribute("Message");
This shud work in your case.

Similar Messages

  • How  to propogate the JAAS LoginException to JSP

    Hi,
    I have written a simple LoginModule to plug in to tomcat 5.0xx. Just wondering is there a way to propogate LoginExceptions to a Tomcat JSP page.
    The current situation is when during authentication, if I I were to abort the process ( login() returns false ), a LoginException would be thrown, but the error is printed as a stack trace in tomcats' log file. If I modify the exception thrown to FailedLoginException, no stack trace would be printed at all.
    Now, the question is how am I able to get the exception on my JSP page instead of printing it out in the log file?
    thanks in advance,
    Tuan

    After processing your servlet ,forward it to JSP page and set that exception in object from servlet and accces it in JSP Page and display it.
    Example:
    //Servlet
    String errorMessage;
    if error occurs set errorMessage to that error.
    request.setAttribute("Message",errorMessage);
    //JSP
    Acces Message string from request Object and display it imn JSP page using
    String errorMessage=request.getAttribute("Message");
    This shud work in your case.

  • How to get the error raised in LoginModule into the error.jsp page?

    Hi,
    I would like to get the Exception message raised in a LoginModule and display it "friendly" into my error.jsp page.
    How to do that?
    Thanks.
    Stephane

    I have posted this question a few times. These forums are useless for all but the simplest of problems.
    Here is what you can do, of course it is unsupported, and may or may not break with a future release - all I can say is that it works in 10.1.3
    In your loginmodule login() method, add the JAZNContextCallback to your callbacks array, then after the callbacks are handled you can access the request in the following way:
    HttpServletRequest request = (HttpServletRequest) ((JAZNContextCallback)callbacks[2]).getContextObject(JAZNContextCallback.HTTP_SERVLET_REQUEST, null);
    You can then add the error message to the request and your jsp or whatever will be able to access it.
    By the way, JAZNContextCallback is contained in the jazncore.jar file.

  • Deployment Error -- JSP Compilation Error: java.lang.OutOfMemoryError -- nu

    When I deploy WAR files with the precompile jsp option, I receive the following error:
    Deployment Error -- JSP Compilation Error: java.lang.OutOfMemoryError -- null
    Is there a way for me to precompile my jsp's without using this process? Once this blows up, the admin server gets hosed. This is very frustrating. Any suggestions would be appreciated.
    Regards,
    Joshua

    You need little more memory :-), use java param -mx512M.
    You can adjust it in OC Server properties
    AS > OC4J_home(demo) > Server Properties
    section Multiple VM Configuration, Command Line Options
    Java Options: -mx512M
    Zajo

  • Redirect to error.jsp

    Hi,
    I am getting Http 500 Internal server error from tomcat. I have follwing Jsp fragment, that is throwing this error.
    <c:if test="${ empty userId}">
         <c:forEach var='thisCookie' items='${cookie}'>
         <c:if test='${thisCookie.key == "NWPUSERNAME"}'>
    <c:set target='${SharedCookieBean}' property='val' value='${thisCookie.value.value}' />
              <c:if test='${SharedCookieBean.valid == "true"}'>
         <c:set target='${UserBean}' property='userId' value='${SharedCookieBean.username}' />                
                   <c:if test='${SharedCookieBean.fflag == "true"} || ${UserBean.userFlag == "true"}'>
                   <c:redirect url="error.jsp?error=2" />               
                   </c:if>
         <c:set target='${UpdateUserAuthenticatedBean}' property='userId' value='${SharedCookieBean.username}' />
    <c:set target='${SetSessionParamsBasedOnUserIdBean}' property='req' value='${pageContext.request}' />
    <c:set target='${SetSessionParamsBasedOnUserIdBean}' property='userId' value='${SharedCookieBean.username}' />
    </c:if>
    </c:if>
    </c:forEach>
    </c:if>
    This happend when I give a bogus userid say xdf which is NOT present in the database during the authentication. server sends error 500, which i like to suppress and rather redirect to error.jsp(My redirect attempt in above code is NOT working). It does not redirect to error.jsp. It shows errro 500 Internal server error in the browser.
    any help in redirecting it correctly to error.jsp??
    pp

    My guess would be there is an exception happening in the database lookup code. If you set a generic errorPage for your jsp page, you should be able to redirect properly.
    Where does this occur - when you set the SharedCookieBean value?
    You might also try the <c:catch> tag. Put it around the bit of code creating the error.
    eg...
    <c:catch var="except">
        // the bit of code that creates the exception
       <c:set target='${SharedCookieBean}' property='val' value='${thisCookie.value.value}' />
    </c:catch>
    <c:if ${not empty except}">
      An exception occured - <c:out value="${except.message}"/>
    </c:if>Cheers,
    evnafets

  • How to redirect to error.jsp, if servlet encounters error ??

    how do i redirect to error.jsp file , if there is some error in my servlet file.
    can i user response.sendRedirect() in catch clause or i should use RequestDispatcher in catch clause ??

    You can use either way to redirect to error.jsp. If you want to pass your Request, response from servelet to JSP, then better to go for RequestDispatcher.

  • Weblogic 10 jaas and login.jsp and web.xml/weblogic.xml security constaints

    Hello,
    I struggled through and got the examples.security.jaas.SampleCallbackHandler.java and examples.common.utils.ExampleUtils.java/ExampleConstants.java into eclipse where they compile. A bean I made can call SambleCallbackHandler like such:
    mybean.logmein(username,password,url). I can then do a mybean.getStatus() or even a mybean.returnCode(). It does seem to correctly identlify that it is authenticating me (I see in stdout logs that it shows success or failures. The problem I have is I do not know how to apply this weblogic and web.xml/weblogic.xml so that if authentication works it redirects me to the page requiring the authentication. In web.xml I have the following set up:
    <security-role>
         <role-name>Admins</role-name>
    </security-role>
    <login-config>
         <auth-method>FORM</auth-method>
         <realm-name>default</realm-name>
         <form-login-config>
              <form-login-page>/login.jsp</form-login-page>
              <form-error-page>/badlogin.html</form-error-page>
         </form-login-config>
    </login-config>
    <security-constraint>
         <web-resource-collection>
              <web-resource-name>empower</web-resource-name>
              <description>These pages are only accessible by authorized users.</description>
              <url-pattern>/admin/*</url-pattern>
              <http-method>GET</http-method>
              <http-method>POST</http-method>
         </web-resource-collection>
    <auth-constraint>
    <description>These are the roles who have access</description>
    <role-name>Administrators</role-name>
    </auth-constraint>
         <user-data-constraint>
         <description>This is how the user data must be transmitted</description>
         <transport-guarantee>NONE</transport-guarantee>
         </user-data-constraint>
    </security-constraint>
    My weblogic.xml has:
    <?xml version="1.0" encoding="UTF-8"?>
    <wls:weblogic-web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wls="http://www.bea.com/ns/weblogic/90" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd http://www.bea.com/ns/weblogic/90 http://www.bea.com/ns/weblogic/90/weblogic-web-app.xsd">
    <wls:security-role-assignment>
    <wls:role-name>Admins</wls:role-name>
    <wls:principal-name>Administrators</wls:principal-name>
    <wls:principal-name>dashap</wls:principal-name>
    </wls:security-role-assignment>
    </wls:weblogic-web-app>
    With this set up, if I try to go to a page in /admin folder in my application, it correctly pops up the login page. The jaas in the bean is doing a loginContext.login(), which I thought does authentication too, but it never goes back to the /admin page I was going to that needed the authentication. With jaas, can I not use the web.xml FORM security option? Do I Need to use j_security in the login.jsp's form's action= option and j_username and j_password for the input type names? How do I use j_username/j_password things if I am using jaas? I could just ignore using the web.xml security stuff and put something in the pages that need authentication, but it would be easier if I could use jaas with the security featurs without doing all that. Note that my code above is using a realm called default just because that was what was in the example I got from the web. Does that need to be something else?

    Hi John,
    I would like magic of course. However, in this case I want something special: my authentication provider uses special means and contents of headers, cookies and service from external identity management systems to determine the user's identity.
    I do not want the application to present the login dialog! I want to derive the identity and the fact that the user is logged in from whatever the authentication provider returns in terms of Subject.
    Ideally, the flow is something like:
    - user accesses an unprotected resource - resource is shown, no interaction with authentication provider
    - user presses a link or button that takes him/her to a protected resource
    - the authentication provider is contacted to work with the identity asserter to establish the identity of the current user and create a subject object for this user
    - the application can access the subject and principals
    - ADF Security recognizes the identity and the roles (based on the principals) and coordinates access based on this.
    the authentication method is client certificate. presumably this prompts WebLogic/OPS to use an identity asserter to work with custom headers and cookies ("... when you configure a web application to use CLIENT-CERT authentication. In this case, WebLogic can perform identity assertion based on values from request headers and cookies. If the header name or cookie name matches the active token type for the provider, the value is passed to the provider."). No login form should be presented to the user, as all information required to perform the authentication is already available.
    I am trying to understand what I must do to have the ADF application adopt the subject set by the authentication provider - if anything?!
    If you more ideas to share - I would love to hear them.
    best regards,
    Lucas

  • JAAS configuration error

    HI Iam getting the following error while running a sample RDBMS JAAS Login Module
    Error creating LoginContext. Login Failure: all modules ignored
    javax.security.auth.login.LoginException: Login Failure: all modules ignored
    Please clarify this issue.
    Thanks in advance.
    Kt

    HI Iam getting the following error while running a
    sample RDBMS JAAS Login Module
    Error creating LoginContext. Login Failure: all
    modules ignored
    javax.security.auth.login.LoginException: Login
    Failure: all modules ignored
    Please clarify this issue.
    Thanks in advance.
    KtSomething must be wrong in the creation of your LoginContext. Either the config file is wrong or you callbackhandlers are wrong.

  • [JSP] Error JSP

    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:358)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    root cause
    java.lang.NullPointerException
         at org.apache.jsp.server_jsp._jspService(server_jsp.java:94)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    note The full stack trace of the root cause is available in the Tomcat logs.
    Apache Tomcat/5.0.19
    What is the problem?
    please!

    Hi,
    You get this exception is thrown when an application attempts to use null in a case where an object is required
    Refer http://java.sun.com/j2se/1.4.2/docs/api/java/lang/NullPointerException.html to understand when this exception can be thrown.
    Please post your code if you are unable to solve the issue.
    -Amol

  • Jaas login in uix, like the jaas login in jsp

    I read the note on jaas with jsp / vpd
    but this is not working on a uix application
    is there a easy way to have jaas login with
    uix

    I am very interested in the solution to this also! Is there a solution? I can't imagine nobody else has run up against this because prompting for user/password via a dialog is one of the first things one would do.

  • Error -JSP-Oracle 9i

    Hi,
    I was trying to connect my JSP with oracle 9i(isql).I was using following code
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@hostname:1521:course","username","password");
    Statement stmt = conn.createStatement();
    ResultSet rset = stmt.executeQuery("Select * from credit");
    But i'm getting following error:
    javax.servlet.ServletException: No suitable driver
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:846)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:779)
         org.apache.jsp.myJSP.connectDBJsp_jsp._jspService(org.apache.jsp.myJSP.connectDBJsp_jsp:112)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:99)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:325)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    root cause
    java.sql.SQLException: No suitable driver
         java.sql.DriverManager.getConnection(DriverManager.java:545)
         java.sql.DriverManager.getConnection(DriverManager.java:171)
         org.apache.jsp.myJSP.connectDBJsp_jsp._jspService(org.apache.jsp.myJSP.connectDBJsp_jsp:61)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:99)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:325)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    Please tell me how to correct it.
    Thanks for ur help
    Prerp

    Use the following code which will help you
    Class.forName("oracle.jdbc.driver.OracleDriver");
    con=DriverManager.getConnection("jdbc:oracle:thin:@hostname:port:SID",username,password);
    continue with rest of the code.
    Make sure classes12.jar or classes12.zip must be in classpath.

  • POST INSTALLATION ERROR : JSP ?? HELP OUT

    My Pre Installation Steps were perfect
    The installation went fine
    I Installed on XP, used Cygwin, and VC++, as given in the blog, for installing on XP
    Everything went fine.
    It took me over 5 hours for staging and installing
    But at the last stage
    Post Installation Steps checks was stuck some where
    I am sending you the last part of log file. It might help you to detect the error.
    Please tell me what went wrong, and where
    C:\Stage11i\startCD\Disk1\rapidwiz>echo off
    Mon 02/11/2008
    01:21 AM
    "The environment settings are as follows ..."
    " ORACLE_HOME : C:\oracle\visora\8.0.6"
    " ORACLE_SID : "
    " TWO_TASK : "
    " PATH : C:\oracle\visora\8.0.6\bin;C:\oracle\viscomn\util\java\1.4\j2sdk1.4.2_04\bin;C:\Perl\site\bin;C:\Perl\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem; C:\Cygwin\bin; C:\V98\VC\bin"
    " LD_LIBRARY_PATH : C:\oracle\visora\8.0.6\lib"
    SQL*Plus: Release 8.0.6.0.0 - Production on Mon Feb 11 01:21:58 2008
    (c) Copyright 1999 Oracle Corporation. All rights reserved.
    Connected.
    Disconnected from Oracle9i Enterprise Edition Release 9.2.0.6.0 - Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.6.0 - Production
    connect test returning code 0
    ERRORCODE = 0 ERRORCODE_END
    Apps ORACLE_HOME connection test has succeeded
    Environment File Check
    Database ORACLE_HOME environment file passes instantiated variables test:
    File = C:\oracle\visdb\9.2.0\VIS_sid-87f00f29add.env
    Apps ORACLE_HOME environment file passes instantiated variables test:
    File = C:\oracle\visora\iAS\VIS_sid-87f00f29add.cmd
    iAS ORACLE_HOME environment file passes instantiated variables test:
    File = C:\oracle\visora\8.0.6\VIS_sid-87f00f29add.cmd
    APPL_TOP environment file passes instantiated variables test:
    File = C:\oracle\visappl\VIS_sid-87f00f29add.cmd
    ADOVARS environment file passes instantiated variables test:
    File = C:\oracle\visappl\admin\adovars.cmd
    APPSCONFIG passes instantiated variables test:
    File = C:\oracle\visappl\admin\adconfig.txt
    DBC File Check
    DBC file passes instantiated variables test:
    File = C:\oracle\visappl\fnd\11.5.0\secure\VIS_sid-87f00f29add\vis.dbc
    HTTP Check
    checking URL = http://sid-87f00f29add.mydomain:8000
    Portal is responding
    JSP Check
    [b] checking URL = http://sid-87f00f29add.mydomain:8000/OA_HTML/jsp/fnd/fndhelp.jsp?dbc=C:\oracle\visappl\fnd\11.5.0\secure\VIS_sid-87f00f29add\vis.dbc
    JSP is not responding, waiting 15 seconds and retesting.
    JSP is not responding, waiting 15 seconds and retesting.
    [b] JSP is not responding, waiting 15 seconds and retesting.
    JSP is not responding, waiting 15 seconds and retesting.
    JSP is not responding
    PHP Check
    checking URL = http://sid-87f00f29add.mydomain:8000/OA_HTML/US/ICXINDEX.htm
    Login Page is responding
    As Mentioned i am able to open the homepage for Oracle
    But not able to go ahead.
    please help me what is missing ?
    Thanks in advance
    Sidharth

    Sidharth ,
    Do you have a valid entry in the hosts file?
    I would suggest you change your hostname "sid-87f00f29add", and check then. You can either change it and start the installation all over again OR follow the steps outlined in the following notes to do that.
    Note: 341322.1 - How to change the hostname of an Applications Tier using AutoConfig
    https://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=341322.1
    Note: 338003.1 - How to change the hostname of an Database Tier using AutoConfig
    https://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=338003.1

  • Installation complete with one error JSP Timing Out. Need suggestion/help

    JSP Check
    checking URL = http://khushi.mydomain:8003/OA_HTML/jsp/fnd/fndhelp.jsp?dbc=g:\oractest3\vistest3appl\fnd\11.5.0\secure\VISTEST3_khushi\vistest3.dbc
    JSP is not responding, waiting 15 seconds and retesting.
    JSP is not responding, waiting 15 seconds and retesting.
    JSP is not responding, waiting 15 seconds and retesting.
    JSP is not responding, waiting 15 seconds and retesting.
    JSP is not responding
    /i have done both ways. Have waited for 15 mins. and then did a restart of rapidwiz it is still giving this error.
    also have installed JDK6.0 at c drive and have also added the bin folder in the path directory.
    please let me know what needs to be done..
    appreciate if somebody can help.
    .I can see the welcome page. but the servlets are not visible.
    Any help pointers would be of great help.
    thanks.
    dhriaj

    Which JDK should be installed ?
    Can somebody tell what exactly should be done for JSP Timing Out. I mean there should be something for that.. So many people have got the issue. Today night after work I am going to sit and diagnose the issue.
    If anybody can give any pointers/directions as to how this is to be diagnosed. That would be of immense help.
    Thans hsawwan. I will try your commands. But a more verbose help would be of cause for this issue.
    Thanks,
    Dhiraj

  • JAAS AdminTool error

    Hello:
    I tried to run JAAS AdminTool but got the following errors. Any idea?
    C:\jdevstudiobase1013\j2ee\home>java -jar jazn.jar
    Exception in thread "main" java.lang.UnsupportedClassVersionError: oracle/securi
    ty/jazn/tools/Admintool (Unsupported major.minor version 48.0)
    at java.lang.ClassLoader.defineClass0(Native Method)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.access$100(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    Thanks in advance

    Hi,
    type java -version and ensure the JRE you use is Java 5. If not, download Java JRE 1.5 or execute the command from a JRE 1.5 home
    Frank

  • PropertyDescriptor Error - jsp

    Hello all,
    I have a Transferobject class B with getter/setter method which extends an AbstractTransferObject class A (which is abstract)...my jsp was working fine with this structure I wanted a common TransferObject C which extends B and B extends A ...something like this ...
    public abstract class A{
    public class B extends A{
    public class C extends B{
    ]But I'm getting the following error
    PropertyDescriptor: internal error while merging PDs: type mismatch between read and write methods
    I think there is nothing wrong in extending a class which already extends another class....
    Help is greatly appreciated
    Thanks

    .

Maybe you are looking for

  • Suddenly I can't open any email attachments in MSWord, Excel or Powerpoint format

    I have been using my  PC with Windows 7 and multiple browsers (IE, Chrome & Firefox) I have experienced the same problem on all three browsers.  For the past week, whenever I downloaded a MSOffice formatted attachment I can download it or save it but

  • Adding Button to a form

    Hi I'm trying to add a new button to a form, here is my code:         objForm = SBO_Application.Forms.GetForm("992", "1")         objForm.Items.Add("btnHelp", BoFormItemTypes.it_BUTTON)         btnHelp = objForm.Items.Item("btnHelp").Specific        

  • Migrating CE9 reports to XI R3.1

    I have a customer that is asking the following questions: 1, When you import (migrate) reports from CR 9.0 to BO XI 3.1 are they automatically upgraded to CR 2008 format?     Or do you have to open the reports in CR 2008 designer, refresh it and then

  • PO_BOX not bound

    Hello , I have enhanced the compoent:IUICMD for PO BOX which is selected from BOL entity :'BuilStandardAddress'. For this i have created a new context node for this attribute and assign the same into view configuration. But while testing the view IUI

  • Can log into adobe experience manager assets

    I cant log into adobe experience manager assets - Keeps telling me "unable to connect to the server.Try again or contact your administrator" I am already logged in with a user name and password into creative cloud but I also keep getting this message