Cannot debug JBoss 6.3.0(7.4.0), get NullPointerException

Hello.

I've tried for a long time to remote-debug my local JBoss that's running in standalone mode. The http-port is 10103, the management port is 9990 and the debug port in intellij is set to 8787. I've double checked this in the standalone-full.xml.
I've done this several times before with other JBoss without any trouble so I'm starting to think I might be missing something obvious.

When starting the JBoss I get this with debugging enabled:
JAVA_OPTS:  -server -XX:+UseCompressedOops -Xms2000m -Xmx2000m -XX:MaxPermSize=512m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true -Djboss.modules.policy-permissions=true -agentlib:jdwp=transport=dt_socket,address=8787,suspend=n,server=y

When I try to connect to it, after a while I get the following error in IntelliJ:
Error running JBoss 6.3.0
Error Connecting to JBoss Server.
Exception occurred : java.lang.NullPointerException
Exception message : null

The funny thing is that it works without any issues from Eclipse, so I'm fairly certain it's not a connectivity issue, but rather something wrong with IntelliJ.

Here are my debug settings:
Selection_004.png
Selection_005.png
standalone-full.xml:
Selection_006.png

Does anyone know what the issue is, is it IntelliJ, JBoss or just me?

2 comments
Comment actions Permalink

I had the same NPE problem on remote debuging JBoss 4.2.3GA from IntelliJ IDEA 2017.3.3.

Here is the excerpt from idea.log:

2017-12-26 18:52:32,762 [614537584] ERROR - oteAgentReflectiveProxyFactory - null
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.remoteServer.agent.impl.RemoteAgentReflectiveProxyFactory$ReflectiveInvocationHandler.invoke(RemoteAgentReflectiveProxyFactory.java:89)
at com.sun.proxy.$Proxy306.connect(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.remoteServer.agent.impl.ThreadInvocationHandler.a(ThreadInvocationHandler.java:56)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at com.intellij.util.concurrency.BoundedTaskExecutor$2.run(BoundedTaskExecutor.java:212)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoClassDefFoundError: org/jnp/interfaces/NamingContextFactory
at com.intellij.javaee.oss.jboss.agent.JBossAgent.getInitialContext(JBossAgent.java:81)
at com.intellij.javaee.oss.jboss.agent.JBossAgent.doConnect(JBossAgent.java:35)
at com.intellij.javaee.oss.agent.SimpleAgentBase$1.doJob(SimpleAgentBase.java:17)
at com.intellij.javaee.oss.agent.SimpleAgentBase$1.doJob(SimpleAgentBase.java:13)
at com.intellij.javaee.oss.agent.SimpleAgentJob.perform(SimpleAgentJob.java:12)
at com.intellij.javaee.oss.agent.SimpleAgentBase.connect(SimpleAgentBase.java:25)
... 16 more
Caused by: java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 22 more
2017-12-26 18:52:32,762 [614537584] ERROR - oteAgentReflectiveProxyFactory - IntelliJ IDEA 2017.3.1 Build #IU-173.3942.27
2017-12-26 18:52:32,762 [614537584] ERROR - oteAgentReflectiveProxyFactory - JDK: 1.8.0_152-release
2017-12-26 18:52:32,762 [614537584] ERROR - oteAgentReflectiveProxyFactory - VM: OpenJDK 64-Bit Server VM
2017-12-26 18:52:32,763 [614537585] ERROR - oteAgentReflectiveProxyFactory - Vendor: JetBrains s.r.o
2017-12-26 18:52:32,763 [614537585] ERROR - oteAgentReflectiveProxyFactory - OS: Windows 7
2017-12-26 18:52:32,763 [614537585] ERROR - oteAgentReflectiveProxyFactory - Last Action: Rerun
2017-12-26 18:52:32,763 [614537585] ERROR - t.impl.ThreadInvocationHandler - null
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.remoteServer.agent.impl.ThreadInvocationHandler.a(ThreadInvocationHandler.java:56)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at com.intellij.util.concurrency.BoundedTaskExecutor$2.run(BoundedTaskExecutor.java:212)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
at com.sun.proxy.$Proxy306.connect(Unknown Source)
... 10 more

This hinted that org.jnp.interfaces.NamingContextFactory is missing.

The problem was resolved after adding jboss\client\jnp-client.jar to Application server libraries in IDEA's Debug configuration.

0

Please sign in to leave a comment.