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

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.

Related

gravitee.io can not debug policy in intellij

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

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.

Jacoco Code coverage in IntelliJ for Remote Run/Debug Configuration

We're using IntelliJ version 14 and are trying to add Jacoco code coverage to our remote Java application project. This is defined under the "Remote" option in the Edit Run/Debug Configuration.
Is there any way to activate Code Coverage for Remote app? There is no "Coverage" tab.
This is not a standard app with a main method.
Thanks
Enabling code coverage requires adding a JVM agent that instruments bytecode to collect coverage information. When you use the Remote configuration, the JVM is not started by IntelliJ IDEA, and therefore there is no way to enable code coverage through the IntelliJ IDEA UI.
You can enable the coverage manually by modifying the VM options used to start your remote process and adding the coverage agent.

debugging project without eclipse debugger

I am using maven project in eclipse mars . My Project is not building in the eclipse so i am compiling my project through dos mode. I not being able to debug the code.so somebody please help me to solve issue
You can debug a tomcat server even if you don't run it inside Eclipse, using remote debug.
Please take a look at Remote debugging Tomcat with Eclipse or this blog for Intellij / this one for Eclipse
The idea is to start your tomcat server in debug mode then connecting your debugger to the "remote" (even if on your local PC) JVM (The JVM of the server).

Running/Debugging ServiceMix application with Intellij IDEA

I have been trying to find some documention on whether it's possible to run ServiceMix with IntelliJ for running/debugging purposes?
Does anyone know how to do this/point me to some kind of guide?
Thanks.
I'm debugging servicemix app with remtoe debugging.
Run server with "debug" parameter ($SERVICEMIX_HOME/bin/servicemix debug) and connect to it with Remote Run/Debug configuration in Idea.
Servicemix starts debug on default 5005 port so simply change the SM server host name in Idea configuration.