List Info

Thread: javax.servlet.ServletException: Error calling action method of component with id




javax.servlet.ServletException: Error calling action method of component with id
country flaguser name
United States
2007-09-24 06:49:52
hi list, i`m newbee with jsf, it gives me this exception:

javax.servlet.ServletException: Error calling action method
of component
with id formulario:boton
	javax.faces.webapp.FacesServlet.service(FacesServlet.java:1
52)

org.netbeans.modules.web.monitor.server.MonitorFilter.doFilt
er(MonitorFilter.java:368)

causa raĆ­z

javax.faces.FacesException: Error calling action method of
component with id
formulario:boton

org.apache.myfaces.application.ActionListenerImpl.processAct
ion(ActionListenerImpl.java:74)

de.mindmatters.faces.application.DelegatingActionListener.pr
ocessAction(DelegatingActionListener.java:106)
	javax.faces.component.UICommand.broadcast(UICommand.java:10
6)

org.ajax4jsf.framework.ajax.AjaxViewRoot.processEvents(AjaxV
iewRoot.java:274)

org.ajax4jsf.framework.ajax.AjaxViewRoot.broadcastEvents(Aja
xViewRoot.java:250)

org.ajax4jsf.framework.ajax.AjaxViewRoot.processApplication(
AjaxViewRoot.java:405)

de.mindmatters.faces.lifecycle.InvokeApplicationPhase.execut
ePhase(InvokeApplicationPhase.java:43)
	de.mindmatters.faces.lifecycle.AbstractPhase.execute(Abstra
ctPhase.java:37)

de.mindmatters.faces.lifecycle.LifecycleImpl.executePhase(Li
fecycleImpl.java:166)

de.mindmatters.faces.lifecycle.LifecycleImpl.execute(Lifecyc
leImpl.java:211)
	javax.faces.webapp.FacesServlet.service(FacesServlet.java:1
37)

org.netbeans.modules.web.monitor.server.MonitorFilter.doFilt
er(MonitorFilter.java:368)


i`m using myfaces 1.1.4 with jdk 1.6, tomcat 5.5.17.

my web.xml is 

<?xml version="1.0"
encoding="UTF-8"?>
<web-app version="2.4" xmlns="http://java.sun
.com/xml/ns/j2ee"
xmlnssi=&q
uot;http:
//www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/x
ml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"&g
t;
    <context-param> 
       
<param-name>javax.faces.CONFIG_FILES</param-name>
; 
       
<param-value>/WEB-INF/faces-config.xml</param-value
> 
    </context-param>
    <context-param>
       
<param-name>contextConfigLocation</param-name>
	<param-value>/WEB-INF/applicationContext.xml</para
m-value>
    </context-param>
    <context-param>
       
<param-name>com.sun.faces.verifyObjects</param-name
>
        <param-value>true</param-value>
    </context-param>
    <context-param>
       
<param-name>com.sun.faces.validateXml</param-name&g
t;
        <param-value>true</param-value>
    </context-param>
    <context-param>
       
<param-name>javax.faces.STATE_SAVING_METHOD</param-
name>
        <param-value>client</param-value>
    </context-param>
    <session-config>
        <session-timeout>
            30
        </session-timeout>
    </session-config>
    <welcome-file-list>
	<welcome-file>
            index.jsp
        </welcome-file>
    </welcome-file-list>
    <!-- listener de spring-->
    <listener>  
       
<listener-class>org.springframework.web.context.reques
t.RequestContextListener</listener-class>  
    </listener>
    <listener>

<listener-class>org.springframework.web.context.Contex
tLoaderListener</listener-class>
    </listener>
    <servlet>
        <servlet-name>Faces
Servlet</servlet-name>
       
<servlet-class>javax.faces.webapp.FacesServlet</ser
vlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet> 
        <servlet-name>TilesServet</servlet-name>

           
<servlet-class>org.apache.struts.tiles.TilesServlet<
;/servlet-class> 
            <init-param> 
               
<param-name>definitions-config</param-name> 
               
<param-value>/WEB-INF/tiles-defs.xml</param-value&g
t; 
            </init-param> 
            <load-on-startup>2</load-on-startup>

    </servlet> 
    <servlet-mapping>
        <servlet-name>Faces
