You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@netbeans.apache.org by "Greenberg, Gary" <gg...@visa.com.INVALID> on 2023/03/13 17:03:49 UTC

Debugging web application on Tomcat

Last year I have developed a Spring-Boot web application.
It was originally developed as a JAR but later converted to a WAR and deployed to the Tomcat 9 on a production server.
Last week, a bug was found and I need to fix it.
Not to change the configuration, I have installed Tomcat 9 on my Windows laptop and was trying to debug the application on it.
When I click on "Debug" in my Netbeans 16, it builds the war but than trying to stop Tomcat for a while and then fails to do it.
I did stop Tomcat manually and tried to do it again, but than Netbeans failed to start Tomcat.
Looks like there are some permission issues. Can someone tells me how to fix it.
I remember, long ago, with Netbeans 8.2 and Tomcat6 I haven't had a problems deploying apps without start/stop.

Gary Greenberg
Staff Software Engineer


Re: Debugging web application on Tomcat

Posted by Tim de Vries <te...@gmail.com>.
when i do a Deploy? It makes my jar. I have to Launch manually on the 
server (in theory), and then headless, or run in gui.

Its a WIP.

On 13/03/2023 11:03 a.m., Greenberg, Gary wrote:
>
> Last year I have developed a Spring-Boot web application.
> It was originally developed as a JAR but later converted to a WAR and 
> deployed to the Tomcat 9 on a production server.
>
> Last week, a bug was found and I need to fix it.
>
> Not to change the configuration, I have installed Tomcat 9 on my 
> Windows laptop and was trying to debug the application on it.
>
> When I click on “Debug” in my Netbeans 16, it builds the war but than 
> trying to stop Tomcat for a while and then fails to do it.
>
> I did stop Tomcat manually and tried to do it again, but than Netbeans 
> failed to start Tomcat.
>
> Looks like there are some permission issues. Can someone tells me how 
> to fix it.
> I remember, long ago, with Netbeans 8.2 and Tomcat6 I haven’t had a 
> problems deploying apps without start/stop.
>
> *Gary Greenberg*
>
> Staff Software Engineer
>

Re: Debugging web application on Tomcat

Posted by Tim de Vries <te...@gmail.com>.
I do Spring and starter=web, on my classpath; -- you'd have to review 
the tec.xml, but thats not public yet.

On 13/03/2023 11:54 a.m., László Kishalmi wrote:
> How have you installed Tomcat 9 on your System?
>
> On Mon, Mar 13, 2023 at 10:04 AM Greenberg, Gary 
> <gg...@visa.com.invalid> wrote:
>
>     Last year I have developed a Spring-Boot web application.
>     It was originally developed as a JAR but later converted to a WAR
>     and deployed to the Tomcat 9 on a production server.
>
>     Last week, a bug was found and I need to fix it.
>
>     Not to change the configuration, I have installed Tomcat 9 on my
>     Windows laptop and was trying to debug the application on it.
>
>     When I click on “Debug” in my Netbeans 16, it builds the war but
>     than trying to stop Tomcat for a while and then fails to do it.
>
>     I did stop Tomcat manually and tried to do it again, but than
>     Netbeans failed to start Tomcat.
>
>     Looks like there are some permission issues. Can someone tells me
>     how to fix it.
>     I remember, long ago, with Netbeans 8.2 and Tomcat6 I haven’t had
>     a problems deploying apps without start/stop.
>
>     *Gary Greenberg*
>
>     Staff Software Engineer
>

Re: Debugging web application on Tomcat

Posted by László Kishalmi <la...@gmail.com>.
How have you installed Tomcat 9 on your System?

On Mon, Mar 13, 2023 at 10:04 AM Greenberg, Gary <gg...@visa.com.invalid>
wrote:

> Last year I have developed a Spring-Boot web application.
> It was originally developed as a JAR but later converted to a WAR and
> deployed to the Tomcat 9 on a production server.
>
> Last week, a bug was found and I need to fix it.
>
> Not to change the configuration, I have installed Tomcat 9 on my Windows
> laptop and was trying to debug the application on it.
>
> When I click on “Debug” in my Netbeans 16, it builds the war but than
> trying to stop Tomcat for a while and then fails to do it.
>
> I did stop Tomcat manually and tried to do it again, but than Netbeans
> failed to start Tomcat.
>
> Looks like there are some permission issues. Can someone tells me how to
> fix it.
> I remember, long ago, with Netbeans 8.2 and Tomcat6 I haven’t had a
> problems deploying apps without start/stop.
>
>
>
> *Gary Greenberg*
>
> Staff Software Engineer
>
>
>

