How to authorize my Login.jsp file to create LoginContext, deployed in war

I am currently doing a login process and I need to know how to give my Login.jsp file the permission to create a LoginContext. I packaged everything in a war file and deployed it to the server.
Specifically this is the error that I am getting:
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: access denied (javax.security.auth.AuthPermission createLoginContext.studentportal)
     org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:384)
     org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:297)
     org.apache.jasper.servlet.JspServlet.service(JspServlet.java:247)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
     sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     java.lang.reflect.Method.invoke(Method.java:585)
     org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
     java.security.AccessController.doPrivileged(Native Method)
     javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
     org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
     org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)
root cause
java.security.AccessControlException: access denied (javax.security.auth.AuthPermission createLoginContext.studentportal)
     java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
     java.security.AccessController.checkPermission(AccessController.java:427)
     java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
     javax.security.auth.login.LoginContext.init(LoginContext.java:224)
     javax.security.auth.login.LoginContext.(LoginContext.java:403)
     org.apache.jsp.Login_jsp._jspService(Login_jsp.java:55)
     org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:105)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
     org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:336)
     org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:297)
     org.apache.jasper.servlet.JspServlet.service(JspServlet.java:247)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
     sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     java.lang.reflect.Method.invoke(Method.java:585)
     org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
     java.security.AccessController.doPrivileged(Native Method)
     javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
     org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
     org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)
note The full stack trace of the root cause is available in the Sun-Java-System/Application-Server logs.
In my code in Login.jsp this is what I have at the top of the page:
<%@ page language="Java" import="portal.*,javax.security.auth.login.*" %>
<%
String s = request.getParameter("loginButton");
if (s != null) {
out.println("The user attempted to login");
String user = request.getParameter("username");
String psw = request.getParameter("psw");
AscCallbackHandler cbh = new AscCallbackHandler(user,psw);
LoginContext ctx;
try {
ctx = new LoginContext("studentportal",cbh);
} catch (LoginException  le) {
out.println("Sorry, could NOT create context");
}The admin page tells me that portal is deployed at location:
${com.sun.aas.instanceRoot}/applications/j2ee-modules/portal
My entry in the server.policy file looks like so:
grant codeBase "file:/home/jay/sun/Creator2_1/SunAppServer8/domains/creator/applications/j2ee-modules/portal/WEB-INF/-" {
permission javax.security.auth.AuthPermission "createLoginContext.studentportal";
permission javax.security.auth.AuthPermission "modifyPrincipals";
permission javax.security.auth.AuthPermission "getLoginConfiguration";
Which gives the error shown above
Please help
Message was edited by:
jay_dawg
Placing code tags

java.lang.NoClassDefFoundError: org/jdom/JDOMException
     java.lang.Class.getDeclaredConstructors0(Native Method)
     java.lang.Class.privateGetDeclaredConstructors(Class.java:2357)
     java.lang.Class.getConstructor0(Class.java:2671)
     java.lang.Class.getConstructor(Class.java:1629)
     org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1164)
     org.apache.jasper.compiler.Node$UseBean.accept(Node.java:1116)
     org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
     org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
     org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2219)
     org.apache.jasper.compiler.Node$Root.accept(Node.java:456)
     org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
     org.apache.jasper.compiler.Generator.generate(Generator.java:3305)
     org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:198)
     org.apache.jasper.compiler.Compiler.compile(Compiler.java:295)
     org.apache.jasper.compiler.Compiler.compile(Compiler.java:276)
     org.apache.jasper.compiler.Compiler.compile(Compiler.java:264)
     org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
     org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:303)
     org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
     org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
     org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)and following by this

