gravitee.io can not debug policy in intellij - intellij-idea

I am using intellij CE and trying to debug the gravitee.io policy locally. I am struggling from several days with no avail. I am C# developer and very novice to intellij. If someone can help me nail down the issue of my debugging, I will truly appreciate it. Here is my setup:
I have cloned 1.30.x branch of gateway and management-api in following respective directories:
C:\Work\Java\gravitee.io\git\gravitee-gateway-1.30.x
C:\Work\Java\gravitee.io\git\gravitee-management-rest-api-1.30.x
I also downloaded gravitee.io 1.30.1 binaries and placed it in the following respective directories:
C:\Work\Java\gravitee.io\1.30.1\graviteeio-gateway-1.30.1
C:\Work\Java\gravitee.io\1.30.1\graviteeio-management-api-1.30.1
As per guide, I need to run the standalone container for both gateway and management-api in debug mode.
So here is my debug configuration for both gateway and management-api
Gateway
Management-api
These both are working fine in debug mode.
Now I created a maven policy and in pom.xml, I use maven-resources-plugin to copy compiled policy into following directories:
C:\Work\Java\gravitee.io\1.30.1\graviteeio-gateway-1.30.1\plugins
C:\Work\Java\gravitee.io\1.30.1\graviteeio-management-api-1.30.1\plugins
I would like to debug this policy and hit my breakpoints. Can someone please guide me setting this up?
Without debugging, development of any project is just not possible whether it be C# or Java.
It will not automatically hit my breakpoints I believe.. In .Net world, we have a concept of debug symbols.. I am sure something similar will be available in Java to find m code and hit breakpoint. I still don't understand once I deploy my plugin (zip file) to the respective plugins directory in gateway and management-api, there is no magical thing which will let it find my code and hit the breakpoint.
I am sure I am missing something on either my policy project OR gateway and management-api debug configuration that can help gateway and management-api find my code.
I also would like to mention that policy is loaded just fine in both gateway and management-api since I already see logs in gateway console coming out of my policy.
Any help is truly appreciated. As I mentioned, I am very novice to intellij and Java world but not to programming.
Thanks

Related

how to setup kafka connect in intellij IDE

I am trying to setup kafka connect in Intellij IDE so that I can understand how it works especially the way it loads the jar files in the plugin path and how it calls the methods present in the jar so that I can develop solutions on top of that. I have searched for docs but I am not able find any good guide that explains on this. please help me by providing any information available for the same.
You would clone Kafka source code
Then you can set breakpoints in the connect module, and attach a remote debugger to a running Connect JVM
What is a simple, effective way to debug custom Kafka connectors?

how to setup the environment to debug the Restcomm-smsc source code

can you please describe me how to setup a development environment with intellij IDEA for restcomm-smsc to debug run compile build and doing breakpoints etc.
i am using ubuntu 14.04.
i could run the smsc gateway from the binary package and do the simulator tests but when it comes to do some coding and debugging and building stuff, i cannot creat e the correct development environment for restcomm-smsc source code.
i really appreciate if you can guide me simply how to do it?
Thanks a lot
BR
Gokhan
Do you want to debug application deployed on JBoss? If so you need to simply add/uncomment JAVA_OPTS="$JAVA_OPTS -agentlib:jdwp=transport=dt_socket,address=$DEBUG_PORT,server=y,suspend=n" in run.sh/standalone.sh.
In intellij Run -> Edit Configurations -> Remote and provide jboss IP and port from JAVA_OPTS.

How to debug Liferay portlet using IntelliJ idea?

I deploy my application using Maven on Liferay 7 (on Tomcat 8). But I need to debug it. How to configure my debug? Because, when I start maven with debug mode, it builds and stops. I have no ideas how to deal with it
Maven with debug mode is only targeted to debug maven build processes. If you want to debug your portlet you should follow the next steps:
Run Menu Entry > Edit Configurations > Add New Remote Configuration > Configure your host and debug port
You have to check too that JPDA port is enabled your Tomcat (you can enable it in your startup.sh/startup.bat script adding jpda in the final line)
exec "$PRGDIR"/"$EXECUTABLE" jpda start "$#"
Quick generic answer (someone with actual IntelliJ experience can probably give more details):
You start tomcat, that has Liferay deployed. Follow the advice you have for "how to debug tomcat applications". The caveat is that you might need to point IntelliJ to the source files for some (all) of the modules in Liferay - which is a huge task (being composed out of 500 modules. For eclipse I'm aware of a fix, for IntelliJ I'm not aware. I'm pretty sure such a beast exists though.
It will be easier (e.g. quick) if you only need your own modules' source.

How to configure GWT configuration to start up Drools Workbench in Intellij IDEA

I have downloaded drools-wb-6.4.x and kie-wb-common-6.4.x at github, after compiles with maven, I import the two as modules into an empty project. However, the README.MD provided by official that tells how to configure seems out-of-date I dont know how to correctly configure GWT configuration to start up this project, can anyone help me?
If you want to run GWT app from Idea, you will have to use so called GWT Super Dev Mode.
How to get GWT Super Dev Mode to work with IntelliJ

How is Tomcat handled by IntelliJ IDEA 10.5

I am a newbie to IntelliJ IDEA. I was trying to deploy a web app in Tomcat.
It failed to deploy and i was not able to see any errors in the log console.
After much searching, I was able to find out the log files at
~/Library/Caches/IntelliJIdea10/tomcat/_p1/logs/ folder.
There were a bunch of log files here and one of the files contained the error. I then could solve the issue and proceed.
I was a user of eclipse and this error would have come directly in the log console in eclipse. However this is not the case in IntelliJ IDEA. Can somebody please explain what I am missing here?
Also, it would be nice if somebody could point out how the integration with Tomcat is done in IDEA (for better understanding). Note: I am using IntelliJ IDEA 10.5.2 Ultimate edition on Mac OS 10.6.8.
IntelliJ IDEA instructs Tomcat to use temporary directory as CATALINA_BASE where it places context configuration with the Artifact path from your project settings, it doesn't copy your web application into webapps directory.
In the Tomcat Run/Debug configuration there is Logs tab where you can specify custom logs to show in IDEA console, it should work out of the box, but probably you have customized logging in Tomcat configuration or in the application itself. Or maybe Tomcat 7 logging configuration is different and doesn't work with IDEA in which case you should submit a bug.
Here's some info for Windows users....if you check the boxes for 'Show console when stdout/stderr change', you may find that the Output tab does not show up even if stdout/stderr change.
For me, this was due to directory structure for the project containing spaces.
When I renamed the directory structure so that it did not contain spaces the Output tab showed up.
Found solution here: Cannot deploy project to tomcat inside intellij IDEA 14. Applications Context was incorrect.
Run/Debug Configurations -> Deployment tab -> Applications Context