美文网首页
elastic-job错误

elastic-job错误

作者: 菜菜8602 | 来源:发表于2018-10-17 12:07 被阅读0次

    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.dangdang.ddframe.job.lite.spring.api.SpringJobScheduler#0': Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: com.google.gson.stream.JsonWriter.jsonValue(Ljava/lang/String;)Lcom/google/gson/stream/JsonWriter;

            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1708)

            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:581)

            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:503)

            at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317)

            at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)

            at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315)

            at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)

            at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:760)

            at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:869)

            at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550)

            at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:144)

            at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:95)

            at com.zhuyun.cbs.util.Main.main(Main.java:39)

    Caused by: java.lang.NoSuchMethodError: com.google.gson.stream.JsonWriter.jsonValue(Ljava/lang/String;)Lcom/google/gson/stream/JsonWriter;

            at com.dangdang.ddframe.job.util.json.AbstractJobConfigurationGsonTypeAdapter.write(AbstractJobConfigurationGsonTypeAdapter.java:183)

            at com.dangdang.ddframe.job.util.json.AbstractJobConfigurationGsonTypeAdapter.write(AbstractJobConfigurationGsonTypeAdapter.java:46)

            at com.google.gson.Gson.toJson(Gson.java:593)

            at com.google.gson.Gson.toJson(Gson.java:572)

            at com.google.gson.Gson.toJson(Gson.java:527)

            at com.google.gson.Gson.toJson(Gson.java:507)

            at com.dangdang.ddframe.job.lite.internal.config.LiteJobConfigurationGsonFactory.toJson(LiteJobConfigurationGsonFactory.java:59)

            at com.dangdang.ddframe.job.lite.internal.config.ConfigurationService.persist(ConfigurationService.java:72)

            at com.dangdang.ddframe.job.lite.internal.schedule.SchedulerFacade.updateJobConfiguration(SchedulerFacade.java:103)

            at com.dangdang.ddframe.job.lite.api.JobScheduler.init(JobScheduler.java:105)

            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

            at java.lang.reflect.Method.invoke(Method.java:498)

            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1833)

            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1776)

            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1704)

            ... 12 common frames omitted

    解决方法:

    <!-- zookeeper -->

    <dependency>

        <groupId>org.apache.zookeeper</groupId>

        <artifactId>zookeeper</artifactId>

        <version>3.4.12</version>

    </dependency>

    <dependency>

        <groupId>org.apache.curator</groupId>

        <artifactId>curator-recipes</artifactId>

        <version>2.12.0</version>

    </dependency>

    <dependency>

        <groupId>org.apache.curator</groupId>

        <artifactId>curator-client</artifactId>

        <version>2.12.0</version>

    </dependency>

    <!-- gson -->

    <dependency>

        <groupId>com.google.code.gson</groupId>

        <artifactId>gson</artifactId>

        <version>2.6.2</version>

    </dependency>

    相关文章

      网友评论

          本文标题:elastic-job错误

          本文链接:https://www.haomeiwen.com/subject/dkglzftx.html