Similar Messages

  • Functionality of  LoginSubmit function in Login.jsp file

    Hi,
    I have tried to change the javascript customization in the "Login.jsp" file on my test box but I am sort of stuck in terms of getting the logic behind the function "LoginSubmit(value)" .
    What I have tried to do is to create a conditional expression based on the button ("submit" or "cancel" in the password reset form) that is clicked. Based on my testing I find that the function "LoginSubmit(value) " is called for each button click and it seems to treat each call in a different way.
    The function "LoginSubmit(value)" is a function which is available in the default implementation of access manager itself. I basically needed to know how this function works when the "Login.jsp" file is called or how this function responds to each button click .
    Can anyone direct me to specific documentation which is of help.
    Appreciate your thoughts on the working of this function.
    Thanks,

    Have a look here. This might be useful to you:
    Re: How to call a PL/SQL procedure from a Java class?

  • How can i access the jsp file in a asp file

    Hi every one..
    we have two projects one is developed in ASP and one is developed in JSP both are running in two different locations.
    now i want to include a jsp file from one project to ASP file in the other project.
    please tell me how can i insert the JSP file in ASP application.
    thanx in advance.

    Wouldn't that be an ASP question for an ASP forum?

  • How can i change login.jsp in oracle portal

    Hi every body,
    I want to change login.jsp page or replace another page instead of it.How can i do this?
    can i build a page and add login portlet to it and replace it instead of login.jsp

    I have tried this. (But I just modify the jsp code directly)
    But page doesn't change at all.
    Also there is another question.
    Where should i put image file???

  • How to precompile jsp file in jdeveloper before deployment....

    Hi
    thank you for reading my post
    how i compile jsp file in my web application , is it doable in jdeveloper 10.1.3.0.4?
    even if i could precompile the application before deployment is OK for me.
    thanks

    1. Highlight your web project or the individual file
    2. Right click
    3. Select Rebuild to build all jsp files or Make to rebuilt only changed files

  • How to run/build the JSP file using Eclipse

    Hello,
    I want to build a new project for running the jsp file in eclipse.
    Can you help me in doing that?
    with some structure format?
    where to create web.xml file
    how to configure that fiel with our eclipse java poject?
    like that...
    Thanks,
    Soorya

    On New Project creation, choose 'Dynamic Web Project'. Then the structure will be created for you.

  • How to get  value on jsp file from ActionServlets class

    Hi All,
    I am facing problem in action servlets class into Struts, I am able to get the value on jsp file from action class with the help of session scope but i want to another method for it , so how i can solve the problem.Plz help me
    Thanks......... in advance

    I got a way out to access the attribute, i feel it is
    <jsp:usebean id="myRack" class="settings.Rack"/>
    <c:foreach var="book" item="myRack.books">
    </c:foreach>
    I am not able to check if this is correct or not because myRack.books is not having any value set by me in the request scope. How do i get instance of Rack class set by another page in the current request? I can get the value if i use scriptlet but i dont want to use scriptlet.
    I am continiously trying, if I get an answer, I shall post, else pls somebody guide.

  • How to transfer parameters in jsp files

    what i want is :
    there is a jsp file named errorMsg.jsp, and in the file a variable msg which type
    is String is used, and the value of msg will be display on web browser.
    now, i want transfer a string to the errorMsg.jsp in another jsp file named try.jsp.
    that mean i can decide which string be transfered dynamically, and transfer it to
    errorMsg.jsp to show on the user's browser.
    i want not to use the url something like this .../errorMsg.jsp?msg=hello.
    any other method is there for using.
    thx.

    If the page involves form, another alternative is to use hidden fields for that.
    <form name="errorMsg.jsp" method="POST">
    <input type="hidden" name="message" value="hello">
    ... other fields here....
    </form>
    => and in errorMsg.jsp retrieve the value using
    String msg = request.getParameter("message");

  • How can i include a jsp file in servlet?

    hi
    i generate a dynamic page from servlet.
    i need to include a jsp file in same servlet.
    i try like this --
    out.println("<HTML>");
    out.println("<HEAD><TITLE>First</TITLE></HEAD>");
    out.println("<BODY>");
    out.println("<%@ include file=\"abc.jsp\">");
    out.println("<FORM>");
    out.println("</FORM>");
    out.println("</BODY>");
    out.println("</HTML>");

    Replace your line with
    RequestDispatcher rd = request.getRequestDispatcher("abc.jsp");
    rd.include(request, response);

  • How to use class in JSP file?

    Hello All,
    I am new to Jsp.
    In Jsp file,I used class of myself.
    Why,the Constractor seems not working?
    Thanks in advance.

    Hi,
    You can import the class in a jsp file.
    Use <% page import = "">
    and call that class.
    If u want to import a funtion in your class, then u can insert that into scriplets like <%! ..%>
    Hope u got that!
    Artz

  • How to add entries a jsp file during a Source view

    hi all,
    im currently extending the tags present on BEA. im creating my own custom tag. when i tried to drag and drop it on the current source view of the jsp file..
    is it possible for me to check the current source code of the jsp file first before preceding. For example. if the tag to be inserted must be within a certain tag only..
    or modify an existing tag. say a <netui:form > and add some attributes on it.

    Looks like Crystal Reports is using log4j for logging, which is so badly designed that it throws a fit if the log4j configuration is missing.
    All you need to do to get it to work is put a log4j.properties file in the classpath (google for a dummy file with default values). It usually needs to be put in the root of the classpath.
    Or you can initialize the log4j logging for your own application properly and Crystal Reports will piggyback on it.

  • How to do handle multiple JSP file in one portlet?

    Hi...
    I studied the JPDK for multipage..
    What the example do, is just link from page 1 to page 2.
    What i want to do is..
    I have a jsp called infoForm.jsp as a portlet.
    When i clicked submit button, a second page (getForm.jsp) will grab the data and will process it and send the result back to the infoForm.jsp.
    Can anybody help me on this?
    Thanks..

    Akshay,
    If am not wrong, you are trying to upload files using your portlet. Then you expect the content from the uploaded file should be available at the provider midtier to your portlet JSPs. There are certain issues wrt file upload using a web provider.
    Since, the PPE & JPDK communicate using SOAP over HTTP/S, they cannot handle the requests where content type is multipart, as is the case with file uploads. Hence the solution to this is to upload that file in the Portal content area & not to bring it to the provider midtier. There was a DB portlet available on Knowledge Exchange that could do this. So please visit Knowledge Exchange & search for the DB portlet for file upload.
    If there is anything else that you desire, please let me know.
    Regards,
    Abhinav

  • How can I include a jsp file in other jsp from different applications?

              Hi,
              I'd like know if it´s possible to include jsp or servlet from different applications.
              

              Thanks Deepak but I think you don´t understand me.
              I would like the include works like a normal include. I have a jsp in my application
              and , when the client requests this jsp, in the jsp should be added the result
              of the other jsp ejecution that belong to other application in the same domain.
              Is this possible?
              Thank you very much.
              Deepak Vohra <[email protected]> wrote:
              > A Jsp from a different application is included with a relative url to
              >th=
              >e Jsp.
              ><%@ include file=3D"relative url" %>
              >
              >A Jsp could be included with request parameter.
              > <jsp:include page=3D'<%=3D request.getParameter("incFile") %>' />
              >
              >javilla wrote:
              >
              >> Hi,
              >>
              >> I'd like know if it=B4s possible to include jsp or servlet from differe=
              >nt applications.
              >
              

  • How to create and deploy a war file on wls using the console

              my question is how to deploy the simpleSession.jsp example in the weblogic/samples/examples/jsp/
              dir examples as a war file on wls cluster what are the steps to do so.. thanks
              in advance
              

    [att1.html]
              

  • How do I move a .mp3 file I created in my music software to iTunes?

    My music software now has .mp3 creation capabilities, with ID tags.  I am trying to insert one file as a test (and the ID tags are filled in).  In my PC running Windows 7, I navigated to Music\iTunes\iTunes music\[new folder] and place the .mp3 file there.  But when I open iTunes, my file does not appear in the list.  I've clicked on all the subcategories to alpha them, but no luck.  How do I install this?  I need to know because I am going to offer .mp3 files with a book I've written, which is being published now.
    Thank you!

    You need to open iTunes first then drag and drop the mp3 file onto the Music section of iTunes to get the file imported.

