What shoud I do with this eclipse error(html preview)? - java

When I try to check my HTML code, I receive this error.
What should I do?
*'Starting HTTP Preview at localhost' has encountered a problem.
Port 8080 required by HTTP Preview at localhost is already in use. The Server may already be running in another process, or a system process may be using the port. To start this server you will need to stop the other process or change the port number(s).
*
I don't use and install Tomcat, Because I didn't study about jsp yet.
+My operating system is Windows 10.

Port 8080 that your application is trying to use is already occupied by some other application. You have to close that application or use another port for your application.
To find which application is using port 8080, check this post How can you find out which process is listening on a port on Windows?

You should check the state of ports by the command netstat -ano, and you will see an item like this: TCP 0.0.0.0:8080 0.0.0.0:0 LISTENING 8940, the last number is the pid of the process which is using the port 8080, you can use task manager to find the progress with this pid and kill it.

Related

Windows server cannot start Apache tomcat due to port 443 is in use and cannot be killed

Hi I cannot start apache tomcat 7.0.77 under my windows server 2012 due to this conflict,
netstat -a -n -o | findstr 443
TCP 0.0.0.0:443 0.0.0.0:0 LISTENING 4
TCP [::]:443 [::]:0 LISTENING 4
which I cannot kill by kill the pid due to error:
Error: the proces with PID 4 could not be terminated
reason: access is denied.
I cannot change port in the server config file because another port is not being able to accessed in public. So my only choice is to terminate this conflict and use this port for tomcat.
I have tried to restart the server several times and looking for similar posts in this page.
I really don't know what caused this problem since tomcat used to work fine before. Only when I try to deploy new war file from tomcat gui manager then restart, start, stop apache tomcat service under service manager few times and it keep stopping right after I click start.
Any help please !!
Thank you !
I found out the solution by using process hacker at:
https://processhacker.sourceforge.io/
then go to processes kill that process using that port (note: you can lost remote desktop connection if that is the process related or your server could restart, but after a while all will be back, as for my case).

Deploying a Play Framework application on port 80 beside Apache

