log4j:ERROR Attempted to append to closed appender named [A1]

953 views
Skip to first unread message

euler

unread,
Sep 26, 2015, 3:27:28 AM9/26/15
to DSpace Technical Support
Dear All,

When attempting to run "dspace -h" from the command line, I am receiving this error:

log4j:ERROR Attempted to append to closed appender named [A1].
log4j:ERROR Attempted to append to closed appender named [A1].
log4j:ERROR Attempted to append to closed appender named [A1].
Exception in thread "main" java.lang.NoSuchMethodError: org.slf4j.spi.LocationAw
areLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;[Ljava/lang
/Object;Ljava/lang/Throwable;)V
ionAwareLog.java:159)
        at org.springframework.context.support.AbstractApplicationContext.prepar
eRefresh(AbstractApplicationContext.java:411)
        at org.springframework.context.support.AbstractApplicationContext.refres
h(AbstractApplicationContext.java:349)
        at org.dspace.servicemanager.spring.SpringServiceManager.startup(SpringS
erviceManager.java:207)
        at org.dspace.servicemanager.DSpaceServiceManager.startup(DSpaceServiceM
anager.java:205)
        at org.dspace.servicemanager.DSpaceKernelImpl.start(DSpaceKernelImpl.jav
a:150)
        at org.dspace.app.launcher.ScriptLauncher.main(ScriptLauncher.java:83)

E:\DSpace\bin>

I just upgraded this repository from version 1.6 to 5.3. Build and ant update were successful. This is my problem now, since I cannot migrate/upgrade the database because of that error from the command line. I have never encountered this error before. This is running on Windows Server 2008 (64 bit). Please help how can I resolve this since this is a production server. I have the exact setup in the staging server and I did not encounter this error either. I'm not entirely sure if this is related to permissions error.

Thanks in advance and best regards,
euler

Andrea Schweer

unread,
Sep 27, 2015, 4:18:14 PM9/27/15
to euler, DSpace Technical Support
Hi euler,

On 26/09/15 19:27, euler wrote:
> Dear All,
>
> When attempting to run "dspace -h" from the command line, I am
> receiving this error:
>
> log4j:ERROR Attempted to append to closed appender named [A1].
> log4j:ERROR Attempted to append to closed appender named [A1].
> log4j:ERROR Attempted to append to closed appender named [A1].
> Exception in thread "main" java.lang.NoSuchMethodError:
> org.slf4j.spi.LocationAw
> areLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;[Ljava/lang
> /Object;Ljava/lang/Throwable;)V

Just to get the super obvious out of the way, you did run mvn clean
during the upgrade, yes? I think I've seen this happen when I forgot the
"clean" bit, which results in more than one slf4j version in
[dspace]/lib and the wrong one (an earlier version) is loaded instead of
the correct one. What do you get for this?
ls [dspace]/lib/slf4j*

I just ran this on a DSpace 5.3 instance and I get:
slf4j-api-1.6.1.jar
slf4j-log4j12-1.6.1.jar

cheers,
Andrea

--
Dr Andrea Schweer
IRR Technical Specialist, ITS Information Systems
The University of Waikato, Hamilton, New Zealand
+64-7-837 9120

euler

unread,
Sep 27, 2015, 9:09:02 PM9/27/15
to DSpace Technical Support, esn...@seafdec.org.ph
Hi Andrea,

Yes, I did run mvn clean clean -U package. I just checked this morning and running ls slf4j* in [dspace]/lib, I have this files:

$ ls slf4j*
slf4j-api-1.5.6.jar  slf4j-log4j12-1.5.6.jar
slf4j-api-1.6.1.jar  slf4j-log4j12-1.6.1.jar

Anyways, I was kind of desperate to fix this issue and couldn't wait after the weekend to wait for a response, so I just reinstall DSpace to a different directory. Thankfully I didn't encounter that issue. I really suspect it's a permission issue because I just inherited this repository and I am using a different user when the original DSpace was installed. Plus, I always encountered a permissions denied errors from the [dspace]/log directory.

Thanks for this, I now know where to look and what file to delete if ever I encounter that error again.

Best regards,
euler

Andrea Schweer

unread,
Sep 27, 2015, 9:14:34 PM9/27/15
to dspac...@googlegroups.com, Nemiz, Elvi
Hi euler,

glad to hear you got there in the end, and that my suspicion about the problem (though perhaps not the one about the cause of the problem) was correct - multiple versions of slf4j jars.

Just for the record, I think another scenario where I encountered this was custom dependencies (eg in [dspace-src]/dspace/modules/additions/pom.xml) pointing to an older version of dspace-api, which resulted in the inclusion of both versions. https://maven.apache.org/plugins/maven-dependency-plugin/examples/resolving-conflicts-using-the-dependency-tree.html shows how to get the dependencies for a particular group of artifacts, that technique might help troubleshoot this sort of issue.

cheers,
Andrea
--
You received this message because you are subscribed to the Google Groups "DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dspace-tech...@googlegroups.com.
To post to this group, send email to dspac...@googlegroups.com.
Visit this group at http://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages