3

I know there have been many SO questions asked regarding this issue, but I have surfed everywhere and tried all possible solutions to no avail.

I'm trying to deploy a small application using GlassFish 4.1.1. The application successfully builds and deploys, but when I click on a commandbutton to submit the form I get the following error

enter image description here

I'm using CDI to manage the Java bean via the @Named annotation. I'm using Java EE 7, so I believe that a beans.xml file is not necessary, but I manually created one and placed it in the WEB-INF directory, and I still got the same error.

Perhaps this is useful information: I'm using JavaServer Faces as the framework for my web app. However, unlike the image below, the JavaServer Faces Configuration on my screen is grayed out and locked. It does not allow me to select any of the tabs (Libraries, Configuration, Components) and thus I cannot select Primefaces as the JSF component suites to set up for my app. I figured this wouldn't be an issue, as I have downloaded the PrimeFaces 6.1.4 jar and placed it in the Libraries Folder of my application.

enter image description here

JSF Managed Bean class file:

import javax.inject.Named;
import javax.enterprise.context.SessionScoped;
import java.io.Serializable;

@Named(value = "autoLoan")
@SessionScoped
public class AutoLoan implements Serializable {

     /* The values of these private properties are supplied by the user */
    private float principalAmount;      // = P
    private float interestRatePercent;
    private float numberOfYears;        // = y

    /* The values of these private properties are computed in calculateLoan() */
    private double monthlyPayment;       // = M
    private double totalInterest;

    /**
     * Creates a new instance from the AutoLoan class
     */
    public AutoLoan() {

    }
    .
    .
    .

(I have getters and setters for all fields)

index.xhtml file where I'm attempting to reference the bean:

 <!-- Column 2 -->
 <h:inputText id="principal"
         label="Principal Amount Borrowed Input Text Field"
         value="#{autoLoan.principalAmount}"
         required="true"
         styleClass="loanText">
     <f:validateDoubleRange minimum="1000" maximum="1000000"></f:validateDoubleRange>
 </h:inputText>

Please let me know

jubilantdollop
  • 221
  • 2
  • 10

0 Answers0