注解解析不到异常好像,java.lang.annotation.AnnotationFormatError: Invalid default:


整合SSM出现这么一个bug:

Caused by: java.lang.annotation.AnnotationFormatError: Invalid default: public abstract java.lang.Class org.mybatis.spring.annotation.MapperScan.factoryBean()
	at java.lang.reflect.Method.getDefaultValue(Unknown Source)


说是注解解析不到怎么怎么的,摸不清楚,百度网上,说是spring-webmvc,等的jar包与jdk版本不一致,jdk版本设置1.7,

1.5.都无效,

后来看依赖,添加了spring-jdbc依赖,却意外好了。删了又报错,不知是什么原因导致这个bug.

查bug好难。


七月 02, 2018 5:45:01 下午 org.apache.catalina.core.AprLifecycleListener init
信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: D:\JAVA8\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;D:/JAVA8/bin/server;D:/JAVA8/bin;D:/JAVA8/lib/amd64;D:\oracle\product\10.2.0\client_1\bin;D:\oracle\product\10.2.0\db_1\bin;D:\JAVA8\bin;C:\ProgramData\Oracle\Java\javapath;c:\gtk\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;d:\u8\admin;C:\Program Files (x86)\Microsoft SQL Server\80\Tools\Binn\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;D:\mysql01\bin;C:\Users\Administrator\Desktop\java\java\eclipseMars;;.
七月 02, 2018 5:45:01 下午 org.apache.tomcat.util.digester.SetPropertiesRule begin
警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:CGB-SSM-v1.1' did not find a matching property.
七月 02, 2018 5:45:01 下午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["http-bio-80"]
七月 02, 2018 5:45:01 下午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["ajp-bio-8009"]
七月 02, 2018 5:45:01 下午 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 413 ms
七月 02, 2018 5:45:01 下午 org.apache.catalina.core.StandardService startInternal
信息: Starting service Catalina
七月 02, 2018 5:45:01 下午 org.apache.catalina.core.StandardEngine startInternal
信息: Starting Servlet Engine: Apache Tomcat/7.0.53
七月 02, 2018 5:45:03 下午 org.apache.catalina.core.ApplicationContext log
信息: 1 Spring WebApplicationInitializers detected on classpath
七月 02, 2018 5:45:03 下午 org.apache.catalina.core.ApplicationContext log
信息: Initializing Spring root WebApplicationContext
七月 02, 2018 5:45:03 下午 org.springframework.web.context.ContextLoader initWebApplicationContext
信息: Root WebApplicationContext: initialization started
七月 02, 2018 5:45:03 下午 org.springframework.web.context.support.AnnotationConfigWebApplicationContext prepareRefresh
信息: Refreshing Root WebApplicationContext: startup date [Mon Jul 02 17:45:03 CST 2018]; root of context hierarchy
七月 02, 2018 5:45:03 下午 org.springframework.web.context.support.AnnotationConfigWebApplicationContext loadBeanDefinitions
信息: Registering annotated classes: [class com.jt.common.config.AppServletConfig]
七月 02, 2018 5:45:03 下午 org.springframework.web.context.support.AnnotationConfigWebApplicationContext refresh
警告: Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: file [D:\ws1803\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\CGB-SSM-v1.1\WEB-INF\classes\com\jt\common\config\AppRootConfig.class]; nested exception is java.lang.annotation.AnnotationFormatError: Invalid default: public abstract java.lang.Class org.mybatis.spring.annotation.MapperScan.factoryBean()
七月 02, 2018 5:45:03 下午 org.springframework.web.context.ContextLoader initWebApplicationContext
严重: Context initialization failed
org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: file [D:\ws1803\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\CGB-SSM-v1.1\WEB-INF\classes\com\jt\common\config\AppRootConfig.class]; nested exception is java.lang.annotation.AnnotationFormatError: Invalid default: public abstract java.lang.Class org.mybatis.spring.annotation.MapperScan.factoryBean()
	at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:311)
	at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.doScan(ClassPathBeanDefinitionScanner.java:272)
	at org.springframework.context.annotation.ComponentScanAnnotationParser.parse(ComponentScanAnnotationParser.java:135)
	at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:287)
	at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:245)
	at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:198)
	at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:167)
	at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:308)
	at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:228)
	at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:270)
	at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:93)
	at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:687)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:525)
	at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:443)
	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:325)
	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4971)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5467)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.annotation.AnnotationFormatError: Invalid default: public abstract java.lang.Class org.mybatis.spring.annotation.MapperScan.factoryBean()
	at java.lang.reflect.Method.getDefaultValue(Unknown Source)
	at org.springframework.core.annotation.AnnotationUtils.registerDefaultValues(AnnotationUtils.java:1178)
	at org.springframework.core.type.classreading.RecursiveAnnotationAttributesVisitor.visitEnd(RecursiveAnnotationAttributesVisitor.java:42)
	at org.springframework.core.type.classreading.AnnotationAttributesReadingVisitor.visitEnd(AnnotationAttributesReadingVisitor.java:64)
	at org.springframework.asm.ClassReader.readAnnotationValues(ClassReader.java:1869)
	at org.springframework.asm.ClassReader.accept(ClassReader.java:657)
	at org.springframework.asm.ClassReader.accept(ClassReader.java:523)
	at org.springframework.core.type.classreading.SimpleMetadataReader.(SimpleMetadataReader.java:64)
	at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:98)
	at org.springframework.core.type.classreading.CachingMetadataReaderFactory.getMetadataReader(CachingMetadataReaderFactory.java:102)
	at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:287)
	... 24 more
七月 02, 2018 5:45:03 下午 org.apache.catalina.core.StandardContext startInternal
严重: Error listenerStart
七月 02, 2018 5:45:03 下午 org.apache.catalina.core.StandardContext startInternal
严重: Context [/CGB-SSM-v1.1] startup failed due to previous errors
七月 02, 2018 5:45:03 下午 org.apache.catalina.core.ApplicationContext log
信息: Closing Spring root WebApplicationContext
七月 02, 2018 5:45:03 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["http-bio-80"]
七月 02, 2018 5:45:03 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["ajp-bio-8009"]
七月 02, 2018 5:45:03 下午 org.apache.catalina.startup.Catalina start
信息: Server startup in 2039 ms


你可能感兴趣的:(spring)