Spring – Maven | Jasper dependency-Collection of common programming errors
SECOND ANSWER
The first error indicates that an incompatible XML parser implementation is getting used. Most likely Weblogic provides it’s own implementation, and that is conflicting with an XML parser implementation being brought in by one of your dependencies. You need to figure out what is bringing in an XML parser, and then exclude that parser. Many IDEs (like Eclipse when using m2eclipse) can provide a visual graph of your POM to help figure the dependencies out. Alternatively, I think you can use ‘mvn dependency:tree’.
The second error seems to indicate that org.apache.log4j.LogManager
is not on the classpath. Assuming you are correctly building the war (or exploded war) and all of the maven produced dependency jars are in the /WEB-INF/lib folder, then my best guess would be that there are two log4j implementations in play, and they are conflicting. (Perhaps weblogic includes a log4j implementation and makes it available to webapps by default.) To test that, you might try setting the log4j dependency scope to “provided”. If you continue to have problems with log4j, you might consider using slf4j’s own logging implementation (logback) instead. i.e.
ch.qos.logback
logback-classic
runtime
1.0.0
FIRST ANSWER (Perhaps useful, but doesn’t address main issue.)
Try excluding commons-logging from jasper.
Also, I noticed you are using Jackson directly. Jasper also has a dependency on Jackson. In my case, I need to exclude Jackson from Jasper as well so I could reference a much newer version.
net.sf.jasperreports
jasperreports
4.5.0
commons-logging
commons-logging
jackson-mapper-lgpl
org.codehaus.jackson
jackson-core-lgpl
org.codehaus.jackson
I see that you did remove commons-logging from a number of other dependencies correctly. If you check that final transitive dependencies, you should not see a commons-logging.jar.
(Also, I tried improved formatting of your XML a little. It was very difficult to read previously. Still not that easy to read, but better.)