Support Topics Documentation Slack YouTube Blog

New service works fine in debug mode bu throws error when deployed

Backendless Version (3.x / 5.x, Online / Managed / Pro )

v6.1.7, Online

Client SDK (REST / Android / Objective-C / Swift / JS )

Java

Application ID

B78A830E-7A03-838E-FF36-46CF57DEF200

Expected Behavior

Created a new service in Java for QR code generation (“QRgen”). Service takes in a string, and dimensions (pixels) of the desired output. It has 2 methods. One of them returns a bytestream and another returns a png file and creates an entry in table qr_code.

Please describe the expected behavior of the issue, starting from the first action.

  1. I downloaded the java SDK and I built the class(“QRgen”) offline using intellij IDEA.
  2. I ran CodeRunner.sh to test it in debug mode. Both methods worked fine.
  3. I ran Deploy.sh and the service was seen on Backendless as a Deployed Service.
  4. I invoked the deployed service in curl. Was expecting to see the same results as in debug mode.

Actual Behavior

When running the service QRgen in deployed mode, I see the following error when either of the 2 methods is invoked:

  • 400 - Type:“java.lang.NoClassDefFoundError”, Description:“Could not initialize class java.util.zip.Deflater”, ExceptionClass:“ServiceException” {Msg:“none”, Cause:“none”}

Reproducible Test Case

Go to the app’s Business Services. Click on QRgen. Select either of the 2 POST methods. Pass these parameters and invoke.

{
“data”: “abcde”,
“width”: 200,
“height”: 200
}

Could you please zip up your project, upload the zip to the Backendless files storage and send us the link for it? You can email the link to support@backendless.com.

Regards,
Mark

https://backendlessappcontent.com/B78A830E-7A03-838E-FF36-46CF57DEF200/console/tavmscnpdfuakbqtdkyeadbickuxnglibqcf/files/view/intrceptX__JAVA_default_coding%20(1).zip

That link will not work, it is a link that works only for you. To get a public link, click the link icon for the file.

https://backendlessappcontent.com/B78A830E-7A03-838E-FF36-46CF57DEF200/BC28F1C3-6611-4633-A83C-59324EDC8B1D/files/intrceptX__JAVA_default_coding.zip

And this is thr recipe I followed.

1 Like

Where did you put your code?
image

Hi there, any update on this issue. Planning to go live next week.

Hello @Sanjay_Iyer

Unfortunately, there is no code in the archive to deploy. Could you send us an archive to help reproduce the problem?

Regards,
Inna

It is under src/com/intrceptx/models.

I had responded to this request long ago, by email. Guess I will have to come to this page to respond? Lesson learnt :slight_smile:

@Sanjay_Iyer

I apologize for the current situation. I downloaded the archive from the link that you attached in this topic and the “models” folder is empty.
https://monosnap.com/direct/P59UrkPthJ4kXmtREdipOjakWlTZ5S

Could you please try this?

https://backendlessappcontent.com/B78A830E-7A03-838E-FF36-46CF57DEF200/BC28F1C3-6611-4633-A83C-59324EDC8B1D/files/intrceptX__JAVA_default_coding+(1)+2.zip

@Sanjay_Iyer

We were able to reproduce your problem.
The internal ticket BKNDLSS-23321 is created, we will let you know about solution.

Regards,
Inna

Hello @Sanjay_Iyer

We made a fix.
Please check if it works for you.
Please write about the result.

It worked. Thanks a lot.