ChannelApe / shopify-sdk

Java SDK for Shopify REST APIs
Apache License 2.0
166 stars 112 forks source link

java.lang.NullPointerException: null #112

Open chengliangdev opened 1 year ago

chengliangdev commented 1 year ago

java.lang.NullPointerException: null at org.glassfish.hk2.utilities.ServiceLocatorUtilities.addClasses(ServiceLocatorUtilities.java:412) ~[hk2-api-3.0.4.jar:na] at org.glassfish.hk2.utilities.ServiceLocatorUtilities.enablePerThreadScope(ServiceLocatorUtilities.java:84) ~[hk2-api-3.0.4.jar:na] at org.glassfish.jersey.inject.hk2.AbstractHk2InjectionManager.createLocator(AbstractHk2InjectionManager.java:92) ~[jersey-hk2-2.30.1.jar:na] at org.glassfish.jersey.inject.hk2.AbstractHk2InjectionManager.(AbstractHk2InjectionManager.java:62) ~[jersey-hk2-2.30.1.jar:na] at org.glassfish.jersey.inject.hk2.ImmediateHk2InjectionManager.(ImmediateHk2InjectionManager.java:38) ~[jersey-hk2-2.30.1.jar:na] at org.glassfish.jersey.inject.hk2.Hk2InjectionManagerFactory$Hk2InjectionManagerStrategy$1.createInjectionManager(Hk2InjectionManagerFactory.java:55) ~[jersey-hk2-2.30.1.jar:na] at org.glassfish.jersey.inject.hk2.Hk2InjectionManagerFactory.create(Hk2InjectionManagerFactory.java:73) ~[jersey-hk2-2.30.1.jar:na] at org.glassfish.jersey.internal.inject.InjectionManagerFactory.create(InjectionManagerFactory.java:32) ~[jersey-common-2.30.1.jar:na] at org.glassfish.jersey.internal.inject.Injections.createInjectionManager(Injections.java:44) ~[jersey-common-2.30.1.jar:na] at org.glassfish.jersey.client.ClientConfig$State.initRuntime(ClientConfig.java:412) ~[jersey-client-2.30.1.jar:na] at org.glassfish.jersey.internal.util.collection.Values$LazyValueImpl.get(Values.java:317) ~[jersey-common-2.30.1.jar:na] at org.glassfish.jersey.client.ClientConfig.getRuntime(ClientConfig.java:807) ~[jersey-client-2.30.1.jar:na] at org.glassfish.jersey.client.ClientRequest.getClientRuntime(ClientRequest.java:219) ~[jersey-client-2.30.1.jar:na] at org.glassfish.jersey.client.ClientRequest.getInjectionManager(ClientRequest.java:610) ~[jersey-client-2.30.1.jar:na] at org.glassfish.jersey.client.JerseyWebTarget.onBuilder(JerseyWebTarget.java:364) ~[jersey-client-2.30.1.jar:na] at org.glassfish.jersey.client.JerseyWebTarget.request(JerseyWebTarget.java:199) ~[jersey-client-2.30.1.jar:na] at org.glassfish.jersey.client.JerseyWebTarget.request(JerseyWebTarget.java:36) ~[jersey-client-2.30.1.jar:na] at com.shopify.ShopifySdk.lambda$get$4(ShopifySdk.java:1015) ~[shopify-sdk-2.8.0.jar:na] at com.github.rholder.retry.AttemptTimeLimiters$NoAttemptTimeLimit.call(AttemptTimeLimiters.java:78) ~[guava-retrying-2.0.0.jar:na] at com.github.rholder.retry.Retryer.call(Retryer.java:160) ~[guava-retrying-2.0.0.jar:na] at com.shopify.ShopifySdk.invokeResponseCallable(ShopifySdk.java:1068) ~[shopify-sdk-2.8.0.jar:na] at com.shopify.ShopifySdk.get(ShopifySdk.java:1017) ~[shopify-sdk-2.8.0.jar:na] at com.shopify.ShopifySdk.getShop(ShopifySdk.java:548) ~[shopify-sdk-2.8.0.jar:na] at com.shopify.ShopifySdk.getWebTarget(ShopifySdk.java:1153) ~[shopify-sdk-2.8.0.jar:na] at com.shopify.ShopifySdk.getCustomers(ShopifySdk.java:823) ~[shopify-sdk-2.8.0.jar:na] at com.cc.cmd.AppTest.testGetCustomer(AppTest.java:84) ~[test-classes/:na] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na] at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59) ~[junit-4.13.2.jar:4.13.2] at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) ~[junit-4.13.2.jar:4.13.2] at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56) ~[junit-4.13.2.jar:4.13.2] at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) ~[junit-4.13.2.jar:4.13.2] at org.springframework.test.context.junit4.statements.RunBeforeTestExecutionCallbacks.evaluate(RunBeforeTestExecutionCallbacks.java:74) ~[spring-test-5.2.15.RELEASE.jar:5.2.15.RELEASE] at org.springframework.test.context.junit4.statements.RunAfterTestExecutionCallbacks.evaluate(RunAfterTestExecutionCallbacks.java:84) ~[spring-test-5.2.15.RELEASE.jar:5.2.15.RELEASE] at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75) ~[spring-test-5.2.15.RELEASE.jar:5.2.15.RELEASE] at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86) ~[spring-test-5.2.15.RELEASE.jar:5.2.15.RELEASE] at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84) ~[spring-test-5.2.15.RELEASE.jar:5.2.15.RELEASE] at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366) ~[junit-4.13.2.jar:4.13.2] at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:251) ~[spring-test-5.2.15.RELEASE.jar:5.2.15.RELEASE] at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:97) ~[spring-test-5.2.15.RELEASE.jar:5.2.15.RELEASE] at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331) ~[junit-4.13.2.jar:4.13.2] at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79) ~[junit-4.13.2.jar:4.13.2] at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329) ~[junit-4.13.2.jar:4.13.2] at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66) ~[junit-4.13.2.jar:4.13.2] at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293) ~[junit-4.13.2.jar:4.13.2] at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) ~[spring-test-5.2.15.RELEASE.jar:5.2.15.RELEASE] at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70) ~[spring-test-5.2.15.RELEASE.jar:5.2.15.RELEASE] at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306) ~[junit-4.13.2.jar:4.13.2] at org.junit.runners.ParentRunner.run(ParentRunner.java:413) ~[junit-4.13.2.jar:4.13.2] at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:190) ~[spring-test-5.2.15.RELEASE.jar:5.2.15.RELEASE] at org.junit.runner.JUnitCore.run(JUnitCore.java:137) ~[junit-4.13.2.jar:4.13.2] at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69) ~[junit-rt.jar:na] at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38) ~[junit-rt.jar:na] at com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11) ~[idea_rt.jar:na] at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35) ~[junit-rt.jar:na] at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:235) ~[junit-rt.jar:na] at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:54) ~[junit-rt.jar:na]

chengliangdev commented 1 year ago

JDK11 and 2.8.0 version

chengliangdev commented 1 year ago

final ShopifySdk shopifySdk = ShopifySdk.newBuilder() .withSubdomain(shopifyShop.getMyshopify_domain()) .withAccessToken(shopifyShop.getAccess_token()) .withApiVersion(shopifyConfig.getApi_version()) .build();

    ShopifyGetCustomersRequest request     = ShopifyGetCustomersRequest.newBuilder().build();
    ShopifyPage<ShopifyCustomer> customers = shopifySdk.getCustomers(request);
ryankazokas commented 1 year ago

@chengliangcc I haven't seen this particular thing happen but similar things i've seen like this have to do with spring 5 dependencies and older jersey dependencies we are using here. Sorry i don't have an immediate answer for you but hopefully this can give you a starting point. I can look at getting this into a more modern jersey framework that is cross compatible with these versions of spring.