Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Account SDK throws exception - despite successful execution #148

Open
r1jsheth opened this issue Jul 29, 2022 · 10 comments
Open

Create Account SDK throws exception - despite successful execution #148

r1jsheth opened this issue Jul 29, 2022 · 10 comments

Comments

@r1jsheth
Copy link

r1jsheth commented Jul 29, 2022

I am facing issue in
currencyCloudClient.createAccount(account)
It is throwing exception (exception attached below) and despite on the demo account it creates a sub account.
I am using this file src/test/java/com/currencycloud/examples/CurrencyCloudCookbook.java

And added these few lines of code.

Code

Account account = client.createAccount(new Account(
    "Coockbook",
    "company",
    "BLR",
    "BLR",
    "560068",
    "IN"
    )
);

Exception

Exception in thread "main" ---
exception_type: "UnexpectedException"
platform: "Java 18.0.1.1 (Oracle Corporation)"
request: null
inner_error: "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 @307f6b8c"

	at com.currencycloud.client.ExceptionTransformer.aroundInvoke(ExceptionTransformer.java:23)
	at si.mazi.rescu.InterceptedInvocationHandler.invoke(InterceptedInvocationHandler.java:42)
	at com.currencycloud.client.Reauthenticator.aroundInvoke(Reauthenticator.java:23)
	at si.mazi.rescu.InterceptedInvocationHandler.invoke(InterceptedInvocationHandler.java:42)
	at jdk.proxy2/jdk.proxy2.$Proxy4.createAccount(Unknown Source)
	at com.currencycloud.client.CurrencyCloudClient.createAccount(CurrencyCloudClient.java:157)
	at com.currencycloud.examples.CurrencyCloudCookbook.runCookBook(CurrencyCloudCookbook.java:51)
	at com.currencycloud.examples.CurrencyCloudCookbook.main(CurrencyCloudCookbook.java:30)

Screenshot of account created from the dashboard

Screenshot 2022-07-29 at 1 22 10 PM

@gergelykovacs
Copy link
Contributor

Hi @r1jsheth ,

Thank you for the interest in improving the SDK.
We have recorded your report and will look into it as soon as possible and update you.

@r1jsheth
Copy link
Author

r1jsheth commented Aug 10, 2022

Moreover, I tried with JDK 17 - the same issue persists.
@gergelykovacs

Screenshot 2022-08-10 at 2 21 30 PM

@sivasquared
Copy link

We are running into the same exact issue described above.

@sivasquared
Copy link

sivasquared commented Aug 15, 2022

Looks like failures were allowed for jdk17 (which we are using) amongst others from this commit
https://github.com/CurrencyCloud/currencycloud-java/pull/143/files#diff-6ac3f79fc25d95cd1e3d51da53a4b21b939437392578a35ae8cd6d5366ca5485R27

@jonathancouchman
Copy link
Contributor

Prior to this commit we were not testing with JDK 17, this commit added the test, but also allowed for the tests to fail since we had not comprehensively tested with JDK 17.

We are currently investigating the JDK 17 issues to add full support for this version

@sivasquared
Copy link

Thanks for investing @jonathancouchman.

Do you have an estimate for when JDK 17 will be fully supported? We're going through a build at the moment and would like to understand how this timeline would affect it.

@jonathancouchman
Copy link
Contributor

It seems the issue is with one of the dependencies, https://github.com/cglib/cglib, that does not support JDK 17 and is no longer in active development.

We will need to implement an alternative solution to resolve the issue. As a short term work around you can set the following JVM argument at runtime (if that is possible for you)

--add-opens java.base/java.lang=ALL-UNNAMED

We will update the ticket once we have found a suitable solution

@sivasquared
Copy link

Thanks for the suggestion Jonathan, that did the trick to unblock us 🎉

@Tsvetalin-Yordanov
Copy link

Hi , as I also have the same problem I would like to ask if you have another solution or for the time being the fix remains with adding the
--add-opens java.base/java.lang=ALL-UNNAMED

@hudson155
Copy link

image Should this project move to ByteBuddy?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants