Announcement Announcement Module
Collapse
No announcement yet.
can't get mongodb, jsf to run mvn tomcat:run or jetty:run Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    yes i think it's english locale. my desktop is ubuntu linux. any way to be sure?

    Comment


    • #17
      ~/Documents/workspace-sts-3.1.0.RELEASE $ locale
      LANG=en_US.UTF-8
      LANGUAGE=
      LC_CTYPE="en_US.UTF-8"
      LC_NUMERIC="en_US.UTF-8"
      LC_TIME="en_US.UTF-8"
      LC_COLLATE="en_US.UTF-8"
      LC_MONETARY="en_US.UTF-8"
      LC_MESSAGES="en_US.UTF-8"
      LC_PAPER="en_US.UTF-8"
      LC_NAME="en_US.UTF-8"
      LC_ADDRESS="en_US.UTF-8"
      LC_TELEPHONE="en_US.UTF-8"
      LC_MEASUREMENT="en_US.UTF-8"
      LC_IDENTIFICATION="en_US.UTF-8"
      LC_ALL=

      Comment


      • #18
        You don't have to declare this :

        <managed-bean>
        <managed-bean-name>localeBean</managed-bean-name>
        <managed-bean-class>com.vaulthealth.jsf.util.LocaleBean</managed-bean-class>
        <managed-bean-scope>session</managed-bean-scope>
        </managed-bean>
        <managed-bean>
        <managed-bean-name>applicationBean</managed-bean-name>
        <managed-bean-class>com.vaulthealth.jsf.ApplicationBean</managed-bean-class>
        <managed-bean-scope>session</managed-bean-scope>
        </managed-bean>
        <managed-bean>
        <managed-bean-name>patientBean</managed-bean-name>
        <managed-bean-class>com.vaulthealth.jsf.PatientBean</managed-bean-class>
        <managed-bean-scope>session</managed-bean-scope>
        </managed-bean>

        Comment


        • #19
          interesting...i removed those lines but now i get this:

          javax.servlet.ServletException: /templates/layout.xhtml at line 8 and column 63 locale="#{localeBean.locale}" Attribute did not evaluate to a String or Locale: null
          javax.faces.webapp.FacesServlet.service(FacesServl et.java:213)
          org.primefaces.webapp.filter.FileUploadFilter.doFi lter(FileUploadFilter.java:79)

          Comment


          • #20
            Under ~.util package please check if your LocaleBean class has these 2 annotations : @ManagedBean and @SessionScoped

            Comment


            • #21
              package com.myapp.jsf.util;

              import java.util.ArrayList;
              import java.util.Iterator;
              import java.util.List;
              import java.util.Locale;

              import javax.annotation.PostConstruct;
              import javax.faces.bean.ManagedBean;
              import javax.faces.bean.SessionScoped;
              import javax.faces.context.FacesContext;
              import javax.faces.model.SelectItem;

              @ManagedBean
              @SessionScoped
              public class LocaleBean {
              private Locale locale;

              @PostConstruct
              public void init() {
              locale = FacesContext.getCurrentInstance().getExternalConte xt().getRequestLocale();
              }

              public Locale getLocale() {
              return locale;
              }

              public void setLocale(Locale locale) {
              this.locale = locale;
              }

              public SelectItem[] getLocales() {
              List<SelectItem> items = new ArrayList<SelectItem>();
              Iterator<Locale> supportedLocales = FacesContext.getCurrentInstance().getApplication() .getSupportedLocales();
              while (supportedLocales.hasNext()) {
              Locale locale = supportedLocales.next();
              items.add(new SelectItem(locale.toString(), locale.getDisplayName()));
              }
              return items.toArray(new SelectItem[] {});
              }

              public String getSelectedLocale() {
              return getLocale().toString();
              }

              public void setSelectedLocale() {
              setSelectedLocale(FacesContext.getCurrentInstance( ).getExternalContext().getRequestParameterMap().ge t("locale"));
              }

              public void setSelectedLocale(String localeString) {
              Iterator<Locale> supportedLocales = FacesContext.getCurrentInstance().getApplication() .getSupportedLocales();
              while (supportedLocales.hasNext()) {
              Locale locale = supportedLocales.next();
              if (locale.toString().equals(localeString)) {
              this.locale = locale;
              break;
              }
              }
              }
              }

              Comment


              • #22
                This is a web server version problem.

                If you use Tomcat 7.x it should work without problems. You're already done

                Comment


                • #23
                  if i instead use jetty:run (since i think i am using tomcat 7) i get this:



                  Problem accessing /myapp/pages/main.jsf. Reason:

                  Target Unreachable, identifier 'bookBean' resolved to null

                  Caused by:

                  javax.el.PropertyNotFoundException: Target Unreachable, identifier 'bookBean' resolved to null

                  this has taken waaaaay too much time at this point. i thought this was supposed to be RAD out-of-the-box. i'm going to try groovy and see how much luck i have there.

                  Comment


                  • #24
                    so i switched to tomcat7 :

                    Dec 15, 2012 11:19:35 AM org.apache.catalina.core.StandardEngine startInternal
                    INFO: Starting Servlet Engine: Apache Tomcat/7.0.25

                    but still i get the locale bean error:

                    SEVERE: Servlet.service() for servlet [Faces Servlet] in context with path [/thedrvault] threw exception [/templates/layout.xhtml at line 8 and column 63 locale="#{localeBean.locale}" Attribute did not evaluate to a String or Locale: null] with root cause
                    javax.faces.view.facelets.TagAttributeException: /templates/layout.xhtml at line 8 and column 63 locale="#{localeBean.locale}" Attribute did not evaluate to a String or Locale: null

                    Comment

                    Working...
                    X