Foros del Web » Programación para mayores de 30 ;) » Java »

problema con log4j

Estas en el tema de problema con log4j en el foro de Java en Foros del Web. hola a todos, espero me puedan ayudar, les cuento: tengo una aplicacion web con struts, en la cual quiero usar log4j para guardar los eventos ...
  #1 (permalink)  
Antiguo 13/06/2006, 17:35
 
Fecha de Ingreso: abril-2006
Mensajes: 36
Antigüedad: 18 años
Puntos: 0
problema con log4j

hola a todos, espero me puedan ayudar, les cuento:

tengo una aplicacion web con struts, en la cual quiero usar log4j para guardar los eventos que los usuarios realicen, entonces declare un logger en una accion , pero me tira el siguiente error


java.lang.NoClassDefFoundError: org/apache/log4j/Logger:

mi codigo es el siguiente:

public class EvaluarEntregaAction extends Action {

static Logger logger = Logger.getLogger(EvaluarEntregaAction.class);

public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {

ActionErrors errors = new ActionErrors();
ActionForward forward = new ActionForward(); // return value
FbEntrega fbEntrega = (FbEntrega) form;

HttpSession session = request.getSession();

/*===========================================*/

PropertyConfigurator.configure("log4j.properties") ;
logger.info("Entrando a la Accion");


/*===========================================*/
String v_rut;
String mensaje = null;
int v_polizas;
long v_campana;
int v_tipoDoc;
int v_despacho;
Collection solicitudPoliza = new ArrayList();

try {

// do something here
//System.out.println(fbEntrega.getCampanas());
v_rut = "11111111K";
v_polizas = fbEntrega.getCantidadPolizas();
v_campana = Integer.parseInt(fbEntrega.getCampanas());
v_tipoDoc = Integer.parseInt(fbEntrega.getTipoDocumentos());
v_despacho = Integer.parseInt(fbEntrega.getDespacho());


mensaje = iData.prueba.setRealizarSolicitarPolizas(v_polizas ,v_rut,v_campana,v_tipoDoc,v_despacho);

solicitudPoliza = iData.prueba.setSolicitudPolizasByVendedor("111111 11K");

session.setAttribute("solPoliza",solicitudPoliza);

fbEntrega.setCantidadPolizas(0);//a cero
request.setAttribute("mensaje",mensaje);


} catch (Exception e) {

// Report the error using the appropriate name and ID.
errors.add("name", new ActionError("id"));

}

// If a message is required, save the specified key(s)
// into the request for use by the <struts:errors> tag.

if (!errors.isEmpty()) {
saveErrors(request, errors);
}
// Write logic determining how the user should be forwarded.
forward = mapping.findForward("lanza");

// Finish with
return (forward);

}
}


y mi property es el siguiente se llama "log4j.properties":


log4j.rootCategory=ALL, Default
log4j.appender.Default=org.apache.log4j.FileAppend er
log4j.appender.Default.file=server.log
log4j.appender.Default.layout=org.apache.log4j.xml .XMLLayout
log4j.appender.Default.append=false


de antemano, gracias por la ayuda.....
  #2 (permalink)  
Antiguo 14/06/2006, 00:39
 
Fecha de Ingreso: octubre-2003
Mensajes: 3.578
Antigüedad: 20 años, 6 meses
Puntos: 51
¿Tienes las librerias del log4J en el classpath pero sólo UNA vez?
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 11:15.