March 29, 2020
Estimated Post Reading Time ~

Debugging and Vault Configuration in IntelliJ Idea and Eclipse in AEM

Being a developer, I always believe to use the automated things in place of manual, because I am a strong believer of smart work, but not hard work.

Today in this blog we will discuss some of the ways that saves us to do the following work manually.

Debug java code using the debugger
Sync Data (The data sync between CRX and File System)

In AEM Development, People mostly use two IDE's for development intellijIdea and Eclipse. So in this blog, I am going to cover the above points using both IDE’s.

Debugging JAVA Code in AEM
We need a write a big java code to support backend. How cool is that if we could debug each and every line at any point and find out what is happening.To put loggers can be a lengthy process.

So how to debug java code....
1. Start your aem jar in debug mode.
java -jar cq-author-4502.jar -fork -forkargs -- -Xdebug -Xrunjdwp:transport=dt_socket,address=59865,suspend=n,server=y -Xmx1520m -XX:MaxPermSize=512m -XX:-UseSplitVerifier

Note: In place of “cq-author-4502.jar” you need to put your jar name.
In IntellijIdea,

1. Go to Run-> Edit Configurations.
2. Click on “+” and choose Remote.

Fig : Choose Remote from the Edit Cofiguration

3. Add Name(Optional) and Port defined as socket address in command.You can change the socket address at both places if you want to.

Fig : Debug Configurations in IntellijIdea

That’s all you need to configure.

Now to start debugging , Go to Run-> Debug-> Choose your configuration. This will start your IDE in debug mode. Now put breakpoints and debug the code.

In Eclipse
Go to Run->Debug Configurations->Remote Java Application

Fig : Debug Configurations in Eclipse

Configure the above options and click on apply.

VLT Plugin to Sync data with CRX
Configure IntelliVault: The IntellijIdea Plugin
IntelliVault is not by default available in IntellijIdea. It is a plugin you need to install in your IDE.
1. Go to File->Settings-> Plugins.
2. Search for IntelliVault. Click on search in repositories.
3. Now install the plugin in IDE.and restart IntellijIdea.

Fig : Install IntelliVault Plugin


Fig : Configure IntelliVault


Fig : Pull/Push data from/to CRX using IntelliVault
This is how, you can push/pull data from/to CRX.

Note: Sometimes syncing doesn’t work even after these configurations. I noticed this issue in windows. So, to resolve this issue:
1. Go to intellijidea icon, right click and choose properties.
2. In the Start In, copy your intellijidea path :C:\Program Files\JetBrains\IntelliJ IDEA 2017.1.4\bin.(Copy yours)

Fig: Configuration in IntellijIdea Properties

3. Click on apply and then ok.
4. Now you will be able to use Vault plugin successfully.

Configure VaultClipse: The Eclipse Plugin
If we directly go and install VaultClipse plugin, our vault plugin won't work because vault plugin require eclipse 2.0 UI style plugin update to display in eclipse UI.

How to install eclipse 2.0 UI style plugin:
1. Go to help->Install new Software
2. In the work with drop down select “http://download.eclipse.org/eclipse/updates/4.5”.


Fig : Install Eclipse 2.0 UI Style Plugin
3. Now go to Eclipse Tests,tools,Examples and Extras and choose Eclipse 2.0 Style Plugin Support.
4. Install this software and restart the eclipse to see the changes.

Install VaultClipse Plugin
1. Go to Help-> Eclipse MarketPlace and Search for VaultClipse plugin.

Fig : Install VaultClipse Plugin

2. Install VaultClipse software and restart the eclipse to see the changes.

To configure the VaultClipse, Go to

a. Go to Window-> Preferences
b. Choose VaultClipse and Configure the Vault plugin
c. Configure Vault Plugin Configurations and now you can import and export content.

Note: In eclipse, I am trying to configure vaultClipse, but when I try to configure vault Configurations, it is giving me this error.

Fig : Error while configuring the VaultClipse


By aem4beginner

No comments:

Post a Comment

If you have any doubts or questions, please let us know.