[jboss-jira] [JBoss JIRA] (AS7-4908) Error

Pablo Ochoa (JIRA) jira-events at lists.jboss.org
Tue May 29 10:55:18 EDT 2012


    [ https://issues.jboss.org/browse/AS7-4908?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12696853#comment-12696853 ] 

Pablo Ochoa commented on AS7-4908:
----------------------------------

Buenas 

    Te anexo el codigo que utilizo 

import java.util.*;
import javax.naming.*;
import org.apache.log4j.Hierarchy;
import org.apache.log4j.Level;
import org.apache.log4j.spi.*;

public class Log4jContextJNDISelector
    implements RepositorySelector
{
    public Log4jContextJNDISelector(){
        defaultHierarchy = new Hierarchy(new RootLogger(Level.DEBUG));
    }
    public LoggerRepository getLoggerRepository()
    {
        String loggingContextName = null;
        try
        {
            Context ctx = new InitialContext();
            loggingContextName = (String)ctx.lookup("java:comp/env/log4j/logging-context");
        }
        catch(NamingException ne) { }
        if(loggingContextName == null)
            return defaultHierarchy;
        Hierarchy hierarchy = (Hierarchy)hierMap.get(loggingContextName);
        if(hierarchy == null)
        {
            hierarchy = new Hierarchy(new RootLogger(Level.DEBUG));
            hierMap.put(loggingContextName, hierarchy);
        }
        return hierarchy;
    }

Archivo web.xml esta configuración


        <context-param>
		<param-name>log4j-selector</param-name>
		<param-value>ve.com.prueba.gdis.cia.config.logging.Log4jContextJNDISelector</param-value>
		<description> Selector de repositorios basado en JNDI desde donde se
			configurar el repositorio de logs para esta aplicación
		</description>
	</context-param>

Atento a cualquier colaboración que me puedas brindar.

atte
Pablo Ochoa


                
> Error
> -----
>
>                 Key: AS7-4908
>                 URL: https://issues.jboss.org/browse/AS7-4908
>             Project: Application Server 7
>          Issue Type: Feature Request
>          Components: Class Loading
>    Affects Versions: 7.1.1.Final
>            Reporter: Pablo Ochoa
>            Assignee: David Lloyd
>             Fix For: 7.1.1.Final
>
>
> Buenos Días,
>     Tengo problema con la version 7.1.1 de Jboss por defecto viene creado un Selector y yo intento crea uno nuevo para el manejo de mi classes me arroja el siguiente error
> Preferred repository selector not installed because one has already exists. No problem, using existing selector...
> Estado investigando de verdad no conseguido algo para poder solventar este problema el la ultima version de Jboss 6 no ocurre este mismo problema agradezco toda la colaboración que me puedan brindar 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       



More information about the jboss-jira mailing list