javax.naming.NameNotFoundException: Name test.LanguageController isnot bound in this Context


A

aalberani

Hi.
I'm trying to create a CRUD application with JSF and Entity Beans with
the authomatics tools of Netbeans.
First I've generated the entity class using the "Entity Class from
database" feature.
Then I've used the feature "JSF pages from entity classes" in order to
generate the controller, the converter class and the 4 JSP for CRUD
operations.
But when I launch every jsp, I obtain this exception:

AVVERTENZA: executePhase(RENDER_RESPONSE
6,[email protected]) threw exception
com.sun.rave.web.ui.appbase.ApplicationException:
javax.faces.FacesException: javax.naming.NameNotFoundException: Name
test.LanguageController is not bound in this Context
at
com.sun.rave.web.ui.appbase.faces.ViewHandlerImpl.cleanup(ViewHandlerImpl.java:
594)
at
com.sun.rave.web.ui.appbase.faces.ViewHandlerImpl.renderView(ViewHandlerImpl.java:
311)
at
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:
106)
at
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
at
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
at
com.sun.faces.extensions.avatar.lifecycle.PartialTraversalLifecycle.render(PartialTraversalLifecycle.java:
106)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:
245)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:
290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:
206)
at
com.sun.webui.jsf.util.UploadFilter.doFilter(UploadFilter.java:267)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:
235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:
206)
at
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:
390)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:
235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:
206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:
233)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:
175)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:
128)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:
102)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:
109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:
286)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:
844)
at org.apache.coyote.http11.Http11Protocol
$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint
$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
Caused by: javax.faces.FacesException: javax.faces.FacesException:
javax.naming.NameNotFoundException: Name test.LanguageController is
not bound in this Context
at
com.sun.faces.application.ApplicationAssociate.createAndMaybeStoreManagedBeans(ApplicationAssociate.java:
537)
at
com.sun.faces.el.ManagedBeanELResolver.getValue(ManagedBeanELResolver.java:
82)
at
javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
at
com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:
64)
at
org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:61)
at org.apache.el.parser.AstValue.getTarget(AstValue.java:59)
at org.apache.el.parser.AstValue.invoke(AstValue.java:148)
at
org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:
276)
at
org.apache.jasper.el.JspMethodExpression.invoke(JspMethodExpression.java:
68)
at
javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:
77)
at
com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:
91)
at
com.sun.rave.web.ui.appbase.faces.ActionListenerImpl.processAction(ActionListenerImpl.java:
91)
at javax.faces.component.UICommand.broadcast(UICommand.java:
383)
at
javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:447)
at
javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:
752)
at
com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:
97)
at
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
at
com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
at
com.sun.faces.extensions.avatar.lifecycle.PartialTraversalLifecycle.execute(PartialTraversalLifecycle.java:
94)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:
244)
... 18 more
Caused by: javax.faces.FacesException:
javax.naming.NameNotFoundException: Name test.LanguageController is
not bound in this Context
at
com.sun.faces.config.ManagedBeanFactoryImpl.newInstance(ManagedBeanFactoryImpl.java:
340)
at
com.sun.faces.application.ApplicationAssociate.createAndMaybeStoreManagedBeans(ApplicationAssociate.java:
527)
... 37 more
Caused by: javax.naming.NameNotFoundException: Name
test.LanguageController is not bound in this Context
at org.apache.naming.NamingContext.lookup(NamingContext.java:
770)
at org.apache.naming.NamingContext.lookup(NamingContext.java:
153)
at
org.apache.catalina.util.DefaultAnnotationProcessor.lookupFieldResource(DefaultAnnotationProcessor.java:
203)
at
org.apache.catalina.util.DefaultAnnotationProcessor.processAnnotations(DefaultAnnotationProcessor.java:
135)
at
com.sun.faces.vendor.Tomcat6InjectionProvider.inject(Tomcat6InjectionProvider.java:
46)
at
com.sun.faces.config.ManagedBeanFactoryImpl.newInstance(ManagedBeanFactoryImpl.java:
298)
... 38 more
28-giu-2008 0.44.07 com.sun.faces.lifecycle.LifecycleImpl phase
AVVERTENZA: phase(RENDER_RESPONSE
6,[email protected]) threw exception:
com.sun.rave.web.ui.appbase.ApplicationException:
javax.faces.FacesException: javax.naming.NameNotFoundException: Name
test.LanguageController is not bound in this Context
javax.faces.FacesException: javax.naming.NameNotFoundException: Name
test.LanguageController is not bound in this Context
com.sun.rave.web.ui.appbase.faces.ViewHandlerImpl.cleanup(ViewHandlerImpl.java:
594)
com.sun.rave.web.ui.appbase.faces.ViewHandlerImpl.afterPhase(ViewHandlerImpl.java:
470)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:280)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
com.sun.faces.extensions.avatar.lifecycle.PartialTraversalLifecycle.render(PartialTraversalLifecycle.java:
106)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:
290)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:
206)
com.sun.webui.jsf.util.UploadFilter.doFilter(UploadFilter.java:267)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:
235)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:
206)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:
390)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:
235)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:
206)
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:
233)
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:
175)
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:
128)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:
102)
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:
109)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:
286)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:
844)
org.apache.coyote.http11.Http11Protocol
$Http11ConnectionHandler.process(Http11Protocol.java:583)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:
447)
java.lang.Thread.run(Thread.java:619)