Servlet</servlet-name>
        <url-pattern>*.faces</url-pattern>
    </servlet-mapping>
    
</web-app>

my jsf is 

<% taglib uri="http://java.sun.co
m/jsf/html" prefix="h" %>
<% taglib uri="http://java.sun.co
m/jsf/core" prefix="f" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0
Transitional//EN">

<html>
<f:view>
    <f:loadBundle basename="MessageResources"
var="msg"/>
<head>
        <title>
            ${msg.titulo}
        </title>
</head>

<body>
    <h:form id="formulario">
        <h:inputText id="campoQue"
value="#{yellProxy.campoQue}" />
        <h:inputText id="campoDonde"
value="#{yellProxy.campoDonde}" />
        <h:commandButton id="boton"
value="#{msg.boton}"
action="#{yellProxy.encuentra}"/>
    </h:form>
</f:view>
</body>
</html>

yellPoxy.java

/*
 * YellProxy.java
 *
 * Created on 13 de septiembre de 2007, 11:59
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package es.yell.frontlite.servlets;

import java.util.Collection;
import java.util.Locale;
import java.util.ResourceBundle;

import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
import javax.faces.event.ValueChangeEvent;
import javax.faces.model.SelectItem;
import org.springframework.beans.factory.InitializingBean;
import es.yell.frontlite.service.impl.*;
import org.springframework.util.Assert;
/**
 * Esta clase va a hacer las siguientes acciones:
 * Averiguar quien es el cliente, IE, firefox, PDA.
 * Averiguar si tiene el js activado.
 * en funcion si tiene el js activado o no, redirijo la
peticion a un
servicio u otro
 * la peticion que hace el cliente
 * author operador
 */
public class YellProxy{
    
    //campo que sirve para almacenar el resultado de la
operacion que se
hace en el cliente para ver si js esta activado.
    private String jsActivado;
    //campo que representa la identidad del navegador, IE,
firefox...
    private String quienSoy;
    //campos que van a almacenar los campos que y donde de
la pagina ppal.
    private String campoQue;
    //a este campo habra que destokenizar para rellenar los
siguientes
campos, direccion, localidad y cp
    private String campoDonde;
    //atributo que pasamos al servicio con los parametros
que nos da el
formulario de la jsp
    private BusquedaVO busquedaVO; 
    //el servicio que nos da acceso a la capa de
datos.INYECTADO
    private SrvBusquedaNoxtrumServiceImpl servicio;
    //atributo q contiene toda la informacion cuando
utilizamos AJAX
    private String xml;
    //atributo q contiene toda la informacion cuando no
utilizamos AJAX
    private Collection coleccion;
    /** Creates a new instance of YellProxy */
    public YellProxy() {
    }
    /**
     *Este metodo responde al evento del boton encuentra que
esta en la
pagina principal.
     *Basicamente va a destokenizar el campo campoDonde en
los subcampos
Direccion, localidad y CP.
     *Tambien y dependiendo de si el cliente tiene activado
o no el js,
ejecutaremos un servicio u otro.
    */
    public String encuentra(){
        //deja los atributos privados rellenos.
        String mensaje ;
        crearYRellenarBusquedaVO();
        //Javscript activado
        if (getJsActivado()!=null &&
getJsActivado().compareToIgnoreCase("S") == 0){
            //invocamos servicio adecuado
           
setXml(this.getServicio().obtenerResultadosJSactivado(this.g
etBusquedaVO()));
            mensaje="succesJS";
        }else{
            //javascript no activado
           
this.setColeccion(this.getServicio().obtenerResultadosJSdesa
ctivado(this.getBusquedaVO()));
            mensaje="succesNoJS";
        }
        
        return mensaje;
    }

    private void crearYRellenarBusquedaVO() {
        
        if (busquedaVO == null){
            busquedaVO = new BusquedaVO();
        }
        busquedaVO.setCampoQue(this.getCampoQue());
        busquedaVO.setCampoDonde(this.getCampoDonde());
    }

    public String getCampoQue() {
        return campoQue;
    }

    public void setCampoQue(String campoQue) {
        this.campoQue = campoQue;
    }

    public String getCampoDonde() {
        return campoDonde;
    }

