2 Replies Latest reply on Jul 3, 2007 10:44 AM by Krunoslav Samardzic

    Seam 2.0 beta problem

    Krunoslav Samardzic Newbie

      I started to migrate from seam 1.21 to 2.0 (jboss 4.2), I followed migration tutorial, and examples in seam 2.0.
      The problem is when I try to call some bean with ajax4jsf component or tomahawk component I get exception, but with h:commandButton or s:button
      things work.

      Thanks in advance for any help Kruno.

      Exception:

      11:08:44,536 ERROR [[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception
      java.lang.NullPointerException
       at org.jboss.seam.el.SeamExpressionFactory.createMethodExpression(SeamExpressionFactory.java:76)
       at org.jboss.seam.jsf.UnifiedELMethodBinding.getMethodExpression(UnifiedELMethodBinding.java:63)
       at org.jboss.seam.jsf.UnifiedELMethodBinding.invoke(UnifiedELMethodBinding.java:50)
       at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91)
       at javax.faces.component.UICommand.broadcast(UICommand.java:383)
       at org.ajax4jsf.framework.ajax.AjaxViewRoot.processEvents(AjaxViewRoot.java:180)
       at org.ajax4jsf.framework.ajax.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:158)
       at org.ajax4jsf.framework.ajax.AjaxViewRoot.processApplication(AjaxViewRoot.java:346)
       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)
      .......
      
      


      Here is jsp page:
      <%@ page contentType="text/html; charset=UTF-8" %>
      <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
      <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
      <%@ taglib uri="http://jboss.com/products/seam/taglib" prefix="s"%>
      <%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
      <%@ taglib uri="http://richfaces.ajax4jsf.org/rich" prefix="r"%>
      <%@ taglib uri="https://ajax4jsf.dev.java.net/ajax" prefix="a"%>
      
      <f:view>
      <h:form id="forma">
      <h:messages id="poruke"/><br>
      
      <h:commandButton action="#{obradaTest.mjenjajGranu}" value="SUN HTML" />
      
      <t:commandButton action="#{obradaTest.mjenjajGranu}" value="TOMAHAWK" />
      
      <a:commandButton action="#{obradaTest.mjenjajGranu}" value="=AJAX" />
      
      <s:button action="#{obradaTest.mjenjajGranu}" value="=SEAM" />
      
      
      </h:form>
      </f:view>
      


      web.xml:
      
      <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd"
       version="2.5">
      
      <!-- Apsolutna putanja do direktorija -->
       <context-param>
       <param-name>slike</param-name>
       <param-value>/home/orka/slikeKORISNICI/</param-value>
       </context-param>
      
       <!-- Seam -->
      
      
       <listener>
       <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
       </listener>
      
       <context-param>
       <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
       <param-value>.jsp</param-value>
       </context-param>
       <!-- MyFaces -->
      
      
       <!--
       <context-param>
       <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
       <param-value>client</param-value>
       </context-param>
       -->
       <servlet>
       <servlet-name>Faces Servlet</servlet-name>
       <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
       <load-on-startup>1</load-on-startup>
       </servlet>
      
       <!-- Propagate conversations across redirects -->
      
       <servlet-mapping>
       <servlet-name>Faces Servlet</servlet-name>
       <url-pattern>*.orka</url-pattern>
       </servlet-mapping>
      
      
      
       <filter>
       <filter-name>Seam Filter</filter-name>
       <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
       </filter>
      
      
      
       <filter-mapping>
       <filter-name>Seam Filter</filter-name>
       <url-pattern>/*</url-pattern>
       </filter-mapping>
      
       <servlet>
       <servlet-name>Slika</servlet-name>
       <servlet-class>orka.util.SlikaServlet</servlet-class>
       <load-on-startup>1</load-on-startup>
       </servlet>
       <servlet-mapping>
       <servlet-name>Slika</servlet-name>
       <url-pattern>/slika/*</url-pattern>
       </servlet-mapping>
      
      
      
       <context-param>
      
       <param-name>org.ajax4jsf.SKIN</param-name>
      
       <param-value>#{postavkeAplikacija.izgled}</param-value>
      
       </context-param>
      
      
      
       <filter>
       <filter-name>MyFacesExtensionsFilter</filter-name>
       <filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
       <init-param>
       <param-name>maxFileSize</param-name>
       <param-value>20m</param-value>
       </init-param>
      </filter>
      
      <!-- extension mapping for adding <script/>, <link/>, and other resource tags to JSF-pages -->
      <filter-mapping>
       <filter-name>MyFacesExtensionsFilter</filter-name>
       <!-- servlet-name must match the name of your javax.faces.webapp.FacesServlet entry -->
       <servlet-name>Faces Servlet</servlet-name>
      </filter-mapping>
      
      <!-- extension mapping for serving page-independent resources (javascript, stylesheets, images, etc.) -->
      <filter-mapping>
       <filter-name>MyFacesExtensionsFilter</filter-name>
       <url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
      </filter-mapping>
      
       <session-config>
       <!-- u minutama -->
       <session-timeout>30</session-timeout>
      </session-config>
      </web-app>
      
      


      faces-config.xml
      <faces-config 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"
       version="1.2">
      
      
      
       <application>
       <locale-config>
       <default-locale>hr</default-locale>
       <supported-locale>hr</supported-locale>
       <supported-locale>en</supported-locale>
       </locale-config>
      
       </application>
      
      
      </faces-config>
      
      


      packaging-build.xml
      <?xml version="1.0" encoding="UTF-8"?>
      <project name="Packaging Generator" default="_packaging_generation_">
       <target name="_packaging_generation_" depends="N65540,N65581,N65632,obrisi,kopiraj" />
       <property environment="env"/>
       <property name="putanjaDoLibova" value="${env.PUTANJADOLIBOVA}"/>
       <property name="putanjaKopiraj" value="${env.PUTANJAKOPIRAJ}/kadrovska.ear"/>
       <property name="putanjaDeploy" value="${env.PUTANJADEPLOY}/kadrovska.ear"/>
       <!-- Putanja do direktorija na serveru gdje se nalaze slike djelatnika
       IMPLEMENTIRATI
       -->
       <property name="slikeDjelatnici" value="/home/orka/slike/djelatnici"/>
      
      
      
       <target name="N65540" description="kadrovska.jar">
       <jar destfile="kadrovska.jar">
       <zipfileset dir="resources">
       <include name="seam.properties" />
       </zipfileset>
       <zipfileset dir="${putanjaDoLibova}/ext">
       <include name="jbpm-jpdl.jar" />
       </zipfileset>
       <zipfileset dir="resources/META-INF" prefix="META-INF">
       <include name="ejb-jar.xml" />
       </zipfileset>
       <zipfileset dir="resources/META-INF" prefix="META-INF">
       <include name="persistence.xml" />
       </zipfileset>
       <zipfileset dir="bin" />
       </jar>
       </target>
      
       <target name="N65581" description="kadrovska.war">
       <jar destfile="kadrovska.war">
       <zipfileset dir="${putanjaDoLibova}/seam" prefix="WEB-INF/lib">
       <include name="jboss-seam-ui.jar" />
       </zipfileset>
      
      
      
       <zipfileset dir="${putanjaDoLibova}/ext" prefix="WEB-INF/lib">
       <include name="tomahawk-1.1.6.jar" />
       <include name="ajax4jsf-1.1.1.jar" />
       <include name="richfaces-3.0.1.jar" />
       <include name="commons-fileupload.jar"/>
       <include name="commons-digester-1.6.jar"/>
       <include name="commons-beanutils-1.7.0.jar"/>
       <include name="commons-el-1.0.jar"/>
       <include name="commons-lang-2.1.jar"/>
      
       </zipfileset>
      
      
      
       <zipfileset dir="resources/WEB-INF" prefix="WEB-INF" />
       <zipfileset dir="view" />
       <zipfileset dir="resources/slike" prefix="slike" />
       <zipfileset dir="resources/css" prefix="css" />
       <zipfileset dir="resources/javascript" prefix="javascript" />
       </jar>
       </target>
      
       <target name="N65632" description="kadrovska.ear">
       <jar destfile="kadrovska.ear">
       <zipfileset dir="resources/META-INF" prefix="META-INF">
       <include name="application.xml" />
       </zipfileset>
       <zipfileset dir="resources/META-INF" prefix="META-INF">
       <include name="jboss-app.xml" />
       </zipfileset>
       <zipfileset dir="${putanjaDoLibova}/ext">
       <include name="jboss-el.jar" />
       </zipfileset>
       <zipfileset dir="${putanjaDoLibova}/seam">
       <include name="jboss-seam.jar" />
       </zipfileset>
       <zipfileset dir=".">
       <include name="kadrovska.jar" />
       </zipfileset>
       <zipfileset dir=".">
       <include name="kadrovska.war" />
       </zipfileset>
      
       <zipfileset dir="${putanjaDoLibova}/ext">
       <include name="jbpm-jpdl.jar" />
       </zipfileset>
      
       <zipfileset dir="resources/pageflows" prefix="pageflows"/>
       </jar>
       </target>
      
       <target name="obrisi" description="obrisi ear">
       <delete file="${putanjaEar}">
       </delete>
       </target>
      
       <target name="kopiraj" description="kopiraj ear">
       <copy file="${putanjaKopiraj}" tofile="${putanjaDeploy}" />
       </target>
      
      </project>