2017-08-17 4 views
0

spring-data-redisを使用したredisキャッシングとの統合を備えたライブラリ(smartconnect-commons)を開発しました。このライブラリは、これまでRedisを使用したいアプリケーションにプラグインすることができます。そのライブラリのJUnitテストは成功です。これまでのところ問題はありません。Spring Redisインテグレーションのjava.lang.annotation.AnnotationFormatError

私は上記のライブラリをSpringブートアプリケーションの依存として使用しています。スプリングブートアプリケーションを実行すると、アプリケーションコンテキストの初期化エラーで失敗します。

2017-08-17 10:38:25,118 [main] ERROR org.springframework.boot.SpringApplication - - Application startup failed 
java.lang.annotation.AnnotationFormatError: Invalid default: public abstract java.lang.Class org.springframework.data.redis.repository.configuration.EnableRedisRepositories.repositoryFactoryBeanClass() 
    at java.lang.reflect.Method.getDefaultValue(Method.java:612) 
    at sun.reflect.annotation.AnnotationType.<init>(AnnotationType.java:132) 
    at sun.reflect.annotation.AnnotationType.getInstance(AnnotationType.java:85) 
    at sun.reflect.annotation.AnnotationParser.parseAnnotation2(AnnotationParser.java:266) 
    at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:120) 
    at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:72) 
    at java.lang.Class.createAnnotationData(Class.java:3521) 
    at java.lang.Class.annotationData(Class.java:3510) 
    at java.lang.Class.getAnnotations(Class.java:3446) 
    at org.springframework.core.type.StandardAnnotationMetadata.<init>(StandardAnnotationMetadata.java:68) 
    at org.springframework.boot.autoconfigure.data.AbstractRepositoryConfigurationSourceSupport.getConfigurationSource(AbstractRepositoryConfigurationSourceSupport.java:65) 
    at org.springframework.boot.autoconfigure.data.AbstractRepositoryConfigurationSourceSupport.registerBeanDefinitions(AbstractRepositoryConfigurationSourceSupport.java:58) 
    at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsFromRegistrars(ConfigurationClassBeanDefinitionReader.java:354) 
    at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:143) 
    at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:116) 
    at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:320) 
    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:686) 
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:524) 
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) 
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:737) 
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:370) 
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:314) 
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1162) 
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1151) 
    at com.adp.smartconnect.SmartconnectWPInitializer.main(SmartconnectWPInitializer.java:32) 

春の依存バージョンと一致しないように見えますが、時間がかかりましたが、それを理解できませんでした。春のブートアプリの依存ツリーをご覧ください。

