、
1、svn导入了一个maven项目,结果会出现获取不到远程仓库的依赖的问题;
Failure to transfer com.thoughtworks.xstream:xstream:jar:1.4.3 from http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error:Could not transfer artifact com.thoughtworks.xstream:xstream:jar:1.4.3 from/to central (http://repo.maven.apache.org/maven2): No response received after 60000 pom.xml /testweb line 1 Maven Configuration Problem
解决:
setting文件中加入了ali的私服地址,然后通过maven clean、maven install、update project等,将项目的错误排掉,依赖如果还是报错,将本地仓库对应的文件夹删掉重新获取一下;
有的依赖,比如今天的Oraclejar包和那个ID什么什么xxclent那个,maven获取不到,需要手动去下载放进去;
例如这个错:Missing artifact com.oracle.ojdbc6:ojdbc6:jar:11.2.0.3
在获取依赖时,忽然中断,也可以这么搞,删除掉最后一次更新
Linux:find ~/.m2 -name "*.lastUpdated" -exec grep -q "Could not transfer" {} \; -print -exec rm {} \;
windows:
①cd %userprofile%\.m2\repository
②for /r %i in (*.lastUpdated) do del %i
③然后到工程中选择 Maven->"Update Project ...
2、cannot be resolved to a type
原来这个也可能是导包的问题;
①weblogic和tomcat差异造成的...weblogic能自动处理其中的list和map,而tomcat不可以;引入相应的java包就好了,我的是引入了java.util.*,这个我没试;
3、WebService,也有可能缺少WebService的关键包
<!-- https://mvnrepository.com/artifact/org.apache.axis/axis-jaxrpc -->
<dependency>
<groupId>org.apache.axis</groupId>
<artifactId>axis-jaxrpc</artifactId>
<version>1.4</version>
</dependency>
4、这个也是少包;
<dependency>
<groupId>org.apache.axis</groupId>
<artifactId>axis</artifactId>
<version>1.4</version>
</dependency>
5、javax.xml.bind.JAXBException: null
javax.xml.bind.JAXBException和javax.xml.bind.annotation.XmlType问题
那一般是因为少了对应的javaxb类库导致,maven引入以下类包即可
<!-- java.lang.ClassNotFoundException: javax.xml.bind.JAXBException/javax.xml.bind.annotation.XmlType问题解决 -->
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>1.1.1</version>
</dependency>
6、