Showing posts with label hybris server. Show all posts
Showing posts with label hybris server. Show all posts

Monday, 9 May 2016

How to start Hybris server in debug mode

Generally a developer requires the server to be started in debug mode so that the code can be debugged easily. Follow the below steps.


Step 1: Add the below line in local.properties files

tomcat.debugjavaoptions=-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,address=8001,suspend=n -Xverify:none -DforceANSI=true

Step 2: Open command prompt. Go to platform directory. Start hybris server in debug mode using command hybrisserver.bat debug

Step 3: In eclipse go to debug configurations as shown below


















Step 4: Go to remote java application and right click and new. Give any name to it. Make sure hostname is localhost and the port number is same what is mentioned in local.properties file.

In the source tab, you can add all the projects which you want the debug to be worked on.













































Click on debug and happy debugging. In future just start the hybris server in debug mode as mentioned in step 3 and launch your debugger from eclipse.

Creating a web module in Hybris

A web module in hybris is referenced as extension. We have multiple templates in hybris which we can choose as base to create our new extension.

Step 1: Create a new extension using hybris extension command ant extgen. Select the template as yempty

give extension name as "extensiontest" and package as "com.test". Refer screens below











Step 2:Once step 1 is done, the below screen will be appeared with a message of build successful




















Step 4: Once build is done.Go to directory C:\hybristest\hybris\bin\custom and you will find folder with name of your extension.

















Step 5: Make entry of the new extension in localextensions.xml. Can be found at C:\hybristest\hybris\config\localextensions.xml

Step 6: Run ant clean all. Once build is successful add the new extension to your workspace using import.

Step 7: Start hybris server using hybrisserver.bat

Step 8: Open hybris admin console using admin and nimda as username and password(http://localhost:9001/) and under extensions tab you can see the newly created extension, which validates that the new extension is created successfully.

Here is the general structure of an extension we see in eclipse