有赞新零售社区

发帖
API使用问题»我使用有赞的sdk,在本地跑好好的,在服务器上跑就这样了

我使用有赞的sdk,在本地跑好好的,在服务器上跑就这样了

康鹏小凡 2018-12-23 1406 浏览 4 评论 | 只看楼主 [打印]
一样的配置,请问有高手遇到过吗?

java.lang.NoClassDefFoundError: com/youzan/open/sdk/client/auth/Auth
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Class.java:2615)
        at java.lang.Class.getDeclaredMethods(Class.java:1860)
        at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:612)
        at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:524)
        at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:510)
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.determineCandidateConstructors(AutowiredAnnotationBeanPostProcessor.java:241)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineConstructorsFromBeanPostProcessors(AbstractAutowireCapableBeanFactory.java:1069)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1042)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772)
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:839)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:538)
        at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:444)
        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:326)
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5068)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5584)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
        at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1259)
        at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1998)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: com.youzan.open.sdk.client.auth.Auth
        at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1858)
        at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1701)
        ... 34 more

用手机打开
收藏 ··· 回复
    小余 青铜   2018-12-23 | 只看该作者
    很着急啊。求关注的技术人员回到。我使用的都是jdk7.

      小余 青铜   2018-12-23 | 只看该作者
         public YouzanCrmCustomerPointsIncreaseResult youzanCrmCustomerPointsIncrease(String mobile , Long points){
              YZClient client = new DefaultYZClient(new Token(token)); //new Sign(appKey, appSecret)
              YouzanCrmCustomerPointsIncreaseParams youzanCrmCustomerPointsIncreaseParams = new YouzanCrmCustomerPointsIncreaseParams();

              youzanCrmCustomerPointsIncreaseParams.setMobile(mobile);
              youzanCrmCustomerPointsIncreaseParams.setPoints(points);
              YouzanCrmCustomerPointsIncrease youzanCrmCustomerPointsIncrease = new YouzanCrmCustomerPointsIncrease();
              youzanCrmCustomerPointsIncrease.setAPIParams(youzanCrmCustomerPointsIncreaseParams);
              YouzanCrmCustomerPointsIncreaseResult result = client.invoke(youzanCrmCustomerPointsIncrease);
              return result;
          }
      这是我的代码。

        用的sdk是什么版本,另外请求参数+请求时间提供一下

          康鹏小凡 发表于 2018-12-22 18:44
          public YouzanCrmCustomerPointsIncreaseResult youzanCrmCustomerPointsIncrease(String mobile , Long ...


          另外可能是服务器上的启动脚本有问题,覆盖了原来的classpath环境变量,建议检查下启动脚本。

            1跳至
            您需要登录后才可以回帖 登录 | 立即注册

            本版积分规则

            复制链接
            新浪微博
            QQ空间
            微信扫码
            • 回复

            • 评分

            客服工作时间是9:00-18:00,客服妹子当前不在线,若不能及时回复请谅解。试试右上角的搜索吧,论坛有丰富的经验贴、公告贴,相信一定能够帮到您~

            复制成功