cancel
Showing results for 
Search instead for 
Did you mean: 

[SOLVED] Module developpement & libs

pounard
Champ in-the-making
Champ in-the-making
Hi,

I'm currently developping a authentication component module for Alfresco, to use authentication from a proprietary framework, I have some question about Alfresco.

The framework I use need some libraries, including log4j, dom4j and others common libs. I need also to use proprietary libraries from my company. I did put the framework's libs in the tomcat/shared/libs dir, so my module can find it, the problem is:
Alfresco seems to use log4j to, but when I start it with my module, my module can't find log4j (I think this is a ClassLoader problem), so I dropped a copy of the log4j jar into the same dir, but I have many errors from log4j when Alfresco starting (not exceptions, just some errors):
log4j:ERROR A "org.apache.log4j.ConsoleAppender" object is not assignable to a "org.apache.log4j.Appender" var
iable.
log4j:ERROR The class "org.apache.log4j.Appender" was loaded by
log4j:ERROR [org.apache.catalina.loader.StandardClassLoader@12f9ee] 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@12f9ee
].
log4j:ERROR Could not instantiate appender named "Console".
log4j:ERROR A "org.apache.log4j.DailyRollingFileAppender" object is not assignable to a "org.apache.log4j.Appe
nder" variable.
log4j:ERROR The class "org.apache.log4j.Appender" was loaded by
log4j:ERROR [org.apache.catalina.loader.StandardClassLoader@12f9ee] whereas object of type
log4j:ERROR "org.apache.log4j.DailyRollingFileAppender" was loaded by [WebappClassLoader
  delegate: false
  repositories:
    /WEB-INF/classes/
———-> Parent Classloader:
org.apache.catalina.loader.StandardClassLoader@12f9ee
].
log4j:ERROR Could not instantiate appender named "File".
log4j:WARN No appenders could be found for logger (com.XXXXXX).
log4j:WARN Please initialize the log4j system properly.
XXX authentication module has been loaded
(I masked the company proprietary framework name)

I think tomcat/shared/libs is not the right place to put my libs, where should I drop them ?

PS: Ah, and another question, where Alfresco drop his output and exceptions, a log file ? where?
EDIT: I found alfresco.log Smiley Happy - But it seems that my errors with log4j disable all alfresco logging cause I dont have any more logs after I had these errors.
2 REPLIES 2

pounard
Champ in-the-making
Champ in-the-making
Ok, i found that when I drop my libs in webapps/alfresco/WEB-INF/libs it works great.

So my real question is, is there another way to deploy them in some 'clean way' with my AMP file instead of copying it by hand after the WAR has been deployed a first time ?

pounard
Champ in-the-making
Champ in-the-making
I found this and I have my answer: http://wiki.alfresco.com/wiki/Repository_Configuration#Issues

PS: I had to updgrade log4j in Alfresco dependancies because my framework uses some methods whose are not in the version packaged with Alfresco.