Below, I post the content of the file:
context.xml
faces-config.xml
web.xml
persistemce.xml


This is the context.xml

<?xml version="1.0" encoding="UTF-8"?>
<Context path="/Test">
<Resource auth="Container"
driverClassName="com.mysql.jdbc.Driver"
maxActive="20"
maxIdle="10"
maxWait="-1"
name="Language"
password="xxx"
type="javax.sql.DataSource"
url="jdbc:mysql://localhost/sports"
username="alex"/>
</Context>

This is the faces-config.xml:

<?xml version='1.0' encoding='UTF-8'?>

<!-- =========== FULL CONFIGURATION FILE
================================== -->

<faces-config version="1.2"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
<managed-bean>
<managed-bean-name>SessionBean1</managed-bean-name>
<managed-bean-class>test.SessionBean1</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>Page1</managed-bean-name>
<managed-bean-class>test.Page1</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>ApplicationBean1</managed-bean-name>
<managed-bean-class>test.ApplicationBean1</managed-bean-class>
<managed-bean-scope>application</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>RequestBean1</managed-bean-name>
<managed-bean-class>test.RequestBean1</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>language</managed-bean-name>
<managed-bean-class>test.LanguageController</managed-bean-
class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<converter>
<converter-for-class>test.Language</converter-for-class>
<converter-class>test.LanguageConverter</converter-class>
</converter>
<navigation-rule>
<navigation-case>
<from-outcome>language_create</from-outcome>
<to-view-id>/language/New.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<navigation-case>
<from-outcome>language_list</from-outcome>
<to-view-id>/language/List.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<navigation-case>
<from-outcome>language_edit</from-outcome>
<to-view-id>/language/Edit.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<navigation-case>
<from-outcome>language_detail</from-outcome>
<to-view-id>/language/Detail.jsp</to-view-id>
</navigation-case>
</navigation-rule>
</faces-config>


web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>
</context-param>
<context-param>
<param-name>com.sun.faces.validateXml</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>com.sun.faces.verifyObjects</param-name>
<param-value>false</param-value>
</context-param>
<filter>
<filter-name>UploadFilter</filter-name>
<filter-class>com.sun.webui.jsf.util.UploadFilter</filter-
class>
<init-param>
<description>The maximum allowed upload size in bytes. If
this is set to a negative value, there is no maximum. The default
value is 1000000.</description>
<param-name>maxSize</param-name>
<param-value>1000000</param-value>
</init-param>
<init-param>
<description>The size (in bytes) of an uploaded file
which, if it is exceeded, will cause the file to be written directly
to disk instead of stored in memory. Files smaller than or equal to
this size will be stored in memory. The default value is 4096.</
description>
<param-name>sizeThreshold</param-name>
<param-value>4096</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>UploadFilter</filter-name>
<servlet-name>Faces Servlet</servlet-name>
</filter-mapping>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<init-param>
<param-name>javax.faces.LIFECYCLE_ID</param-name>
<param-value>com.sun.faces.lifecycle.PARTIAL</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>ExceptionHandlerServlet</servlet-name>
<servlet-class>com.sun.errorhandler.ExceptionHandler</servlet-
class>
<init-param>
<param-name>errorHost</param-name>
<param-value>localhost</param-value>
</init-param>
<init-param>
<param-name>errorPort</param-name>
<param-value>24444</param-value>
</init-param>
</servlet>
<servlet>
<servlet-name>ThemeServlet</servlet-name>
<servlet-class>com.sun.webui.theme.ThemeServlet</servlet-
class>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>ExceptionHandlerServlet</servlet-name>
<url-pattern>/error/ExceptionHandler</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>ThemeServlet</servlet-name>
<url-pattern>/theme/*</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>faces/Page1.jsp</welcome-file>
</welcome-file-list>
<error-page>
<exception-type>javax.servlet.ServletException</exception-
type>
<location>/error/ExceptionHandler</location>
</error-page>
<error-page>
<exception-type>java.io.IOException</exception-type>
<location>/error/ExceptionHandler</location>
</error-page>
<error-page>
<exception-type>javax.faces.FacesException</exception-type>
<location>/error/ExceptionHandler</location>
</error-page>
<error-page>
<exception-
type>com.sun.rave.web.ui.appbase.ApplicationException</exception-type>
<location>/error/ExceptionHandler</location>
</error-page>
<jsp-config>
<jsp-property-group>
<url-pattern>*.jspf</url-pattern>
<is-xml>true</is-xml>
</jsp-property-group>
</jsp-config>
</web-app>


And, finally, here you are the persistence.xml

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/
persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
<persistence-unit name="TestPU" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>Language</jta-data-source>
<properties/>
</persistence-unit>
</persistence>
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top