搭建Dubbo MyeclipseMaven331的过程遇到问题集锦.docx
《搭建Dubbo MyeclipseMaven331的过程遇到问题集锦.docx》由会员分享,可在线阅读,更多相关《搭建Dubbo MyeclipseMaven331的过程遇到问题集锦.docx(8页珍藏版)》请在冰点文库上搜索。
搭建DubboMyeclipseMaven331的过程遇到问题集锦
搭建Dubbo+Myeclipse2015+Maven3.3.1的过程遇到问题集锦
1.找不到dubbo2.8.4包的问题在编译Maven工程的过程中,出现如下问题:
DescriptionResourcePathLocationType
ArtifactDescriptorException:
Failedtoreadartifactdescriptorforcom.alibaba:
dubbo:
jar:
2.8.4:
UnresolvableModelException:
Failuretofindcom.alibaba:
dubbo-parent:
pom:
2.8.4inhttp:
//172.28.3.60:
8081/nexus/content/groups/publicwascachedinthelocalrepository,resolutionwillnotbereattempteduntiltheupdateintervalofthirdpartyhaselapsedorupdatesareforcedpom.xml/FileIOline1MavenDependencyProblem
本地Maven的配置如下:
settings.xml:
<settingsxmlns="http:
//maven.apache.org/POM/4.0.0"
xmlns:
xsi="http:
//www.w3.org/2001/XMLSchema-instance"
xsi:
schemaLocation="http:
//maven.apache.org/POM/4.0.0
http:
//maven.apache.org/xsd/settings-1.0.0.xsd">
<mirrors>
<mirror>
<id>CN</id>
<name>OSChinaCentral</name>
<url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
<localRepository>D:
\Java\m2\repository</localRepository>
</settings>
可见,本地的Maven库存放位置为:
D:
\Java\m2\repository,在这个目录下,有如下结构(正常情况下,异常情况下是没有这个结果的,而且dubbo2.8.4这个版本没有公开发布到maven中心库,需要自己进行编译,编译成功后,就可以得到如下的文件结构):
编译过程:
1.从github上将大猫download下来,下载地址:
下载下来后,解压,在解压后的路径中,执行:
mvninstall-Dmaven.test.skip=true
执行完毕后,就可以生成本地maven库中dubbo的目录结构,这样工程中所有使用dubbo2.8.4的地方,都可以正常的编译:
2.用Maven构建web工程,出现如下错误:
DescriptionResourcePathLocationType
Thesuperclass"javax.servlet.http.HttpServlet"wasnotfoundontheJavaBuildPathindex.jsp/webMavenWebapp/src/main/webappline1JSPProblem
这个错误是因为没有导入web工程的运行时环境导致的,解决办法如下:
然后将projectclean后,重新构建,错误自动消失。
3.修改项目的JDK版本,有时会出现MyEclipse打出的war包,部署到Tomcat服务器上不能够使用的情况,错误一般如下,对于这种情况,要认真检查项目使用JDK版本,以及服务器运行时的JDK版本,只要匹配就不会有问题。
Unsupportedmajor.minorversion52.0(unabletoloadclass:
Whatitmeansisthat,yourcodeiscompiledwithdifferentversionofjavatojavaversionwhichisrunningit.makesureyoucompileandruntitwiththesameversionifjava.4.MavenPOM中添加的Spring版本和Myeclipse提供的Spring版本中出现冲突,解决办法是将Myeclipse中自带的Spring4.1从Build中移除掉:
十一月12,20158:
16:
31下午org.apache.catalina.startup.VersionLoggerListenerlog
信息:
Serverversion:
ApacheTomcat/8.0.21
十一月12,20158:
16:
31下午org.apache.catalina.startup.VersionLoggerListenerlog
信息:
Serverbuilt:
Mar23201514:
11:
21UTC
十一月12,20158:
16:
31下午org.apache.catalina.startup.VersionLoggerListenerlog
信息:
Servernumber:
8.0.21.0
十一月12,20158:
16:
31下午org.apache.catalina.startup.VersionLoggerListenerlog
信息:
OSName:
Windows7
十一月12,20158:
16:
31下午org.apache.catalina.startup.VersionLoggerListenerlog
信息:
OSVersion:
6.1
十一月12,20158:
16:
31下午org.apache.catalina.startup.VersionLoggerListenerlog
信息:
Architecture:
amd64
十一月12,20158:
16:
31下午org.apache.catalina.startup.VersionLoggerListenerlog
信息:
JavaHome:
C:
\ProgramFiles\Java\jdk1.8.0_45\jre
十一月12,20158:
16:
31下午org.apache.catalina.startup.VersionLoggerListenerlog
信息:
JVMVersion:
1.8.0_45-b14
十一月12,20158:
16:
31下午org.apache.catalina.startup.VersionLoggerListenerlog
信息:
JVMVendor:
OracleCorporation
十一月12,20158:
16:
31下午org.apache.catalina.startup.VersionLoggerListenerlog
信息:
CATALINA_BASE:
D:
\tools\apache-tomcat-8.0.21
十一月12,20158:
16:
31下午org.apache.catalina.startup.VersionLoggerListenerlog
信息:
CATALINA_HOME:
D:
\tools\apache-tomcat-8.0.21
十一月12,20158:
16:
31下午org.apache.catalina.startup.VersionLoggerListenerlog
信息:
Commandlineargument:
-Dmaven.multiModuleProjectDirectory=M2_HOME
十一月12,20158:
16:
31下午org.apache.catalina.startup.VersionLoggerListenerlog
信息:
Commandlineargument:
-Dcatalina.base=D:
\tools\apache-tomcat-8.0.21
十一月12,20158:
16:
31下午org.apache.catalina.startup.VersionLoggerListenerlog
信息:
Commandlineargument:
-Dcatalina.home=D:
\tools\apache-tomcat-8.0.21
十一月12,20158:
16:
31下午org.apache.catalina.startup.VersionLoggerListenerlog
信息:
Commandlineargument:
-Dwtp.deploy=D:
\tools\apache-tomcat-8.0.21\webapps
十一月12,20158:
16:
31下午org.apache.catalina.startup.VersionLoggerListenerlog
信息:
Commandlineargument:
-Djava.endorsed.dirs=D:
\tools\apache-tomcat-8.0.21\endorsed
十一月12,20158:
16:
31下午org.apache.catalina.startup.VersionLoggerListenerlog
信息:
Commandlineargument:
-Djava.library.path=C:
\ProgramFiles\Java\jdk1.8.0_45\bin;D:
\tools\apache-tomcat-8.0.21\bin
十一月12,20158:
16:
31下午org.apache.catalina.startup.VersionLoggerListenerlog
信息:
Commandlineargument:
-Dfile.encoding=GBK
十一月12,20158:
16:
31下午org.apache.catalina.core.AprLifecycleListenerlifecycleEvent
信息:
LoadedAPRbasedApacheTomcatNativelibrary1.1.33usingAPRversion1.5.1.
十一月12,20158:
16:
31下午org.apache.catalina.core.AprLifecycleListenerlifecycleEvent
信息:
APRcapabilities:
IPv6[true],sendfile[true],acceptfilters[false],random[true].
十一月12,20158:
16:
31下午org.apache.catalina.core.AprLifecycleListenerinitializeSSL
信息:
OpenSSLsuccessfullyinitialized(OpenSSL1.0.1m19Mar2015)
十一月12,20158:
16:
33下午org.apache.coyote.AbstractProtocolinit
信息:
InitializingProtocolHandler["http-apr-8080"]
十一月12,20158:
16:
33下午org.apache.coyote.AbstractProtocolinit
信息:
InitializingProtocolHandler["ajp-apr-8009"]
十一月12,20158:
16:
33下午org.apache.catalina.startup.Catalinaload
信息:
Initializationprocessedin2776ms
十一月12,20158:
16:
33下午org.apache.catalina.core.StandardServicestartInternal
信息:
StartingserviceCatalina
十一月12,20158:
16:
33下午org.apache.catalina.core.StandardEnginestartInternal
信息:
StartingServletEngine:
ApacheTomcat/8.0.21
十一月12,20158:
16:
33下午org.apache.catalina.startup.HostConfigdeployDirectory
信息:
DeployingwebapplicationdirectoryD:
\tools\apache-tomcat-8.0.21\webapps\docs
十一月12,20158:
16:
33下午org.apache.catalina.util.SessionIdGeneratorBasecreateSecureRandom
信息:
CreationofSecureRandominstanceforsessionIDgenerationusing[SHA1PRNG]took[177]milliseconds.
十一月12,20158:
16:
33下午org.apache.catalina.startup.HostConfigdeployDirectory
信息:
DeploymentofwebapplicationdirectoryD:
\tools\apache-tomcat-8.0.21\webapps\docshasfinishedin623ms
十一月12,20158:
16:
33下午org.apache.catalina.startup.HostConfigdeployDirectory
信息:
DeployingwebapplicationdirectoryD:
\tools\apache-tomcat-8.0.21\webapps\examples
十一月12,20158:
16:
34下午org.apache.catalina.core.ApplicationContextlog
信息:
ContextListener:
contextInitialized()
十一月12,20158:
16:
34下午org.apache.catalina.core.ApplicationContextlog
信息:
SessionListener:
contextInitialized()
十一月12,20158:
16:
34下午org.apache.catalina.startup.HostConfigdeployDirectory
信息:
DeploymentofwebapplicationdirectoryD:
\tools\apache-tomcat-8.0.21\webapps\exampleshasfinishedin439ms
十一月12,20158:
16:
34下午org.apache.catalina.startup.HostConfigdeployDirectory
信息:
DeployingwebapplicationdirectoryD:
\tools\apache-tomcat-8.0.21\webapps\FileIO
十一月12,20158:
16:
44下午org.apache.jasper.servlet.TldScannerscanJars
信息:
AtleastoneJARwasscannedforTLDsyetcontainednoTLDs.EnabledebugloggingforthisloggerforacompletelistofJARsthatwerescannedbutnoTLDswerefoundinthem.SkippingunneededJARsduringscanningcanimprovestartuptimeandJSPcompilationtime.
十一月12,20158:
16:
44下午org.apache.catalina.core.ApplicationContextlog
信息:
NoSpringWebApplicationInitializertypesdetectedonclasspath
十一月12,20158:
16:
44下午org.apache.catalina.core.ApplicationContextlog
信息:
InitializingSpringrootWebApplicationContext
log4j:
WARNNoappenderscouldbefoundforlogger(org.springframework.web.context.ContextLoader).
log4j:
WARNPleaseinitializethelog4jsystemproperly.
log4j:
WARNSeehttp:
//logging.apache.org/log4j/1.2/faq.html#noconfigformoreinfo.
十一月12,20158:
16:
45下午org.apache.catalina.core.StandardContextlistenerStart
严重:
Exceptionsendingcontextinitializedeventtolistenerinstanceofclassorg.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException:
Errorcreatingbeanwithname'secretKeyService':
Injectionofautowireddependenciesfailed;nestedexceptionisorg.springframework.beans.factory.BeanCreationException:
Couldnotautowiremethod:
publicvoidcom.cetc.di.db.secretkeydb.service.impl.secretKeyServiceImpl.setSecretKeyMapper(com.cetc.di.db.secretkeydb.dao.secretKeyDtoMapper);nestedexceptionisorg.springframework.beans.factory.NoSuchBeanDefinitionException:
Noqualifyingbeanoftype[com.cetc.di.db.secretkeydb.dao.secretKeyDtoMapper]foundfordependency:
expectedatleast1beanwhichqualifiesasautowirecandidateforthisdependency.Dependencyannotations:
{}
Relatedcause:
org.springframework.beans.factory.BeanCreationException:
Errorcreatingbeanwithname'secretKeyDtoMapper'definedinfile[D:
\tools\apache-tomcat-8.0.21\webapps\FileIO\WEB-INF\classes\com\cetc\di\db\secretkeydb\dao\secretKeyDtoMapper.class]:
Cannotresolvereferencetobean'sqlSessionFactory'whilesettingbeanproperty'sqlSessionFactory';nestedexceptionisorg.springframework.beans.factory.BeanCreationException:
Errorcreatingbeanwithname'sqlSessionFactory'definedinclasspathresource[spring-mybatis.xml]:
Cannotresolvereferencetobean'dataSource'whilesettingbeanproperty'dataSource';nestedexceptionisorg.springframework.beans.factory.BeanCreationException:
Errorcreatingbeanwithname'dataSource'definedinclasspathresource[spring-mybatis.xml]:
Initializationofbeanfailed;nestedexceptionisjava.lang.NoSuchMethodError:
org.springframework.core.annotation.AnnotatedElementUtils.getMergedAnnotationAttributes(Ljava/lang/reflect/AnnotatedElement;Ljava/lang/Class;)Lorg/springframework/core/annotation/AnnotationAttributes;
atorg.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValu