Forums de discussion

Log4j error

Jeff Williams, modifié il y a 15 années.

Log4j error

Regular Member Publications: 107 Date d'inscription: 15/07/08 Publications récentes
Anyone seeing this in their log:

log4j:ERROR A "org.apache.log4j.ConsoleAppender" object is not assignable to a "org.apache.log4j.Appender" variable.
log4j:ERROR The class "org.apache.log4j.Appender" was loaded by 
log4j:ERROR [WebappClassLoader
  delegate: false
  repositories:
    /WEB-INF/classes/
----------> Parent Classloader:
org.apache.catalina.loader.StandardClassLoader@70cb6009
] whereas object of type 
log4j:ERROR "org.apache.log4j.ConsoleAppender" was loaded by [WebappClassLoader
  delegate: false
  repositories:
    /WEB-INF/classes/
----------> Parent Classloader:
org.apache.catalina.loader.StandardClassLoader@70cb6009
].


Not sure how to resolve this.
Evert Lammerts, modifié il y a 15 années.

RE: Log4j error

New Member Publications: 24 Date d'inscription: 10/10/08 Publications récentes
Hi Jeff,

Did you ever find where this came from? I'm seeing the same here when I deploy a custom plugin portlet, and I think it means two instances of the commons library is being loaded. Another classloader or context issue?

I think this error is the cause of my portlet not being deployed when I try to use the commons FileUpload. Has anybody seen that before?
henry heng Lim, modifié il y a 14 années.

RE: Log4j error

New Member Envoyer: 1 Date d'inscription: 16/06/09 Publications récentes
It very much looks like you have the log4j.jar loaded twice by two distinct class loaders.
I also face this problem last time and I solved this problem by remove one of the log4j.jar
thumbnail
delang j, modifié il y a 14 années.

RE: Log4j error

Expert Publications: 252 Date d'inscription: 14/07/08 Publications récentes
how do i remove log4j.jar while it required jar?

anyone got anyone idea how to solve this?
thumbnail
Manish Kumar Gupta, modifié il y a 14 années.

RE: Log4j error

Liferay Master Publications: 535 Date d'inscription: 16/05/08 Publications récentes
@delang
If you are using any IDE to create your application, you can specify log4j dependency for the compile time and not runtime. In that way, IDE will use the log4j for compilation your application but it will not bundle it. The portal should take care of providing runtime requirement of log4j.
thumbnail
delang j, modifié il y a 14 années.

RE: Log4j error

Expert Publications: 252 Date d'inscription: 14/07/08 Publications récentes
Manish Kumar Gupta:
@delang
If you are using any IDE to create your application, you can specify log4j dependency for the compile time and not runtime. In that way, IDE will use the log4j for compilation your application but it will not bundle it. The portal should take care of providing runtime requirement of log4j.


thanks manish for you reply,
currently im using eclipse for developing application. could you guide me how to specify log4j dependency for the compile time and not runtime?
thumbnail
delang j, modifié il y a 14 années.

RE: Log4j error

Expert Publications: 252 Date d'inscription: 14/07/08 Publications récentes
look like log4j.jar will automatically copy when deploy although i already remove it from 'required.portal.jars'.
thumbnail
Lisa Simpson, modifié il y a 14 années.

RE: Log4j error

Liferay Legend Publications: 2034 Date d'inscription: 05/03/09 Publications récentes
I don't know but maybe someone else does... *BUMP*