Maybe you are looking for

  • In WIndows 8, Google search results for Firefox (only) appear in a narrow column on the left of the window.

    Firefox (25.0.1) and Google worked well together until 11/26/2013 when a guest user searched on Google. Google search still works well on IE and Chrome. The problem is only on Firefox and only with Google. Bing, Ask, Yahoo, Wikipedia all perform and

  • I got a big red X on my iPod that won't go away! Help!

    So yes, l do have this big red X on my iPod (l'm thinking this is like red ring on an Xbox 360), and no matter how many times i reset it, it won't go away. I'm thinking this time is no trick, it's messed up. What can i do? - l did try and connect it

  • T-SQL: Manual Backup of Multiple Databases

    I am looking to change the way I do manual backups of multiple databases on the same instance of SQL Server 2008 R2. Currently I have T-SQL scripts for each database that look like this: BACKUP DATABASE [mydbname] TO DISK = N'D:\backup\manual\2014-01

  • Print with cp1515n

    Does anyone have the same problem with printing using HP color laserjet CP1515n? Printing in black and white is ok.  Cannot print in color.  There are shadows in color printouts.  The colors are not aligned.

  • Organisational keys are assigned based cost centre associated with Bus Area

    Hi , I need to add the authorization check in the Z* program Within TE, restrictions are being implemented based upon organisational key.  Organisational keys are assigned based upon whether or not the cost centre has an associated business area.  If