Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR A "net.logstash.log4j.JSONEventLayoutV1" object is not assignable to a "org.apache.log4j.Layout" variable #25

Closed
Zordrak opened this issue Oct 17, 2013 · 3 comments

Comments

@Zordrak
Copy link

Zordrak commented Oct 17, 2013

This may be my fault, as I'm trying to navigate blind - but I'm using Spredzy's master, which I'm hoping will get pulled into logstash but getting a rather bizarre result.

My logs are happily coming out in JSON format as expected, but I'm also getting this in my Catalina.out:

log4j:ERROR A "net.logstash.log4j.JSONEventLayoutV1" object is not assignable to a "org.apache.log4j.Layout" variable.
log4j:ERROR The class "org.apache.log4j.Layout" was loaded by
log4j:ERROR [WebappClassLoader
delegate: false
repositories:
/WEB-INF/classes/
----------> Parent Classloader:
org.apache.catalina.loader.StandardClassLoader@66650e56
] whereas object of type
log4j:ERROR "net.logstash.log4j.JSONEventLayoutV1" was loaded by [org.apache.catalina.loader.StandardClassLoader@66650e56].
log4j:ERROR No layout set for the appender named [CATALINA].

My config/versions is as per http://blog.tpa.me.uk/2013/10/17/logstash-tomcat6-log4j-on-centos-6/

Really unsure if this is me or the code..

@Spredzy
Copy link

Spredzy commented Oct 17, 2013

@Zordrak Could you pull again from my master and try it again.

The branch I am making the PR against was renaming_classes, I haven't noticed that master was unfortuantely in an unstable state. It has been fixed and I merged renaming_classes to my master. You should be good to go, let me know if that's not the case.

@Zordrak
Copy link
Author

Zordrak commented Oct 18, 2013

Thanks Spredzy. I will rebuild the master (have put it into my Jenkins) - though I must report this was my fault not yours - very sorry about that. The message is an issue regarding log4j being loaded by both the StandardClassLoader and the WebappClassLoader causing a library collision. I'm having to work around it by removing log4j from the webapps which the dev guys aren't too happy about, but nonetheless I'm closer to a solution :-)

@Zordrak Zordrak closed this as completed Oct 18, 2013
@veetow
Copy link

veetow commented Dec 12, 2014

I think this is an actual issue. I can't get the logger to function unless all log4j jar files are removed from the class path entirely. Only the jsonevent layout jar must exist on the class path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants