Business Logic event handlers show up for Production but not Debug

My Business Logic is working, and I followed the video tutorial on YouTube. However they don’t show up for Debug; is this going to cause an issue? Why is there a debug and production tab anyway? What’s the difference?http://support.backendless.com/public/attachments/33530c8fc99cb19660a1cf97960a50c1.png</img>
However, under debug they are not there:
http://support.backendless.com/public/attachments/51d1f61f24c51670734b54fac57584c6.png</img>

The debug tab is used to show event handlers and timers when you run CodeRunner locally (that is in the debug mode).

If you do not run CodeRunner locally, the Debug tab will be empty.

When you deploy code using the Deploy utility, it will show up in the Production tab - that means the code will run on our server, thus is in production.

Ok, so I’ve added a remote configuration to run it locally:

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

But my breakpoints are never hit when I login, register, or update a User. Do I have to this via CURL (like in the YouTube tutorial?), or should I expect the breakpoints to be hit even if I execute any of the handler-triggers from my iPhone simulator?

(Sorry for so all my questions; I’m just getting familiar with Backendless since I’m coming from Parse; really liking it so far and appreciative of the awesome support).

You created a configuration, but you need to start “debugging” it. Once you’re debugging the code, all breakpoints will get a little checkmark right inside of the red circle.

http://support.backendless.com/public/attachments/b52ab56766239b0bcc13a58308c9ab31.jpg</img>

I get the following message when I try to enter debug mode:
http://support.backendless.com/public/attachments/8171522f49533d060da394b43f5f0ea3.png</img>

Here is how I have my configuration set-up:
http://support.backendless.com/public/attachments/f8967aa7feca3479c6e8c0c192d4321c.png</img>

8171522f49533d060da394b43f5f0ea3.png

That means code runner is not running locally… Have you started it with CodeRunner.sh?

Ah, running that has allowed me to connect:
http://support.backendless.com/public/attachments/bbbc6638b0ffc51566c2ef72f14ae1a6.png</img>

However, my breakpoints are not getting hit. For example, I put a breakpoint in beforeLogin:
http://support.backendless.com/public/attachments/3b9caa5e81b9411a795388c21e3f7440.png</img>
But when I login with a user, it is not hit.

bbbc6638b0ffc51566c2ef72f14ae1a6.png

Your project is still not properly connected to the running code. A breakpoint must be on a line of executable code. If there is no breakpoint, what will the program be breaking on? )))

Once again you are correct! I assumed it would break within the scope of the method (like how Xcode debugging works). Thanks again for such quick and helpful responses!

Hey, so actually I’m able to trigger breakpoints for my User class (such as when a user logs in the breakpoint hits).

However they aren’t breaking for my custom classes:
http://support.backendless.com/public/attachments/05eaab017800f1e7fd5b6408a5562cf7.png</img>

When I create those objects either from my simulator or the data console, they don’t hit.

Edit:

Jus noticed I get this from Xcode console when having deployed a beforeCreate for that class:
http://support.backendless.com/public/attachments/5ca21dbe3f8b5948d4d028bab32deee2.png</img>

and this message if having deployed an afterCreate:
http://support.backendless.com/public/attachments/cb4e9e3f4a2c9d31d805b36f08b3075d.png</img>

So for some reason, implementing the beforeCreate or afterCreate and deploying it is causing an error for the creation of that custom class.

cb4e9e3f4a2c9d31d805b36f08b3075d.png

Add the following code in Bootstrap.java right after initApp:

Backendless.Persistence.mapTableToClass( “Friendship”, Friendship.class );

Repeat that for every table you create a handler for.

thanks, I coincidentally just found that here and was going to post that its working now:

http://support.backendless.com/t/correct-usage-of-beforecreate-event-handler-in-data-api

I have one last quick question about this process of debugging Business Logic: where can I find my logs? For example, if I want to System.out.println() or Log.d() something to the console:

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

I’m using Android Studio, and do not see the LogCat anywhere. Thanks again

Custom business logic runs in CodeRunner which is a standard command prompt Java application. It is not an android app, therefore LogCat logs are not applicable. The System.out.println output should be visible in stdout which is the output of the CodeRunner process.

I see now that it is indeed logging out to my command prompt where I am running CodeRunner. Fantastic.

I am really loving the depth of Business Logic with Backendless; especially coming from a previous BaaS where there were barely any debugging tools! Thanks again