localhost 4848, 8080 problem - java

this might sound like a stupid question, but i want to clarify a concept:
using netbeans 6.9, ive successfully completed a web application project using a glassfish container (locally). when i run the project, everything works well, except it runs on http://localhost:11494/myApp/. should'nt the accessing task be on http://localhost:8080/myApp/? when i type http://localhost:8080/myApp/, it doesnt connect to localhost.. neither does http://localhost:4848 to access the admin console. why is this? i think my concepts on deployment are not that thorough. i didn't manually deploy anything.. thanks in advance!
EDIT: right now, the university module im taking has lecture notes which specify manual deployment. id rather let netbeans handle deployment. perhaps this is the cause of the difference in port numbers?

All of your settings are in the domain.xml so you can look in there. However, the port (8262) your showing in your connection tab should be your admin console, so you can view the settings in there as well.

I think port number 8080 is not assigned to your application, you can assign 8080 to listen to your application by making changes into server.xml, file all you need to do is add a connector or modify the connector entry to listen to 8080 instead of 11494...!!

When you run the project, do you launch the server from within Netbeans? If so, I'd check there first. If you run from the command line, it has to be a GlassFish configuration issue.
If I got desperate, I'd grep my machine for "11494"!
Remember, the solution should be as simple as possible, but no simpler! ;-)

I think port 8080 is occupied by another process, therefore Glassfish decide to use another port..

Related

is it possible to use tomcat 10 for JEE and tomcat 9 for spring on one laptop?

is it possible to use tomcat 10 for JEE and tomcat 9 for spring on one laptop? if yes can you ask for instructions on how to do this
Yes, it is possible. Just create two projects and connected to both with two different tomcat versions, you can even change the port of the server. But remember both will not run together if they have the same port.
It is possible to run both server on one computer as long as they are running on different ports
For JEE application to change port you can click on server tab and double click on Apache version and change the port from there. You can see detailed information in the below link:
https://www.codejava.net/servers/tomcat/how-to-change-port-numbers-for-tomcat-in-eclipse
And for spring you can edit application.properties file and set server.port=9090 or anything, this will change the port
By default for both port is 8080, so changing in one of them will make you running both server on a single laptop

How to see tomcat console when tomcat started from services

This might be silly question but I really don't know it.
I have performed some changes in my web application in java/jsp.
Tested it in localhost in eclipse where I can see logs in console.
After that I have deployed the changes to beta server and its not
reflecting as in localhost hence want to see running logs through
tomcat console but Tomcat is already running and was started with
services utility of windows.
Is there any way to open console of running tomcat.
I do know that we can see tomcat logs as well, but running console
will be preferred for me as there are multiple projects are running on
same server.
You can check log file(s) in the tomcat-home/logs folder.
You can attach Eclipse to a running process if you have started the server with the right settings: see Attach debugger to application using Eclipse On windows, you can either delete and reinstall the services as in https://tomcat.apache.org/tomcat-7.0-doc/windows-service-howto.html or, you can add these parameters in the Windows registry for the Tomcat you are running: see http://www.tomcatexpert.com/knowledge-base/allocating-more-ram-tomcat-windows . I would be very careful with the registry hack unless you've hacked the registry before and are comfortable doing it.

XAMPP / java.net.BindException: Address already in use

I was wondering if someone could help me out with an issue I'm having. I'm using a Jetty server and using XAMPP to connect to a MySQL server, which I'm accessing through PHPMyAdmin.
I have a class that essentially is meant to drop all the tables in a database and then add some more, with data.
The first time I ran it, it worked fine, and did what it's meant to do, but the next time, I'm getting errors like the ones below. If I try it with a different database on the same host, again, it works fine first time, but any additional attempts will not work.
Can anyone shed some light please?
It seems that your Jetty instance is already running. Try to stop it and then run your test again.
If I try it with a different database on the same host, again, it works fine first time, but any additional attempts will not work.
This is happening because, I suppose, you are trying to start the server every time you start a test, but not closing after the test is done.
You can now either stop your Jetty instance manually, using Task Manager, restarting your machine in order to be able to run tests again
You've probably ran Jetty server twice or port 8444 is being 'listened' by another application.
Fire that command and find out which service is using that port
netstat -aon | find /i "listening"

How to deploy a Play framework project to Amazon?

Is it possible to create a .war of a project running on Play, so that it can be easily deployed on Amazon? Or is it necessary to install play on the server itself where the app will be run?
I would prefer a .war since I want traffic from all sources to be able to run the app, not just on port 9000.
Read this for play 1.x, http://www.playframework.org/documentation/1.2.5/production
and this for 2.x, http://www.playframework.org/documentation/2.0.4/Production
For easier deployment over SSH you may want to look at, https://github.com/nylund/play-deploy/blob/master/documentation/manual/home.textile (disclaimer I wrote the plugin).
You've got quite few concepts mixed there.
The Port the app listens to is 9000 by default but you can change it in application.conf to whatever you want, or even have different ports configured for dev/test/production,... This has nothing to do with war or no war deployment.
Traffic from all sources to be able to run the app, if you mean where the traffic comes from, that's the source port, not the port where your server runs. The only thing I can make sense of there is that you might be thinking about people behind firewalls or proxy's that can typically only access ports 80 or 8080. But as said before, you can listen at whatever port you want.
You might also be referring to port 9000 being firewalled by default in AWS, but again this is something you can set up.
In any case, the answer to the original question is yes, you can create a war and instead of installing Play you can install Tomcat/Jboss/... and deploy it there, but is not related to any of your concerns, so probably just go with Play standalone and save yourself a bunch of problems.

eclipse port occupying error on startup

I am getting this error while starting eclipse. I am using eclipse on windows 7
"There is a process already using the admin port 4848 -- it probably is another instance of a GlassFish server.
Command start-domain failed."
I have searched and found that if i put mny hostname against 127.0.0.1 then this problem can be resolve but my problem is that i can't place my hostname in my host file due to our organization internal network security and i can't even edit this file.So i want that this glassfish server stops allocating 4848 port and starts working on another port.
Please help as i got stuck in this issue.
Thanks
The Eclipse plugin contributes its own Glassfish instance that runs only as long as Eclipse runs. Uninstalling your standalone copy is probably a good solution for you. If not, reconfigure the standalone copy to use a different admin port.
A simple Google search will cover that for you. Here's what I have found as the top hit.

Categories

Resources