Error JSF

Hello, the first thing i want see you is i'm sorry for my english because it's very bad.
I have a problem... I have one jsp file with following code:
<%@page language="java" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
     <base href="<%=basePath%>">
     <title>My JSF 'Login.jsp' starting page</title>
     <meta http-equiv="pragma" content="no-cache">
     <meta http-equiv="cache-control" content="no-cache">
     <meta http-equiv="expires" content="0">   
     <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
     <meta http-equiv="description" content="This is my page">
     <!--
     <link rel="stylesheet" type="text/css" href="styles.css">
     -->
</head>
<body>
     <f:view>
          <h:form id="loginForm">
               <h:message for="loginForm" /><br />
                    <h:outputText value="Usuario" />
                    <h:inputText id="usuario" value="#{LoginManagedBean.usuario}"></h:inputText> <br />
                    <h:outputText value="Password" />
                    <h:inputSecret id="clave" value="#{LoginManagedBean.password}"></h:inputSecret>
               <h:commandButton id="Submit" action="#{LoginManagedBean.login}" value="Login" />
          </h:form>
     </f:view>
</body>
</html>I think this is good, but, when i want see this page i see this error:
org.apache.jasper.JasperException: La uri absoluta: http://java.sun.com/jsf/core no puede resolverse o en web.xml o el los archivos jar desplegados con esta aplicaci�n
     org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:50)
     org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:411)
     org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:118)
     org.apache.jasper.compiler.TagLibraryInfoImpl.generateTLDLocation(TagLibraryInfoImpl.java:316)
     org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:147)
     org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:418)
     org.apache.jasper.compiler.Parser.parseDirective(Parser.java:483)
     org.apache.jasper.compiler.Parser.parseElements(Parser.java:1539)
     org.apache.jasper.compiler.Parser.parse(Parser.java:126)
     org.apache.jasper.compiler.ParserController.doParse(ParserController.java:220)
     org.apache.jasper.compiler.ParserController.parse(ParserController.java:101)
     org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:203)
     org.apache.jasper.compiler.Compiler.compile(Compiler.java:470)
     org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
     org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
     org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
     org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
     org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
     org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:802)Do you know which the problem is?
Thanks

La uri absoluta: http://java.sun.com/jsf/core no puede resolverse o en web.xml o el los archivos jar desplegados con esta aplicaci�nYes, I forgot translate the error... It's more or less:
The absolut uri: http://java.sun.com/jsf/core cann't resolve or in web.xml or in the jar opened files with this application.I'm sorry but i don't know where I have to put these jars... In the windows classpath??? If anyboy wants see my web, he has to input these jars in his classpath?? Or I have to input these jars in some where in Eclipse???

Similar Messages

  • Validation Error - JSF Custom Component

    I am trying to create a Custom Component. It is a pre-populated list of selection items. So all that the page author would have to do is use a tag like
    <jsfcust:mySelectOneComponent  value="#{requestScope.selectedItem}/>and this should display a drop-down list from which only one item can be selected. I got this working except for the final stretch.
    I created the following...
    1. tag in the .tld file
    2. CustSelectOneTag.java (set the value as a ValueBinding in setProperties() method)
    3. CustSelectComponent.java
    4. CustSelectRenderer.java (In the decode() method, called setSubmittedValue(value) on the component)
    5. updated the faces-config.xml file
    The display seems to be working fine. The problem is when I click on a Submit button and go to the next page where I want to display the selected value. It shows up as null. All that I want to do is be able to select an item from the custom drop down and display it in the next page after hitting submit.
    What is the proper way to send the value back in the response? In my case, I was merely trying to pass the value so that the next page can access it from the request scope and display it.
    I was not sure if I had to implement the getConvertedValue() method in my renderer. Can someone help?
    Thanks,
    JM

    Thanks for your reply! Your answer fixed my problems, so definitely thanks! I need to use escaped values for things like "<,&,#, etc", like the pound "amp" semicolon stuff. If I try to type out strings like these the forum unescapes them - fun part of posting forum questions about HTML escaping on HTML-based forums! :) I didn't realize an escaped querystring would still work as expected in a <a href ... />. You actually fixed both of my problems, and I... I do feel appropriately foolish now :) Had a feeling this might be a slaps forehead one. Thanks for the quick answer!,
    Jim

  • JSF error handling when the bean is not correctly loaded

    Hi,
    I am doing some error handling in JSF and I want to do it in an elegant way. I have the following scenario for error handling.
    When the bean is initialized I load the bean with values from DAO which give SQL Exceptions.
    Since the bean is not loaded I properly I have to send the user to an error page showing the error message why I am sending the user to this page.
    I can do it by [ FacesContext.getCurrentInstance.redirect("/error.jsf") ] doing so I will loose all the FacesMessages that are added by the exceptions.
    Instead I want to use the [ FacesContext.getCurrentInstance.dispatch("url") ] which will allow the transfer of the user but I get the following
    16:59:39,341 WARN [lifecycle] executePhase(RESTORE_VIEW 1,com.sun.faces.context.FacesContextImpl@8537f9) threw exception
    java.lang.ClassCastException: javax.faces.component.UIViewRoot
    and the method that I am calling is
    public static void programErrorEnd() {
    logger.info("in the prgmErrorEnd mehod");
    //intializing the contex object
    FacesContext ctx = FacesContext.getCurrentInstance();
    try {
    //ready to dispatch the url.
    //ctx.getExternalContext().redirect("app/error/prgmerror.jsf");
    ctx.getExternalContext().dispatch("error/prgmerror.jsf");
    } catch (IOException e) {
    //TODO what to do when there is an error at this stage.
    finally {
    ctx.responseComplete();
    }Thanks and Regarding
    Edited by: sgatl2 on Aug 28, 2008 2:32 PM
    Edited by: sgatl2 on Aug 28, 2008 2:45 PM

    Just let it throw the exception and define an error-page entry in the web.xml which catches the specified exception (or a superclass of it or a HTTP status code) and displays the error.jsf page accordingly.

  • Jsf install error

    I am trying to use jsf with JBOSS, i copied all my jar files, and reference in my web.xml ect.
    but when i try to start my server, it says
    javax.servlet.ServletException: Servlet.init() for servlet Faces Servlet threw exception
         org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
         org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
         org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:407)
         org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
         org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
         org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
         org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
         org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
         java.lang.Thread.run(Thread.java:534)
    root cause
    java.lang.NullPointerException
         javax.faces.webapp.FacesServlet.init(FacesServlet.java:144)
         org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
         org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
         org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:407)
         org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
         org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
         org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
         org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
         org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
         java.lang.Thread.run(Thread.java:534)
    note The full stack trace of the root cause is available in the Apache Tomcat/5.5 logs.

    I have very similar error. I have a very simple JSF page:
    <body>
         <f:view>
              This is my Error JSF JSP page. <br>
         </f:view>
    </body>It works with Tomcat, but not in JBoss, giving the following error:
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: Exception in JSP: /Error.jsp:29
    26: </head>
    27:  
    28: <body>
    29:      <f:view>
    30:           This is my Error JSF JSP page. <br>
    31:      </f:view>
    32: </body>
    Stacktrace:
         org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:504)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
         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:810)
         com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
         com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:147)
         com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
         com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
         com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
         org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
    root cause
    java.lang.NullPointerException
         javax.faces.webapp.UIComponentTag.setupResponseWriter(UIComponentTag.java:615)
         javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:217)
         org.apache.myfaces.taglib.core.ViewTag.doStartTag(ViewTag.java:71)
         org.apache.jsp.Error_jsp._jspx_meth_f_view_0(Error_jsp.java:109)
         org.apache.jsp.Error_jsp._jspService(Error_jsp.java:84)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
         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:810)
         com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
         com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:147)
         com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
         com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
         com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
         org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
    note The full stack trace of the root cause is available in the Apache Tomcat/5.5.17 logs.And I have the following web.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee   http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    <listener>
        <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
    </listener>
      <context-param>
        <param-name>javax.faces.CONFIG_FILES</param-name>
        <param-value>/WEB-INF/faces-config.xml</param-value>
      </context-param>
      <!-- Faces Servlet -->
       <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
      </servlet>
      <!-- Faces Servlet Mapping -->
      <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>/faces/*</url-pattern>
      </servlet-mapping>
      <welcome-file-list>
           <welcome-file>/Index.jsp</welcome-file>
      </welcome-file-list>
    </web-app>Any ideas??
    Thanks in advanced
    Mensaje editado por:
    [email protected]

  • Dealing with javax.faces.application.ViewExpiredException in jsf 1.2

    Hello,
    I am working on a jsf 1.2 application and I am trying to implement a way to deal with the ViewExpiredException. Here is what I tried:
    <error-page>
    <exception-type>javax.faces.application.ViewExpiredException</exception-type>
    <location>/WEB-INF/include/viewExpired.jsf</location>
    </error-page>
    (there is a viewExpired.xhtml file in the same folder as the jsf file)
    What happens is that the above exception is indeed thrown by my app by an ajax component but the error page is not displayed leaving the user with an application that is not working.
    Can anyone please help?
    Thanks in advance,
    Julien.

    Facelets tends to wrap exceptions into generic ones; anything that is not an IOException or a RuntimeException is wrapped into a FacesException. Thus your ViewExpiredException is not the top-level exception anymore and the error-page rule won't work.
    The way I work around this is to define my own view handler to be able to deal with exceptions myself. I figured this out from some article, but I cannot find it anymore. So I'll just post what I have:
    public class MyFaceletsViewHandler extends FaceletViewHandler {
      // TODO: replace with your own log API
      protected Logger  logger = Logger.getLogger(getClass().getName());
      public MyFaceletsViewHandler(ViewHandler parent) {
        super(parent);
      protected void handleRenderException(FacesContext context, Exception ex) throws IOException, ELException, FacesException {
        try {
          Throwable rootcause = findRootCause(ex);
          context.getExternalContext().getSessionMap().put("exception", rootcause);
          logger.error("Error rendering view!", ex);
          // TODO: put correct path to error page here
          ((HttpServletResponse) context.getExternalContext().getResponse()).sendRedirect("error.jsf");
          context.responseComplete();
        catch (IOException ioe) {
          logger.fatal("Could not process redirect to handle application error", ioe);
      private Throwable findRootCause(Throwable t){
        Throwable ret = t;
        while(ret.getCause() != null && ret.getCause() != ret){
          ret = ret.getCause();
        return ret;
      }And in your faces-config.xml:
    <application>
            <view-handler>package.to.MyFaceletsViewHandler</view-handler>
        </application>In the view handler you can then target specific exceptions if you want, like your ViewExpiredException. I added a little trickery to search for the root cause of the exception; that is usually the only part of an exception stacktrace that I'm interested in.
    If anybody knows a better way to deal with specific exceptions in facelets, please share.

  • JSF Tiles Stylesheet solution

    This is just a post for other newbies (like me !) out there who might have struggled with integrating JSF & Tiles. It turns out my problem was not integration related at all & nor was it related to JSF (probably) or Tiles. I just did not know how to load a stylesheet correctly. The way I did it the first time was:
    <head>
    <link rel="stylesheet" href="./config/styles.css" type="text/css"/>
    </head>
    This worked fine the first time the page was displayed. Now if there was a validation error JSF would re-display the same page with all styles missing. The page would have the correct Tiles layout nonetheless.
    After much searching up all the wrong alleys (such as integration between the two etc.), I finally arrived at the correct way to load the .css file:
    <head>
    <link rel="stylesheet" href="<%=request.getContextPath()%>/config/styles.css" type="text/css" />
    </head>
    Now the path is derived from the contextPath of the application each time and the pages do not lose their styles.
    ...just in case someone else hits this and ends up looking here.
    Ciao, Bhishma

    Thanks Bhishma your solution was very usefull, I wish to know if you have some blog or something where I could write to you, for to be in touch and share experiences from our countries, sorry for my bad english

  • JSF TLD Namespace Deployment Issue

    We have gotten through the other issues with depployments. However, right now no matter what we deploy we are getting a JSP-0008 error
    JSF TLD Namespace is not registered.
    I have included all the JSP, Tag Libraries and files I can think of in the deployment - to the point my deployment WAR file is almost 50 megs.
    Why would the application not alos deploy to the default-web-app directory if that is what we specified when doing the deployment, it only deploys to the applications sub-directory..
    Any ideas how to resolve these would be great?

    Hi Friends,
    I downloaded the source code of JSF implementation and I went through the entire sequence. It looks like Util.getViewHandler() calls fails when it invokes the conext.getApplication().
    Line # 127 is creating a new application object using ApplicationFactory.
    ApplicationFactory aFactory =
    (ApplicationFactory) FactoryFinder.getFactory(
    FactoryFinder.APPLICATION_FACTORY);
    application = aFactory.getApplication();
    The only way that can throw a null pointer is when aFactory is NULL. I really doubt this case because, the same thing is doen in init() of FacesServlet. If it had failed there, the exception should have occured during server startup.
    This leaves me more and more confused....I am desperate for some help now :((
    Ramesh

  • Session Time Out and Redirect to login page - urgent

    My problem is I want to display alert message and redirect to the home page when session expires.
    Iam using TimeOutListener in my application as follows.
    public PhaseId getPhaseId() {
    return PhaseId.ANY_PHASE;
    public void beforePhase(PhaseEvent phaseEvent) {
         FacesContext facesContext = phaseEvent.getFacesContext();
    HttpSession sessionx = (HttpSession)facesContext.getExternalContext().getSession(false);
    if(sessionx == null) {
         FacesUtils.sessionCheck = true;
    String ampee = (String)((HttpServletRequest)FacesContext.getCurrentInstance().getExternalContext().getRequest()).getAttribute("ampee");
    if(ampee != null && ampee.equals("ampee")) FacesUtils.sessionCheck = false;
    if(phaseEvent.getPhaseId() == PhaseId.RENDER_RESPONSE) {
         if(FacesUtils.sessionCheck){
         facesContext.getApplication().getNavigationHandler().handleNavigation(facesContext, "", "sessionExpired" );
         FacesUtils.sessionCheck = false;
    ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();
              HttpServletRequest request = (HttpServletRequest) externalContext.getRequest();
              HttpSession session = request.getSession();
              if (session.isNew()) {
                   try {
                   String errorPageURL = externalContext.getRequestContextPath() +
                   "/index.jsf?errorpage=true";
                   externalContext.redirect(errorPageURL);
                   }catch(Exception e){
                        e.printStackTrace();
    here i have appended param errorPage=true...
    in jsp page i have used following code to get the param<% if(request.getParameter(errorPage)!=null && request.getParameter(errorPage).equals("true")){%>
    <script>alert("session expired");</script>
    <%
    %>
    Can any one help me how to Implement this?
    Do u know another way pls let me know...

    Consider using the Javascript setTimeout() function in conjunction with HttpSession#getMaxInactiveInterval(). The HttpSession#getMaxInactiveInterval() returns the remaining seconds of the session lifetime.
    Basic example:<script>
        setTimeout("alert('The session will timeout after one minute.')", <%= (session.getMaxInactiveInterval() * 1000) - 60000 %>);
    </script>I've given the client one minute (60000ms) extra time space to respond accordingly.
    Use this in combination with the following head:
    <meta http-equiv="refresh" content="<%= session.getMaxInactiveInterval() %>;url=login.jsf">which will redirect to login.jsf if the session is timed out. You can also redirect to another page of your taste, e.g. error.jsf or so.

  • Page does not navigate: form re-displays

    In my project there is a page which consists of 5 radio buttons and a "Submit" button at the last of the page.
    User selects a radio and on press Submit it navigates to a different page.
    Instead when i select a radio button and press Submit "Validation error:Value is not valid" is displayed on top of the page and page does not navigate.
    JSP code:
    <h:selectOneRadio
                                  styleClass="selectOneRadio" id="radio1"
                                                                     value="#{SL.objectSpace.sPId}" 
                                                                     onclick="return sL_radio1_onclick(this, event);">
                                                                <f:selectItem itemValue="#{varBObjs.pId}"
                                                                          itemLabel=" " />
                                                           </h:selectOneRadio>
    <hx:commandExButton type="submit" value="#{labels.button_CS}"
                                            styleClass="commandExButton" id="button_CS"
                                            action="#{SL.objectSpace.cS}"></hx:commandExButton>JS snippet:
    function sL_radio1_onclick(thisObj, thisEvent) {
         var parentRadioButtonName = thisObj.name;
         var p1=thisObj.value;
         var indexStart = eval("form1:table1:".length);
         var indexEnd = parentRadioButtonName.indexOf(':radio1');
         var parentIndex = parentRadioButtonName.substring(indexStart,indexEnd);
         if (!thisObj.checked){
              //parent unchecked, uncheck all children for this parent
              for(i=0;1==1;i++){
                  childRadioButtonName = 'form1:table1:'+parentIndex+':table2:'+i+':radio2';
                  if(thisObj.form.elements[childRadioButtonName]){
                      thisObj.form.elements[childRadioButtonName].checked=false;
                 } else {
                        break;
         } else {
              //parent checked, uncheck other parent
              for(i=0;1==1;i++){
                  parentRadioButtonName = 'form1:table1:'+i+':radio1';
                   if (thisObj.form.elements[parentRadioButtonName]) {
                     if(thisObj.form.elements[parentRadioButtonName].checked && (i != parentIndex)){
                          thisObj.form.elements[parentRadioButtonName].checked=false;
                             //uncheck children of this parent
                          for(j=0;1==1;j++){
                               childRadioButtonName = 'form1:table1:'+i+':table2:'+j+':radio2';
                                 if(thisObj.form.elements[childRadioButtonName]){
                                      thisObj.form.elements[childRadioButtonName].checked=false;
                                 } else {
                                            break;
                    } else {
                        if (i>parentIndex) {
                             break;
    }SL.java code:
    protected String sPId="same";
    |
    |
    public String getSPId() {
              return sPId;
              public void setSPId(String sPId) {
              this.sPId = sPId;
         }Thanks in advance.

    In addition my IDE throws the below error:
    (jsf E com.sun.faces.context.FacesContextImpl addMessage Adding Message[source Id = form1:table1 0:radio1,summary=Validtion Error:Value is not valid)                                                                                                                                                                                                                                                                                                                                                                                                   

  • Infinite loop/afrLoop when deploying ADF application to standalone weblogic

    Working with Oracle ADF / JDeveloper 11.1.2.2
    I have enabled ADF security in my application and am using JAAS combined with Oracle EBS users and roles to provide security to the application. Testing on my local integrated weblogic server works fine.
    When deploying my Oracle ADF application to a standalone Weblogic server through an EAR file, requesting a JSF page causes the server to go into an infinite loop on both IE and firefox.
    GET /test-app/faces/login.jsf HTTP/1.1     200
    GET /test-app/faces/login.jsf?_afrLoop=346001033248597&_afrWindowMode=0&Adf-Window-Id=w0 HTTP/1.1     302
    GET /test-app/adfAuthentication HTTP/1.1     302
    GET /test-app/faces/login.jsf HTTP/1.1     200
    GET /test-app/faces/login.jsf?_afrLoop=346001340281597&_afrWindowMode=0&Adf-Window-Id=w0 HTTP/1.1     302
    GET /test-app/adfAuthentication HTTP/1.1     302
    GET /test-app/faces/login.jsf;jsessionid=syWvP1nMY1L87BySh2JbTd1tb4SY0HzDw6T3LvLctvkbMWKmqqJv!1800986117 HTTP/1.1     200
    GET /test-app/adfAuthentication HTTP/1.1
    Reviewing some of the suggestions from the forum and from the link below, I have tried fixing the issue through updates to my web.xml - but am still having the same issue.
    https://blogs.oracle.com/jdevotnharvest/entry/solving_jdeveloper_11gr2_issue_with
    Updated web.xml:
    <security-constraint>
    <web-resource-collection>
    <web-resource-name>Allowed ADF Resources</web-resource-name>
    <url-pattern>/adf/*</url-pattern>
    <url-pattern>/afr/*</url-pattern>
    <url-pattern>/bi/*</url-pattern>
    <url-pattern>/servlet/GraphServlet/*</url-pattern>
    <url-pattern>/servlet/GaugeServlet/*</url-pattern>
    <url-pattern>/mapproxy/*</url-pattern>
    <url-pattern>/adflib/</url-pattern>
    </web-resource-collection>
    <web-resource-collection>
    <web-resource-name>allPages</web-resource-name>
    <url-pattern>/*</url-pattern>
    </web-resource-collection>
    <web-resource-collection>
    <web-resource-name>adfAuthentication</web-resource-name>
    <url-pattern>/adfAuthentication</url-pattern>
    </web-resource-collection>
    <auth-constraint>
    <role-name>valid-users</role-name>
    </auth-constraint>
    </security-constraint>
    <login-config>
    <auth-method>FORM</auth-method>
    <form-login-config>
    <form-login-page>/faces/login.jsf</form-login-page>
    <form-error-page>/faces/login-error.jsf</form-error-page>
    </form-login-config>
    </login-config>
    <security-role>
    <role-name>valid-users</role-name>
    </security-role>
    weblogic.xml
    <security-role-assignment>
    <role-name>valid-users</role-name>
    <principal-name>users</principal-name>
    </security-role-assignment>
    I know other users have experienced similar issues - but I am having trouble debugging or troubleshooting why this is happening.
    Any suggestions on how to further troubleshoot or resolve this issue would be appreciated!
    Dan

    I was able to resolve the login page looping issue.
    The issue is related to the login page being a JSF page based on a page template.
    When I created the JSF login page as a page template - the template contains a binding:
    <af:pageTemplate viewId="/test-template.jsf" value="#{bindings.ptb1}" id="pt1">
    When I deploy my application to the test weblogic server, the anonymous-role grants are not being respected. So even though I grant view access to the login JSF page to anonymous-role -- it appears that weblogic is trying to request a login for any page with a pageDef (including the login page). By re-creating the login page with no pageDef (a JSF page that does not use a page template) -- the login page is displayed (rather than entering into a loop).
    There is still a seperate issue with the anonymous-role grant not working as I would expect it to work that I will need to troubleshoot further.

  • Problems with Template JDeveloper 11g

    Hi! I have problems with template in Jdeveloper 11g.
    I had created jspx page from templeate:
    <?xml version='1.0' encoding='windows-1257'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=windows-1257"/>
    <f:view>
    <af:document>
    <af:form>
    <af:pageTemplate viewId="/augiTemplate.jspx">
    <f:facet name="mainArea"/>
    </af:pageTemplate>
    </af:form>
    </af:document>
    </f:view>
    </jsp:root>
    THERE are error:
    JSF page template at path /augiTemplate.jspx requires a model binding!!!
    Why it is so an what it means? Pleas help!
    Best regards!

    Hi,
    it means that your template has an ADF binding (PageDef) reference. When you create a page in the JSF page dialog and assign the template then the binding reference is created for you. You should see a bulb in the page source editor. Press it an it should create the missing binding for you
    Frank

  • Single Sign-On (SSO) in Web Server 7.0u5

    Hello,
    I am in the process of trying to configure single sign-on (SSO) between several apps in the same SJWS 7.0u5 virtual server, and I'm not having much luck. This appears to be very similar to the problem reported in another thread (http://forums.sun.com/thread.jspa?forumID=759&threadID=5281564) that applied to 7.0u2.
    I found one interesting detail that the previous post did not mention, however, and I think it is key to resolving this issue.
    I've been using the SSO feature of WS7 since day one, and up to this point is has worked flawlessly. However, I am in the process of adding a new webapp that differs from the prior webapps in one significant way: it uses form-based login, and all the previous webapps used basic authentication.
    Using the "Live HTTP Headers" Firefox add-on I captured the cookie exchanges between the client and server, and this is what I see:
    1. Logging in to any of the apps that use basic authentication results in both the JSESSIONID for the current webapp and the JSESSIONIDSSO for the entire server to be returned in the response.
    2. If I then go to a secured URI in the new (form login) webapp the JSESSIONIDSSO cookie is sent, but I still land on the login page.
    3. When completing the login form and submitting it, no JSESSIONIDSSO is returned.
    In both types of apps, my web.xml includes the appropriate configuration. FORM authentication:  <login-config>
        <auth-method>FORM</auth-method>
        <realm-name>ldap</realm-name>
        <form-login-config>
          <form-login-page>/login.jsf</form-login-page>
          <form-error-page>/error.jsf</form-error-page>
        </form-login-config>
      </login-config>...and BASIC authentication:  <login-config>
        <auth-method>BASIC</auth-method>
        <realm-name>ldap</realm-name>
      </login-config>From this, it appears as though the SSO functionality is not working when using FORM authentication, only when using BASIC authentication.
    The web apps developer's guide specifically says that SSO works for all webapps in the same virtual server with the same realm-name, which is certainly the case for me. It doesn't say that SSO is not supported in FORM-authenticated webapps, but that would appear to be the case.
    Or is this a bug?
    Or am I simply doing something obviously wrong?
    Thanks!
    Bill

    In addition, I set the logging level to "fine", and I see these entries for the FORM authentication:
    [06/Sep/2009:22:52:57] fine (20013): for host 127.0.1.1 trying to GET /testSso/index.jsp while trying to GET /testSso/, service-j2ee reports: Process request for '/testSso/'
    [06/Sep/2009:22:52:57] fine (20013): for host 127.0.1.1 trying to GET /testSso/index.jsp while trying to GET /testSso/, service-j2ee reports:  Checking for SSO cookie
    [06/Sep/2009:22:52:57] fine (20013): for host 127.0.1.1 trying to GET /testSso/index.jsp while trying to GET /testSso/, service-j2ee reports:  SSO cookie is not present
    [06/Sep/2009:22:52:57] fine (20013): for host 127.0.1.1 trying to GET /testSso/index.jsp while trying to GET /testSso/, service-j2ee reports: Security checking request GET /testSso/
    [06/Sep/2009:22:52:57] fine (20013): for host 127.0.1.1 trying to GET /testSso/index.jsp while trying to GET /testSso/, service-j2ee reports:   Matched constraint 'SecurityConstraint[secureURIs]' against GET /index.jsp
    [06/Sep/2009:22:52:57] fine (20013): for host 127.0.1.1 trying to GET /testSso/index.jsp while trying to GET /testSso/, service-j2ee reports:   Matched constraint 'SecurityConstraint[secureURIs]' against GET /index.jsp
    [06/Sep/2009:22:52:57] fine (20013): for host 127.0.1.1 trying to GET /testSso/index.jsp while trying to GET /testSso/, service-j2ee reports:  Calling hasUserDataPermission()
    [06/Sep/2009:22:52:57] fine (20013): for host 127.0.1.1 trying to GET /testSso/index.jsp while trying to GET /testSso/, service-j2ee reports:   User data constraint has no restrictions
    [06/Sep/2009:22:52:57] fine (20013): for host 127.0.1.1 trying to GET /testSso/index.jsp while trying to GET /testSso/, service-j2ee reports:  Calling authenticate()
    [06/Sep/2009:22:52:57] fine (20013): for host 127.0.1.1 trying to GET /testSso/index.jsp while trying to GET /testSso/, service-j2ee reports: Restore request from session '19FFE2F63CF4E8756C19B60AC6F7A65E'
    [06/Sep/2009:22:52:57] fine (20013): for host 127.0.1.1 trying to GET /testSso/index.jsp while trying to GET /testSso/, service-j2ee reports: Authenticated 'testUser' with type 'FORM'
    [06/Sep/2009:22:52:57] fine (20013): for host 127.0.1.1 trying to GET /testSso/index.jsp while trying to GET /testSso/, service-j2ee reports: Registering sso id '2698AFCE8889EF9877778386855517BC' for user 'testUser in realm ldap' with auth type 'FORM'
    [06/Sep/2009:22:52:57] fine (20013): for host 127.0.1.1 trying to GET /testSso/index.jsp while trying to GET /testSso/, service-j2ee reports: Associate sso id 2698AFCE8889EF9877778386855517BC with session StandardSession[19FFE2F63CF4E8756C19B60AC6F7A65E]
    [06/Sep/2009:22:52:57] fine (20013): for host 127.0.1.1 trying to GET /testSso/index.jsp while trying to GET /testSso/, service-j2ee reports: Proceed to restored request
    [06/Sep/2009:22:52:57] fine (20013): for host 127.0.1.1 trying to GET /testSso/index.jsp while trying to GET /testSso/, service-j2ee reports:  Calling accessControl()
    [06/Sep/2009:22:52:57] fine (20013): for host 127.0.1.1 trying to GET /testSso/index.jsp while trying to GET /testSso/, service-j2ee reports:   Checking roles testUser
    [06/Sep/2009:22:52:57] fine (20013): for host 127.0.1.1 trying to GET /testSso/index.jsp while trying to GET /testSso/, service-j2ee reports:  Successfully passed all security constraintsThat seems to indicate that an SSO ID is created and a cookie should be sent with the response, but as show in the Live HTTP Headers output, that is not the case.
    The log entries for the BASIC authentication are as follows:
    [06/Sep/2009:22:57:29] fine (20013): for host 127.0.1.1 trying to GET /ppc/index.jsp while trying to GET /ppc/, service-j2ee reports: Process request for '/ppc/'
    [06/Sep/2009:22:57:29] fine (20013): for host 127.0.1.1 trying to GET /ppc/index.jsp while trying to GET /ppc/, service-j2ee reports:  Checking for SSO cookie
    [06/Sep/2009:22:57:29] fine (20013): for host 127.0.1.1 trying to GET /ppc/index.jsp while trying to GET /ppc/, service-j2ee reports: Security checking request GET /ppc/
    [06/Sep/2009:22:57:29] fine (20013): for host 127.0.1.1 trying to GET /ppc/index.jsp while trying to GET /ppc/, service-j2ee reports:   Matched constraint 'SecurityConstraint[ppc]' against GET /index.jsp
    [06/Sep/2009:22:57:29] fine (20013): for host 127.0.1.1 trying to GET /ppc/index.jsp while trying to GET /ppc/, service-j2ee reports:   Matched constraint 'SecurityConstraint[ppc]' against GET /index.jsp
    [06/Sep/2009:22:57:29] fine (20013): for host 127.0.1.1 trying to GET /ppc/index.jsp while trying to GET /ppc/, service-j2ee reports:  Calling hasUserDataPermission()
    [06/Sep/2009:22:57:29] fine (20013): for host 127.0.1.1 trying to GET /ppc/index.jsp while trying to GET /ppc/, service-j2ee reports:   User data constraint has no restrictions
    [06/Sep/2009:22:57:29] fine (20013): for host 127.0.1.1 trying to GET /ppc/index.jsp while trying to GET /ppc/, service-j2ee reports:  Calling authenticate()
    [06/Sep/2009:22:57:29] fine (20013): for host 127.0.1.1 trying to GET /ppc/index.jsp while trying to GET /ppc/, service-j2ee reports: Logging in user [testUser] into realm: ldap using JAAS module: ldapRealm
    [06/Sep/2009:22:57:29] fine (20013): for host 127.0.1.1 trying to GET /ppc/index.jsp while trying to GET /ppc/, service-j2ee reports: Password login succeeded for : testUser
    [06/Sep/2009:22:57:29] fine (20013): for host 127.0.1.1 trying to GET /ppc/index.jsp while trying to GET /ppc/, service-j2ee reports: Authenticated 'testUser' with type 'BASIC'
    [06/Sep/2009:22:57:29] fine (20013): for host 127.0.1.1 trying to GET /ppc/index.jsp while trying to GET /ppc/, service-j2ee reports: Registering sso id 'A58B93F0A00C619AF18F53C2F7C00D16' for user 'testUser in realm ldap' with auth type 'BASIC'
    [06/Sep/2009:22:57:29] fine (20013): for host 127.0.1.1 trying to GET /ppc/index.jsp while trying to GET /ppc/, service-j2ee reports: Associate sso id A58B93F0A00C619AF18F53C2F7C00D16 with session StandardSession[EF2E1F7E8B3FB7E3FDD4607E4A62D99E]
    [06/Sep/2009:22:57:29] fine (20013): for host 127.0.1.1 trying to GET /ppc/index.jsp while trying to GET /ppc/, service-j2ee reports:  Calling accessControl()
    [06/Sep/2009:22:57:29] fine (20013): for host 127.0.1.1 trying to GET /ppc/index.jsp while trying to GET /ppc/, service-j2ee reports:   Checking roles testUser
    [06/Sep/2009:22:57:29] fine (20013): for host 127.0.1.1 trying to GET /ppc/index.jsp while trying to GET /ppc/, service-j2ee reports: No role found:  administrator
    [06/Sep/2009:22:57:29] fine (20013): for host 127.0.1.1 trying to GET /ppc/index.jsp while trying to GET /ppc/, service-j2ee reports:  Successfully passed all security constraintsIn this case, you can see that the SSO ID that is generated matches the value set in the response.
    Bill

  • Popup window by javax.script. API, help

    Hello All,
    anybody did something like
    <h:commandButton id="errorpage" action="#{bean.errorPage}" value="Error Page" />
    public void errorPage() {
        try {
          ScriptEngineManager factory = new ScriptEngineManager();
          ScriptEngine engine = factory.getEngineByName("JavaScript");
          StringBuilder scriptCode = new StringBuilder();
          scriptCode.append("window.open('/error.faces', 'popupWindow', 'height=400'," +
                  "'width=500'," +
                  "'dependent=yes', " +
                  "'menubar=no'," +
                  " 'toolbar=no');");
          engine.eval(scriptCode.toString());
        } catch (Exception exception) {
          exception.printStackTrace();
      } I would like open popup window after some action generated in managed bean.
    but I see some exception
    javax.script.ScriptException: sun.org.mozilla.javascript.internal.EcmaError: ReferenceError: "window" is not defined. (<Unknown source>#1) in <Unknown source> at line number 1
            at com.sun.script.javascript.RhinoScriptEngine.eval(RhinoScriptEngine.java:110)
            at com.sun.script.javascript.RhinoScriptEngine.eval(RhinoScriptEngine.java:124)
            at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:247)

    also tryed but the same error
      public void errorPage() {
        try {
          ScriptEngineManager factory = new ScriptEngineManager();
          ScriptEngine engine = factory.getEngineByName("JavaScript");  
          String win2 = "/error.jsf" +  "Window2" + "width=310"+ "height=600"+ "scrollbars=yes";      
          engine.put("x", win2);   
          engine.eval("window.open(x)");     
          //engine.eval("onclick='window.open('/error.jsf', 'popupWindow', 'height=400','width=500','dependent=yes',  'menubar=no','toolbar=no');'");           
        } catch (Exception exception) {
          exception.printStackTrace();
    javax.script.ScriptException: sun.org.mozilla.javascript.internal.EcmaError: ReferenceError: "window" is not defined. (<Unknown source>#1) in <Unknown source> at line number 1
            at com.sun.script.javascript.RhinoScriptEngine.eval(RhinoScriptEngine.java:110)
            at com.sun.script.javascript.RhinoScriptEngine.eval(RhinoScriptEngine.java:124)
            at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:247)

  • Cardemo example having problem.

    Hi All,
    When I'm trying to compile the source files, getting following errors:
    jsf:
    [javac] Compiling 9 source files to C:\ISRI Restructured\build\{target.dir}\
    cardemo\WEB-INF\classes
    [javac] C:\NewScreens\jsf\sunjava\jsf-1_1_01\samples\cardemo\src\java\carsto
    re\CarStore.java:42: package components.components does not exist
    [javac] import components.components.AreaSelectedEvent;
    [javac] ^
    [javac] C:\NewScreens\jsf\sunjava\jsf-1_1_01\samples\cardemo\src\java\carsto
    re\FormatValidatorTag.java:48: package javax.servlet.jsp does not exist
    [javac] import javax.servlet.jsp.JspException;
    [javac] ^
    [javac] C:\NewScreens\jsf\sunjava\jsf-1_1_01\samples\cardemo\src\java\carsto
    re\FormatValidatorTag.java:55: cannot access javax.servlet.jsp.tagext.TagSupport
    [javac] file javax\servlet\jsp\tagext\TagSupport.class not found
    [javac] public class FormatValidatorTag extends ValidatorTag {
    [javac] ^
    [javac] C:\NewScreens\jsf\sunjava\jsf-1_1_01\samples\cardemo\src\java\carsto
    re\FormatValidatorTag.java:105: cannot find symbol
    [javac] symbol : class JspException
    [javac] location: class carstore.FormatValidatorTag
    [javac] protected Validator createValidator() throws JspException {
    [javac] ^
    [javac] C:\NewScreens\jsf\sunjava\jsf-1_1_01\samples\cardemo\src\java\carsto
    re\CarStore.java:154: cannot find symbol
    [javac] symbol : class AreaSelectedEvent
    [javac] location: class carstore.CarStore
    [javac] AreaSelectedEvent event = (AreaSelectedEvent) actionEvent;
    [javac] ^
    [javac] C:\NewScreens\jsf\sunjava\jsf-1_1_01\samples\cardemo\src\java\carsto
    re\CarStore.java:154: cannot find symbol
    [javac] symbol : class AreaSelectedEvent
    [javac] location: class carstore.CarStore
    [javac] AreaSelectedEvent event = (AreaSelectedEvent) actionEvent;
    [javac] ^
    [javac] C:\NewScreens\jsf\sunjava\jsf-1_1_01\samples\cardemo\src\java\carsto
    re\FormatValidatorTag.java:81: cannot find symbol
    [javac] symbol : variable super
    [javac] location: class carstore.FormatValidatorTag
    [javac] super.setValidatorId("FormatValidator");
    [javac] ^
    [javac] C:\NewScreens\jsf\sunjava\jsf-1_1_01\samples\cardemo\src\java\carsto
    re\FormatValidatorTag.java:107: cannot find symbol
    [javac] symbol : variable super
    [javac] location: class carstore.FormatValidatorTag
    [javac] result = (FormatValidator) super.createValidator();
    [javac] ^
    [javac] Note: Some input files use unchecked or unsafe operations.
    [javac] Note: Recompile with -Xlint:unchecked for details.
    [javac] 8 errors
    BUILD FAILED
    C:\ISRI Restructured\build\build.xml:50: The following error occurred while exec
    uting this line:
    C:\ISRI Restructured\build\jsfs.xml:34: Compile failed; see the compiler error o
    utput for details.
    Please help me ASAP.
    Regards,
    Sharath.

    It sounds like you forgot to include demo-components.jar in your classpath

  • Javax.script API maintaing the javascript vars

    Hi All,
    First is this the correct forum for javax.script questions? I can't find another....
    Is there a way to maintain the state of a global javascript variable between calls?
    I have a CompiledScript instance which I keep. I call eval once and then at various times I call functions in the javascript. The script has:
    var a = 10;
    at the top. When call a function can changes to var a be maintained between calls?

    also tryed but the same error
      public void errorPage() {
        try {
          ScriptEngineManager factory = new ScriptEngineManager();
          ScriptEngine engine = factory.getEngineByName("JavaScript");  
          String win2 = "/error.jsf" +  "Window2" + "width=310"+ "height=600"+ "scrollbars=yes";      
          engine.put("x", win2);   
          engine.eval("window.open(x)");     
          //engine.eval("onclick='window.open('/error.jsf', 'popupWindow', 'height=400','width=500','dependent=yes',  'menubar=no','toolbar=no');'");           
        } catch (Exception exception) {
          exception.printStackTrace();
    javax.script.ScriptException: sun.org.mozilla.javascript.internal.EcmaError: ReferenceError: "window" is not defined. (<Unknown source>#1) in <Unknown source> at line number 1
            at com.sun.script.javascript.RhinoScriptEngine.eval(RhinoScriptEngine.java:110)
            at com.sun.script.javascript.RhinoScriptEngine.eval(RhinoScriptEngine.java:124)
            at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:247)

Maybe you are looking for