Tomcat Server Just Hangs - log4j Warn - java

So no idea why but tomcat7 seems to be just hanging. When I enter in localhost or my own ip that it's running on, it just sits there loading. And when doing 'startup' cmd in the tomcat directory, I get some random JSSE java error but then a log4J warning saying please initialize the log4j system properly.
Not sure why a WARN would prevent it from starting. I still see that tomcat service is listening on 443 and java is listening on 80.
Thanks.

Related

Error during Intellij idea remote Tomcat Server debug

I've some problems during configuration of remote Tomcat Server in Intellij
I've got a java web app that need to run in a cluster configuration, so I've got 3 Linux VMS in which I've installed tomcat server.
The problem is that I need to use this 3 tomcat servers together in debug mode in order to test and check issues.
I've tried some things but I was not able to get a solution.
OPTION A: configuring Remote JVM Debug:
I've tried to configure a Remote JVM Debug on my intellij configuring Catalina to listen to another port (2001) and launch it with the command: sh catalina.sh jpda start -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:2001 but it stucks on this message "Connected to the target VM, address: 'IP:2001', transport: 'socket'"
OPTION B: remote Tomcat server:
I've tried configuring a remote Tomcat server (that is the thing I prefer) configuring remote host with SFTP, but in this case Tomcat service start, it works for some minutes and after that it goes in TimeoutException
[](https://i.stack.imgur.com/XmDKx.png)
I hope anyone can help me, I read a lot of thing on the internet but no-one works.

Is Tomcat 8's port use interfering with itself when run out of Netbeans?

We have a web application that's been running on Tomcat 7, we're moving to Tomcat 8 and are now depending on an internal microservice for the application as well. We use Netbeans.
I have made the necessary changes to configuration such that I can start the microservice app and then the web application on my machine from the command line. However, when I attempt to run the web app from within Netbeans, it tells me "Starting of Tomcat failed, the server port 8443 is already in use".
I don't know why that port is reported as in use when run from within Netbeans, but not if the same server with the same web application is run from the command line. Does anyone have any ideas on what to check?
A quick way to make progress is simply to use a port other than 8443. That won't necessarily resolve the problem you are experiencing, but it will circumvent it. To do that:
Stop Tomcat.
Pick a port other than 8443. I chose 8447.
Run the following command from the console to verify that port 8447 is not already being used:
netstat -aon | findstr 8447
That's the syntax for Windows - I think it is different on Linux. If nothing is displayed then 8447 is an available port. Otherwise keep picking different port numbers until you find one which is available.
Take a backup of server.xml which resides in directory {Tomcat dir}/conf (so you can regress if necessary).
Edit server.xml replacing all instances of 8443 with 8447, or whatever alternative port you chose, and save the file.
Start Tomcat. It will come up using port 8447 instead of 8443. You can verify that in Tomcat's log shown in NetBeans; look for the string https-openssl-apr-8447 to verify:
09-Jan-2018 02:07:26.279 INFO [main]
org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler
["http-nio-8080"] 09-Jan-2018 02:07:26.285 INFO [main]
org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler
["https-openssl-apr-8447"] 09-Jan-2018 02:07:26.290 INFO [main]
org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler
["ajp-nio-8009"] 09-Jan-2018 02:07:26.293 INFO [main]
org.apache.catalina.startup.Catalina.start Server startup in 2585 ms
You should now be able to test your web app. I just verified that this approach works using Tomcat 9 but I'm sure it would also work with Tomcat 8.
As a separate issue, once everything is working on port 8447, run netstat -aon | findstr 8443 to see if port 8443 is still being used while Tomcat is running. If so then (on Windows) get the PID of the process that is still using that port, and then lookup that PID on the Details tab of Task Manager. Here's a screenshot showing that in my case port 8447 was used by PID 2340 which was an instance of java.exe for Tomcat:
If none of that resolves anything:
Please advise which Operating System and which version of NetBeans are being used.
Add the relevant portion of Tomcat's log within NetBeans to your post.

tomcat7 redhat could not start up

I hava installed on RedHatEnterpriseLinux java1.7 and apache tomcat 7, starting tomcat on port 8080 and checking through
netstat -nap | grep 8080
and getting
tcp 0 0 :::8080 :::* LISTEN 29178/java
but when i try to open tomcat home page from browser, browser is loading and loading and nothing appears. and when I try to stop tomcat server, I am getting
java.net.ConnectionException: Connection Refused error.
How can it be solved?
The Tomcat server may have bound to port 8080, but was unable to complete startup for some reason, and so not is not servicing requests yet. Check the tomcat logs for errors, and make sure that the server has started successfully. Successful startup of tomcat is usually indicated by the log statement "Server startup in XXXX ms" in catalina.out.
The problem could be in iptables. Try to open port 8080:
# lokkit --port=8080:tcp

java remote debugging Tomcat app: Why does the JVM not listen?

I want to remote debug an application running in Tomcat 7. Tomcat is running as a service on a Win2008 server.
I added the following to the Java options in the Java Configuration Panel of Tomcat:
-Xdebug -Xrunjdwp:transport=dt_socket,address=4711,server=y,suspend=n and opened the firewall on my workstation and the server for this port.
But when I try debugging from IntelliJ 9 on my workstation, I get an error message Unable to open debugger port : java.net.ConnectException "Connection timed out: connect". The jvm is the standatd Sun/Oracle 64 bit JVM version 1.6.0_27.
I verified that the command line parameters are in use by accessing ManagementFactory.getRuntimeMXBean().getInputArguments() within the application deployed to Tomcat and logging the result to the log file.
I verified via Wireshark on my workstation and on the server that the TCP request on port 4711 is sent from my pc and arriving on the server, but there is is no answer. Running netstat -a on the server does not show a process listening on this port. So I assume somehow Tomcat/JVM does not start the remote debugging.
You need to put -Xdebug and -Xrunjdwp... on separate lines in the Java panel of the Tomcat Service Configuration Panel.
So having:
-Xdebug -Xrunjdwp:transport=dt_socket,address=4711,server=y,suspend=n
will not work, but:
-Xdebug
-Xrunjdwp:transport=dt_socket,address=4711,server=y,suspend=n
will.

How to change default WAS liberty server port 9080 to other port number in RAD?

When I am using WAS Liberty profile V8.5 beta, I can not find anywhere to change default service port 9080 in RAD, I tried to add httpendpoint section in server.xml, liberty server reports configuration update successful, but got failure when running web application.
Anybody knows how to solve this? Thanks!
There was a bug in the beta which prevented some port changes from being preserved when the server was restarted. There is a forum thread discussing the issue with the cached port value, and the answer is to start the server with the --clean option (from the command line), there is an equivalent checkbox available when you start the server via the tools.
[1] https://www.ibm.com/developerworks/forums/thread.jspa?messageID=14770100
I would start there.

Categories

Resources