3

I am running a Tridion based (DXA) JAVA web application in IntelliJ. The Run/Debug configuration is based on the standard Local Tomcat server settings.

When I stop the debugging session and start again to try again I get this error in the IntelliJ Event Log

2:12:06 PM All files are up-to-date
2:12:09 PM Error running Tomcat local 8080: Address localhost:1099 is already in use
2:12:12 PM Error running Tomcat local 8080: Unable to open debugger port (127.0.0.1:59985): java.net.SocketException "socket closed"

This only occurs when the ObjectCache with RemoteSynchronization is enabled in the CD storage config (cd_storage_conf.xml) of the webapp.

<Configuration Version="7.1">
    <Global>
        <ObjectCache Enabled="true">
            <Policy Type="LRU" Class="com.tridion.cache.LRUPolicy">
                <Param Name="MemSize" Value="16mb"/>
            </Policy>
            <Features>
                <Feature Type="DependencyTracker" Class="com.tridion.cache.DependencyTracker"/>
            </Features>
            <RemoteSynchronization Queuesize="512">
                <Connector Class="com.tridion.cache.JMSCacheChannelConnector" Topic="Tridion" Strategy="AsyncJMS11">
                    <JndiContext>

I see that there are multiple JAVA process running after the debug session is stopped. After I kill them the debug session starts normal without errors.

Is it normal that processes keep running after a debug session? How can I stop the right processes?

3

You have to ensure that you only make and deploy the project once, else two processes will get started, while port 1099 is started in deployment 1, but your debugging session actually happens on deployment 2.

If you use maven, you only need to set the following line in your Make configuration:

enter image description here

If you don't use Maven, then choose to either only Make the project, or to only choose to Build the Artifact.

| improve this answer | |
2

Like Raimond said: only build once. The problem was a bug in the Run/Debug Configuration in IntelliJ. I did both Make and Build webapp artifact. Without the fist make step it works fine.

enter image description here

It turns out that that confuses IntelliJ, in this case I only need a Build webapp artifact.

| improve this answer | |
0

It does not sound right, but as a workaround I use this script to kill Java processes which come from IntelliJ. This does not kill the IntelliJ IDE itself.

$processes = Get-WmiObject Win32_Process -Filter "name = 'java.exe'"

foreach($proc in $processes)
{
    if($proc.CommandLine.Contains("IntelliJ"))
    {
        Write-Host "stopping proccess $($proc.ProcessId) with $($proc.ThreadCount) threads; $($proc.CommandLine.Substring(0, 50))..."
        Stop-Process -F $proc.ProcessId
    } else
    {
        Write-Host "skipping proccess $($proc.ProcessId) with $($proc.ThreadCount) threads; $($proc.CommandLine.Substring(0, 50))..."
    }
}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.