Re: Debugging web application on Tomcat

Posted by Thomas Kellerer <sh...@gmx.net>.
> is that the IDE doesn't support it yet.

NetBeans most certainly supports debugging a running Tomcat started with the "jpda" option through the "Debug -> Attach" menu

I am doing this on a regular basis with applications that can't be deployed through NetBeans (e.g. Liferay portlets).

If you can't start Tomcat from within NetBeans, then start it on the command line (after deploying your WAR file manually)

In my experience you need to use the "catalina" script, because "startup" script does not seem to pass the parameters correctly.

When using

     catalina.bat jpdba run

You will see something like this:

     Using CATALINA_BASE:   "d:\etc\apache-tomcat-9.0.73"
     Using CATALINA_HOME:   "d:\etc\apache-tomcat-9.0.73"
     Using CATALINA_TMPDIR: "d:\etc\apache-tomcat-9.0.73\temp"
     Using JRE_HOME:        "c:\etc\Java11"
     Using CLASSPATH:       "d:\etc\apache-tomcat-9.0.73\bin\bootstrap.jar;d:\etc\apache-tomcat-9.0.73\bin\tomcat-juli.jar"
     Using CATALINA_OPTS:   ""
     NOTE: Picked up JDK_JAVA_OPTIONS:  --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
     Listening for transport dt_socket at address: 8000
     25-Mar-2023 08:55:20.303 INFORMATION [main] org.apache.catalina.startup.VersionLoggerListener.log Server Version:        Apache Tomcat/9.0.73

The important bit is: the "Listening for transport dt_socket at address: 8000"

If that shows up, you can use "Debug -> Attach" from within NetBeans to debug your application inside Tomcat.

Thomas

Tim de Vries schrieb am 25.03.2023 um 02:10:
> Probably, the problem with this...., and maybe lombok, is that the IDE doesn't support it yet.
>
>
> It depends on who's doing what and how.
>
>
> Everything I make, works, mostly, ... , I continually make changes and test.
>
> Tim
>
> On 23/03/2023 11:39 p.m., Thomas Kellerer wrote:
>> Greenberg, Gary schrieb am 13.03.2023 um 18:03:
>>> Last year I have developed a Spring-Boot web application.
>>> It was originally developed as a JAR but later converted to a WAR and deployed to the Tomcat 9 on a production server.
>>>
>>> Last week, a bug was found and I need to fix it.
>>>
>>> Not to change the configuration, I have installed Tomcat 9 on my Windows laptop and was trying to debug the application on it.
>>>
>>> When I click on “Debug” in my Netbeans 16, it builds the war but than trying to stop Tomcat for a while and then fails to do it.
>>>
>>> I did stop Tomcat manually and tried to do it again, but than Netbeans failed to start Tomcat.
>>>
>>> Looks like there are some permission issues. Can someone tells me how to fix it.
>>> I remember, long ago, with Netbeans 8.2 and Tomcat6 I haven’t had a problems deploying apps without start/stop.
>> A workaround might be to start Tomcat manually in debug mode (using "catalina jpda run")
>>
>> Then use "Debug -> Attach" to attach to the running Tomcat instance.
>>
>> Thomas

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
For additional commands, e-mail: users-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


Re: Debugging web application on Tomcat

Posted by Thomas Kellerer <sh...@gmx.net>.
Greenberg, Gary schrieb am 13.03.2023 um 18:03:
> Last year I have developed a Spring-Boot web application.
> It was originally developed as a JAR but later converted to a WAR and deployed to the Tomcat 9 on a production server.
>
> Last week, a bug was found and I need to fix it.
>
> Not to change the configuration, I have installed Tomcat 9 on my Windows laptop and was trying to debug the application on it.
>
> When I click on “Debug” in my Netbeans 16, it builds the war but than trying to stop Tomcat for a while and then fails to do it.
>
> I did stop Tomcat manually and tried to do it again, but than Netbeans failed to start Tomcat.
>
> Looks like there are some permission issues. Can someone tells me how to fix it.
> I remember, long ago, with Netbeans 8.2 and Tomcat6 I haven’t had a problems deploying apps without start/stop.

A workaround might be to start Tomcat manually in debug mode (using "catalina jpda run")

Then use "Debug -> Attach" to attach to the running Tomcat instance.

Thomas


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
For additional commands, e-mail: users-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists