Aspose-cad-cloud for Java breaks the project

Hi there,

So I am trying to use the cloud SDK for the CAD API because I need a service that allows me to convert svg to dxf on demand, and our usage leads us to the cloud version. Following your advice, I switched from imaging-cloud to cad-cloud and I could make a minimal example work back in December, but the exact same code now makes Maven fail the build.

FYI I’m using Java 21 on my project and the pom.xml has been updated according to this page (I also found compliant information on this page).

The error I get when I try to run my server is the following:
image.png (366 KB)

I don’t mind switching back to imaging-cloud if necessary, but its svg to dxf conversion was broken few month ago, and my production server needs a service that is reliable over time.

Thanks for your inputs.

@Ancotech

The Aspose.CAD Cloud SDK for Java 20.11 is working fine with Java 21 and both Junit 4.13.1 and 4.12 at my end. If you faced an error after updating the Junit version to 4.13.1 then please revert the version to 4.12 and share the results?

Hi,

First of all thank you for your quick answer. So our project is using SpringBoot v. 3.2.4, which has JUnit v. 4.13.2 as a dependency. (so a bit higher than your environment). We tried on other devices to ensure that it was not an environment issue and came across the exact same error:
image.jpg (132.0 KB)

Also the error suggests that it could come from Jackson (which we need very much). Any chance you would have encountered some concurrency issue with that dependency?

Waiting for your input, and updating the post if anything new comes up.

@Ancotech

Thanks for sharing the additional information. I added the Maven dependency of Spring Boot v3.2.4 to my project, but I am afraid I am still unable to reproduce the issue. We will appreciate it if you please share a minimal project to reproduce the issue at our end.

Alright, I will try to investigate on my side and to provide a minimal project as soon as I can take care of that. Most likely this week.

1 Like

I have been investigating and I have a few more elements. The minimal project is coming soon.

So our server run properly with the dependency aspose-cad-cloud added to the pom.xml (which I can’t find on mvnrepository.com btw). But it fails with the already known jackson error as soon as I include a com.aspose import in the code. After that the project won’t run anymore even if I delete the dependency and rollback the code back to before implementing your API.

Also I tried many ways of including jaxb-api in my pom.xml, according to every single person online that had this issue, but none worked.

I don’t know if this information can help but it doesn’t hurt to share it.

@Ancotech

Please note that we host our Maven release on releases.aspose.cloud. Please find Aspose.CAD Cloud For Java SDK on following link.

https://releases.aspose.cloud/java/repo/com/aspose/aspose-cad-cloud/

We are looking forward to your sample project. It will help us to investigate and address your issue exactly.

1 Like

Alright,

So I made a new empty project and came across yet another error:
image.png (157.3 KB)

I double-checked the app ID and secret I use and they are matching with the online dashboard.

Also, I found another documentation page that is suggesting a different URL for the profile in the pom.xml: Aspose.CAD Cloud | Process/Convert AutoCAD Formats Java REST

Here is the documentation I based my implementation on: GitHub - aspose-cad-cloud/aspose-cad-cloud-java

I tried both without any success.

Do you have a single source of truth that I can refer to?

Still working on reproducing the original error, I will keep you in touch here.

Hello !

So the initial problem was finally solved using a solution that was online: add the jaxb-api dependency.

The problem is that I was not doing it right. So long story short, here is the dependency to add to the pom.xml:

<dependency>
	<groupId>javax.xml.bind</groupId>
	<artifactId>jaxb-api</artifactId>
	<version>2.3.1</version>
</dependency>

And before the maven clean install, it is mandatory to RELOAD ALL MAVEN PROJECTS. That will force maven to update all dependencies specified in the pom file.

So it appears in the end that your API was not responsible for this one. Sorry for the inconvenience.

Only this error left (and this one is presumably on your side):

com.aspose.cad.cloud.invoker.ApiException: {“error”:“invalid_client”}

Thank you very much for your time and investment so far.

1 Like

@Ancotech,
Hi.
So could you please attach the test project, so we can see and check “invalid_client” error?

Here you go, but I think it might be related to my credentials. They seems fine on the ASPOSE Dashboard though.

@Ancotech,
thank you, let us check it and come back.

1 Like

@Ancotech,
Hi.
We updated our Aspose.CAD Cloud SDK for Java, so recent version is 24.1.
Please also check that in this line

CadApi cadApi = new CadApi(APP_KEY, APP_SECRET);

SECRET key should be before APP key. Could you please try on your side if this is helpful.

1 Like

I have been fooled by the CadApi constructor’s signature.
Everything works as expected now (with some unexpected extra lines in the result dxf, but this is another problem).

Thank you very much for your time and help, and I hope that your documentation will become more unified and accessible in the future.

Best regards.

1 Like

@Ancotech,
happy to hear that project works now. Please accept our apologies for the lack of documentation.