[INFO] --- maven-dependency-plugin:2.10:tree (default-cli) @ smartconnect-wage-payments-writer --- 
[INFO] com.adp.smartconnect:smartconnect-wage-payments-writer:war:1.0.0-SNAPSHOT 
[INFO] +- com.adp.smartconnect:smartconnect-config:jar:2.3.42:compile 
[INFO] | +- org.mule.modules:mule-module-mongo:jar:5.0.999:compile 
[INFO] | \- org.mongodb:mongo-java-driver:jar:3.4.2:compile 
[INFO] +- com.adp.smartconnect:smartconnect-commons:jar:1.0.9-SNAPSHOT:compile 
[INFO] | +- org.springframework:spring-web:jar:4.3.8.RELEASE:compile 
[INFO] | +- org.springframework.data:spring-data-redis:jar:1.8.3.RELEASE:compile 
[INFO] | | +- org.springframework.data:spring-data-keyvalue:jar:1.2.3.RELEASE:compile 
[INFO] | | +- org.springframework:spring-oxm:jar:4.3.8.RELEASE:compile 
[INFO] | | +- org.springframework:spring-context-support:jar:4.3.8.RELEASE:compile 
[INFO] | | \- org.slf4j:jcl-over-slf4j:jar:1.7.25:compile 
[INFO] | +- redis.clients:jedis:jar:2.9.0:compile 
[INFO] | | \- org.apache.commons:commons-pool2:jar:2.4.2:compile 
[INFO] | +- org.springframework:spring-core:jar:4.3.8.RELEASE:compile 
[INFO] | +- org.springframework:spring-test:jar:4.3.8.RELEASE:compile 
[INFO] | +- org.springframework.data:spring-data-mongodb:jar:1.10.3.RELEASE:compile 
[INFO] | | +- org.springframework:spring-expression:jar:4.3.8.RELEASE:compile 
[INFO] | | \- org.springframework.data:spring-data-commons:jar:1.13.3.RELEASE:compile 
[INFO] | +- com.fasterxml.jackson.core:jackson-core:jar:2.8.8:compile 
[INFO] | +- org.json:json:jar:20140107:compile 
[INFO] | +- com.fasterxml.jackson.core:jackson-databind:jar:2.8.8:compile 
[INFO] | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.8.0:compile 
[INFO] | +- com.adp.avs.domain:cdm:jar:1.0.9:compile 
[INFO] | | \- com.fasterxml.jackson.module:jackson-module-jsonSchema:jar:2.8.8:compile 
[INFO] | \- org.codehaus.jackson:jackson-mapper-asl:jar:1.9.13:compile 
[INFO] |  \- org.codehaus.jackson:jackson-core-asl:jar:1.9.13:compile 
[INFO] +- com.adp.smartconnect:avs-prod-payload:jar:2.3.3:compile 
[INFO] | +- commons-beanutils:commons-beanutils-core:jar:1.8.0:compile 
[INFO] | +- commons-collections:commons-collections:jar:3.2.2:compile 
[INFO] | +- io.swagger:swagger-annotations:jar:1.5.3:compile 
[INFO] | +- org.projectlombok:lombok:jar:1.16.16:compile 
[INFO] | +- com.adp.smartconnect:smartconnect-mongo-cdm-library-cdm-0.9:jar:1.0.90:compile 
[INFO] | | +- org.apache.commons:commons-collections4:jar:4.1:compile 
[INFO] | | \- org.mule.modules:smartconnect-tracking-service-connector-cdm-0.9:jar:1.0.90:compile 
[INFO] | |  \- org.mule.tools.devkit:mule-devkit-shade:jar:3.8.0:compile 
[INFO] | +- org.apache.logging.log4j:log4j-api:jar:2.7:compile 
[INFO] | +- org.apache.logging.log4j:log4j-core:jar:2.7:compile 
[INFO] | \- ch.qos.logback:logback-classic:jar:1.1.11:compile 
[INFO] |  \- ch.qos.logback:logback-core:jar:1.1.11:compile 
[INFO] +- org.springframework.boot:spring-boot-starter-web:jar:1.5.3.RELEASE:compile 
[INFO] | +- org.springframework.boot:spring-boot-starter:jar:1.5.3.RELEASE:compile 
[INFO] | | +- org.springframework.boot:spring-boot:jar:1.5.3.RELEASE:compile 
[INFO] | | +- org.springframework.boot:spring-boot-autoconfigure:jar:1.5.3.RELEASE:compile 
[INFO] | | +- org.springframework.boot:spring-boot-starter-logging:jar:1.5.3.RELEASE:compile 
[INFO] | | | +- org.slf4j:jul-to-slf4j:jar:1.7.25:compile 
[INFO] | | | \- org.slf4j:log4j-over-slf4j:jar:1.7.25:compile 
[INFO] | | \- org.yaml:snakeyaml:jar:1.17:runtime 
[INFO] | +- org.springframework.boot:spring-boot-starter-tomcat:jar:1.5.3.RELEASE:compile 
[INFO] | | +- org.apache.tomcat.embed:tomcat-embed-core:jar:8.5.14:compile 
[INFO] | | +- org.apache.tomcat.embed:tomcat-embed-el:jar:8.5.14:compile 
[INFO] | | \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:8.5.14:compile 
[INFO] | +- org.hibernate:hibernate-validator:jar:5.3.5.Final:compile 
[INFO] | | +- javax.validation:validation-api:jar:1.1.0.Final:compile 
[INFO] | | +- org.jboss.logging:jboss-logging:jar:3.3.1.Final:compile 
[INFO] | | \- com.fasterxml:classmate:jar:1.3.3:compile 
[INFO] | \- org.springframework:spring-webmvc:jar:4.3.8.RELEASE:compile 
[INFO] +- org.springframework.boot:spring-boot-starter-test:jar:1.5.3.RELEASE:test 
[INFO] | +- org.springframework.boot:spring-boot-test:jar:1.5.3.RELEASE:test 
[INFO] | +- org.springframework.boot:spring-boot-test-autoconfigure:jar:1.5.3.RELEASE:test 
[INFO] | +- com.jayway.jsonpath:json-path:jar:2.2.0:test 
[INFO] | | \- net.minidev:json-smart:jar:2.2.1:test 
[INFO] | |  \- net.minidev:accessors-smart:jar:1.1:test 
[INFO] | |  \- org.ow2.asm:asm:jar:5.0.3:test 
[INFO] | +- org.assertj:assertj-core:jar:2.6.0:test 
[INFO] | +- org.mockito:mockito-core:jar:1.10.19:test 
[INFO] | | \- org.objenesis:objenesis:jar:2.1:test 
[INFO] | +- org.hamcrest:hamcrest-core:jar:1.3:test 
[INFO] | +- org.hamcrest:hamcrest-library:jar:1.3:test 
[INFO] | \- org.skyscreamer:jsonassert:jar:1.4.0:test 
[INFO] |  \- com.vaadin.external.google:android-json:jar:0.0.20131108.vaadin1:test 
[INFO] +- com.typesafe.akka:akka-actor_2.11:jar:2.5.0:compile 
[INFO] | +- org.scala-lang:scala-library:jar:2.11.8:compile 
[INFO] | +- com.typesafe:config:jar:1.3.1:compile 
[INFO] | \- org.scala-lang.modules:scala-java8-compat_2.11:jar:0.7.0:compile 
[INFO] +- com.typesafe.akka:akka-remote_2.11:jar:2.5.0:compile 
[INFO] | +- com.typesafe.akka:akka-stream_2.11:jar:2.5.0:compile 
[INFO] | | +- org.reactivestreams:reactive-streams:jar:1.0.0:compile 
[INFO] | | \- com.typesafe:ssl-config-core_2.11:jar:0.2.1:compile 
[INFO] | |  \- org.scala-lang.modules:scala-parser-combinators_2.11:jar:1.0.4:compile 
[INFO] | +- com.typesafe.akka:akka-protobuf_2.11:jar:2.5.0:compile 
[INFO] | +- io.netty:netty:jar:3.10.6.Final:compile 
[INFO] | +- io.aeron:aeron-driver:jar:1.2.3:compile 
[INFO] | \- io.aeron:aeron-client:jar:1.2.3:compile 
[INFO] |  \- org.agrona:agrona:jar:0.9.3:compile 
[INFO] +- com.typesafe.akka:akka-cluster_2.11:jar:2.5.0:compile 
[INFO] +- com.typesafe.akka:akka-testkit_2.11:jar:2.5.0:compile 
[INFO] +- com.typesafe.akka:akka-slf4j_2.11:jar:2.5.0:compile 
[INFO] | \- org.slf4j:slf4j-api:jar:1.7.25:compile 
[INFO] +- javax.jms:javax.jms-api:jar:2.0:compile 
[INFO] +- com.ibm.mq:mqallclient:jar:8.0:compile 
[INFO] +- org.springframework:spring-jms:jar:4.3.0.RELEASE:compile 
[INFO] | +- org.springframework:spring-aop:jar:4.3.8.RELEASE:compile 
[INFO] | +- org.springframework:spring-beans:jar:4.3.8.RELEASE:compile 
[INFO] | +- org.springframework:spring-context:jar:4.3.8.RELEASE:compile 
[INFO] | +- org.springframework:spring-messaging:jar:4.3.8.RELEASE:compile 
[INFO] | \- org.springframework:spring-tx:jar:4.3.8.RELEASE:compile 
[INFO] +- org.apache.commons:commons-lang3:jar:3.0:compile 
[INFO] +- commons-io:commons-io:jar:2.5:compile 
[INFO] +- commons-configuration:commons-configuration:jar:1.6:compile 
[INFO] | +- commons-lang:commons-lang:jar:2.4:compile 
[INFO] | +- commons-logging:commons-logging:jar:1.1.1:compile 
[INFO] | \- commons-digester:commons-digester:jar:2.1:compile 
[INFO] |  \- commons-beanutils:commons-beanutils:jar:1.9.3:compile 
[INFO] +- org.mockito:mockito-all:jar:1.10.19:test 
[INFO] +- org.powermock:powermock-api-mockito:jar:1.7.0:test 
[INFO] | \- org.powermock:powermock-api-mockito-common:jar:1.7.0:test 
[INFO] |  \- org.powermock:powermock-api-support:jar:1.7.0:test 
[INFO] +- org.powermock:powermock-module-junit4:jar:1.7.0:test 
[INFO] | \- org.powermock:powermock-module-junit4-common:jar:1.7.0:test 
[INFO] |  +- org.powermock:powermock-reflect:jar:1.7.0:test 
[INFO] |  \- org.powermock:powermock-core:jar:1.7.0:test 
[INFO] |  \- org.javassist:javassist:jar:3.21.0-GA:test 
[INFO] \- junit:junit:jar:4.12:test 
+0

あなたのjvm/jdkバージョンに言及してください。 – Thomas

+0

それは1.8です、私はこの問題の根本的な原因を見つけました、私の答えをご覧ください。ありがとうThomas。 –

答えて

0

私は、spring-data-redisモジュールがSpringブート1.5.3バージョンでは動作していないことがわかりました。だから、私が春のバージョンを1.5.6にアップグレードすると、問題は解決されます。

関連する問題