Question

I have trying to use remote debugging for Java applets. I m using Java 7 update 51 and when i try to load the applets this is displyed in the java console and then it is struck.

network: Connecting http://domain.com/useradmin3.gif with proxy=DIRECT
network: Connecting http://domain.com/ with proxy=DIRECT
preloader: Stop progressCheck thread

I have passed the following as runtime parameters in the Javacpl: "-Djava.compiler=NONE -Xnoagent -Xdebug -Xrunjdwp:transport=dt_socket,address=8007,server=y,suspend=n"

Était-ce utile?

La solution 2

I did figure out the casue for this issue. I have a page which contains multiple applets. And i have set the Java params for remote debugging. Whenever i load the page, it loads two JVMs for the page which i am not sure why. So for the first JVM it uses the port no. mentioned for listening. But for the second JVM, the same port no. is supposed to be used as the Java params are defined globally. So the second JVM gets hangs while waiting for the port to get free.

I did come up with a workaround for this problem and let me know if anyone need it.

Autres conseils

Biscuit maybe you are missing some compiler flags (like "lines,vars,source") to allow remote debugging.

For example, is you are using Ant you need to add this lines to your javac:

<!-- Javac lines, vars, source compiler flags -->
<javac srcdir="..." destdir="..." classpathref="..." debug="true" debuglevel="lines,vars,source" />

Then in your execution script you jave to add:

<!-- debug configurations: modify the port you want-->
<jvmarg value="-Xdebug"/>
<jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=4060"/>

On the other hand, if you are using Maven same flags can be added in the , like this:

<build>
  <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-compiler-plugin</artifactId>
      <version>2.0.2</version>
      <configuration>
        <!-- Necessary in order for the debug levels to be considered-->
        <debug>true</debug>
        <debugLevel>lines,vars,source</debugLevel>
      </configuration>
    </plugin>
  </plugins>
</build>

In case of using Jetty, same as before... you need to have the following variable:

export MAVEN_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=4000,server=y,suspend=n"

On the other hand, what you can check is setting the suspend flag to "yes", it is "suspend=y". This won't start your app unless you connect a debugger to your port.

Here you can check specific info about jboss:

http://webdev.apl.jhu.edu/~jcs/ejava-javaee/coursedocs/605-784-site/docs/content/html/devenv-jboss-setup.html#enable-jboss-debug

And always check stoping your firewall. In case of iptables, you can execute the following command:

service iptables stop

Oh, an another thing you can try is checking if your port is currently used by another process:

In windows:
netstat -nab

Linux:
netstat -nap

Hope to help.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top