Friday 11 January 2019

How to debug Hybris project in eclipse


As a developer its very important to debug the code.

Hybris project has 500 extensions approximately. The code complexity is more and you can’t understand without debugging knowledge.

In this post, I will help you to debug the Hybris project, Follow below steps


Step 1:- Start the server in debug mode like this   /hybrisserver.bat debug


Step 2:- Make sure this line of description shown in the console.


Step 3:- Put Some debug points like this, Here blue dot we call as debug points



Step 4:- Just right click on the class and select the option debugconfigurations.


Step 5:- Select Remotejavaapplication and give the port number that is shown in the console and click on debug. Then debug process starts,


Step 6:- If you get this error log in the middle just click on ok and Debug button in eclipse toolbar.





Step 7:- Once the debug process done you will see this popup and click on proceed.






Step 8:- Goto the site and give request.




Step 9:- You will see the green mark like this,




Step 10:- In the following image you can see the debugging option. F5 (to get into the code), F6 (goto next line), F7(return to the previous line), F8 (goto next debug point).





Step 11:- To check the data at the particular line just select that line and click  ctrl+shift+i.




Step 12:- We can also change the attribute values at runtime.




I hope you will get the process and keep debugging the code become good developer.

How to stop initialization in Hybris

In this blog post, I am going to explain how can we stop others to do initialization from HAC.

In real time projects if a developer did initialization means all the developed code will be lost to prevent this situation we need to lock the initialization process.

In the following steps, I guide you to stop the initialization process.

Step 1:- Add the below properties in local.properties file.
                 system.unlocking.disabled=true

Step 2:-  Do ant build & start the server.



Step 3:-  Login to HAC and check Platform/Initialization


 Note:-  We can also do this from HAC without restarting the server.
    * Goto Platform/Configuration and search for this property and make it true.