SpringMVC整合极光推送报错ClassNotFound

问题:

  今天在做后台和极光整合的过程中,将极光部分代码整合到Dao层,在启动项目的过程中总是报错,classNotFund cn/jpush/api/push/xxxx

 

极光官方文档:

  http://docs.jiguang.cn/jpush/server/3rd/java_sdk/

 

解决:

  在整合的过程中按照极光官网,在pom文件中已经加入极光的dependency。同时加入依赖gson。在项目中看到已经有了sl4f和log4f的jar包于是就没有考虑加入这两个(在pom文件中没有对应的dependency)。经过一下午的的调试发现原来是没有加入这两个的依赖。加入依赖后,重新install。项目正常。完整的极光推送pom:

    <dependency>
        <groupId>cn.jpush.api</groupId>
        <artifactId>jpush-client</artifactId>
        <version>3.2.9</version>
    </dependency>

    <dependency>
        <groupId>com.google.code.gson</groupId>
        <artifactId>gson</artifactId>
        <version>2.2.4</version>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>1.7.5</version>
    </dependency>

    <!-- For log4j -->
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>
        <version>1.7.5</version>
    </dependency>
    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.16</version>
    </dependency>

 

  

 

posted @ 2016-10-14 17:20  0xcafedaddy  阅读(627)  评论(0编辑  收藏  举报