Discussion:
[Resin-interest] Remote debugging Resin 3.1
Mattias Jiderhamn
2008-04-18 14:10:28 UTC
Permalink
I'm just in the process of upgrading my dev envorinment to Resin 3.1.
With Resin 3.0 I could attach my IDE debugger to Resin if started with
-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005
With Resin 3.1, I would then attach to the watchdog process.
Is there an easy way to tell the watchdog to start Resin with a debugger
port, or do I need different config files with different <jvm-args> for
debug/no debug?

Thanks.

/Mattias
Andrew Fritz
2008-04-18 14:37:55 UTC
Permalink
I am using remote debugging (and profiling also) with IntelliJ. I assume
it is tool agnostic. Here are the relevant JVM args from my server.conf
file:

<jvm-args>-Xdebug</jvm-args>
<jvm-args>-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=9080</jvm-args>

Don't specify the same port on the watchdog start or things will fail
since both instances of the JVM will try to use the same port. I just
have a production and a dev conf file. That also lets me deal with
things like our production machines having 16Gb of ram and my laptop
only having 2Gb of ram.

For a previous problem others suggested defining a variable in the
startup comment:

java -Ddev=true -jar lib/resin.jar ...

and then use that define in the config files. I suppose you could do
that for this as well.

Andrew
Post by Mattias Jiderhamn
I'm just in the process of upgrading my dev envorinment to Resin 3.1.
With Resin 3.0 I could attach my IDE debugger to Resin if started with
-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005
With Resin 3.1, I would then attach to the watchdog process.
Is there an easy way to tell the watchdog to start Resin with a debugger
port, or do I need different config files with different <jvm-args> for
debug/no debug?
Thanks.
/Mattias
_______________________________________________
resin-interest mailing list
resin-interest at caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Andrew.vcf
Type: text/x-vcard
Size: 122 bytes
Desc: not available
Url : http://maillist.caucho.com/pipermail/resin-interest/attachments/20080418/e0e16fc0/attachment.vcf
Mattias Jiderhamn
2008-04-22 07:13:22 UTC
Permalink
Post by Andrew Fritz
I am using remote debugging (and profiling also) with IntelliJ. I
assume it is tool agnostic. Here are the relevant JVM args from my
<jvm-args>-Xdebug</jvm-args>
<jvm-args>-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=9080</jvm-args>
... I just have a production and a dev conf file. That also lets me
deal with things like our production machines having 16Gb of ram and
my laptop only having 2Gb of ram.
For a previous problem others suggested defining a variable in the
java -Ddev=true -jar lib/resin.jar ...
and then use that define in the config files. I suppose you could do
that for this as well.
Right! That is a good tip.
However, <jvm-arg> tags inside a <resin:if> causes the exception below.
Seems really strange to me!

....server-root\conf\resin.conf:57: 'jvm-arg' is an unknown property of
'com.caucho.server.cluster.Server'.

55: <jvm-arg>-Xdebug</jvm-arg>
56: <resin:if test="${system['debug']}">
57: <jvm-arg>-Xmn256M</jvm-arg>

at com.caucho.config.ConfigContext.error(ConfigContext.java:1115)
at
com.caucho.config.ConfigContext.configureChildNode(ConfigContext.java:443)
at
com.caucho.config.ConfigContext.configureAttribute(ConfigContext.java:322)
at
com.caucho.config.program.NodeBuilderChildProgram.inject(NodeBuilderChildProgram.java:55)
at
com.caucho.config.program.ContainerProgram.inject(ContainerProgram.java:80)
at com.caucho.config.program.ConfigProgram.configure(ConfigProgram.java:60)
at com.caucho.config.core.ResinIf.init(ResinIf.java:71)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
com.caucho.config.j2ee.PostConstructProgram.inject(PostConstructProgram.java:60)
at com.caucho.config.type.BeanType.init(BeanType.java:226)
at
com.caucho.config.ConfigContext.configureChildNode(ConfigContext.java:505)
at
com.caucho.config.ConfigContext.configureAttribute(ConfigContext.java:322)
at
com.caucho.config.program.NodeBuilderChildProgram.inject(NodeBuilderChildProgram.java:55)
at
com.caucho.config.program.ContainerProgram.inject(ContainerProgram.java:80)
at com.caucho.config.program.ConfigProgram.configure(ConfigProgram.java:60)
at com.caucho.server.cluster.Server.<init>(Server.java:199)
at com.caucho.server.cluster.Cluster.startServer(Cluster.java:706)
at
com.caucho.server.cluster.ClusterServer.startServer(ClusterServer.java:528)
at com.caucho.server.resin.Resin.start(Resin.java:695)
at com.caucho.server.resin.Resin.initMain(Resin.java:1139)
at com.caucho.server.resin.Resin.main(Resin.java:1341)
Post by Andrew Fritz
Post by Mattias Jiderhamn
I'm just in the process of upgrading my dev envorinment to Resin 3.1.
With Resin 3.0 I could attach my IDE debugger to Resin if started
with -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005
With Resin 3.1, I would then attach to the watchdog process.
Is there an easy way to tell the watchdog to start Resin with a
debugger port, or do I need different config files with different
<jvm-args> for debug/no debug?
Thanks.
/Mattias
Scott Ferguson
2008-04-22 17:42:14 UTC
Permalink
Post by Mattias Jiderhamn
Right! That is a good tip.
However, <jvm-arg> tags inside a <resin:if> causes the exception below.
Seems really strange to me!
....server-root\conf\resin.conf:57: 'jvm-arg' is an unknown property of
'com.caucho.server.cluster.Server'.
55: <jvm-arg>-Xdebug</jvm-arg>
56: <resin:if test="${system['debug']}">
57: <jvm-arg>-Xmn256M</jvm-arg>
Thanks. I've just added this as http://bugs.caucho.com/view.php?
id=2617. The boot arguments are a little trickier to handle, because
they're ignored by Resin and read by the watchdog, so there's an extra
space for bugs.

-- Scott
Post by Mattias Jiderhamn
at com.caucho.config.ConfigContext.error(ConfigContext.java:1115)
at
com
443)
at
com
322)
at
com
.caucho
.config
55)
at
com
80)
at
60)
at com.caucho.config.core.ResinIf.init(ResinIf.java:71)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun
.reflect
.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun
.reflect
.DelegatingMethodAccessorImpl
.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
com
.caucho
.config.j2ee.PostConstructProgram.inject(PostConstructProgram.java:60)
at com.caucho.config.type.BeanType.init(BeanType.java:226)
at
com
505)
at
com
322)
at
com
.caucho
.config
55)
at
com
80)
at
60)
at com.caucho.server.cluster.Server.<init>(Server.java:199)
at com.caucho.server.cluster.Cluster.startServer(Cluster.java:706)
at
com
528)
at com.caucho.server.resin.Resin.start(Resin.java:695)
at com.caucho.server.resin.Resin.initMain(Resin.java:1139)
at com.caucho.server.resin.Resin.main(Resin.java:1341)
Loading...