Erreur "Target Unreachable, identifier 'helloWorld' resolved to null"
Bonjour,
J'ai une erreur toute conne dans mon appli (sous tomcat 6) mais je suis tellement dans les nuages que je ne trouve pas seul. Quelqu'un peut-il m'aider ?
En gros, je travaille sur un POC de Seam 3. Je build mon projet avec Maven 3.
Mon projet est composé de 2 modules : seampoc-web et seampoc-domain.
Le pom de seampoc-web :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.icauda</groupId>
<artifactId>seampoc</artifactId>
<version>0.1</version>
<relativePath>../pom.xml</relativePath>
</parent>
<groupId>com.icauda</groupId>
<artifactId>seampoc-web</artifactId>
<packaging>war</packaging>
<name>WEB SEAM POC</name>
<description>Web Seam POC</description>
<url>http://www.icauda.com</url>
<dependencies>
<dependency>
<groupId>com.icauda</groupId>
<artifactId>seampoc-domain</artifactId>
<version>${poc.version}</version>
</dependency>
... |
Dans le module seampoc-domain, j'ai la classe HelloWorld (ouais je bug pas fort) :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
package com.icauda.seampoc.domain;
@Model
public class HelloWorld {
private final String text = "Hello, World!";
private String letters;
private String numbers;
private String email;
public HelloWorld() {
}
... |
J'appelle HelloWorld depuis un xhtml qui est un simple copié collé de celui généré par l'archetype.
Mais j'obtiens l'erreur suivante :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
1 août 2011 09:34:40 com.sun.faces.lifecycle.ProcessValidationsPhase execute
ATTENTION: /index.xhtml @20,76 value="#{helloWorld.letters}": Target Unreachable, identifier 'helloWorld' resolved to null
javax.el.PropertyNotFoundException: /index.xhtml @20,76 value="#{helloWorld.letters}": Target Unreachable, identifier 'helloWorld' resolved to null
at com.sun.faces.facelets.el.TagValueExpression.getType(TagValueExpression.java:97)
at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getConvertedValue(HtmlBasicInputRenderer.java:91)
at javax.faces.component.UIInput.getConvertedValue(UIInput.java:1023)
at javax.faces.component.UIInput.validate(UIInput.java:953)
at javax.faces.component.UIInput.executeValidate(UIInput.java:1204)
at javax.faces.component.UIInput.processValidators(UIInput.java:693)
at javax.faces.component.UIForm.processValidators(UIForm.java:240)
at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1081)
at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1081)
at javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:1159)
at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:72)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:97)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:114)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:308)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
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:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
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:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:662) |
Par contre, quand je met HelloWorld dans le module seampoc-web (dans le package com.icauda.seampoc.domain), là ça marche...
J'ai dû oublier un truc vraiment tout con. Donc si quelqu'un a une idée...
Évidement c'est seampoc-web qui contient le web.xml :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
|
<?xml version="1.0" encoding="UTF-8"?>
<web-app 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_3_0.xsd"
version="3.0">
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
<context-param>
<param-name>org.apache.myfaces.annotation.SCAN_PACKAGES</param-name>
<param-value>com.icauda.seampoc.web</param-value>
</context-param>
<display-name>WEB SEAM POC</display-name>
<!-- Activate the JSF 2.0 servlet -->
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- Tell the context which URLs to process with JSF -->
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<!-- This section is optional. We are allowing index.jsf to handle the root
URL (i.e., /). -->
<welcome-file-list>
<!-- Add additional files here, if desired, for example: <welcome-file>index.html</welcome-file> -->
<welcome-file>index.jsf</welcome-file>
</welcome-file-list>
<!-- Weld Jetty/Tomcat specific configuration parameters -->
<!-- *** The <listener> and <resource-env-ref> elements can be deleted when
running in a Java EE 6 container *** -->
<listener>
<listener-class>org.jboss.weld.environment.servlet.Listener</listener-class>
</listener>
<!-- JAX-RS 1.1 configuration through Jersey -->
<servlet>
<servlet-name>Jersey Web Application</servlet-name>
<servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
<init-param>
<param-name>com.sun.jersey.config.property.packages</param-name>
<param-value>com.icauda.seampoc.web</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Jersey Web Application</servlet-name>
<url-pattern>/rest/*</url-pattern>
</servlet-mapping>
<!-- End Jersey JAX-RS configuration -->
<resource-env-ref>
<description>Object factory for the CDI Bean Manager</description>
<resource-env-ref-name>BeanManager</resource-env-ref-name>
<resource-env-ref-type>javax.enterprise.inject.spi.BeanManager</resource-env-ref-type>
</resource-env-ref>
<servlet>
<servlet-name>OneServlet</servlet-name>
<servlet-class>com.icauda.seampoc.web.OneServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>OneServlet</servlet-name>
<url-pattern>/OneServlet</url-pattern>
</servlet-mapping>
<!-- Use Seam Catch for these -->
<!-- <error-page> <exception-type>org.jboss.seam.security.NotLoggedInException</exception-type>
<location>/home.xhtml</location> </error-page> <error-page> <exception-type>org.jboss.seam.security.AuthorizationException</exception-type>
<location>/denied.xhtml</location> </error-page> <error-page> <error-code>500</error-code>
<location>/error.xhtml</location> </error-page> -->
</web-app> |
Th.