commercetools / commercetools-paypal-plus-integration

Integration between commercetools API and PayPal Plus API
Apache License 2.0
7 stars 1 forks source link

I am getting error on javax.validation.valid #210

Open amolbotre769 opened 2 years ago

amolbotre769 commented 2 years ago

image can anyone help me resolve the issue I share it in screenshot. I try to run using command ./gradlew bootRun

lojzatran commented 2 years ago

Hi @amolbotre769 please paste here the whole output from terminal. It might be that the error is not in your screenshot. Thank you.

lojzatran commented 2 years ago

For me I was able to successfully run the app using following command from terminal:

SPRING_APPLICATION_JSON='{"tenantConfig":{"tenants":{"your-commercetools-project":{"ctp":{"projectKey":"your-commercetools-project","clientId":"commercetoolsClientId","clientSecret":"commercetoolsClientSecret"},"paypalPlus":{"id":"paypalPlusId","secret":"paypalPlusSecret","mode":"sandbox"}}}},"ctp.paypal.plus.integration.server.url":"https://my-deployed-paypal-plus-serviceurl.de"}' ./gradlew bootRun

As you see, you need to provide the configuration as env var with name SPRING_APPLICATION_JSON.

amolbotre769 commented 2 years ago

java.lang.IllegalStateException: Cannot load configuration class: com.commercetools.Application at org.springframework.context.annotation.ConfigurationClassPostProcessor.enhanceConfigurationClasses(ConfigurationClassPostProcessor.java:403) ~[spring-co ntext-4.3.13.RELEASE.jar:4.3.13.RELEASE] at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanFactory(ConfigurationClassPostProcessor.java:249) ~[spring-context -4.3.13.RELEASE.jar:4.3.13.RELEASE] at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:283) ~[spri ng-context-4.3.13.RELEASE.jar:4.3.13.RELEASE] at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:127) ~[spri ng-context-4.3.13.RELEASE.jar:4.3.13.RELEASE] at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:687) ~[spring-context-4.3 .13.RELEASE.jar:4.3.13.RELEASE] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:525) ~[spring-context-4.3.13.RELEASE.jar:4.3.13.R ELEASE] at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) ~[spring-boot-1.5.9.RELEASE.jar: 1.5.9.RELEASE] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693) ~[spring-boot-1.5.9.RELEASE.jar:1.5.9.RELEASE] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360) ~[spring-boot-1.5.9.RELEASE.jar:1.5.9.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:303) ~[spring-boot-1.5.9.RELEASE.jar:1.5.9.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118) ~[spring-boot-1.5.9.RELEASE.jar:1.5.9.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107) ~[spring-boot-1.5.9.RELEASE.jar:1.5.9.RELEASE] at com.commercetools.Application.main(Application.java:19) ~[main/:na] Caused by: java.lang.ExceptionInInitializerError: null at org.springframework.context.annotation.ConfigurationClassEnhancer.newEnhancer(ConfigurationClassEnhancer.java:122) ~[spring-context-4.3.13.RELEASE.jar:4 .3.13.RELEASE] at org.springframework.context.annotation.ConfigurationClassEnhancer.enhance(ConfigurationClassEnhancer.java:110) ~[spring-context-4.3.13.RELEASE.jar:4.3.1 3.RELEASE] at org.springframework.context.annotation.ConfigurationClassPostProcessor.enhanceConfigurationClasses(ConfigurationClassPostProcessor.java:393) ~[spring-co ntext-4.3.13.RELEASE.jar:4.3.13.RELEASE] ... 12 common frames omitted Caused by: org.springframework.cglib.core.CodeGenerationException: java.lang.reflect.InaccessibleObjectException-->Unable to make protected final java.lang.Class j ava.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base doe s not "opens java.lang" to unnamed module @5bcea91b at org.springframework.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:464) ~[spring-core-4.3.13.RELEASE.jar:4.3.13.RELEASE] at org.springframework.cglib.core.AbstractClassGenerator.generate(AbstractClassGenerator.java:336) ~[spring-core-4.3.13.RELEASE.jar:4.3.13.RELEASE]
at org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData$3.apply(AbstractClassGenerator.java:93) ~[spring-core-4.3.13.RELEASE.jar:4.3.13.RE LEASE] at org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData$3.apply(AbstractClassGenerator.java:91) ~[spring-core-4.3.13.RELEASE.jar:4.3.13.RE LEASE] at org.springframework.cglib.core.internal.LoadingCache$2.call(LoadingCache.java:54) ~[spring-core-4.3.13.RELEASE.jar:4.3.13.RELEASE] at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[na:na] at org.springframework.cglib.core.internal.LoadingCache.createEntry(LoadingCache.java:61) ~[spring-core-4.3.13.RELEASE.jar:4.3.13.RELEASE] at org.springframework.cglib.core.internal.LoadingCache.get(LoadingCache.java:34) ~[spring-core-4.3.13.RELEASE.jar:4.3.13.RELEASE] at org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData.get(AbstractClassGenerator.java:116) ~[spring-core-4.3.13.RELEASE.jar:4.3.13.RELEA SE] at org.springframework.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:291) ~[spring-core-4.3.13.RELEASE.jar:4.3.13.RELEASE] at org.springframework.cglib.core.KeyFactory$Generator.create(KeyFactory.java:221) ~[spring-core-4.3.13.RELEASE.jar:4.3.13.RELEASE] at org.springframework.cglib.core.KeyFactory.create(KeyFactory.java:174) ~[spring-core-4.3.13.RELEASE.jar:4.3.13.RELEASE] at org.springframework.cglib.core.KeyFactory.create(KeyFactory.java:153) ~[spring-core-4.3.13.RELEASE.jar:4.3.13.RELEASE] at org.springframework.cglib.proxy.Enhancer.(Enhancer.java:73) ~[spring-core-4.3.13.RELEASE.jar:4.3.13.RELEASE] ... 15 common frames omitted Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[], int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @5bcea91b
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354) ~[na:na] at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297) ~[na:na] at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:200) ~[na:na] at java.base/java.lang.reflect.Method.setAccessible(Method.java:194) ~[na:na] at org.springframework.cglib.core.ReflectUtils$1.run(ReflectUtils.java:61) ~[spring-core-4.3.13.RELEASE.jar:4.3.13.RELEASE] at java.base/java.security.AccessController.doPrivileged(AccessController.java:569) ~[na:na] at org.springframework.cglib.core.ReflectUtils.(ReflectUtils.java:52) ~[spring-core-4.3.13.RELEASE.jar:4.3.13.RELEASE] at org.springframework.cglib.core.KeyFactory$Generator.generateClass(KeyFactory.java:243) ~[spring-core-4.3.13.RELEASE.jar:4.3.13.RELEASE] at org.springframework.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25) ~[spring-core-4.3.13.RELEASE.jar:4.3.13.RELEASE]
at org.springframework.cglib.core.AbstractClassGenerator.generate(AbstractClassGenerator.java:329) ~[spring-core-4.3.13.RELEASE.jar:4.3.13.RELEASE]
... 27 common frames omitted

2022-09-06 15:59:01.890 INFO 1584 --- [ main] ationConfigEmbeddedWebApplicationContext : Closing org.springframework.boot.context.embedded.AnnotationCon figEmbeddedWebApplicationContext@2cf3d63b: startup date [Tue Sep 06 15:59:00 IST 2022]; root of context hierarchy

Task :bootRun FAILED

FAILURE: Build failed with an exception.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.3/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 7s 4 actionable tasks: 2 executed, 2 up-to-date PS C:\Users\amol.botre\IdeaProjects\commercetools-paypal-plus-integration>

amolbotre769 commented 2 years ago

image

amolbotre769 commented 2 years ago

Hi @lojzatran can you please know me what is the problem to run the application I shared the screenshot as well all errors please check

lojzatran commented 2 years ago

Hi @amolbotre769 from your logs and the previous screen share it looks like the project was not correctly built. Did your build pass successfully when running ./gradlew build -x test -x testIntegration?

amolbotre769 commented 2 years ago

Hi @lojzatran build pass successfully image

lojzatran commented 2 years ago

For me I was able to successfully run the app using following command from terminal:

SPRING_APPLICATION_JSON='{"tenantConfig":{"tenants":{"your-commercetools-project":{"ctp":{"projectKey":"your-commercetools-project","clientId":"commercetoolsClientId","clientSecret":"commercetoolsClientSecret"},"paypalPlus":{"id":"paypalPlusId","secret":"paypalPlusSecret","mode":"sandbox"}}}},"ctp.paypal.plus.integration.server.url":"https://my-deployed-paypal-plus-serviceurl.de"}' ./gradlew bootRun

As you see, you need to provide the configuration as env var with name SPRING_APPLICATION_JSON.

@amolbotre769 can you try to run with the config as JSON as I posted here?

amolbotre769 commented 2 years ago

Hi @lojzatran , I get like this image

lojzatran commented 2 years ago

Hi @amolbotre769 it's probably because you are running Windows and the command line is different. You have to check how to pass env var to a command in Windows. I have only Mac OS.

amolbotre769 commented 2 years ago

Hi @lojzatran I pass env var but I got this error. Can you please help me. Screenshot (26)

lojzatran commented 2 years ago

Hi @amolbotre769

it seems like you have a problem with your java distribution. I cannot help you here in Github issue case as this is a problem on your laptop and not related to this repo. Please create an official support ticket so that we can help in other ways as well: https://jira.commercetools.com/servicedesk/customer/portal/1

amolbotre769 commented 2 years ago

Hi @lojzatran I created a ticket for it on link you shared.