    public void setCampoDonde(String campoDonde) {
        this.campoDonde = campoDonde;
    }

    public String getJsActivado() {
        return jsActivado;
    }

    public void setJsActivado(String jsActivado) {
        this.jsActivado = jsActivado;
    }

    public String getQuienSoy() {
        return quienSoy;
    }

    public void setQuienSoy(String quienSoy) {
        this.quienSoy = quienSoy;
    }

    public BusquedaVO getBusquedaVO() {
        return busquedaVO;
    }

    public void setBusquedaVO(BusquedaVO busquedaVO) {
        this.busquedaVO = busquedaVO;
    }

    public String getXml() {
        return xml;
    }

    public void setXml(String xml) {
        this.xml = xml;
    }

    public Collection getColeccion() {
        return coleccion;
    }

    public void setColeccion(Collection coleccion) {
        this.coleccion = coleccion;
    }
    
    public SrvBusquedaNoxtrumServiceImpl getServicio() {
        return servicio;
    }

    public void setServicio(SrvBusquedaNoxtrumServiceImpl
servicio) {
        this.servicio = servicio;
    }
    
}


thx in advance!

-- 
View this message in context: http://www.nabble.com/javax.servlet.Servlet
Exception%3A-Error-calling-action-method-of-component-with-i
d-tf4508679.html#a12858321
Sent from the MyFaces - Users mailing list archive at
Nabble.com.


Re: javax.servlet.ServletException: Error calling action method of component with id
country flaguser name
United States
2007-09-24 14:25:31
Make sure that your facesConfig.xml has the managed bean
yellProxy clearly
declared.
-- 
View this message in context: http://www.nabble.com/javax.servlet.Servlet
Exception%3A-Error-calling-action-method-of-component-with-i
d-tf4508679.html#a12866466
Sent from the MyFaces - Users mailing list archive at
Nabble.com.


Re: javax.servlet.ServletException: Error calling action method of component with id
user name
2007-09-25 02:32:28
thx for answering,

I need this configuration due to the fact that I glide to use together spring and JSF. With this configuration in the faces-config.xml, I am doing that spring';s container is the one that manages the bean YellProxy.

my applicationContext.xml

<?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN&quot;
 &nbsp;   &nbsp;    " http://www.springframework.org/dtd/spring-beans-2.0.dtd"&gt;
<beans>
&nbsp; &nbsp;
 &nbsp;  <bean id="ParserSAX&quot; class=&quot;es.yell.frontlite.parser.ParserPrincipalHandler" scope=&quot;singleton"/>
 &nbsp; 
 &nbsp;  <bean id="Controller&quot; class=&quot;es.yell.frontlite.servlets.Controller"; scope=&quot;singleton"/>
 &nbsp; 
 &nbsp;  <bean id="srvBusquedaNoxtrumService" class=&quot;es.yell.frontlite.service.impl.SrvBusquedaNoxtrumServiceImpl &quot; scope=&quot;singleton">
  ; &nbsp; &nbsp;  <property name=";parserSAX&quot;>&lt;ref bean=";ParserSAX&quot;/>&lt;/property>
 ; &nbsp; &nbsp; &nbsp; <property name=";controlador"><ref bean=";Controller"/></property>
&nbsp; &nbsp; </bean&gt;
 &nbsp;   ; &nbsp; &nbsp; &nbsp;
 &nbsp;  <bean id="yellProxy&quot; class=&quot;es.yell.frontlite.servlets.YellProxy" scope=&quot;singleton">
  ; &nbsp; &nbsp;  <property name=";servicio&quot;>
  ; &nbsp; &nbsp; &nbsp; &nbsp;  <ref bean=";srvBusquedaNoxtrumService"/>
   ; &nbsp; &nbsp; </property>
&nbsp; &nbsp; </bean&gt;
</beans>

regards!

2007/9/24, ScottBrank < scottbrankgmail.com"> scottbrankgmail.com>:

Make sure that your facesConfig.xml has the managed bean yellProxy clearly
declared.
--
View this message in context: http://www.nabble.com/javax.servlet.ServletException%3A-Error-calling-action-method-of-component-with-id-tf4508679.html#a12866466
Sent from the MyFaces - Users mailing list archive at Nabble.com.




--
Alonso Isidoro Roman.
[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )