使用maven构建项目,部署时出现奇怪问题

用maven创建了一个工程,还没来得及编码,刚部署到tomcat下就发现报异常,但是又不很完整,于是又把log4j.jar及commmons-logging.jar还有log4j.properties放入tomcat的lib目录下,
log4j内容:
log4j.rootLogger=info,Console,R 

log4j.appender.Console=org.apache.log4j.ConsoleAppender
log4j.appender.Console.layout=org.apache.log4j.PatternLayout
#log4j.appender.Console.layout.ConversionPattern=%d [%t] %-5p %c - %m%n
log4j.appender.Console.layout.ConversionPattern=%d{yy-MM-dd HH:mm:ss} %5p %c{1}:%L - %m%n 

log4j.appender.R=org.apache.log4j.DailyRollingFileAppender
log4j.appender.R.File=${catalina.home}/logs/tomcat.log 
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%d{yyyy.MM.dd HH:mm:ss} %5p %c{1}(%L):? %m%n 

log4j.logger.org.apache=info, R
log4j.logger.org.apache.catalina.core.ContainerBase.[Catalina].[localhost]=DEBUG, R 
log4j.logger.org.apache.catalina.core=info, R
log4j.logger.org.apache.catalina.session=info, R 


重启后终于看到详细异常信息:
org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected excep
tion parsing XML document from class path resource [applicationContext-mvc.xml];
 nested exception is java.lang.IllegalStateException: Unable to load schema mapp
ings from location [META-INF/spring.schemas]


经排查,是spring-jdbc-3.0.6.RELEASE.jar出现了问题,点击spring-schemas时出现了 :invalid LOC header,可能是maven下载过程中出现了不完全下载?(按理说也不应该啊,真是诡异)
于是把mvn_repository下spring-jdbc的包删除,重新build后maven重新下载jar,问题解决。

你可能感兴趣的:(java,log4j,jdbc)