1.在下载使用javax.mail的jar包时候,注意:
有的jar没有包含sun的实现,只包含了api,这类jar名称通常为javax.mail-api-x.x.x.jar,在使用smtp协议发邮件过程中会报错:
- java.lang.ClassNotFoundException: com.sun.mail.util.MailLogger
另一种jar是包含了sun的实现的,名称通常为javax.mail-x.x.x.jar,使用smtp协议发邮件正常!
2.
java.lang.ClassNotFoundException: org.apache.commons.collections.map.ListOrderedMap解决方法
后来查了一下发现是包有错,使用json常用到的包有以下六个。
- commons-logging-1.0.4.jar
- commons-lang-2.3.jar
- commons-collections-3.2.jar
- commons-beanutils-1.7.0.jar
- json-lib-2.2.1-jdk15.jar
- ezmorph-1.0.4.jar
另外如果commons-collections-3.2.jar没有或版本不对的话会出现
3.Invocation of init method failed; nested exception is java.lang.NoSuchMethodError:问题解决
Spring 和 Hibernate 共用的一些 jar 文件发生了版本冲突, 删除 WEB-INF/lib/asm-2.2.3.jar 然后重启 Tomcat.
asm-2.2.3.jar
asm.jar
asm-attrs.jar
asm-commons-2.2.3.jar
asm-util-2.2.3.jar
4.
javax.transaction.TransactionManager
更新eclipse后出现
Java.lang.ClassNotFoundException: javax.transaction.TransactionManager
网上差了下是因为缺少jta.jar,但是这个包我也有,应该这样,删除jta.jar后再删除该jta,然后在tomcat中删除该项目然后在添加该项目。
5.
【java.lang.UnsupportedClassVersionError】版本不一致出错
Server的SDK用Java SDK1.8 即可。
6.
java.lang.ClassNotFoundException: org.jdom.Content
少了jdom.jar包。
7.java.lang.NoClassDefFoundError: javax/xml/rpc/encoding/Deserializer
加入jaxrpc.jar包试试
8.Caused by: java.lang.ClassNotFoundException:javax.wsdl.xml.WSDLLocator
wsdl4j.jar
9.Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.cdc.openid.service.CrowdClientService org.trustel.system.service.DefaultAuthenticationService.crowdClientService; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [com.cdc.openid.service.CrowdClientService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
datasource配置加入:
<bean id="ldapContextSource"
class="org.springframework.ldap.transaction.compensating.manager.TransactionAwareContextSourceProxy">
<constructor-arg ref="ldapContextSourceTarget" />
</bean>
<bean id="ldapTemplate" class="org.springframework.ldap.core.LdapTemplate">
<constructor-arg ref="ldapContextSource" />
</bean>
<bean id="crowdLdapService" class="com.cdc.openid.service.CrowdLdapService">
</bean>
<bean id="crowdClientService" class="com.cdc.openid.service.CrowdClientService">
</bean>
即可。