I'm looking for a way to deploy my Play-Framework-1.0 application on the port 80.
So first I made the zip file with 'dist' command, then I unzipped it.
When I run the command to lauch the application (play-java-1.0-SNAPSHOT/bin/play-java -Dhttp.port=80 -Dhttp.adresse=127.0.0.1), I get this error :
[error] p.c.s.NettyServer - Failed to listen for HTTP on /0.0.0.0:80!
Oops, cannot start the server.
play.core.server.ServerListenException: Failed to listen for HTTP on /0.0.0.0:80!
at play.core.server.NettyServer.play$core$server$NettyServer$$bindChannel(NettyServer.scala:215)
at play.core.server.NettyServer$$anonfun$1.apply(NettyServer.scala:203)
at play.core.server.NettyServer$$anonfun$1.apply(NettyServer.scala:203)
at scala.Option.map(Option.scala:146)
at play.core.server.NettyServer.<init>(NettyServer.scala:203)
at play.core.server.NettyServerProvider.createServer(NettyServer.scala:266)
at play.core.server.NettyServerProvider.createServer(NettyServer.scala:265)
at play.core.server.ServerProvider$class.createServer(ServerProvider.scala:25)
at play.core.server.NettyServerProvider.createServer(NettyServer.scala:265)
at play.core.server.ProdServerStart$.start(ProdServerStart.scala:53)
at play.core.server.ProdServerStart$.main(ProdServerStart.scala:22)
at play.core.server.ProdServerStart.main(ProdServerStart.scala)
Moreover, in the real server, Apache has been installed. So I wonder, whether that will be a problem.
Thanks!
Optionally, also remember that on most systems, running processes on ports lower than 8000 is disabled in default, in such case you need to allow it, i.e. on Unix servers, just using sudo command(prefix).
If you are using a Linux server, you can try 'fuser 80/tcp' to see whether another process is already running on that port (80). If so (there's showing a process-id, when you enter the command), you cannot use the same port for 2 processes.
Either, you have to start the Play-app in a different port or you can kill the already running process by 'sudo fuser -k 80/tcp' and start the Play-app on the same port (80).
It's not possible to have two processes running on the same host listening on the same port.
However, you could run you Play application on different port, e.g. 8080 and set up Apache as a reverse proxy (Nginx would do too, but you mentioned that you already have Apache running on the server) to forward requests to your Play application.
Example guide how to do that:
https://www.digitalocean.com/community/tutorials/how-to-use-apache-http-server-as-reverse-proxy-using-mod_proxy-extension

port 8080 is already in use and no process using 8080 has been listed

I am trying to start Tomcat from Eclipse, but a problem occured:
Port 8080 required by Tomcat v6.0 Server at localhost is already in use. The server may already be running in another process, or a system process may be using the port. To start this server you will need to stop the other process or change the port number(s).
I tried to list processes connected to this port using command on Windows:
netstat -aon
But on the listing there is no process with PID = 8080. I also tried:
netstat -aon | find "8080"
But it also didn't find anything. Can anyone help me?
PID is the process ID - not the port number. You need to look for an entry with ":8080" at the end of the address/port part (the second column). Then you can look at the PID and use Task Manager to work out which process is involved... or run netstat -abn which will show the process names (but must be run under an administrator account).
Having said that, I would expect the find "8080" to find it...
Another thing to do is just visit http://localhost:8080 - on that port, chances are it's a web server of some description.
Open eclipse go to Servers panel, right click or press F3 to open Overview window and go to Ports (Modify the server ports). You will get the following:
tomcat adminport
HTTP/1.1
AJP/1.3
You can change the port numbers (e.g. HTTP/1.1 port number 8080 to 8082).
In windows " wmic process where processid="pid of the process running" get commandline " worked for me. The
culprit was wrapper.exe process of webhuddle jboss soft.
If no other process is using the port 8080, Eventhough eclipse shows the port 8080 is used while starting the server in eclipse, first you have to stop the server by hitting the stop button in "Configure Tomcat"(which you can find in your start menu under tomcat folder), then try to start the server in eclipse then it will be started.
If any other process is using the port 8080 and as well as you no need to disturb it. then you can change the port.
In my case, there was a conflict with the virtualization function of Windows 10. This problem occurred after installing Hyper-V, virtual machine platform, and hypervisor platform to use hyper-v, docker, and bluestack together.
Even if I check with netstat, it is not a port in use, and even if I restart Windows and change the port, it does not start up saying that it is in use for all ports.
So, by changing the following services to Disabled in Windows Services, the Tomcat problem was solved, but bluestack, docker, etc. execution became impossible.
After starting Tomcat, when I manually changed the services again, bluestack was executed.
Hyper-V Host Compute Service
HV Host Service
Host network service
Network virtualization service

Remotely accessing Weblogic server

I installed locally and now running Weblogic Server in my machine. I can access the web application from my machine by using URL like 192.168.XXX.XXX:7001/myapp/, but I cannot access it from a different machine connected in same network. I have done this one: went to Administrative console, clicked on my server and inserted my IP in the textbox beside Listen Address.But it didn't help.
Please, help me on this matter.
The 'Listen Address' configuration item specifies which IP address your server listens on.
If it's set to 127.0.0.1 or localhost, then your server only listens on localhost address, which means it only serves requests come from localhost.
You should set it to the public IP address of your machine. Or simply set to 0.0.0.0, which means listen on all available address that your machine has.
Companies block some ports due to security reason. And 7001 is one of those common ports which they block.
So you can perform following steps.
Type following command in cmd:
telnet HOST.IP.ADDRESS PORT
Ex: telnet 192.658.152.45 7001
In case if it shows connecting and then stops, that means that port has been
blocked.
Try some other port , let say 8080.
If it works then change the default port in weblogic
Go to config.xml file in
\user_projects\domains\\config
Add listener port as
<server>
<name>AdminServer</name>
<listen-port>8080</listen-port>
<listen-port-enabled>true</listen-port-enabled>
<listen-address></listen-address>
</server>
I had the same problem and solved it like:
From the administration console change Listen address from localhost to admin server's IP
Stop Windows Firewall (I try only to define a new Rule to open port 7001 but without a result)
After that all works like a charm :)
Is your machine connected to the network?
Do you have any firewall installed? Is it blocking access from the outside?
Do you have any other software on your computer that is blocking access?
Does you network have hardware/software that blocks access to certain ports?
Other
This is a firewall issue. You can add port 7001 an exception to the firewall or before that to confirm whether the issue is because of firewall, try
systemctl stop firewalld
Check again if you are able to access the console from a different machine.
just allow specific port in firewall, Try this
sudo firewall-cmd --zone=public --permanent --add-port=7001/tcp
sudo firewall-cmd –-reload

Remote Debugging in eclipse

I have an application running in server A. The dev environment is in server B.
I am trying to do remote debugging of app running in server A.
In server A i added following command to service start script
-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=4554,server=y,suspend=n
And service is running in server A.
When i try to launch remote debugging configuration it gives
Failed to connect to remote VM. Connection refused. Connection refused
port 4554 is free in server A.
What other configuration need to be done for this?
Regards
Dheeraj Joshi
Try this.
Set suspend=y, just to make sure you got the JVM line right. This should stop the VM on startup until you connect.
If you're on Unix, bring up the terminal and try telnet [host] [port] - this will quickly let you know if there's anything listening to that port on that host.
Make sure the connection properties in Eclipse are set correctly. Note that the port defaults to 8000.
Use the IP address instead of the host name, to rule out DNS/hostfile problems.
Another way of starting the JVM that I use successfully is:
-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=y
Check if there is a firewall between and/or on the two servers.

Categories