1. 找不到dubbo2.8.4包的問題html
在編譯Maven工程的過程當中,出現以下問題:java
Description Resource Path Location Type
ArtifactDescriptorException: Failed to read artifact descriptor for com.alibaba:dubbo:jar:2.8.4: UnresolvableModelException: Failure to find com.alibaba:dubbo-parent:pom:2.8.4 in http://172.28.3.60:8081/nexus/content/groups/public was cached in the local repository, resolution will not be reattempted until the update interval of thirdparty has elapsed or updates are forced pom.xml /FileIO line 1 Maven Dependency Problem
本地Maven的配置以下:settings.xml:linux
<settings xmlns="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>OSChina Central</name> <url>http://maven.oschina.net/content/groups/public/</url> <mirrorOf>central</mirrorOf> </mirror> </mirrors> <localRepository>D:\Java\m2\repository</localRepository> </settings>
可見,本地的Maven庫存放位置爲:D:\Java\m2\repository,在這個目錄下,有以下結構(正常狀況下,異常狀況下是沒有這個結果的,並且dubbo2.8.4這個版本沒有公開發布到maven中心庫,須要本身進行編譯,編譯成功後,就能夠獲得以下的文件結構):git
編譯過程:1.從github上將大貓download下來,下載地址:https://github.com/dangdangdotcom/dubbox github
下載下來後,解壓,在解壓後的路徑中,執行: mvn install -Dmaven.test.skip=true web
執行完畢後,就能夠生成本地maven庫中dubbo的目錄結構,這樣工程中全部使用dubbo2.8.4的地方,均可以正常的編譯:spring
2. 用Maven構建web工程,出現以下錯誤:sql
Description Resource Path Location Type
The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path index.jsp /web Maven Webapp/src/main/webapp line 1 JSP Problem
這個錯誤是由於沒有導入web工程的運行時環境致使的,解決辦法以下:apache
而後將project clean後,從新構建,錯誤自動消失。windows
3. 修改項目的JDK版本,有時會出現MyEclipse打出的war包,部署到Tomcat服務器上不可以使用的狀況,錯誤通常以下,對於這種狀況,要認真檢查項目使用JDK版本,以及服務器運行時的JDK版本,只要匹配就不會有問題。
Unsupported major.minor version 52.0 (unable to load class:
What it means is that , your code is compiled with different version of java to java version which is running it . make sure you compile and runt it with the same version if java.
4. Maven POM中添加的 Spring版本和Myeclipse提供的Spring版本中出現衝突,解決辦法是將Myeclipse中自帶的Spring 4.1從Build中移除掉:
十一月 12, 2015 8:16:31 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server version: Apache Tomcat/8.0.21
十一月 12, 2015 8:16:31 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server built: Mar 23 2015 14:11:21 UTC
十一月 12, 2015 8:16:31 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server number: 8.0.21.0
十一月 12, 2015 8:16:31 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: OS Name: Windows 7
十一月 12, 2015 8:16:31 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: OS Version: 6.1
十一月 12, 2015 8:16:31 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Architecture: amd64
十一月 12, 2015 8:16:31 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Java Home: C:\Program Files\Java\jdk1.8.0_45\jre
十一月 12, 2015 8:16:31 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: JVM Version: 1.8.0_45-b14
十一月 12, 2015 8:16:31 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: JVM Vendor: Oracle Corporation
十一月 12, 2015 8:16:31 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: CATALINA_BASE: D:\tools\apache-tomcat-8.0.21
十一月 12, 2015 8:16:31 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: CATALINA_HOME: D:\tools\apache-tomcat-8.0.21
十一月 12, 2015 8:16:31 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dmaven.multiModuleProjectDirectory=M2_HOME
十一月 12, 2015 8:16:31 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dcatalina.base=D:\tools\apache-tomcat-8.0.21
十一月 12, 2015 8:16:31 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dcatalina.home=D:\tools\apache-tomcat-8.0.21
十一月 12, 2015 8:16:31 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dwtp.deploy=D:\tools\apache-tomcat-8.0.21\webapps
十一月 12, 2015 8:16:31 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Djava.endorsed.dirs=D:\tools\apache-tomcat-8.0.21\endorsed
十一月 12, 2015 8:16:31 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Djava.library.path=C:\Program Files\Java\jdk1.8.0_45\bin;D:\tools\apache-tomcat-8.0.21\bin
十一月 12, 2015 8:16:31 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dfile.encoding=GBK
十一月 12, 2015 8:16:31 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
信息: Loaded APR based Apache Tomcat Native library 1.1.33 using APR version 1.5.1.
十一月 12, 2015 8:16:31 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
信息: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
十一月 12, 2015 8:16:31 下午 org.apache.catalina.core.AprLifecycleListener initializeSSL
信息: OpenSSL successfully initialized (OpenSSL 1.0.1m 19 Mar 2015)
十一月 12, 2015 8:16:33 下午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["http-apr-8080"]
十一月 12, 2015 8:16:33 下午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["ajp-apr-8009"]
十一月 12, 2015 8:16:33 下午 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 2776 ms
十一月 12, 2015 8:16:33 下午 org.apache.catalina.core.StandardService startInternal
信息: Starting service Catalina
十一月 12, 2015 8:16:33 下午 org.apache.catalina.core.StandardEngine startInternal
信息: Starting Servlet Engine: Apache Tomcat/8.0.21
十一月 12, 2015 8:16:33 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\tools\apache-tomcat-8.0.21\webapps\docs
十一月 12, 2015 8:16:33 下午 org.apache.catalina.util.SessionIdGeneratorBase createSecureRandom
信息: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [177] milliseconds.
十一月 12, 2015 8:16:33 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory D:\tools\apache-tomcat-8.0.21\webapps\docs has finished in 623 ms
十一月 12, 2015 8:16:33 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\tools\apache-tomcat-8.0.21\webapps\examples
十一月 12, 2015 8:16:34 下午 org.apache.catalina.core.ApplicationContext log
信息: ContextListener: contextInitialized()
十一月 12, 2015 8:16:34 下午 org.apache.catalina.core.ApplicationContext log
信息: SessionListener: contextInitialized()
十一月 12, 2015 8:16:34 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory D:\tools\apache-tomcat-8.0.21\webapps\examples has finished in 439 ms
十一月 12, 2015 8:16:34 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\tools\apache-tomcat-8.0.21\webapps\FileIO
十一月 12, 2015 8:16:44 下午 org.apache.jasper.servlet.TldScanner scanJars
信息: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
十一月 12, 2015 8:16:44 下午 org.apache.catalina.core.ApplicationContext log
信息: No Spring WebApplicationInitializer types detected on classpath
十一月 12, 2015 8:16:44 下午 org.apache.catalina.core.ApplicationContext log
信息: Initializing Spring root WebApplicationContext
log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
十一月 12, 2015 8:16:45 下午 org.apache.catalina.core.StandardContext listenerStart
嚴重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'secretKeyService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void com.cetc.di.db.secretkeydb.service.impl.secretKeyServiceImpl.setSecretKeyMapper(com.cetc.di.db.secretkeydb.dao.secretKeyDtoMapper); nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.cetc.di.db.secretkeydb.dao.secretKeyDtoMapper] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}
Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'secretKeyDtoMapper' defined in file [D:\tools\apache-tomcat-8.0.21\webapps\FileIO\WEB-INF\classes\com\cetc\di\db\secretkeydb\dao\secretKeyDtoMapper.class]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring-mybatis.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [spring-mybatis.xml]: Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: org.springframework.core.annotation.AnnotatedElementUtils.getMergedAnnotationAttributes(Ljava/lang/reflect/AnnotatedElement;Ljava/lang/Class;)Lorg/springframework/core/annotation/AnnotationAttributes;
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:326)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1204)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:538)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:229)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:725)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4728)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5166)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1096)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1756)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void com.cetc.di.db.secretkeydb.service.impl.secretKeyServiceImpl.setSecretKeyMapper(com.cetc.di.db.secretkeydb.dao.secretKeyDtoMapper); nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.cetc.di.db.secretkeydb.dao.secretKeyDtoMapper] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.inject(AutowiredAnnotationBeanPostProcessor.java:630)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:323)
... 26 more
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.cetc.di.db.secretkeydb.dao.secretKeyDtoMapper] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}
at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:1261)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1009)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:904)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.inject(AutowiredAnnotationBeanPostProcessor.java:587)
... 28 more
Related cause:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'secretKeyDtoMapper' defined in file [D:\tools\apache-tomcat-8.0.21\webapps\FileIO\WEB-INF\classes\com\cetc\di\db\secretkeydb\dao\secretKeyDtoMapper.class]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring-mybatis.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [spring-mybatis.xml]: Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: org.springframework.core.annotation.AnnotatedElementUtils.getMergedAnnotationAttributes(Ljava/lang/reflect/AnnotatedElement;Ljava/lang/Class;)Lorg/springframework/core/annotation/AnnotationAttributes;
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:336)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1471)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(
AbstractAutowireCapableBeanFactory.java:1216)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:538)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:229)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298)
at org.springframework.beans.factory.support.AbstractBeanFactory.getTypeForFactoryBean(AbstractBeanFactory.java:1418)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryBean(AbstractAutowireCapableBeanFactory.java:803)
at org.springframework.beans.factory.support.AbstractBeanFactory.isTypeMatch(AbstractBeanFactory.java:541)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:406)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:381)
at org.springframework.beans.factory.BeanFactoryUtils.beanNamesForTypeIncludingAncestors(BeanFactoryUtils.java:187)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1066)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1006)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:904)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.inject(AutowiredAnnotationBeanPostProcessor.java:587)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:323)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1204)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:538)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:229)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:725)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4728)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5166)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1096)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1756)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring-mybatis.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [spring-mybatis.xml]: Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: org.springframework.core.annotation.AnnotatedElementUtils.getMergedAnnotationAttributes(Ljava/lang/reflect/AnnotatedElement;Ljava/lang/Class;)Lorg/springframework/core/annotation/AnnotationAttributes;
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:336)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1471)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1216)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:538)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:229)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
... 46 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [spring-mybatis.xml]: Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: org.springframework.core.annotation.AnnotatedElementUtils.getMergedAnnotationAttributes(Ljava/lang/reflect/AnnotatedElement;Ljava/lang/Class;)Lorg/springframework/core/annotation/AnnotationAttributes;
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:548)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:229)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.sup
port.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
... 56 more
Caused by: java.lang.NoSuchMethodError: org.springframework.core.annotation.AnnotatedElementUtils.getMergedAnnotationAttributes(Ljava/lang/reflect/AnnotatedElement;Ljava/lang/Class;)Lorg/springframework/core/annotation/AnnotationAttributes;
at org.springframework.transaction.annotation.SpringTransactionAnnotationParser.parseTransactionAnnotation(SpringTransactionAnnotationParser.java:42)
at org.springframework.transaction.annotation.AnnotationTransactionAttributeSource.determineTransactionAttribute(AnnotationTransactionAttributeSource.java:154)
at org.springframework.transaction.annotation.AnnotationTransactionAttributeSource.findTransactionAttribute(AnnotationTransactionAttributeSource.java:133)
at org.springframework.transaction.interceptor.AbstractFallbackTransactionAttributeSource.computeTransactionAttribute(AbstractFallbackTransactionAttributeSource.java:151)
at org.springframework.transaction.interceptor.AbstractFallbackTransactionAttributeSource.getTransactionAttribute(AbstractFallbackTransactionAttributeSource.java:100)
at org.springframework.transaction.interceptor.TransactionAttributeSourcePointcut.matches(TransactionAttributeSourcePointcut.java:41)
at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:225)
at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:262)
at org.springframework.aop.support.AopUtils.findAdvisorsThatCanApply(AopUtils.java:294)
at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findAdvisorsThatCanApply(AbstractAdvisorAutoProxyCreator.java:118)
at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findEligibleAdvisors(AbstractAdvisorAutoProxyCreator.java:88)
at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.getAdvicesAndAdvisorsForBean(AbstractAdvisorAutoProxyCreator.java:69)
at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.wrapIfNecessary(AbstractAutoProxyCreator.java:328)
at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.postProcessAfterInitialization(AbstractAutoProxyCreator.java:291)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:422)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1573)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:540)
... 62 more
十一月 12, 2015 8:16:45 下午 org.apache.catalina.core.StandardContext startInternal
嚴重: Error listenerStart
十一月 12, 2015 8:16:45 下午 org.apache.catalina.core.StandardContext startInternal
嚴重: Context [/FileIO] startup failed due to previous errors
十一月 12, 2015 8:16:45 下午 org.apache.catalina.core.StandardContext listenerStop
嚴重: Exception sending context destroyed event to listener instance of class com.github.miemiedev.mybatis.paginator.CleanupMybatisPaginatorListener
java.lang.NullPointerException
at com.github.miemiedev.mybatis.paginator.CleanupMybatisPaginatorListener.contextDestroyed(CleanupMybatisPaginatorListener.java:15)
at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4775)
at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5389)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:160)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1096)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1756)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
十一月 12, 2015 8:16:45 下午 org.apache.catalina.core.ApplicationContext log
信息: Closing Spring root WebApplicationContext
十一月 12, 2015 8:16:45 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory D:\tools\apache-tomcat-8.0.21\webapps\FileIO has finished in 11,456 ms
十一月 12, 2015 8:16:45 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\tools\apache-tomcat-8.0.21\webapps\host-manager
十一月 12, 2015 8:16:45 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory D:\tools\apache-tomcat-8.0.21\webapps\host-manager has finished in 35 ms
十一月 12, 2015 8:16:45 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\tools\apache-tomcat-8.0.21\webapps\manager
十一月 12, 2015 8:16:45 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory D:\tools\apache-tomcat-8.0.21\webapps\manager has finished in 15 ms
十一月 12, 2015 8:16:45 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\tools\apache-tomcat-8.0.21\webapps\ROOT
十一月 12, 2015 8:16:45 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory D:\tools\apache-tomcat-8.0.21\webapps\ROOT has finished in 9 ms
十一月 12, 2015 8:16:45 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["http-apr-8080"]
十一月 12, 2015 8:16:45 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["ajp-apr-8009"]
十一月 12, 2015 8:16:45 下午 org.apache.catalina.startup.Catalina start
信息: Server startup in 12662 ms
5.dubbo出現,Duplicate application configs,這個是由於,一個war包中,一次只可以有一個dubbo的app,出現這個錯誤的緣由是由於在一個工程中,同時定義了兩個dubbo的app,解決辦法是將另一個APP中要註冊的服務放到另一個APP中,就OK了。
十一月 11, 2015 8:08:06 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Server version: Apache Tomcat/8.0.21 十一月 11, 2015 8:08:06 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Server built: Mar 23 2015 14:11:21 UTC 十一月 11, 2015 8:08:06 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Server number: 8.0.21.0 十一月 11, 2015 8:08:06 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: OS Name: Windows 7 十一月 11, 2015 8:08:06 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: OS Version: 6.1 十一月 11, 2015 8:08:06 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Architecture: amd64 十一月 11, 2015 8:08:06 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Java Home: C:\Program Files\Java\jdk1.8.0_45\jre 十一月 11, 2015 8:08:06 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: JVM Version: 1.8.0_45-b14 十一月 11, 2015 8:08:06 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: JVM Vendor: Oracle Corporation 十一月 11, 2015 8:08:06 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: CATALINA_BASE: D:\tools\apache-tomcat-8.0.21 十一月 11, 2015 8:08:06 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: CATALINA_HOME: D:\tools\apache-tomcat-8.0.21 十一月 11, 2015 8:08:06 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Dmaven.multiModuleProjectDirectory=M2_HOME 十一月 11, 2015 8:08:06 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Dcatalina.base=D:\tools\apache-tomcat-8.0.21 十一月 11, 2015 8:08:06 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Dcatalina.home=D:\tools\apache-tomcat-8.0.21 十一月 11, 2015 8:08:06 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Dwtp.deploy=D:\tools\apache-tomcat-8.0.21\webapps 十一月 11, 2015 8:08:06 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Djava.endorsed.dirs=D:\tools\apache-tomcat-8.0.21\endorsed 十一月 11, 2015 8:08:06 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Djava.library.path=C:\Program Files\Java\jdk1.8.0_45\bin;D:\tools\apache-tomcat-8.0.21\bin 十一月 11, 2015 8:08:06 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Dfile.encoding=GBK 十一月 11, 2015 8:08:06 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent 信息: Loaded APR based Apache Tomcat Native library 1.1.33 using APR version 1.5.1. 十一月 11, 2015 8:08:06 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent 信息: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true]. 十一月 11, 2015 8:08:07 下午 org.apache.catalina.core.AprLifecycleListener initializeSSL 信息: OpenSSL successfully initialized (OpenSSL 1.0.1m 19 Mar 2015) 十一月 11, 2015 8:08:07 下午 org.apache.coyote.AbstractProtocol init 信息: Initializing ProtocolHandler ["http-apr-8080"] 十一月 11, 2015 8:08:07 下午 org.apache.coyote.AbstractProtocol init 信息: Initializing ProtocolHandler ["ajp-apr-8009"] 十一月 11, 2015 8:08:07 下午 org.apache.catalina.startup.Catalina load 信息: Initialization processed in 880 ms 十一月 11, 2015 8:08:07 下午 org.apache.catalina.core.StandardService startInternal 信息: Starting service Catalina 十一月 11, 2015 8:08:07 下午 org.apache.catalina.core.StandardEngine startInternal 信息: Starting Servlet Engine: Apache Tomcat/8.0.21 十一月 11, 2015 8:08:07 下午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory D:\tools\apache-tomcat-8.0.21\webapps\docs 十一月 11, 2015 8:08:07 下午 org.apache.catalina.util.SessionIdGeneratorBase createSecureRandom 信息: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [125] milliseconds. 十一月 11, 2015 8:08:07 下午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deployment of web application directory D:\tools\apache-tomcat-8.0.21\webapps\docs has finished in 296 ms 十一月 11, 2015 8:08:07 下午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory D:\tools\apache-tomcat-8.0.21\webapps\examples 十一月 11, 2015 8:08:07 下午 org.apache.catalina.core.ApplicationContext log 信息: ContextListener: contextInitialized() 十一月 11, 2015 8:08:07 下午 org.apache.catalina.core.ApplicationContext log 信息: SessionListener: contextInitialized() 十一月 11, 2015 8:08:07 下午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deployment of web application directory D:\tools\apache-tomcat-8.0.21\webapps\examples has finished in 207 ms 十一月 11, 2015 8:08:07 下午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory D:\tools\apache-tomcat-8.0.21\webapps\FileIO 十一月 11, 2015 8:08:10 下午 org.apache.jasper.servlet.TldScanner scanJars 信息: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time. 十一月 11, 2015 8:08:10 下午 org.apache.catalina.core.ApplicationContext log 信息: No Spring WebApplicationInitializer types detected on classpath 十一月 11, 2015 8:08:10 下午 org.apache.catalina.core.ApplicationContext log 信息: Initializing Spring root WebApplicationContext log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader). log4j:WARN Please initialize the log4j system properly. log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. 十一月 11, 2015 8:08:12 下午 org.apache.catalina.core.StandardContext listenerStart 嚴重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.cetc.di.io.demoservice.DemoService': Invocation of init method failed; nested exception is java.lang.IllegalStateException: Duplicate application configs: <dubbo:application name="diservice-provicer" id="diservice-provicer" /> and <dubbo:application name="hello-world-app" id="hello-world-app" /> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1578) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:305) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:301) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:196) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:835) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:537) at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:446) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:328) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4728) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5166) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1096) at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1756) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.IllegalStateException: Duplicate application configs: <dubbo:application name="diservice-provicer" id="diservice-provicer" /> and <dubbo:application name="hello-world-app" id="hello-world-app" /> at com.alibaba.dubbo.config.spring.ServiceBean.afterPropertiesSet(ServiceBean.java:165) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1637) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574) ... 25 more 十一月 11, 2015 8:08:12 下午 org.apache.catalina.core.StandardContext startInternal 嚴重: Error listenerStart 十一月 11, 2015 8:08:12 下午 org.apache.catalina.core.StandardContext startInternal 嚴重: Context [/FileIO] startup failed due to previous errors 十一月 11, 2015 8:08:12 下午 org.apache.catalina.core.ApplicationContext log 信息: Closing Spring root WebApplicationContext 十一月 11, 2015 8:08:12 下午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deployment of web application directory D:\tools\apache-tomcat-8.0.21\webapps\FileIO has finished in 4,408 ms 十一月 11, 2015 8:08:12 下午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory D:\tools\apache-tomcat-8.0.21\webapps\host-manager 十一月 11, 2015 8:08:12 下午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deployment of web application directory D:\tools\apache-tomcat-8.0.21\webapps\host-manager has finished in 17 ms 十一月 11, 2015 8:08:12 下午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory D:\tools\apache-tomcat-8.0.21\webapps\manager 十一月 11, 2015 8:08:12 下午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deployment of web application directory D:\tools\apache-tomcat-8.0.21\webapps\manager has finished in 15 ms 十一月 11, 2015 8:08:12 下午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory D:\tools\apache-tomcat-8.0.21\webapps\ROOT 十一月 11, 2015 8:08:12 下午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deployment of web application directory D:\tools\apache-tomcat-8.0.21\webapps\ROOT has finished in 13 ms 十一月 11, 2015 8:08:12 下午 org.apache.coyote.AbstractProtocol start 信息: Starting ProtocolHandler ["http-apr-8080"] 十一月 11, 2015 8:08:12 下午 org.apache.coyote.AbstractProtocol start 信息: Starting ProtocolHandler ["ajp-apr-8009"] 十一月 11, 2015 8:08:12 下午 org.apache.catalina.startup.Catalina start 信息: Server startup in 4991 ms
提交成功後的dubbo控制檯效果以下:
6. web.xml中配置注意事項:
7. 打成war包要注意check Maven依賴是否被成功的加入到了打包路徑,在Deployment Assembly中設置:
8. 在Mavne pom.xml文件中指定JDK版本:
9. 在maven pom.xml文件中指定多個地址:
在show view中找到maven,能夠看到工程maven庫的狀況:
10. 更新整個工程,讓maven從新check Pom文件,相似於idea intellij中 maven reimport:
11. 在執行run –> mvn compile/install/clean出現找不到M2_HOME的狀況,解決方案以下:
在JDK中添加默認參數-Dmaven.multiModuleProjectDirectory=M2_HOME(前提是操做系統中設置了M2_HOME的環境變量,注意windows系統中,M2_HOME前面不可以添加$符號,在linux系統中必需要添加$符號)