Problem with {facesContext.externalContext.requestContextPath}

Hello,
I would like for my app to evaluate the above expression. If I use the following sign (#) I get this error: the attributes for a standard action cannot be deferred expressions. If I use the dollar sign the expression is copied as is and not evaluated. My question is as follows: how can use context path in jsf?
Thanks in advance,
Julien Martin.
<f:view xmlns:h="http://java.sun.com/jsf/html"
        xmlns:f="http://java.sun.com/jsf/core"
        xmlns:jsp="http://java.sun.com/JSP/Page"
        xmlns:ice="http://www.icesoft.com/icefaces/component">
    <ice:outputDeclaration
        doctypeRoot="HTML"
        doctypePublic="-//W3C//DTD XHTML 1.0 Strict//EN"
        doctypeSystem="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"/>     
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
            <title>JSP Page</title>
            <link href="${facesContext.externalContext.requestContextPath}/css/xp/xp.css" rel="stylesheet" type="text/css"/>
            <link href="${facesContext.externalContext.requestContextPath}/css/console-style.css" rel="stylesheet" type="text/css"/>
        </head>
        <body>
            <ice:outputConnectionStatus/>
            <ice:form>
                <ice:inputFile
                    progressListener="#{consoleInputFile.progress}"
                    actionListener="#{consoleInputFile.action}"/>
                <ice:outputProgress
                    indeterminate="true"
                    value="#{consoleInputFile.percent}" />
                <ice:messages
                    showDetail="true"
                    styleClass="consoleInputFileMessages"/>
            </ice:form> 
        </body>
    </html>
</f:view>

Did you try to use
<h:outputLink "${facesContext.externalContext.requestContextPath}/css/xp/xp.css" ..... />

Similar Messages

  • FacesContext.externalContext.requestContextPath  help please

    I am trying to retrieve an image file and need to pass 3 request parameters to a servlet, from a jsf page. The following snippet fails, the contentId req parm gets all the whole string.
    <img src="#{facesContext.externalContext.requestContextPath}/imagedownload?contentId='f8a88f68-0415-4972-8973-6dc7ec27574';mimeType='image/jpeg';contentSize='141312'" />
    your help is much appreciated. Thanks.

    Resolved, basically I was allowed only a get. Thanks RaymondDeCampo for showing me the obvious, I had tried & and obviously I needed a break!!
    Regards,
    gnaval

  • Weird problems with CSS being applied to JSF pages

    I have this really weird problem with my CSS rules being applied to my JSF pages. My CSS rules don't get applied unless one of the following two things happen:
    - A page is reloaded (by redirecting to itself, or if there were validation errors)
    - The previous page in the history had the same relative reference to the same CSS file.
    If a page is newly loaded, and the previous page did not have that same CSS reference, the CSS styles will not show up. Also, if the above is true, and the page is reloaded by JSF, the CSS styles show up.
    Now, my problem could be solved if I put all JSP files in the same level, but the display of the first page would still be without the CSS style applied.
    Is this known behaviour? And if it is, does it have anything to do do with the way JSF handles URLs (always one level back)? Help and input is kindly appreciated!

    Dude,
    I tried the same
    <link rel="stylesheet" href="<h:outputText value="#{facesContext.externalContext.requestContextPath}"/pages/css/default.css" />
    and I got the following Jasper exception.... pointers plz ??
    =============================================================
    2005-08-24 14:18:55,937 [http-8080-Processor25] ERROR org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[mydemo].[FacesServlet] - Servlet.service() for servlet FacesServlet threw exception
    org.apache.jasper.JasperException: /myproj/eventCrit.jsp(8,78) Unterminated <h:outputText tag
         at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
         at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:405)
         at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:130)
         at org.apache.jasper.compiler.Parser.parseOptionalBody(Parser.java:1049)
         at org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1367)
         at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1564)
         at org.apache.jasper.compiler.Parser.parseBody(Parser.java:1793)
         at org.apache.jasper.compiler.Parser.parseOptionalBody(Parser.java:1060)
         at org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1367)
         at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1564)
         at org.apache.jasper.compiler.Parser.parse(Parser.java:126)
         at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:211)
         at org.apache.jasper.compiler.ParserController.parse(ParserController.java:100)
         at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:146)
         at org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
         at org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
         at org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
         at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:293)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
    =========================================================

  • Problem with Non JSF Request to JSF Page

    Hi All,
    I am working on dynamic controls generation based on the request come from non jsf page
    For the first request, pageworks perfectly. but when we go for second request, it is not rendering and I am getting same old page.
    What I have identified is if I have 2 pages as JSF, application is not giving any problem.
    For this I have written small test application contains both JSF pages only.
    page1 contains 3 submit buttons.
    When submit buttons are clicked based on the request, I get, am able to see the dynamic controls.
    SO there is no problem with JSF PAGE to JSF Page Communication
    Now I have done some changes in First JSF page. Instead of submitting directly I am submitting the page through JavaScript which is nonb JSF request. There I am facing the problem and based on requested qaction I am not able to see correct rendered page based on the requested action.
    Any Idea why it is giving problem for non JSF requests??
    Thanks
    Sudhakar

    For Your Convenience in understanding the problem
    I am pasting entire test code
    Page 1 -- (here page2 is Page1 and Page1 is page2 - some naming convention errors :) )
    <?xml version="1.0" encoding="UTF-8"?>
    <jsp:root version="1.2" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page">
        <jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/>
        <jsp:text><![CDATA[
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    ]]></jsp:text>
        <f:view>
            <html lang="en-US" xml:lang="en-US">
                <head>
                    <meta content="no-cache" http-equiv="Cache-Control"/>
                    <meta content="no-cache" http-equiv="Pragma"/>
                    <title>Page2 Title</title>
                    <link href="resources/stylesheet.css" rel="stylesheet" type="text/css"/>
                </head>
                <body style="-rave-layout: grid">
                    <h:form binding="#{Page2.form1}" id="form1">
    <!-- Non JSF REquests -->
                        <h:commandButton action="#{Page2.button1_action}" binding="#{Page2.button1}" id="button1" style="left: 48px; top: 48px; position: absolute" value="Submit" onclick="document.forms['form1'].action='faces/Page2.jsp?id=1'; document.forms['form1'].submit(); return false;"/>
                        <h:commandButton action="#{Page2.button2_action}" binding="#{Page2.button2}" id="button2" style="left: 48px; top: 96px; position: absolute" value="Submit" onclick="document.forms['form1'].action='faces/Page2.jsp?id=2'; document.forms['form1'].submit(); return false;"/>
                        <h:commandButton action="#{Page2.button3_action}" binding="#{Page2.button3}" id="button3" style="left: 48px; top: 144px; position: absolute" value="Submit" onclick="document.forms['form1'].action='faces/Page2.jsp?id=3'; document.forms['form1'].submit(); return false;"/>
    <!-- this  is JSF request -->
                        <!--
                        <h:commandButton action="#{Page2.button1_action}" binding="#{Page2.button1}" id="button1" style="left: 48px; top: 48px; position: absolute" value="Submit" />
                        <h:commandButton action="#{Page2.button2_action}" binding="#{Page2.button2}" id="button2" style="left: 48px; top: 96px; position: absolute" value="Submit" />
                        <h:commandButton action="#{Page2.button3_action}" binding="#{Page2.button3}" id="button3" style="left: 48px; top: 144px; position: absolute" value="Submit" />-->
                    </h:form>
                </body>
            </html>
        </f:view>
    </jsp:root>Page1 Bean
    * Page2.java
    * Created on June 25, 2005, 11:08 AM
    * Copyright user
    package webapplication8;
    import javax.faces.*;
    import com.sun.jsfcl.app.*;
    import javax.faces.component.html.*;
    import javax.faces.context.ExternalContext;
    import javax.faces.context.FacesContext;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.http.HttpSession;
    public class Page2 extends AbstractPageBean {
        // <editor-fold defaultstate="collapsed" desc="Creator-managed Component Definition">
        private int __placeholder;
        private HtmlForm form1 = new HtmlForm();
        public HtmlForm getForm1() {
            return form1;
        public void setForm1(HtmlForm hf) {
            this.form1 = hf;
        private HtmlCommandButton button1 = new HtmlCommandButton();
        public HtmlCommandButton getButton1() {
            return button1;
        public void setButton1(HtmlCommandButton hcb) {
            this.button1 = hcb;
        private HtmlCommandButton button2 = new HtmlCommandButton();
        public HtmlCommandButton getButton2() {
            return button2;
        public void setButton2(HtmlCommandButton hcb) {
            this.button2 = hcb;
        private HtmlCommandButton button3 = new HtmlCommandButton();
        public HtmlCommandButton getButton3() {
            return button3;
        public void setButton3(HtmlCommandButton hcb) {
            this.button3 = hcb;
        // </editor-fold>
        public Page2() {
            // <editor-fold defaultstate="collapsed" desc="Creator-managed Component Initialization">
            try {
            } catch (Exception e) {
                log("Page2 Initialization Failure", e);
                throw e instanceof javax.faces.FacesException ? (FacesException) e: new FacesException(e);
            // </editor-fold>
            // Additional user provided initialization code
        protected webapplication8.ApplicationBean1 getApplicationBean1() {
            return (webapplication8.ApplicationBean1)getBean("ApplicationBean1");
        protected webapplication8.SessionBean1 getSessionBean1() {
            return (webapplication8.SessionBean1)getBean("SessionBean1");
         * Bean cleanup.
        protected void afterRenderResponse() {
        public String button1_action()  throws Exception{
            // TODO Following code was replaced by static navigation
           getSessionBean1().setId(1);       
          /* ExternalContext ctx=(ExternalContext)FacesContext.getCurrentInstance().getExternalContext();
           HttpServletRequest req=(HttpServletRequest)ctx.getRequest();
           HttpServletResponse res=(HttpServletResponse)ctx.getResponse();
           res.sendRedirect("http://localhost:18080/webapplication8/faces/Page2.jsp");
           return null;*/
            return "case1";
        public String button2_action()  throws Exception{
            // TODO Following code was replaced by static navigation
                getSessionBean1().setId(2);
          /*  ExternalContext ctx=(ExternalContext)FacesContext.getCurrentInstance().getExternalContext();
           HttpServletRequest req=(HttpServletRequest)ctx.getRequest();
           HttpServletResponse res=(HttpServletResponse)ctx.getResponse();
           res.sendRedirect("http://localhost:18080/webapplication8/faces/Page2.jsp");
           return null;*/
            return "case2";
        public String button3_action() throws Exception{
            // TODO Following code was replaced by static navigation
                getSessionBean1().setId(3);
            /*    ExternalContext ctx=(ExternalContext)FacesContext.getCurrentInstance().getExternalContext();
           HttpServletRequest req=(HttpServletRequest)ctx.getRequest();
           HttpServletResponse res=(HttpServletResponse)ctx.getResponse();
           res.sendRedirect("http://localhost:18080/webapplication8/faces/Page2.jsp");
            return null;*/
            return "case3";
    }page 2
    <?xml version="1.0" encoding="UTF-8"?>
    <jsp:root version="1.2" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page">
        <jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/>
        <jsp:text><![CDATA[
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    ]]></jsp:text>
        <f:view>
            <html lang="en-US" xml:lang="en-US">
                <head>
                    <meta content="no-cache" http-equiv="Cache-Control"/>
                    <meta content="no-cache" http-equiv="Pragma"/>
                    <title>Page1 Title</title>
                    <link href="resources/stylesheet.css" rel="stylesheet" type="text/css"/>
                </head>
                <body style="-rave-layout: grid">
                    <h:form binding="#{Page1.form1}" id="form1">
                        <h:panelGrid binding="#{Page1.gridPanel1}" id="gridPanel1" style="left: 96px; top: 48px; position: absolute"/>
                        <f:selectItems binding="#{Page1.radioButtonList1SelectItems1}" id="radioButtonList1SelectItems1"/>
                        <h:commandButton action="#{Page1.button1_action}" binding="#{Page1.button1}" id="button1"
                            style="left: 384px; top: 120px; position: absolute" value="Submit"/>
                        <h:commandButton action="#{Page1.button1_action}" binding="#{Page1.button1}" id="button1" style="left: 384px; top: 72px; position: absolute" value="Submit"/>
                        <h:outputLink binding="#{Page1.hyperlink1}" id="hyperlink1" style="left: 480px; top: 216px; position: absolute" value="http://www.sun.com/jscreator">
                            <h:outputText binding="#{Page1.hyperlink1Text}" id="hyperlink1Text" value="Hyperlink"/>
                        </h:outputLink>
                        <h:commandLink binding="#{Page1.linkAction1}" id="linkAction1" style="left: 456px; top: 264px; position: absolute">
                            <h:outputText binding="#{Page1.linkAction1Text}" id="linkAction1Text" value="Link Action"/>
                        </h:commandLink>
                    </h:form>
                </body>
            </html>
        </f:view>
    </jsp:root>page2 bean
    * Page1.java
    * Created on June 25, 2005, 10:52 AM
    * Copyright user
    package webapplication8;
    import javax.faces.*;
    import com.sun.jsfcl.app.*;
    import com.sun.jsfcl.data.DefaultSelectItemsArray;
    import java.util.Vector;
    import javax.faces.component.UIComponent;
    import javax.faces.component.UISelectItems;
    import javax.faces.component.html.*;
    import javax.faces.context.ExternalContext;
    import javax.faces.context.FacesContext;
    import javax.faces.el.ValueBinding;
    import javax.faces.model.SelectItem;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    public class Page1 extends AbstractPageBean {
        // <editor-fold defaultstate="collapsed" desc="Creator-managed Component Definition">
        private int __placeholder;
        private HtmlForm form1 = new HtmlForm();
        public HtmlForm getForm1() {
            return form1;
        public void setForm1(HtmlForm hf) {
            this.form1 = hf;
        private HtmlPanelGrid gridPanel1 = new HtmlPanelGrid();
        public HtmlPanelGrid getGridPanel1() {
            return gridPanel1;
        public void setGridPanel1(HtmlPanelGrid hpg) {
            this.gridPanel1 = hpg;
        private HtmlCommandButton button1 = new HtmlCommandButton();
        public HtmlCommandButton getButton1() {
            return button1;
        public void setButton1(HtmlCommandButton hcb) {
            this.button1 = hcb;
        private HtmlOutputLink hyperlink1 = new HtmlOutputLink();
        public HtmlOutputLink getHyperlink1() {
            return hyperlink1;
        public void setHyperlink1(HtmlOutputLink hol) {
            this.hyperlink1 = hol;
        private HtmlOutputText hyperlink1Text = new HtmlOutputText();
        public HtmlOutputText getHyperlink1Text() {
            return hyperlink1Text;
        public void setHyperlink1Text(HtmlOutputText hot) {
            this.hyperlink1Text = hot;
        private HtmlCommandLink linkAction1 = new HtmlCommandLink();
        public HtmlCommandLink getLinkAction1() {
            return linkAction1;
        public void setLinkAction1(HtmlCommandLink hcl) {
            this.linkAction1 = hcl;
        private HtmlOutputText linkAction1Text = new HtmlOutputText();
        public HtmlOutputText getLinkAction1Text() {
            return linkAction1Text;
        public void setLinkAction1Text(HtmlOutputText hot) {
            this.linkAction1Text = hot;
        // </editor-fold>
        public Page1() {
            // <editor-fold defaultstate="collapsed" desc="Creator-managed Component Initialization">
            try {
                ExternalContext ctx=(ExternalContext)FacesContext.getCurrentInstance().getExternalContext();
                HttpServletRequest req=(HttpServletRequest)ctx.getRequest();
                HttpServletResponse res=(HttpServletResponse)ctx.getResponse();
                String id=req.getParameter("id");
                if(id!=null)
                    getSessionBean1().setId(Integer.parseInt(id));
                if (getSessionBean1().getId()==1) {
                    addTextBox();
                else if (getSessionBean1().getId()==2) {
                    addCheckBox();
                    addRadio();
                else if (getSessionBean1().getId()==3) {
                    addRadio();
                   // addCheckBox();
            } catch (Exception e) {
                log("Page1 Initialization Failure", e);
                throw e instanceof javax.faces.FacesException ? (FacesException) e: new FacesException(e);
            // </editor-fold>
            // Additional user provided initialization code
        protected webapplication8.ApplicationBean1 getApplicationBean1() {
            return (webapplication8.ApplicationBean1)getBean("ApplicationBean1");
        protected webapplication8.SessionBean1 getSessionBean1() {
            return (webapplication8.SessionBean1)getBean("SessionBean1");
         * Bean cleanup.
        protected void afterRenderResponse() {
        private void addRadio() {
            HtmlPanelGrid gridPanel = new HtmlPanelGrid();
            UIComponent parent = gridPanel1;
            HtmlOutputText outputText = new HtmlOutputText();
            outputText.setValue("Some Desc");
            outputText.setId("somedesc2");
            HtmlSelectOneRadio checkBox = new HtmlSelectOneRadio();
            checkBox.setBorder(0);
            checkBox.setLayout("pageDirection");
            checkBox.setId("a3");
            UISelectItems items = new UISelectItems();
            DefaultSelectItemsArray objArray =new DefaultSelectItemsArray();
            vectDefaultSelectItemsArray.add(objArray);
            arrays=(DefaultSelectItemsArray[])vectDefaultSelectItemsArray.toArray(new DefaultSelectItemsArray[vectDefaultSelectItemsArray.size()]);
            int size =arrays.length;
            arrays[size - 1].clear();
            for (int i =0;i<10;i++) {
                arrays[size - 1].add(new SelectItem(""+i+"",""+i));
            // array.setItems(new String[] {"Yes","No" });
            items.setValueBinding("value",getValueBinding("#{Page1.arrays["+(size-1)+"]}"));
            checkBox.getChildren().add(items);
            gridPanel.getChildren().add(outputText);
            gridPanel.getChildren().add(checkBox);
            parent.getChildren().add(gridPanel);
        private void addCheckBox() {
            HtmlPanelGrid gridPanel = new HtmlPanelGrid();
            UIComponent parent = gridPanel1;
            HtmlOutputText outputText = new HtmlOutputText();
            outputText.setValue("Some Desc");
            outputText.setId("somedesc1");
            HtmlSelectManyCheckbox checkBox = new HtmlSelectManyCheckbox();
            checkBox.setBorder(0);
            checkBox.setLayout("pageDirection");
            checkBox.setId("a2");
            UISelectItems items = new UISelectItems();
            DefaultSelectItemsArray objArray =new DefaultSelectItemsArray();
            vectDefaultSelectItemsArray.add(objArray);
            arrays=(DefaultSelectItemsArray[])vectDefaultSelectItemsArray.toArray(new DefaultSelectItemsArray[vectDefaultSelectItemsArray.size()]);
            int size =arrays.length;
            arrays[size - 1].clear();
            for (int i =0;i<10;i++) {
                arrays[size - 1].add(new SelectItem(""+i+"",""+i));
            // array.setItems(new String[] {"Yes","No" });
            items.setValueBinding("value",getValueBinding("#{Page1.arrays["+(size-1)+"]}"));
            checkBox.getChildren().add(items);
            gridPanel.getChildren().add(outputText);
            gridPanel.getChildren().add(checkBox);
            parent.getChildren().add(gridPanel);
        private void addTextBox() {
            HtmlPanelGrid gridPanel = new HtmlPanelGrid();
            UIComponent parent = gridPanel1;
            HtmlOutputText outputText = new HtmlOutputText();
            outputText.setValue("Some Description for Control Text Box");
            outputText.setId("somedesc");
            HtmlInputText textField = new HtmlInputText();
            //  textField.setId("textField_"+control.getId());
            textField.setId("a1");
            HtmlOutputText outputText1 = new HtmlOutputText();
            hyperlink1Text.setValue(" ");
            hyperlink1Text.setStyleClass("bodyText");
            textField.setStyleClass("frmObjects");
            gridPanel.setColumns(3);
            gridPanel.getChildren().add(outputText);
            gridPanel.getChildren().add(hyperlink1Text);
            gridPanel.getChildren().add(textField);
            parent.getChildren().add(gridPanel);
        private DefaultSelectItemsArray array = new DefaultSelectItemsArray();
        public DefaultSelectItemsArray getArray() {
            return array;
        public void setArray(DefaultSelectItemsArray dsia) {
            this.array = dsia;
        private Vector vectDefaultSelectItemsArray = new Vector();
        private DefaultSelectItemsArray[] arrays = new DefaultSelectItemsArray[10];
        public DefaultSelectItemsArray[] getArrays() {
            return arrays;
        public void setArrays(DefaultSelectItemsArray[]dsia) {
            this.arrays = dsia;
        private UISelectItems radioButtonList1SelectItems1 = new UISelectItems();
        public UISelectItems getRadioButtonList1SelectItems1() {
            return radioButtonList1SelectItems1;
        public void setRadioButtonList1SelectItems1(UISelectItems uisi) {
            this.radioButtonList1SelectItems1 = uisi;
        private ValueBinding getValueBinding(String expression) {
            return     FacesContext.getCurrentInstance().getApplication().createValueBinding(expression);
        public String button1_action() {
            // TODO Replace with your code
            return "case1";
    }my navigation.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
                                  "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
    <faces-config>
        <navigation-rule>
            <from-view-id>/Page2.jsp</from-view-id>
            <navigation-case>
                <from-outcome>case1</from-outcome>
                <to-view-id>/Page1.jsp</to-view-id>
            </navigation-case>
            <navigation-case>
                <from-outcome>case2</from-outcome>
                <to-view-id>/Page1.jsp</to-view-id>
            </navigation-case>
            <navigation-case>
                <from-outcome>case3</from-outcome>
                <to-view-id>/Page1.jsp</to-view-id>
            </navigation-case>
        </navigation-rule>
        <navigation-rule>
            <from-view-id>/Page1.jsp</from-view-id>
            <navigation-case>
                <from-outcome>case1</from-outcome>
                <to-view-id>/Page2.jsp</to-view-id>
            </navigation-case>
        </navigation-rule>
    </faces-config>my managed beans xml
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
                                  "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
    <faces-config>
        <managed-bean>
            <managed-bean-name>Page1</managed-bean-name>
            <managed-bean-class>webapplication8.Page1</managed-bean-class>
            <managed-bean-scope>request</managed-bean-scope>
        </managed-bean>
        <managed-bean>
            <managed-bean-name>SessionBean1</managed-bean-name>
            <managed-bean-class>webapplication8.SessionBean1</managed-bean-class>
            <managed-bean-scope>session</managed-bean-scope>
        </managed-bean>
        <managed-bean>
            <managed-bean-name>ApplicationBean1</managed-bean-name>
            <managed-bean-class>webapplication8.ApplicationBean1</managed-bean-class>
            <managed-bean-scope>application</managed-bean-scope>
        </managed-bean>
        <managed-bean>
            <managed-bean-name>Page2</managed-bean-name>
            <managed-bean-class>webapplication8.Page2</managed-bean-class>
            <managed-bean-scope>request</managed-bean-scope>
        </managed-bean>
        <managed-bean>
    </faces-config>

  • Problem with a Constructor of a backingBean

    Hello there!, i have a problem with this code , on a constructor of backingBean
        public Login() {
            System.out.println("New instance!!");
            FacesContext fc = FacesContext.getCurrentInstance();
            String sessionId = fc.getExternalContext().getRequestParameterMap().get("id");
            System.out.println("Session ID :" + sessionId);
            if(sessionId.equals("1"){
            UIComponent it2 = (UIComponent)fc.getViewRoot().findComponent("it2");
            it2.getAttributes().put("value", "Hello World");
        }The error :
    <30-12-2009 06:12:10 PM BOT> <Error> <HTTP> <BEA-101020>
    <[ServletContext@17783620[app:LoginJSF module:LoginJSF-ViewController-context-root path:/LoginJSF-ViewController-context-root spec-version:2.5]]
    Servlet failed with Exception oracle.mds.exception.MDSRuntimeException: MDS-00168:
    Any help?

    hi Frank
    See forum thread "JDeveloper 11g Handbook : Chapter 10 : MDSRuntimeException MDS-00168" about a (possibly related) MDSRuntimeException (MDS-00168) with a reproducible scenario.
    regards
    Jan Vervecken

  • Problems with building blueprints catalog

    Hi,
    I've got some problems building bp-catalog v 0.8 on a windows 7 machine, GlassFish 3.0.1.
    I've properly changed build.properties file and executed "ant setup" but when I issues the "ant run" command, the compiler can't find packages (JSF packages mainly).
    Why it cannot find jars? The ant script should include glassfish jee jars into classpath...right?
    I've got the same problem with Petstore but since it's a netbeans ready project, I easily imported it and configured the runtime to GlassFish, and this solved the problem.
    With the bp catalog, it could be pretty handy to build and deploy all the projects, without to import one by one in netbeans and manually solve the missing references problems.
    Many thanks in advance:
    E:\user\My Documents\Learning\SoftwareEngineering\JavaProjects\bpcatalog-ee5-ea-0.8>ant run
    Buildfile: E:\user\My Documents\Learning\SoftwareEngineering\JavaProjects\bpcatalog-ee5-ea-0.8\build.xml
    default:
    default:
    default-ear:
    -pre-compile:
    bpp-actual-compilation:
    [echo] Compiling bp-ui-5
    [javac] Compiling 61 source files to E:\user\My Documents\Learning\SoftwareEngineering\JavaProjects\bpcatalog-ee5-ea-0.8\components\ui\build\classes
    [javac] E:\user\My Documents\Learning\SoftwareEngineering\JavaProjects\bpcatalog-ee5-ea-0.8\components\ui\src\java\com\sun\javaee\blueprints\components\ui\autocompl
    ompleteComponent.java:14: package javax.faces.component.html does not exist
    [javac] import javax.faces.component.html.HtmlInputText;
    [javac] ^
    [javac] E:\user\My Documents\Learning\SoftwareEngineering\JavaProjects\bpcatalog-ee5-ea-0.8\components\ui\src\java\com\sun\javaee\blueprints\components\ui\autocompl
    ompleteComponent.java:15: package javax.faces.context does not exist
    [javac] import javax.faces.context.FacesContext;
    [javac] ^
    [javac] E:\user\My Documents\Learning\SoftwareEngineering\JavaProjects\bpcatalog-ee5-ea-0.8\components\ui\src\java\com\sun\javaee\blueprints\components\ui\autocompl
    ompleteComponent.java:16: package javax.el does not exist
    [javac] import javax.el.MethodExpression;
    [javac] ^
    [javac] E:\user\My Documents\Learning\SoftwareEngineering\JavaProjects\bpcatalog-ee5-ea-0.8\components\ui\src\java\com\sun\javaee\blueprints\components\ui\autocompl
    ompleteComponent.java:45: cannot find symbol
    [javac] symbol: class HtmlInputText
    [javac] public class AutoCompleteComponent extends HtmlInputText {
    [javac] ^
    [javac] E:\user\My Documents\Learning\SoftwareEngineering\JavaProjects\bpcatalog-ee5-ea-0.8\components\ui\src\java\com\sun\javaee\blueprints\components\ui\autocompl
    ompleteComponent.java:47: cannot find symbol
    [javac] symbol : class MethodExpression
    [javac] location: class com.sun.javaee.blueprints.components.ui.autocomplete.AutoCompleteComponent
    [javac] private MethodExpression completionMethod;
    [javac] ^

    Hi,
    I've got some problems building bp-catalog v 0.8 on a windows 7 machine, GlassFish 3.0.1.
    I've properly changed build.properties file and executed "ant setup" but when I issues the "ant run" command, the compiler can't find packages (JSF packages mainly).
    Why it cannot find jars? The ant script should include glassfish jee jars into classpath...right?
    I've got the same problem with Petstore but since it's a netbeans ready project, I easily imported it and configured the runtime to GlassFish, and this solved the problem.
    With the bp catalog, it could be pretty handy to build and deploy all the projects, without to import one by one in netbeans and manually solve the missing references problems.
    Many thanks in advance:
    E:\user\My Documents\Learning\SoftwareEngineering\JavaProjects\bpcatalog-ee5-ea-0.8>ant run
    Buildfile: E:\user\My Documents\Learning\SoftwareEngineering\JavaProjects\bpcatalog-ee5-ea-0.8\build.xml
    default:
    default:
    default-ear:
    -pre-compile:
    bpp-actual-compilation:
    [echo] Compiling bp-ui-5
    [javac] Compiling 61 source files to E:\user\My Documents\Learning\SoftwareEngineering\JavaProjects\bpcatalog-ee5-ea-0.8\components\ui\build\classes
    [javac] E:\user\My Documents\Learning\SoftwareEngineering\JavaProjects\bpcatalog-ee5-ea-0.8\components\ui\src\java\com\sun\javaee\blueprints\components\ui\autocompl
    ompleteComponent.java:14: package javax.faces.component.html does not exist
    [javac] import javax.faces.component.html.HtmlInputText;
    [javac] ^
    [javac] E:\user\My Documents\Learning\SoftwareEngineering\JavaProjects\bpcatalog-ee5-ea-0.8\components\ui\src\java\com\sun\javaee\blueprints\components\ui\autocompl
    ompleteComponent.java:15: package javax.faces.context does not exist
    [javac] import javax.faces.context.FacesContext;
    [javac] ^
    [javac] E:\user\My Documents\Learning\SoftwareEngineering\JavaProjects\bpcatalog-ee5-ea-0.8\components\ui\src\java\com\sun\javaee\blueprints\components\ui\autocompl
    ompleteComponent.java:16: package javax.el does not exist
    [javac] import javax.el.MethodExpression;
    [javac] ^
    [javac] E:\user\My Documents\Learning\SoftwareEngineering\JavaProjects\bpcatalog-ee5-ea-0.8\components\ui\src\java\com\sun\javaee\blueprints\components\ui\autocompl
    ompleteComponent.java:45: cannot find symbol
    [javac] symbol: class HtmlInputText
    [javac] public class AutoCompleteComponent extends HtmlInputText {
    [javac] ^
    [javac] E:\user\My Documents\Learning\SoftwareEngineering\JavaProjects\bpcatalog-ee5-ea-0.8\components\ui\src\java\com\sun\javaee\blueprints\components\ui\autocompl
    ompleteComponent.java:47: cannot find symbol
    [javac] symbol : class MethodExpression
    [javac] location: class com.sun.javaee.blueprints.components.ui.autocomplete.AutoCompleteComponent
    [javac] private MethodExpression completionMethod;
    [javac] ^

  • Websphere 6: JNDI problem with Sping - urgent.

    Hi,
    I have my cJSC project working fine with JNDI on my local sun app server. However when deploying to websphere I am getting problems.
    Obviously websphere is different setup and I have had to add the following to the web.xml to get a datasource
    <resource-ref>
         <description>VMS Datasource</description>
         <res-ref-name>jdbc/VMSDS</res-ref-name>
         <res-type>javax.sql.DataSource</res-type>
         <res-auth>Container</res-auth>
    </resource-ref>
    However, the app is still bombing out with following..
    Error page exception
    The server cannot use the error page specified for your application to handle the Original Exception printed below. Please see the Error Page Exception below for a description of the problem with the specified error page.
    Original Exception:
    Error Message: SRVE0207E: Uncaught initialization exception thrown by servlet
    Error Code: 500
    Target Servlet: Faces Servlet
    Error Stack:
    java.lang.NullPointerException
    at javax.faces.webapp.FacesServlet.init(FacesServlet.java:144)
    at com.ibm.ws.cache.servlet.ServletWrapper.init(ServletWrapper.java:231)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:274)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:480)
    at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:2954)
    at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:221)
    at com.ibm.ws.webcontainer.VirtualHost.handleRequest(VirtualHost.java:210)
    at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1912)
    at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:84)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:472)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:411)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:288)
    at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminaters(NewConnectionInitialReadCallback.java:207)
    at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:109)
    at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java:566)
    at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java:619)
    at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java:952)
    at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java:1039)
    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1469)
    Error Page Exception:
    Error Message: Cannot find FacesContext
    Error Code: 0
    Target Servlet: null
    Error Stack:
    javax.servlet.jsp.JspException: Cannot find FacesContext
    at javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:405)
    at com.sun.faces.taglib.jsf_core.ViewTag.doStartTag(ViewTag.java:105)
    at com.ibm._jsp._ErrorPage._jspx_meth_f_view_0(_ErrorPage.java:330)
    at com.ibm._jsp._ErrorPage._jspService(_ErrorPage.java:63)
    at com.ibm.ws.jsp.runtime.HttpJspBase.service(HttpJspBase.java:88)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    at com.ibm.ws.cache.servlet.ServletWrapper.serviceProxied(ServletWrapper.java:264)
    at com.ibm.ws.cache.servlet.CacheHook.handleFragment(CacheHook.java:344)
    at com.ibm.ws.cache.servlet.CacheHook.handleServlet(CacheHook.java:216)
    at com.ibm.ws.cache.servlet.ServletWrapper.service(ServletWrapper.java:246)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1282)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1239)
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:113)
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:82)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:670)
    at com.ibm.wsspi.webcontainer.servlet.GenericServletWrapper.handleRequest(GenericServletWrapper.java:117)
    at com.ibm.ws.jsp.webcontainerext.JSPExtensionServletWrapper.handleRequest(JSPExtensionServletWrapper.java:178)
    at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:294)
    at com.ibm.ws.webcontainer.webapp.WebApp.sendError(WebApp.java:2593)
    at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:2983)
    at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:221)
    at com.ibm.ws.webcontainer.VirtualHost.handleRequest(VirtualHost.java:210)
    at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1912)
    at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:84)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:472)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:411)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:288)
    at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminaters(NewConnectionInitialReadCallback.java:207)
    at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:109)
    at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java:566)
    at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java:619)
    at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java:952)
    at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java:1039)
    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1469)
    Anybody used JSC and Websphere with JNDI? I go live next week and don't want to have to configure a context file each time for production.
    Regards,
    LOTI

    Is the resource ref the same as you configured for the bundled
    Sun App server ?
    We do have a sample JNDI application and tip if they help:
    http://developers.sun.com/prodtech/javatools/jscreator/reference/code/sampleapps/2/JaasAuthentication.zip
    (see the README file in the zip file)
    http://developers.sun.com/prodtech/javatools/jscreator/reference/tips/2/jaas_authentication.html
    John

  • Problems with setCurrentRowWithKeyValue

    Hi,
    I'v got a problem with setCurrentRowWithKeyValue... it just doesn't set the value. I'm probably missing something obvious..
    On the first page, I have a link command:
    <af:commandLink text="#{row.DocumentTitle}" action="myAction">
      <tr:setActionListener from="#{row.DocumentId}" to="#{requestScope.documentId}"/>
    </af:commandLink>In the page def, I have secTurrentRowWithKeyValueAction:
    <action IterBinding="DocMonthlyReportViewIterator"
                id="setCurrentRowWithKeyValue"
                InstanceName="DocumentsModuleDataControl.DocMonthlyReportView"
                DataControl="DocumentsModuleDataControl" RequiresUpdateModel="false"
                Action="setCurrentRowWithKeyValue">
          <NamedData NDName="rowKey" NDValue="#{requestScope.documentId}"
                     NDType="java.lang.String"/>
        </action>But this action doesn't fire. If i set a breakpoint in the view object's findByKey method, I see it's never called.
    The only difference with this example and other forms it that DocMonthlyReportView is based on two EOs. But still, it has just one key column, so there should be no problem, right?
    I tried to workaround the issue and created a backing bean wich implements PagePhaseListener:
    public void onPageLoad()
         ValueBinding vb =FacesContext.getCurrentInstance().getApplication().createValueBinding("#{requestScope.documentId}");
         Object o=vb.getValue(FacesContext.getCurrentInstance());
         if(o!=null)
             DCBindingContainer dcBc = (DCBindingContainer) bc;
             DCIteratorBinding iter =
                     dcBc.findIteratorBinding("DocMonthlyReportViewIterator");
             iter.setCurrentRowWithKeyValue(o.toString());
        }This seems to work for DocMonthlyReportView, which is master view, but detail views are not loaded. More exact: the first time I load this page, there's no detail records. If I load it again, detail records are present. Why is that? How could I force detail records to be loaded in above code?
    Thanks
    Jernej

    Update:
    it also seems that my page load twice. If I implement the onPageLoad like this:
    public void onPageLoad()
         ValueBinding vb =FacesContext.getCurrentInstance().getApplication().createValueBinding("#{requestScope.documentId}");
         Object o=vb.getValue(FacesContext.getCurrentInstance());
         if(o!=null)
             DCBindingContainer dcBc = (DCBindingContainer) bc;
             DCIteratorBinding iter =
                     dcBc.findIteratorBinding("DocMonthlyReportViewIterator");
             iter.setCurrentRowWithKeyValue(o.toString());
               //load details
               iter =
              dcBc.findIteratorBinding("DocMonthlyReportItemsView1Iterator");
             iter.executeQuery();
        }i see the view is loaded in the server output:
    [646] **** refreshControl() for BindingContainer :net_kinvent_psa_monthlyReportPageDef
    [647] Invoke refresh for :DocMonthlyReportViewIterator
    [648] Executing and syncing on IteratorBinding.refresh from :DocMonthlyReportViewIterator
    Source breakpoint occurred at line 49 of DocMonthlyReport.java.
    [649] DCUtil, returning:oracle.adf.model.binding.DCParameter, for DocumentsModuleDataControl
    [650] Resolving VO:DocMonthlyReportView for iterator binding:DocMonthlyReportViewIterator
    [651] DocMonthlyReportItemsView1 ViewRowSetImpl.execute caused params to be "un"changed
    [652] Column count: 7
    [653] ViewObject: DocMonthlyReportItemsView1 Reusing defined prepared Statement
    [654] Bind params for ViewObject: DocMonthlyReportItemsView1
    [655] Binding param 1: 11
    [656] DCUtil, returning:oracle.adf.model.binding.DCParameter, for DocumentsModuleDataControl
    [657] Invoke refresh for :DocMonthlyReportItemsView1Iterator
    [658] Executing and syncing on IteratorBinding.refresh from :DocMonthlyReportItemsView1Iterator
    [659] Resolving VO:DocMonthlyReportItemsView1 for iterator binding:DocMonthlyReportItemsView1Iterator
    [660] DCUtil, returning:oracle.adfinternal.view.faces.model.binding.FacesCtrlHierBinding, for DocMonthlyReportItemsView1
    [661] DocMonthlyReportItemsView1 ViewRowSetImpl.execute caused params to be "un"changed
    [662] Column count: 7
    [663] ViewObject: DocMonthlyReportItemsView1 Reusing defined prepared Statement
    [664] Bind params for ViewObject: DocMonthlyReportItemsView1
    [665] Binding param 1: 11Notice the binding param value: 11. Thiis is the right value. But after this code complets, I see this in server output:
    [666] **** refreshControl() for BindingContainer :net_kinvent_psa_monthlyReportPageDef
    [667] **** refreshControl() for BindingContainer :net_kinvent_psa_monthlyReportPageDef
    [668] Invoke refresh for :DocMonthlyReportViewIterator
    [669] Executing and syncing on IteratorBinding.refresh from :DocMonthlyReportViewIterator
    [670] Invoke refresh for :DocMonthlyReportItemsView1Iterator
    [671] Executing and syncing on IteratorBinding.refresh from :DocMonthlyReportItemsView1Iterator
    [672] Clearing VO cache for DocMonthlyReportItemsView1
    [673] Clear QueryCollection in cache for VO DocMonthlyReportItemsView1
    [674] Clearing VO cache for DocMonthlyReportView
    [675] Clear QueryCollection in cache for VO DocMonthlyReportView
    [676] **** PoolMessage REQ ATTACH LWS
    [677] **** PoolMessage REQ DETACH LWS
    [678] (oracle.adf.model.bc4j.DataControlFactoryImpl.SyncMode = Immediate
    [679] Security V2 is on
    Source breakpoint occurred at line 37 of DocMonthlyReport.java.
    [680] **** refreshControl() for BindingContainer :net_kinvent_psa_monthlyReportPageDef
    [681] **** refreshControl() for BindingContainer :net_kinvent_psa_monthlyReportPageDef
    [682] Invoke refresh for :DocMonthlyReportItemsView1Iterator
    [683] Executing and syncing on IteratorBinding.refresh from :DocMonthlyReportItemsView1Iterator
    [684] DCUtil, returning:oracle.adf.model.binding.DCParameter, for DocumentsModuleDataControl
    [685] (oracle.adf.model.bc4j.DataControlFactoryImpl.SyncMode = Immediate
    [686] Reusing a cached session application module instance
    [687] **** PoolMessage REQ ATTACH LWS
    [688] Resolving VO:DocMonthlyReportItemsView1 for iterator binding:DocMonthlyReportItemsView1Iterator
    [689] DCUtil, returning:oracle.adfinternal.view.faces.model.binding.FacesCtrlHierBinding, for DocMonthlyReportItemsView1
    [690] DocMonthlyReportView ViewRowSetImpl.execute caused params to be "un"changed
    [691] Column count: 12
    [692] ViewObject: DocMonthlyReportView Reusing defined prepared Statement
    [693] Bind params for ViewObject: DocMonthlyReportView
    [694] DocMonthlyReportItemsView1 ViewRowSetImpl.execute caused params to be "un"changed
    [695] Column count: 7
    [696] ViewObject: DocMonthlyReportItemsView1 Reusing defined prepared Statement
    [697] Bind params for ViewObject: DocMonthlyReportItemsView1
    [698] Binding param 1: 12
    [699] DocMonthlyReportItemsView1 ViewRowSetImpl.execute caused params to be "un"changed
    [700] Column count: 7
    [701] ViewObject: DocMonthlyReportItemsView1 Reusing defined prepared Statement
    [702] Bind params for ViewObject: DocMonthlyReportItemsView1
    [703] Binding param 1: 12
    [704] Clearing VO cache for DocMonthlyReportItemsView1
    [705] Clear QueryCollection in cache for VO DocMonthlyReportItemsView1
    [706] **** PoolMessage REQ ATTACH LWS
    [707] **** PoolMessage REQ DETACH LWSWhy is the page loading twice? And why does the binding parameter value changes the second time?? What could cause this?

  • Problem with af:selectInputDate (no calendar popup)

    Hi All,
    I have a problem with the af:selectInputDate component and the calendar popup when using a custom converter. My converter converts the date in a way, that it always has a four digit year depending on the short date format and the corresponding locale, e.g. 01/18/2007 instead of 01/18/07 for en-us. It looks like when I am using my converter with the component in the following way some javascript is not generated by the af:selectInputDate which results in an javascript error when clicking on the popup button:
    <h:panelGroup>
    <af:selectInputDate id="idPatientBirthDate" columns="12" simple="true" value="#{PatientDetails.patient.birthDate}">
    <f:converter converterId="BirthdateConverter" />
    </af:selectInputDate>
    <h:message for="idPatientBirthDate" errorClass="errorMessageStyle"></h:message>     
    </h:panelGroup>
    The following javascript is not generated using the above jsf:
    <script>
    if(window['_dfs'] == (void 0)){var _dfs=new Object();}_dfs["_id43:general:idPatientBirthDate"]='M/d/yyyy';function __id43Validator(){return true;}
    </script>
    I am using version 10.1.3.0.4 of ADF faces.
    My BirthdateConverter is a standard converter that implements the Converter interface and is not doing any magical. It works perfectly for other components. An interesting fact is, that the above javascript gets generated when I am using no converter at all or the standard date/time converters like f:convertDateTime provided by the RI. However, these don't provide the functionality I need.
    I have the bad feeling, that I am missing something. Does anyone else ran across this problem?
    Thanks,
    Herbert

    Frank,
    Thank you for your answer. I'm not using ADF BC, so is there a possible workaround? My model provides a standard java.util.Date. My converter looks like:
    public class BirthdateConverter implements Converter {
      public Object getAsObject(FacesContext facesContext, UIComponent uIComponent, String sDate) {
        Locale locale = facesContext.getCurrentInstance().getExternalContext().getRequestLocale();
        String pattern = AppUtil.getFourDigitYearPattern(DateFormat.SHORT);
        SimpleDateFormat sdf = new SimpleDateFormat(pattern, locale);
        java.util.Date d = sdf.parse(sDate);
        // converter logic
        return d;
      public String getAsString(FacesContext facesContext, UIComponent uIComponent, Object object) {
        if (object == null)
          return null;
        if (!(object instanceof Date))
          return object.toString();
        Locale locale = facesContext.getCurrentInstance().getExternalContext().getRequestLocale();
        String pattern = AppUtil.getFourDigitYearPattern(DateFormat.SHORT);
        SimpleDateFormat sdf = new SimpleDateFormat(pattern, locale);
        return sdf.format((java.util.Date)object);
    }AppUtil.getFourDigitYearPattern(DateFormat.SHORT) provides a date pattern, e.g. "M/d/yyyy" for locale en-us. In the above code I did not include try-catch blocks to make it more readable.
    Herbert
    Message was edited by:
    user575859

  • Problems with Weblogic 8.1

    I've got an exception
    <07.11.2004 18:20:22 MSK> <Error> <HTTP> <BEA-101216> <Servlet: "Faces Servlet"
    failed to preload on startup in Web application: "MyApp".
    javax.servlet.ServletException
    at weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubIm
    pl.java:906)
    at weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStub
    Impl.java:842)
    at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubI
    mpl.java:782)
    at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppS
    ervletContext.java:3236)
    at weblogic.servlet.internal.WebAppServletContext.preloadServlets(WebApp
    ServletContext.java:3193)
    at weblogic.servlet.internal.WebAppServletContext.preloadServlets(WebApp
    ServletContext.java:3179)
    at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAp
    pServletContext.java:3154)
    at weblogic.servlet.internal.HttpServer.preloadResources(HttpServer.java
    :654)
    at weblogic.servlet.internal.WebService.preloadResources(WebService.java
    :483)
    at weblogic.servlet.internal.ServletInitService.resume(ServletInitServic
    e.java:30)
    at weblogic.t3.srvr.SubsystemManager.resume(SubsystemManager.java:131)
    at weblogic.t3.srvr.T3Srvr.resume(T3Srvr.java:964)
    at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:359)
    at weblogic.Server.main(Server.java:32)
    >
    JSF v.1.1
    Does JSF work with WebLogic?

    Have you already figured it out? I have the same
    problem to deploy a jsf war file to Weblogic 8.1.I got it working on wls 8.1 sp2. This is a work around for some of us who need to work with existing products and any upgrade to a newer version takes its own sweet time. Read below ...
    1.     Work-around for �listener� in web.xml not working
    a.     Create InitFacesContext Servlet
    public class InitFacesContext extends GenericServlet {
         StartupServletContextListener listener;
         public void destroy() {
              super.destroy();
              listener.contextDestroyed(new ServletContextEvent(getServletContext()));
         public void init(ServletConfig arg0) throws ServletException {
              super.init(arg0);
              listener = new StartupServletContextListener();
              listener.contextInitialized(new ServletContextEvent(getServletContext()));
         public void service(ServletRequest arg0, ServletResponse arg1) throws ServletException, IOException {
    }b.     Configure web.xml
    <!--
         <listener>
           <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
         </listener>
          -->
         <servlet>
              <servlet-name>InitFacesContext</servlet-name>
              <servlet-class>com.gene.volts.servlet.InitFacesContext</servlet-class>
              <load-on-startup>0</load-on-startup>
         </servlet>
         <servlet>
              <servlet-name>FacesServlet</servlet-name>
              <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
              <load-on-startup>1</load-on-startup>
         </servlet>2.     JSP 2.0 requirement
    a.     Download jsp-api.jar (like from Tomcat 5.x distribution ;-) ) and include it in web-inf/lib
    3.     Dealing with FacesContext not being initialized error
    a.     web.xml configuration
         <servlet-mapping>
              <servlet-name>FacesServlet</servlet-name>
              <url-pattern>*.faces</url-pattern>
         </servlet-mapping>
         <welcome-file-list>
              <welcome-file>index.jsp</welcome-file>
         </welcome-file-list>b.     Redirect
    <jsp:forward page="/abc.faces"/>

  • A problem with threads

    I am trying to implement some kind of a server listening for requests. The listener part of the app, is a daemon thread that listens for connections and instantiates a handling daemon thread once it gets some. However, my problem is that i must be able to kill the listening thread at the user's will (say via a sto button). I have done this via the Sun's proposed way, by testing a boolean flag in the loop, which is set to false when i wish to kill the thread. The problem with this thing is the following...
    Once the thread starts excecuting, it will test the flag, find it true and enter the loop. At some point it will LOCK on the server socket waiting for connection. Unless some client actually connects, it will keep on listening indefinatelly whithought ever bothering to check for the flag again (no matter how many times you set the damn thing to false).
    My question is this: Is there any real, non-theoretical, applied way to stop thread in java safely?
    Thank you in advance,
    Lefty

    This was one solution from the socket programming forum, have you tried this??
    public Thread MyThread extends Thread{
         boolean active = true;          
         public void run(){
              ss.setSoTimeout(90);               
              while (active){                   
                   try{                       
                        serverSocket = ss.accept();
                   catch (SocketTimeoutException ste){
                   // do nothing                   
         // interrupt thread           
         public void deactivate(){               
              active = false;
              // you gotta sleep for a time longer than the               
              // accept() timeout to make sure that timeout is finished.               
              try{
                   sleep(91);               
              }catch (InterruptedException ie){            
              interrupt();
    }

  • Problem with Threads and a static variable

    I have a problem with the code below. I am yet to make sure that I understand the problem. Correct me if I am wrong please.
    Code functionality:
    A timer calls SetState every second. It sets the state and sets boolean variable "changed" to true. Then notifies a main process thread to check if the state changed to send a message.
    The problem as far I understand is:
    Assume the timer Thread calls SetState twice before the main process Thread runs. As a result, "changed" is set to true twice. However, since the main process is blocked twice during the two calls to SetState, when it runs it would have the two SetState timer threads blocked on its synchronized body. It will pass the first one, send the message and set "changed" to false since it was true. Now, it will pass the second thread, but here is the problem, "changed" is already set to false. As a result, it won't send the message even though it is supposed to.
    Would you please let me know if my understanding is correct? If so, what would you propose to resolve the problem? Should I call wait some other or should I notify in a different way?
    Thanks,
    B.D.
    Code:
    private static volatile boolean bChanged = false;
    private static Thread objMainProcess;
       protected static void Init(){
            objMainProcess = new Thread() {
                public void run() {
                    while( objMainProcess == Thread.currentThread() ) {
                       GetState();
            objMainProcess.setDaemon( true );
            objMainProcess.start();
        public static void initStatusTimer(){
            if(objTimer == null)
                 objTimer = new javax.swing.Timer( 1000, new java.awt.event.ActionListener(){
                    public void actionPerformed( java.awt.event.ActionEvent evt){
                              SetState();
        private static void SetState(){
            if( objMainProcess == null ) return;
            synchronized( objMainProcess ) {
                bChanged = true;
                try{
                    objMainProcess.notify();
                }catch( IllegalMonitorStateException e ) {}
        private static boolean GetState() {
            if( objMainProcess == null ) return false;
            synchronized( objMainProcess ) {
                if( bChanged) {
                    SendMessage();
                    bChanged = false;
                    return true;
                try {
                    objMainProcess.wait();
                }catch( InterruptedException e ) {}
                return false;
        }

    Thanks DrClap for your reply. Everything you said is right. It is not easy to make them alternate since SetState() could be called from different places where the state could be anything else but a status message. Like a GREETING message for example. It is a handshaking message but not a status message.
    Again as you said, There is a reason I can't call sendMessage() inside setState().
    The only way I was able to do it is by having a counter of the number of notifies that have been called. Every time notify() is called a counter is incremented. Now instead of just checking if "changed" flag is true, I also check if notify counter is greater than zero. If both true, I send the message. If "changed" flag is false, I check again if the notify counter is greater than zero, I send the message. This way it works, but it is kind of a patch than a good design fix. I am yet to find a good solution.
    Thanks,
    B.D.

  • Problem with threads running javaw

    Hi,
    Having a problem with multi thread programming using client server sockets. The program works find when starting the the application in a console using java muti.java , but when using javaw multi.java the program doesnt die and have to kill it in the task manager. The program doesnt display any of my gui error messages either when the server disconnect the client. all works find in a console. any advice on this as I havent been able to understand why this is happening? any comment would be appreciated.
    troy.

    troy,
    Try and post a minimum code sample of your app which
    does not work.
    When using javaw, make sure you redirect the standard
    error and standard output streams to file.
    Graeme.Hi Graeme,
    I dont understand what you mean by redirection to file? some of my code below.
    The code works fine under a console, code is supposed to exit when the client (the other server )disconnects. the problem is that but the clientworker side of the code still works. which under console it doesnt.
    public class Server{
    ServerSocket aServerSocket;
    Socket dianosticsSocket;
    Socket nPortExpress;
    ClientListener aClientListener;
    LinkedList queue = new LinkedList();
    int port = 0;
    int clientPort = 0;
    String clientName = null;
    boolean serverAlive = true;
    * Server constructor generates a server
    * Socket and then starts a client threads.
    * @param aPort      socket port of local machine.
    public Server(int aPort, String aClientName, int aClientPort){
    port = aPort;
    clientName = aClientName;
    clientPort = aClientPort;
    try{
    // create a new thread
    aServerSocket = new ServerSocket(port) ;
    // connect to the nPortExpress
    aClientListener = new ClientListener(InetAddress.getByName(clientName), clientPort, queue,this);
    // aClientListener.setDaemon(true);
    aClientListener.start();
    // start a dianostic port
    DiagnosticsServer aDiagnosticsServer = new DiagnosticsServer(port,queue,aClientListener);
    // System.out.println("Server is running on port " + port + "...");
    // System.out.println("Connect to nPort");
    catch(Exception e)
    // System.out.println("ERROR: Server port " + port + " not available");
    JOptionPane.showMessageDialog(null, (e.toString()),"ERROR: Server port " + port + " not available", JOptionPane.ERROR_MESSAGE);
    serverAlive = false;
    System.exit(1);
    while(serverAlive&&aClientListener.hostSocket.isConnected()){
    try{
    // connect the client
    Socket aClient = aServerSocket.accept();
    //System.out.println("open client connection");
    //System.out.println("client local: "+ aClient.getLocalAddress().toString());
    // System.out.println("client localport: "+ aClient.getLocalPort());
    // System.out.println("client : "+ aClient.getInetAddress().toString());
    // System.out.println("client port: "+ aClient.getLocalPort());
    // make a new client thread
    ClientWorker clientThread = new ClientWorker(aClient, queue, aClientListener, false);
    // start thread
    clientThread.start();
    catch(Exception e)
    //System.out.println("ERROR: Client connection failure");
    JOptionPane.showMessageDialog(null, (e.toString()),"ERROR: Client connection failure", JOptionPane.ERROR_MESSAGE);
    }// end while
    } // end constructor Server
    void serverExit(){
         JOptionPane.showMessageDialog(null, "Server ","ERROR: nPort Failure", JOptionPane.ERROR_MESSAGE);
         System.exit(1);
    }// end class Server
    *** connect to another server
    public class ClientListener extends Thread{
    InetAddress hostName;
    int hostPort;
    Socket hostSocket;
    BufferedReader in;
    PrintWriter out;
    boolean loggedIn;
    LinkedList queue;      // reference to Server queue
    Server serverRef; // reference to main server
    * ClientListener connects to the host server.
    * @param aHostName is the name of the host eg server name or IP address.
    * @param aHostPort is a port number of the host.
    * @param aLoginName is the users login name.
    public ClientListener(InetAddress aHostName, int aHostPort,LinkedList aQueue,Server aServer)      // reference to Server queue)
    hostName = aHostName;
    hostPort = aHostPort;
    queue = aQueue;
    serverRef = aServer;      
    // connect to the server
    try{
    hostSocket = new Socket(hostName, hostPort);
    catch(IOException e){
    //System.out.println("ERROR: Connection Host Failed");
    JOptionPane.showMessageDialog(null, (e.toString()),"ERROR: Connection to nPort Failed", JOptionPane.ERROR_MESSAGE);     
    System.exit(0);
    } // end constructor ClientListener
    ** multi client connection server
    ClientWorker(Socket aSocket,LinkedList aQueue, ClientListener aClientListener, boolean diagnostics){
    queue = aQueue;
    addToQueue(this);
    client = aSocket;
    clientRef = aClientListener;
    aDiagnostic = diagnostics;
    } // end constructor ClientWorker
    * run method is the main loop of the server program
    * in change of handle new client connection as well
    * as handle all messages and errors.
    public void run(){
    boolean alive = true;
    String aSubString = "";
    in = null;
    out = null;
    loginName = "";
    loggedIn = false;
    while (alive && client.isConnected()&& clientRef.hostSocket.isConnected()){
    try{
    in = new BufferedReader(new InputStreamReader(client.getInputStream()));
    out = new PrintWriter(new OutputStreamWriter(client.getOutputStream()));
    if(aDiagnostic){
    out.println("WELCOME to diagnostics");
    broadCastDia("Connect : diagnostics "+client.getInetAddress().toString());
    out.flush();
    else {       
    out.println("WELCOME to Troy's Server");
    broadCastDia("Connect : client "+client.getInetAddress().toString());
         out.flush();
    String line;
    while(((line = in.readLine())!= null)){
    StringTokenizer aStringToken = new StringTokenizer(line, " ");
    if(!aDiagnostic){
    broadCastDia(line);
    clientRef.sendMessage(line); // send mesage out to netExpress
    out.println(line);
    out.flush();
    else{
    if(line.equals("GETIPS"))
    getIPs();
    else{
    clientRef.sendMessage(line); // send mesage out to netExpress
    out.println(line);
    out.flush();
    } // end while
    catch(Exception e){
    // System.out.println("ERROR:Client Connection reset");
                             JOptionPane.showMessageDialog(null, (e.toString()),"ERROR:Client Connection reset", JOptionPane.ERROR_MESSAGE);     
    try{
    if(aDiagnostic){
    broadCastDia("Disconnect : diagnostics "+client.getInetAddress().toString());
    out.flush();
    else {       
    broadCastDia("Disconnect : client "+client.getInetAddress().toString());
         out.flush();
    // close the buffers and connection;
    in.close();
    out.close();
    client.close();
    // System.out.println("out");
    // remove from list
    removeThreadQueue(this);
    alive = false;
    catch(Exception e){
    // System.out.println("ERROR: Client Connection reset failure");
    JOptionPane.showMessageDialog(null, (e.toString()),"ERROR: Client Connection reset failure", JOptionPane.ERROR_MESSAGE);     
    }// end while
    } // end method run
    * method run - Generates io stream for communicating with the server and
    * starts the client gui. Run also parses the input commands from the server.
    public void run(){
    boolean alive = true;
    try{
    // begin to life the gui
    // aGuiClient = new ClientGui(hostName.getHostName(), hostPort, loginName, this);
    // aGuiClient.show();
    in = new BufferedReader(new InputStreamReader(hostSocket.getInputStream()));
    out = new PrintWriter(new OutputStreamWriter(hostSocket.getOutputStream()));
    while (alive && hostSocket.isConnected()){
    String line;
    while(((line = in.readLine())!= null)){
    System.out.println(line);
    broadCast(line);
    } // end while
    } // end while
    catch(Exception e){
    //     System.out.println("ERRORa Connection to host reset");
    JOptionPane.showMessageDialog(null, (e.toString()),"ERROR: Connection to nPort reset", JOptionPane.ERROR_MESSAGE);
    try{
    hostSocket.close();
         }catch(Exception a){
         JOptionPane.showMessageDialog(null, (a.toString()),"ERROR: Exception", JOptionPane.ERROR_MESSAGE);
    alive = false;
    System.exit(1);
    } // end method run

  • Problem with threads and camera.

    Hi everybody!
    I've a problem with taking snapshot.
    I would like to display a loading screen after it take snapshot ( sometimes i
    have to wait few seconds after i took snapshot. Propably photo is being taken in time where i have to wait).
    I was trying to use threads but i didn't succeed.
    I made this code:
    display.setCurrent(perform);               
            new Thread(new Runnable(){
                public void run() {               
                    while((!performing.isShown()) && (backgroundCamera.isShown())){
                        Thread.yield();
                    notifyAll();
            }).start();
            new Thread(new Runnable(){
                public void run() {
                    try {
                        this.wait();                   
                    } catch(Exception e) {
                        exceptionHandler(e);
                    photo = camera.snapshot();                               
                    display.setCurrent(displayPhoto);
            }).start();This code is sometimes showing performing screen but sometimes no.
    I don't know why. In my opinion performing.isShown() method isn't working correctly.
    Does anyone have some idea how to use threads here?

    Hi,
    I've finally managed to work this fine.
    The code:
           Object o = new Object();
           display.setCurrent(perform);               
            new Thread(new Runnable(){
                public void run() {               
                    while(!performing.isShown()){
                        Thread.yield();
                   synchronized(o) {
                      o.notify();
            }).start();
            new Thread(new Runnable(){
                public void run() {
                    try {
                        synchronized(o) {
                           o.wait(1);
                    } catch(Exception e) {
                        exceptionHandler(e);
                    photo = camera.snapshot();                               
                    display.setCurrent(displayPhoto);
            }).start();

  • Problem with threads hanging

    We have a problem where our application stops responding after a few days of usage. Things will for fine for a day or two, and then pretty quickly threads will start getting hung up, usually in places where they are allocating memory
    We are running WebLogic 8.1 SP2 on Sun JDK 1.4.2_04 on Solaris 8 using the alternate threading model and the -server hotspot vm. We are running pretty much the same code that we had no problems with under WebLogic 6.1 SP4 and Sun JDK 1.3.1.
    A thread dump usually shows that some or all of our execute threads are in the state "waiting for monitor entry" even though they are not currently waiting on any java locks. Here is a sample thread from the thread dump (we have ~120 threads so I don't want to post the full dump).
    =============================================================================================
    "ExecuteThread: '8' for queue: 'itgCrmWarExecutionQueue'" daemon prio=5 tid=0x005941d0 nid=0x2c waiting for monitor entry [c807f000..c807fc28]
    at java.lang.String.substring(String.java:1446)
    at java.lang.String.substring(String.java:1411)
    at weblogic.servlet.internal.ServletRequestImpl.getRelativeUri(ServletRequestImpl.java:1872)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3492)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2585)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
    =============================================================================================
    String.java line 1446 for this jdk allocates a new String object, and all the other threads in this state also are creating new objects or arrays, etc.
    We've done a pstack on this process when it's in this state, and the threads that are in the "waiting for monitor entry" that look like they're allocating memory are all waiting on the same lwp_mutex_lock with some allocation method that's calling into the native TwoGenerationCollectorPolicy.mem_allocate_work (see pstack output below for the same thread as in the thread dump above)
    =============================================================================================
    ----------------- lwp# 44 / thread# 44 --------------------
    ff31f364 lwp_mutex_lock (e3d70)
    fee92384 __1cNObjectMonitorGenter26MpnGThread__v_ (5000, 525c, 5000, 50dc, 4800, 4af0) + 2d8
    fee324d4 __1cSObjectSynchronizerKfast_enter6FnGHandle_pnJBasicLock_pnGThread__v_ (c807f65c, c807f7d4, 5941d0, 0, 35d654, fee328ec) + 68
    fee32954 __1cQinstanceRefKlassZacquire_pending_list_lock6FpnJBasicLock__v_ (c807f7d4, ff170000, d4680000, 4491d4, fee1bc2c,
    0) + 78
    fee3167c __1cPVM_GC_OperationNdoit_prologue6M_i_ (c807f7bc, 4400, ff170000, 2d2b8, 4a6268, c807fa18) + 38
    fee2e0b0 __1cIVMThreadHexecute6FpnMVM_Operation__v_ (c807f7bc, 963a8, 0, 0, 1, 0) + 90
    fed2c2a4 __1cbCTwoGenerationCollectorPolicyRmem_allocate_work6MIii_pnIHeapWord__ (962c0, ff1c29ec, ff1c297c, ff131a26, 4800, 4998) + 160
    fed22940 __1cNinstanceKlassRallocate_instance6MpnGThread__pnPinstanceOopDesc__ (ee009020, 5941d0, 15ca581, 3647f0, 4a6268, c807f8c8) + 180
    fed34928 __1cLOptoRuntimeFnew_C6FpnMklassOopDesc_pnKJavaThread__v_ (ee009018, 5941d0, 0, 0, 0, 0) + 28
    fa435a58 ???????? (ee009018, e86de, 15ca4de, 50dc, 5941d0, c807f9c8)
    fb36f9a4 ???????? (0, d412ccd8, ee046c28, ff170000, 0, 0)
    fad8b278 ???????? (ee046c28, d6000c90, ee046530, 8, db8e8450, c807f9e8)
    fad62abc ???????? (d412ccd8, ee046530, d6000c90, ee3bfa38, 8, c807fa18)
    fa4b3c38 ???????? (c807fb9c, 0, f2134700, fa415e50, 8, c807faa8)
    fa40010c ???????? (c807fc28, c807fe90, a, ee9e1e20, 4, c807fb40)
    fed5d48c __1cJJavaCallsLcall_helper6FpnJJavaValue_pnMmethodHandle_pnRJavaCallArguments_pnGThread__v_ (c807fe88, c807fcf0, c807fda8, 5941d0, 5941d0, c807fd00) + 27c
    fee4b784 __1cJJavaCallsMcall_virtual6FpnJJavaValue_nLKlassHandle_nMsymbolHandle_4pnRJavaCallArguments_pnGThread__v_ (ff170000, 594778, c807fd9c, c807fd98, c807fda8, 5941d0) + 164
    fee5e8dc __1cJJavaCallsMcall_virtual6FpnJJavaValue_nGHandle_nLKlassHandle_nMsymbolHandle_5pnGThread__v_ (c807fe88, c807fe84, c807fe7c, c807fe74, c807fe6c, 5941d0) + 6c
    fee6fc74 __1cMthread_entry6FpnKJavaThread_pnGThread__v_ (5941d0, 5941d0, 838588, 594778, 306d10, fee69254) + 128
    fee6927c __1cKJavaThreadDrun6M_v_ (5941d0, 2c, 40, 0, 40, 0) + 284
    fee6575c _start   (5941d0, fa1a1600, 0, 0, 0, 0) + 134
    ff3758c0 lwpstart (0, 0, 0, 0, 0, 0)
    =============================================================================================
    Also when it's having this problem, the "VM Thread" is always using a lot of processor time. We did a couple of pstacks today while it was having this problem, and this thread was stuck in the ONMethodSweeper.sweep for over 15 minutes when we finally killed the server.
    From the thread dump:
    "VM Thread" prio=5 tid=0x000e2d20 nid=0x2 runnable
    From the first pstack:
    =============================================================================================
    ----------------- lwp# 2 / thread# 2 --------------------
    fed40c04 __1cXvirtual_call_RelocationIparse_ic6FrpnICodeBlob_rpC5rppnHoopDesc_pi_nNRelocIterator__ (42a2f4, fa5fa46d, ffffffff, fc4ffcb8, 42a2f4, 42a324) + 124
    fed46318 __1cKCompiledIC2t5B6MpnKRelocation__v_ (42a2f0, fc4ffd24, fc4ffd4c, e802, 0, 6) + 38
    fed90c38 __1cHnmethodVcleanup_inline_caches6M_v_ (fa5f7f88, fa608940, 1, 0, fa400000, 6) + 1ac
    fede18b4 __1cONMethodSweeperFsweep6F_v_ (2cf38, 0, ffffffff, ff1cf1fc, ff1c66e8, fede1d44) + 1b0
    fede1e6c __1cUSafepointSynchronizeFbegin6F_v_ (2cf38, ff1ba138, 5000, 50dc, 5000, 525c) + 248
    feef1fd4 __1cIVMThreadEloop6M_v_ (4400, 4000, 4324, 4000, 42b0, 3800) + 3d4
    feef1ae4 __1cIVMThreadDrun6M_v_ (e2d20, 2, 40, 0, 40, 0) + 8c
    fee6575c _start   (e2d20, ff270200, 0, 0, 0, 0) + 134
    ff3758c0 lwpstart (0, 0, 0, 0, 0, 0)
    =============================================================================================
    Second pstack
    =============================================================================================
    ----------------- lwp# 2 / thread# 2 --------------------
    fed41180 __1cXvirtual_call_RelocationIparse_ic6FrpnICodeBlob_rpC5rppnHoopDesc_pi_nNRelocIterator__ (0, ff1b9664, ffffffff, fc4ffcb8, a6f2cc, fc4ffbd0) + 6a0
    fed46318 __1cKCompiledIC2t5B6MpnKRelocation__v_ (a6f2c8, fc4ffd24, fc4ffd4c, e802, 0, 6) + 38
    fed90c38 __1cHnmethodVcleanup_inline_caches6M_v_ (faded4c8, fadf2c80, 1, 0, fa400000, 6) + 1ac
    fede18b4 __1cONMethodSweeperFsweep6F_v_ (2cf38, 0, ffffffff, ff1cf1fc, ff1c66e8, fede1d44) + 1b0
    fede1e6c __1cUSafepointSynchronizeFbegin6F_v_ (2cf38, ff1ba138, 5000, 50dc, 5000, 525c) + 248
    feef1fd4 __1cIVMThreadEloop6M_v_ (4400, 4000, 4324, 4000, 42b0, 3800) + 3d4
    feef1ae4 __1cIVMThreadDrun6M_v_ (e2d20, 2, 40, 0, 40, 0) + 8c
    fee6575c _start   (e2d20, ff270200, 0, 0, 0, 0) + 134
    ff3758c0 lwpstart (0, 0, 0, 0, 0, 0)
    =============================================================================================
    Has anyone ever seen anything like this? I'm trying to figure out if this is caused by something we're doing, or something relating to our environment and jvm options. Any ideas?

    Thanks for the reply - I'm testing our app with the +UseConcMarkSweepGC now in our test environment to make sure it doesn't cause any problems there.  Unfortunately the only place we've had this problem is on the production server, so it's extra difficult debugging this. 
    We're using the following memory options:
    -ms512m -mx512m -XX:NewSize=128m -XX:PermSize=192m -XX:MaxNewSize=128m -XX:MaxPermSize=192m -XX:SurvivorRatio=8and the following debugging options, as we've also been seeing OutOfMemoryErrors ( see http://forum.java.sun.com/thread.jsp?forum=37&thread=522354&tstart=45&trange=15 )
    -verbosegc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintHeapAtGCBTW, which c++filt version and options are you using? Our Solaris boxes only seem to have the GNU version installed. I was trying to run that on some of the other stack traces and wasn't getting anywhere, and didn't know if because it was GNU version wouldn't work on something compiled with the Sun compiler.
    Thanks!
    --Andy                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Maybe you are looking for