- This topic has 4 replies, 5 voices, and was last updated 18 years, 2 months ago by sabagamma.
-
AuthorPosts
-
Paul BakerMemberI just upgraded to JBOSS 4-0-2. Now when I start JBOSS I get the following error:
21:33:04,734 INFO [TomcatDeployer] deploy, ctxPath=/eLoadSheet-war, warUrl=file:/C:/JBoss/jboss-4.0.2/server/all/deploy/eLoadSheet-war.war/ 21:33:05,765 INFO [STDOUT] log4j:ERROR A "org.jboss.logging.util.OnlyOnceErrorHandler" object is not assignable to a "org.apache.log4j.spi.ErrorHandler" variable. 21:33:05,765 INFO [STDOUT] log4j:ERROR The class "org.apache.log4j.spi.ErrorHandler" was loaded by 21:33:05,765 INFO [STDOUT] log4j:ERROR [WebappClassLoader delegate: false repositories: /WEB-INF/classes/ ----------> Parent Classloader: java.net.FactoryURLClassLoader@fd9967 ] whereas object of type 21:33:05,765 INFO [STDOUT] log4j:ERROR "org.jboss.logging.util.OnlyOnceErrorHandler" was loaded by [org.jboss.system.server.NoAnnotationURLClassLoader@c68c3]. 21:33:05,875 INFO [STDOUT] log4j:ERROR Could not create an Appender. Reported error follows. 21:33:05,875 INFO [STDOUT] java.lang.ClassCastException: org.jboss.logging.appender.DailyRollingFileAppender 21:33:05,875 INFO [STDOUT] at org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:165)
This error is caused by two copies of Log4J in memory. I have Log4J on my class path and when I deploy the web app it includes Log4J.jar in WEB-INF/lib.
Question, How can I configure the depolyer to NOT include log4j in the lib directory but DO INCLUDE the other jars on the build path in the lib directory?
I have tried every combination of the deployment options and the best I have come up with is an ALL or NONE scenario. HELP!
Thanks in advance… Paul
Scott AndersonParticipantPaul,
I have Log4J on my class path and when I deploy the web app it includes Log4J.jar in WEB-INF/lib.
Adding a jar to WEB-INF/lib automatically adds it to the project classpath, so that situation is normal. Unless you mean the *server* has log4j.jar on *its* classpath and that’s interfering with your webapp. If that’s the case, there should be a way to configure JBoss to keep its “jars to itself” and not make them visible to your application.
If you *really* want to just not deploy that one library in your webapp, you should be able to remove the lib from WEB-INF/lib, but then add a reference to the lib on the classpath and point it to another location in the workspace. Then, you can configure the project preferences to ignore jars on the classpath that aren’t in WEB-INF/lib by deselecting the deployment option “Jars on web project build path”. Full details are in the Advanced section of the Working with Web Projects quickstart here:
http://myeclipseide.com/enterpriseworkbench/help/index.jsp?topic=/com.genuitec.myeclipse.doc/html/quickstarts/webprojects/index.html
maximuszenMemberScott,
I’ve read your message and read your link. I’ve been using these tools for a couple years now but I still find your solution cryptic. Could you clarify?
John
FontoMemberIf you *really* want to just not deploy that one library in your webapp, you should be able to remove the lib from WEB-INF/lib, but then add a reference to the lib on the classpath and point it to another location in the workspace. Then, you can configure the project preferences to ignore jars on the classpath that aren’t in WEB-INF/lib by deselecting the deployment option “Jars on web project build path”.
I use the maven plugin to handle the classpath location in my web project.
I add log4j.jar to the maven-classpath. When I deploy the project to jboss 4.0.4 I get a similar error like pbaker01 wrote.
Now I’m searching for a solution, that only log4j wont be deployed to WEB-INF/lib. With the maven plugin I can’t create a separate classpath location in my project.Many thanks for help
sabagammaMemberDo not put your problem jar in web-inf/lib, rather point to it as an external jar (eg a jar in your JBoss installation).
The next step is to change the way MyEclipse builds a web project.
Right click on the project:
–> Select Properties
–> MyEclipse
–> Web
Click on the “Deployment” tab. Under “Library Deployment Policies” uncheck all tickboxes.Perform a full redeploy of the webapp and the problem should be gone. This worked for MyEclipse 5.0.
-Karim
-
AuthorPosts