[jboss-user] PropertyNotFoundException

Israel Fdez. Cabrera iferca at gmail.com
Wed Jan 9 15:18:01 EST 2008


Hi I'm new to JBoss and even to Java, so please, be patients ;) I was 
reading the list archives and I found many similar questions but I could 
not find one that helps.
I'm trying to develop a "helloWord" app to JBoss 4.2.2GA+Seam2.0.1CR1, 
the code I wrote is this:

import javax.ejb.Local;

--------------The interface----------------------
@Local
public interface IHelloWorld {
    public String sayHello();
}

---------------The action---------------------
import org.jboss.seam.annotations.Name;

@Name("helloWorld")
public class HelloWorldAction implements IHelloWorld {
    public String sayHello() {
        return "Hello World!";
    }
}
------------The page------------------------
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                      
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

   <head>
      <title>Hi!</title>
   </head>
   <body>
      <f:view>
        <h:outputText value="#{helloWorld.sayHello}"/>
      </f:view>
   </body>

</html>

Deployment goes fine but when I try to load the sample page JBoss prints 
the following:


javax.el.PropertyNotFoundException: Target Unreachable, identifier 
'helloWorld' resolved to null
    at org.jboss.el.parser.AstValue.getTarget(AstValue.java:38)
    at org.jboss.el.parser.AstValue.invoke(AstValue.java:95)
    at 
org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
    at org.jboss.seam.core.Expressions$2.invoke(Expressions.java:174)
    at org.jboss.seam.navigation.Page.preRender(Page.java:264)
    at org.jboss.seam.navigation.Pages.preRender(Pages.java:309)
    at 
org.jboss.seam.jsf.SeamPhaseListener.preRenderPage(SeamPhaseListener.java:551)
    at 
org.jboss.seam.jsf.SeamPhaseListener.beforeRenderResponse(SeamPhaseListener.java:462)
    at 
org.jboss.seam.jsf.SeamPhaseListener.beforeServletPhase(SeamPhaseListener.java:146)
    at 
org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:116)
    at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:222)
    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
    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 
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
    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:230)
    at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
    at 
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
    at 
org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
    at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at 
org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
    at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
    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:446)
    at java.lang.Thread.run(Thread.java:595)

I'm not too confident about my deployment process because (as I said 
before) I'm new to this world so JBoss IDE for Eclipse is a dark piece 
of software to me, and I did not found a way to deploy the project so I 
wrote my own ant's build.xml which is this:

<project name="HelloWorld" default="deploy">
    <description>
            My First Seam Project
    </description>

    <property name="src" location="src" />
    <property name="build" location="build" />
    <property name="dist" location="dist" />
    <property name="seam-libs" 
location="/home/nebulha/Install/Java/JBoss/jboss-seam-2.0.1.CR1/lib" />
    <property name="deployment-path" 
location="/home/nebulha/Install/Java/JBoss/jboss-4.2.2.GA/server/default/deploy" 
/>
   
    <target name="compile" depends="init" description="Compile the source">
        <javac srcdir="${src}" destdir="${build}">
            <classpath>
                <pathelement path="${classpath}"/>
                <fileset dir="${seam-libs}">
                  <include name="*.jar"/>
                </fileset>
            </classpath>
        </javac>
    </target>
   
    <target name="clean">
        <delete dir="${dist}"/>
        <delete dir="${build}"/>
    </target>

    <target name="init" depends="clean">   
        <tstamp/>
        <mkdir dir="${dist}"/>
        <mkdir dir="${build}"/>
        <mkdir dir="${build}/view"/>
        <mkdir dir="${build}/view/WEB-INF"/>
    </target>

    <target name="deploy" 
depends="create_jar_dist,create_war_dist,create_ear_dist" 
description="Deploy to a JBoss local server">
        <copy todir="${deployment-path}" 
file="${dist}/bananotree-helloworld.ear"/>
    </target>

    <target name="create_jar_dist" depends="compile" 
description="generate the jar file to the distribution">
        <jar jarfile="${dist}/bananotree-helloworld.jar" 
basedir="${build}"/>
    </target>

    <target name="create_war_dist" depends="compile,prepare_war_dist" 
description="generate the war file to the distribution">
        <jar jarfile="${dist}/bananotree-helloworld.war" 
basedir="${build}/view"/>
    </target>

    <target name="create_ear_dist" depends="compile,prepare_ear_dist" 
description="generate the ear file to the distribution">
        <jar jarfile="${dist}/bananotree-helloworld.ear" 
basedir="${build}/ear"/>
    </target>
   
    <target name="prepare_ear_dist" depends="init">
        <copy todir="${build}/ear" verbose="true">
            <fileset dir="${dist}">
                <include name="bananotree-helloworld.jar" />
                <include name="bananotree-helloworld.war" />
            </fileset>
            <fileset dir="${seam-libs}">
                <include name="*" />
                <!-- <include name="jboss-seam.jar" />
                <include name="jsf-facelets.jar"/>
                <include name="jboss-el.jar"/>-->
            </fileset>
        </copy>
         <copy todir="${build}/ear/META-INF" verbose="true">
            <fileset dir="resources/META-INF">
                <include name="*" />
            </fileset>
        </copy>
    </target>
   
    <target name="prepare_war_dist" depends="init">
        <copy todir="${build}/view/WEB-INF" verbose="true">
            <fileset dir="resources/WEB-INF">
                <include name="*" />
            </fileset>
        </copy>
        <copy todir="${build}/view/" verbose="true">
            <fileset dir="${src}/view/">
                <include name="helloWorld.xhtml"/>
            </fileset>
        </copy>
    </target>


</project>


-- 
____________________
Israel Fdez. Cabrera
iferca at gmail.com
Linux registered user No.: 270292 [http://counter.li.org]

. 0 .
. . 0
0 0 0





More information about the jboss-user mailing list