使用maven2时遇到问题
struts2报错:
Failed startup of context org.mortbay.jetty.webapp.WebAppContext@1aaa14a{/xun,src/main/webapp}
Unable to load configuration. - bean - jar:file:/F:/xun/src/main/webapp/WEB-INF/lib/struts2-core-2.1.8.jar!/struts-default.xml:29:72
Caused by: Bean type class com.opensymphony.xwork2.ObjectFactory with the name xwork has already been loaded by bean - jar:file:/F:/Repository/org/apache/struts/struts2-core/2.1.8/struts2-core-2.1.8.jar!/struts-default.xml:29:72 - bean - jar:file:/F:/xun/src/main/webapp/WEB-INF/lib/struts2-core-2.1.8.jar!/struts-default.xml:29:72
slf4j警告:
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/F:/Repository/org/slf4j/slf4j-log4j12/1.5.11/slf4j-log4j12-1.5.11.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/F:/xun/src/main/webapp/WEB-INF/lib/slf4j-log4j12-1.5.11.jar!/org/slf4j/impl/StaticLoggerBinder.class]
看log好像是maven把这两个配置文件载入了两次,弄了好久也不知道怎么解决。。。
我还是觉得你这个目录下的文件是多出来的,
F:/xun/src/main/webapp/WEB-INF/lib
一般的MVN项目在src下的LIB都是空的,
运行工程应该是通过POM找对应的JAR包
mvn编译时,生成一个F:/xun/TARGET/.....
下面的lib才真正从仓库里拷过来,然后生成想要的WAR包,WEBAPP工程等。
要不你试试删除F:/xun/src/main/webapp/WEB-INF/lib的所有文件,或移到另一个地方去 试试
Bean type class com.opensymphony.xwork2.ObjectFactory with the name xwork has already been loaded by bean
对象工厂已经被加载!
你执行mvn时,加参数,-X或--debug,看打出的详细DEBUG信息,
看看是什么时个即加载了该路径下的CLASSPATH,/F:/Repository/org/apache
又什么时候加载了该路径下的CLASSPATH:/F:/xun/src/main/webapp/
导至XML重复载入
DOS命令行吗?
直接
mvn -X >d:\debugfiles.txt
就可以打印到D盘的 debugfiles.txt文件里面了
你都编译成功了。。。
[code="java"][DEBUG] -- end configuration --
[INFO] [surefire:test {execution: integration-tests}]
[INFO] Tests are skipped.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 53 seconds
[INFO] Finished at: Mon Mar 22 10:24:52 CST 2010
[INFO] Final Memory: 40M/63M[/code]
要看你启动的详细日志
你是怎么启动工程的,也是用MVN启动工程的吗?
你这个目录下的文件是做什么用的?
/F:/Repository
要不先把这个目录改一下名看会报什么错误
或者把这个文件删除试试
F:/Repository/org/apache/struts/struts2-core/2.1.8/struts2-core-2.1.8.jar
你是不是在哪把CLASSPATH设置进去 了
你是怎么加SSH的?通过ECLIPSE加的?
如果是的话,那应该把工程下的F:/xun/src/main/webapp/WEB-INF/lib/struts2-core-2.1.8.jar这些ECLIPSE自动添加进的JAR包去 掉,而把这些包的引用指向Repository仓库里的对应JAR包。。。。