Hello Alain,

 /Library/Tomcat/bin/catalina.sh jpda start should be good enough. If you
have a look at the tomcat command line process are the JPDA options
enabled? E.g.:

$ $CATALINA_HOME/bin/catalina.sh jpda start

$ ps -ef | grep --color dt_socket
lurodrig 13522  2883  6 13:58 pts/5    00:00:04
.../jdk1.8.0_162/bin/java...
-agentlib:jdwp=transport=dt_socket,address=localhost:8000,server=y,suspend=n
... org.apache.catalina.startup.Bootstrap start

In the catalina.out you should see something like: Listening for transport
dt_socket at address: 8000

Asking for the debug and http ports:

lurodrig@:tomcat-9-0-5-installation$ lsof -i:8000
COMMAND   PID     USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
java    13522 lurodrig    4u  IPv4 450991      0t0  TCP localhost:8000
(LISTEN)

lurodrig@:tomcat-9-0-5-installation$ lsof -i:8080
COMMAND   PID     USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
java    13522 lurodrig   51u  IPv6 450993      0t0  TCP *:http-alt (LISTEN)

Hope it helps,

Luis

ps: a HTTP request against the debug port will print this message in the
catalina.out Debugger failed to attach: handshake failed - received >GET /
HTTP/1.1< - expected >JDWP-Handshake<



2018-07-16 13:45 GMT+02:00 Désilets, Alain <alain.desil...@nrc-cnrc.gc.ca>:

> I am unable to start Tomcat in debug mode. I have searched and see that
> lots of people are having similar issues. I tried all the fixes that were
> proposed and none of them seem to work.
>
> Here is what I have at the moment.
>
> I have a file /Library/Tomcat/bin/setenv with the following content
> # Trying to start Tomcat in debug mode...
> #
> # CATALINA_OPTS="-agentlib:jdwp=transport=dt_socket,address=
> 8000,server=y,suspend=n"
> JPDA_ADDRESS=8000
> JPDA_TRANSPORT=dtsocket
> JPDA_SUSPEND=n
>
> Note that I tried setting the JPDA environment both ways (using
> CATALINA_OPTS and JPDA_* vars) and the result is the same.
>
> To restart tomcat, I do the following command:
>
>
> echo "" > /Library/Tomcat/logs/catalina.out ;
> /Library/Tomcat/bin/shutdown.sh; sleep 2; /Library/Tomcat/bin/catalina.sh
> jpda start; echo "Restarted tomcat, catalina.out is:"; cat
> /Library/Tomcat/logs/catalina.out
>
> This produces the following output:
>
>
> Using CATALINA_BASE:   /Library/Tomcat
>
> Using CATALINA_HOME:   /Library/Tomcat
>
> Using CATALINA_TMPDIR: /Library/Tomcat/temp
>
> Using JRE_HOME:        /Library/Java/JavaVirtualMachines/jdk1.8.0_
> 102.jdk/Contents/Home
>
> Using CLASSPATH:       /Library/Tomcat/bin/bootstrap.
> jar:/Library/Tomcat/bin/tomcat-juli.jar
>
> Using CATALINA_BASE:   /Library/Tomcat
>
> Using CATALINA_HOME:   /Library/Tomcat
>
> Using CATALINA_TMPDIR: /Library/Tomcat/temp
>
> Using JRE_HOME:        /Library/Java/JavaVirtualMachines/jdk1.8.0_
> 102.jdk/Contents/Home
>
> Using CLASSPATH:       /Library/Tomcat/bin/bootstrap.
> jar:/Library/Tomcat/bin/tomcat-juli.jar
>
> Tomcat started.
>
> Restarted tomcat, catalina.out is:
>
>
>
> 16-Jul-2018 07:35:12.366 INFO [main] 
> org.apache.catalina.core.StandardServer.await
> A valid shutdown command was received via the shutdown port. Stopping the
> Server instance.
>
> 16-Jul-2018 07:35:12.366 INFO [main] org.apache.coyote.AbstractProtocol.pause
> Pausing ProtocolHandler ["http-nio-8080"]
>
> 16-Jul-2018 07:35:12.426 INFO [main] org.apache.coyote.AbstractProtocol.pause
> Pausing ProtocolHandler ["ajp-nio-8009"]
>
> 16-Jul-2018 07:35:12.483 INFO [main] 
> org.apache.catalina.core.StandardService.stopInternal
> Stopping service [Catalina]
>
> 16-Jul-2018 07:35:12.517 INFO [main] org.apache.coyote.AbstractProtocol.stop
> Stopping ProtocolHandler ["http-nio-8080"]
>
> 16-Jul-2018 07:35:12.520 INFO [main] org.apache.coyote.AbstractProtocol.stop
> Stopping ProtocolHandler ["ajp-nio-8009"]
>
> 16-Jul-2018 07:35:12.523 INFO [main] 
> org.apache.coyote.AbstractProtocol.destroy
> Destroying ProtocolHandler ["http-nio-8080"]
>
> 16-Jul-2018 07:35:12.523 INFO [main] 
> org.apache.coyote.AbstractProtocol.destroy
> Destroying ProtocolHandler ["ajp-nio-8009"]
>
>
>
> When I go to http://localhost:8000, I get “This site can’t be reached”.
>
>
>
> Same if I go to http://localhost:8080/.
>
>
>
> But… if I restart tomcat using the same command as above, except without
> the ‘jpda’ argument to Catalina.sh, then 8080 is started fine, but not 8000
> (which Is to be expected).
>
>
>
> I checked to see if port 8000 is already busy by issueing this command:
>
>
>
> sudo lsof -iTCP -sTCP:LISTEN -n -P | grep 8000
>
>
>
> But is shows no process listening on that port. And I know that this
> command works because when I successfully start tomcat without ‘jpda’, if I
> use this command to check for port 8080, I get:
>
>
>
> java      1925 desilets   60u  IPv6 0xad510ad8630ef821      0t0  TCP
> *:8080 (LISTEN)
>
>
> Not sure what to try next… have pretty much run out of options at this
> point.
>
> Any help will be greatly appreciated.
>
> Thx.
>
> Alain Désilets
> National Research Council of Canad
>



-- 

"Ever tried. Ever failed. No matter. Try Again. Fail again. Fail better."

- Samuel Beckett

Reply via email to