0

My program was working just fine till I added another CDI managed bean. And even after removing that bean the issue remains. This issue is on both CDI managed beans I have and I looked really hard and can not see or understand where the issue is.

The 2 main problems I see others with are:

  1. Managed bean naming issues. I have tried using a lower case and changing the named value to a lower case. Tt still throws the same error. Plus it was working yesterday with the upper case letters.

  2. Something to do with a beans.xml that I don't have and never had.

I have looked and this does not seem to be the case for me.

I'm using JSF, Java EE 7, Derby, GlassFish and have been studying out of the book "Beginning Java EE 7" by Antonio Goncalves.

This is what I call on my JSF page:

#{CustomerController.cusFirstName}

This is my CustomerController class:

import coit13235.myjavaentapp.entity.Customer;
import coit13235.myjavaentapp.myejb.CustomerEJB;
import java.io.Serializable;
import java.util.List;
import javax.ejb.EJB;
import javax.enterprise.context.RequestScoped;
import javax.inject.Named;

@Named(value = "CustomerController")
@RequestScoped
public class CustomerController implements Serializable {
private String cusFirstName;
public String getCusFirstName() {
        return cusFirstName;
    }

    public void setCusFirstName(String cusFirstName) {
        this.cusFirstName = cusFirstName;
    }
//other code
}

Full stack trace:

javax.el.PropertyNotFoundException: /CreateCustomer.xhtml @18,86 value="#{CustomerController.cusFirstName}": Target Unreachable, identifier 'CustomerController' resolved to null
    at com.sun.faces.facelets.el.TagValueExpression.getType(TagValueExpression.java:100)
    at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getConvertedValue(HtmlBasicInputRenderer.java:95)
    at javax.faces.component.UIInput.getConvertedValue(UIInput.java:1045)
    at javax.faces.component.UIInput.validate(UIInput.java:975)
    at javax.faces.component.UIInput.executeValidate(UIInput.java:1248)
    at javax.faces.component.UIInput.processValidators(UIInput.java:712)
    at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1258)
    at javax.faces.component.UIForm.processValidators(UIForm.java:253)
    at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1258)
    at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1258)
    at javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:1195)
    at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:76)
    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
    at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:646)
    at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:318)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)
    at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)
    at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:415)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:282)
    at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)
    at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)
    at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:201)
    at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:175)
    at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235)
    at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
    at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
    at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:561)
    at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
    at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
    at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
    at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
    at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
    at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
    at java.lang.Thread.run(Thread.java:745)
Caused by: javax.el.PropertyNotFoundException: Target Unreachable, identifier 'CustomerController' resolved to null
    at com.sun.el.parser.AstValue.getTarget(AstValue.java:174)
    at com.sun.el.parser.AstValue.getType(AstValue.java:86)
    at com.sun.el.ValueExpressionImpl.getType(ValueExpressionImpl.java:201)
    at com.sun.faces.facelets.el.TagValueExpression.getType(TagValueExpression.java:98)
    ... 42 more
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Daedric
  • 1
  • 6
  • If your application worked fine until you added new bean and stopped working even after removing this bean then do clean&build, restart GlassFish and deploy. GlassFish likes to cache everything. – Geinmachi Sep 27 '15 at 16:52
  • Indeed sounds like the build just failed. For all clues, see also http://stackoverflow.com/q/30128395 – BalusC Sep 27 '15 at 16:53
  • i hate my life.... yes after restarting derby and glassfish the code now works again. i will add the new controller again and see what happens. how does something like that happen? i clean and built the program multiple times and kept getting that error. why did i have to restart derby and glassfish to fix it? – Daedric Sep 27 '15 at 17:07
  • Just restarting GlassFish alone should do, that's the nature of this container I guess. – Geinmachi Sep 27 '15 at 17:13
  • If you're using Eclipse, the GlassFish-Eclipse plugin is terrible as to housekeeping and cleansweeping across redeployments. Sometimes you need to manually clean GF work folders or do it via commandline. In any case, the duplicate has "dirty build" covered as well as some hints how to examine the deployment (step 1c). – BalusC Sep 27 '15 at 18:37
  • no im using Netbeans. not only that but i don't let netbeans handle the launch of derby and glassfish. i manually launch derby and then manually lanch a domain on glassfish then i run netbeans and it connects to that and runs it off that. also BalusC u marked it as duplicate but where is the question that has the answer "restart derby and glassfish" i pointed out i had looked for over an hour but couldn't find the answer that worked for me. i also stated if you are going to mark it as a duplicate then link the freaking question. – Daedric Sep 28 '15 at 07:07

0 Answers0