Backendless 4.0 Cloud - Delete request returns 14002 (Service method not found)

I have created a Java BL function that gets translated into a delete request when deployed to production. When I invoke the function, both from the backendless console and via REST (with Postman) I get the following error:

400 - Service method not found (14002)

All of my other (previously created) functions (that are GET/POST) seem to be working just fine. Deploying via jar upload also displays the same error.

I tried running ./Coderunner.sh to get into debug mode to see what could be happening, but the functions don’t even show up in the backendless console for me to invoke when coderunner is running in my terminal (only Deployed Services are shown).

Is there something up with 4.0 BL?

Renato

Hi Renato,

I created the most basic Java service with a delete method:

package com.consoledemo.services;


import com.backendless.servercode.IBackendlessService;


public class TestService implements IBackendlessService
{
  public boolean deleteFoo( int id )
  {
    return true;
  }
}

When I run it in the debug mode, it shows up like this in console:
http://support.backendless.com/public/attachments/7f1b81da285ff9c7db4d55377629f1c6.jpg</img>

Running a cURL invoke also works fine:
http://support.backendless.com/public/attachments/9e223083827d42ee8dd8e4c9f3af95ff.jpg</img>

The only issue I noticed is this:
If you deploy the service to the Backendless servers (and it does show up in console just fine for me), but after that, you run the service in the debug mode, then the console does not show the service in debug. I logged an internal issue for this scenario.

Regards,
Mark

Could you please share the signature of your delete method?

Hi Mark,

That must be the issue I am seeing - My delete function was first deployed to production, but will then not show up when in debug. Thanks for verifying that bug - I will wait for a resolution on that.

As for the delete function, the method signature is very similar to yours:

public Boolean delete(BackendlessUser _u){
    ...
    return true; //for simplicity
}

Which translates to a DELETE request at / like so:
http://support.backendless.com/public/attachments/fed209660eaeb37d4964373400fc44e6.png</img>

I have also tried changing the method name to “deleteUser”, which would translate to DELETE /User in the console, but the same issue arises.

I also created a “testDelete” function with a simple int param which gets interpreted as a regular POST, and it seems to be doing the same. It’s as if this is not limited to just DELETE methods, rather any new methods I create.

http://support.backendless.com/public/attachments/a0f8aba35e582e04729fc9cdf197ae86.png</img>

Renato

Renato,

A temporary workaround is to delete the deployed service in console and the re-deploy it with CodeRunner. In this case it will get “updated”.

Mark

Hi Mark,

Just tried that - deleted the service in console, and attempted a re-deploy with coderunner. Now the service doesn’t even show under “DEPLOYED SERVICES” in the console, despite there being no errors when running the deploy script.

When I try to upload a jar to see if that will work, it shows “service not found” at first, then disappears entirely after a page refresh.

http://support.backendless.com/public/attachments/1f69c42002e35a293a72e146ef414d9f.png</img>

Renato

What happens when you click the refresh icon?http://support.backendless.com/public/attachments/9258f5c012bdf5542664789057dda8d5.jpg</img>

Nothing - It spins for barely a fraction of a second and nothing seems to refresh or update.

Could you please zip up your project, upload to Google drive or Dropbox and email the link to support@backendless.com ?

Should be in the support inbox now. Thanks Mark!

Thanks, Renato. The project indicated another problem - there are 4 services in the project. 3 of them are already published. When you run CodeRunner in the debug mode and all 4 services go into debug, they do not show up as such in console. I will add this problem to the internal ticket.

Thanks for looking into this, Mark!

Hi Mark, is there any update on this?
I can verify that I am now able to see the services when deployed in debug mode, but using Deploy.sh for production still does not correctly (re)publish that service that I was advised to delete as a workaround.

Renato

Hi Renato,

I just verified that all services in the project become available in the debug mode, even when they are already published to the server. On top of this when I deploy updated service code to the server, it also gets properly updated.

If you experience a problem, could you please provide step-by-step instructions for duplicating the error?

Regards,
Mark

Hi Mark,

I have tried to do a deploy to production two ways:

A.

    Compile the project I execute ./Deploy.sh in terminal from the /bin folder, JAVA_HOME is set

    No errors are displayed, hits “successfully published all event handlers and timers”
    Check backendless console, fourth service that I expect to see re-deployed in the console is still missing, even after clicking the “Refresh service list” button and doing a full page reload

B.
    Compile project This time, execute ./Coderunner.sh (also with JAVA_HOME set) execute "publish" command No errors are displayed, hits "successfully published all event handlers and timers" Same result; service is not re-populated in console
Extra Context:
    This is after I originally had all 4 services published Deleted one service On next deploy, it is expected that the fourth service would re-appear after successful push, but only 3 are shown

Hi Mark, this issue seems to still persist. Is there any update with the extra context I provided?

In addition, it also seems that any logic changes to my cloud code project and any new services do not get pushed into production with both processes as noted above (I also ensured my bin folder was up to date from backendless console code gen). The services (and changes) still show up / work fine when testing in debug.

Hello Renato

I’ve used your project in my application and went through all 3 scenarios you’ve described. And in all of the cases 4 services are successfully deployed. Do you mind if I test it with your app?

Regards Anton

Hi Anton - Absolutely!
Thanks

Hi Renato!

Please check your API services screen. Seems that all services are successfully deployed

Regards Anton

Hi Anton,

Thank you for looking into this - I do now see in console that you were able to publish all services.
I am however still unable to get this working - Any changes I make to the project are not reflected when deploying to production. I also tested this by creating a brand new test service in my project, which also is not published to prod when using the deploy script.

Similar to before, one of the methods you were able to “successfully” publish still returns a 400 error on invocation:

400 - ExceptionClass:"ClassNotFoundException" 

Are there still issues surrounding this process, or am I somehow missing something? My process to deploy code hasn’t changed from what was previously done on 3.x.

Renato