Web applications starts on port 8080, where can I change it? - glassfish-3

I have Netbeans IDE version 6.8, and Glassfish version 3.
My glassfish listener is set to port 81, but when I try to run the simplest web application via the Netbenas IDE it tries to run it on port 8080. where can I change it ? Using port 8080 for my web application is out of the question for me.

Locate config folder which may be as follows:
C:\Program Files\glassfish-3.0.1\glassfish\domains\domain1\config
Open domain.xml using any text editor.
Look for 8080 and change it to some other port number that doesn’t conflict with other port numbers.
source:
http://ohmjavaclasses.blogspot.com/2012/01/how-to-change-port-number-for-glassfish.html

If GlassFish and Oracle Database are installed in the same system, it results in port conflict as both of them use port 8080.
Here is the procedure to change port number of GlassFish so that you can run GlassFish at a different port number from Oracle to avoid the port conflict.
Find out the folder where GlassFish is installed.
If you installed GlassFish along with NetBeans, you can find out the folder where GlassFish is installed by using the following procedure.
Select Services window by using **Window -> Services** in NetBeans IDE
Expand **Servers** node and select GlassFish Domain
Right click and select **Properties** option from popup menu.
On the right of **Domains Folder** you can see the folder where GlassFish is installed.
For example :
C:\netbeans6.8\glassfish-v3\glassfish\domains. You can also see the other details regarding Glassfish such as port number, in the same window.
Go to the folder where Glassfish in installed.
Go into config folder which is as follows: c:\netbeans6.8\glassfish-3\glassfish\domains\domain1\config
Open domain.xml using any text editor.
Look for 8080 and change it to some other port number that doesn’t conflict with other port numbers. I generally change it to 9999.
Save domain.xml.
Now you need to remove GlassFish from NetBeans and add it again so that NetBeans IDE understands the new port number. For this do the following
In **Servers** window of NetBeans, remove GlassFish by using **RemoveServer** button after selecting GlassFish server.
Click on **AddServer** and select GlassFish V2 or GlassFish V3 and click on **Next**.
Select the **Installation Location** of GlassFish and click on **Next**.
Accept defaults and click on **Finish.**
Restart GlassFish, if it was already running.

A bit late, but this should work...
I don't have 6.8 anymore, but the following is true for 6.9 and 6.10m1 - in the directory <home dir>/.netbeans/<version>/config, there is a file called .nbattrs - edit it, and look for something like:
<attr name="GlassFishEE6\Instances\glassfish_autoregistered_instance\httpportnumber" stringvalue="8082"/>
Change the value to whatever you've set in the appropriate Glassfish domain. If, like me, you have more than one version of Glassfish installed, or perhaps multiple domains, just look out for the ....displayName keys and follow your nose - it should be obvious which one you're altering.
HTH,
John
NB: you can, of course, delete the server and add it in again using the wizard to select the right ports - but I think editing .nbattrs is far easier
NB2: there is another .nbattrs file further down the directory chain that also contains glassfish config (can't remember the exact location - sorry!) and this looks like the right place to change the port - but editing this file appears to have no effect as, for me, it gets overridden with whatever is in config/.nbattrs file whenever I start up Netbeans

I'm a bit late, too, but I'll add my comments just-the-same in case anyone runs across this issue in the future. I'm running Windows 7 with NetBeans 6.9.1 and GlassFish 3 locally on a different port (2118) as not to conflict with my Tomcat server on default (8080). If you navigate to <home_dir>/.netbeans/<version>/config/GlassFishEE6/Instances, you'll find your .nbattrs file.
Edit <attr name="httpportnumber" stringvalue="8080"/> to reflect the desired port. Save the file. Restart your server and you should be able to deploy/test your web apps, as desired, using NetBeans.
Incidentally, poking around under <home_dir>/.netbeans/<version>/config/J2EE/InstalledServers, you'll see another .nbattrs file and because I have two app servers installed locally, I see <fileobject name="instance"> for Tomcat and <fileobject name="instance_1"> for GlassFish. XML entries <attr name="port" stringvalue="8080"/> and <attr name="port" stringvalue="2118"/> reflect the respective assigned ports for each server and the change made in the previous .nbattrs file.
Hope this helps.

if you are using Glassfish 3.1.1 it may in /home/user/.netbeans/7.1.2/config/GF3_1/domain1/config/domain.xml,Find the 8080 port and replace it with alternate port number.

Related

Scalatra - change port for standalone server

I am developing a Scalatra application and require the port to be different than the default port 8080. I added the following to the end of my build.sbt:
containerPort in Jetty := 8089
This works great when I am starting the Jetty server within the sbt console (i.e. using jetty:start) but it doesn't work when I create a standalone .jar file using sbt-assembly. When I run the .jar, it still starts the server on port 8080.
Is there something additionally that I need to add to my build.sbt or elsewhere to ensure that sbt-assembly will properly recognize my desired port number?
Thanks in advance!
I solved this by editing the default port in the Bootstrap file. Wasn't able to find a way to do it with changes in the build.sbt file.

Configuring PhpStorm with Xdebug and Vagrant

I am trying to configure PhpStorm 2016.2 with Xdebug and Vagrant (Drupal VM). I have read many tutorials advising how to configure these three applications. I think it's almost there, but I'm not sure what this error is?
When I click to setup path mappings, it appears that 'File path in project' is the issue. On Vagrant I have:
/var/www/drupalvm/sitelog/index.php
On my local I have:
/Users/24ma13wg/PhpstormProjects/sitelog/index.php
...but I don't have index.php in my project files:
How can I resolve this? Thanks.
A
B
To solve the issue of needing to enable Force break at the first line when a script is outside the project can be solved by configuring PHPStorm to talk to the PHP Interpreter that is in DrupalVM.
Navigate to Preferences -> Languages and Frameworks -> PHP and click the ... next to CLI Interpreter. On the next window that pops up, click the + at the top and choose From Docker, Vagrant, VM, Remote. Choose the Vagrant Instance Folder by navigating to your local path to DrupalVM. Click OK on each of the open windows to close the options.
From here, you will just enable PHPStorm to start listening for new debug connections and will need to send a cookie along to allow to connect to xDebug.

Unable to launch the IIS Express Web server, Failed to register URL, Access is denied

Some web projects are causing me problems while others work fine. I decided to focus on one of the problematic ones.
I'm using Visual Studio 2013 on Windows 7. I think I'm running it as administrator, the window title says PROJECT NAME - Microsoft Visual Studio (Administrator).
When I try to run the project I get a popup saying:
Unable to launch the IIS Express Web server.
Failed to register URL "http://localhost:62940/" for site "SITE NAME"
application "/". Error description: Access is denied. (0x80070005).
This does not seem entirely uncommon but I have tried many of the suggestions without luck:
Deleted %userprofile%\Documents\IISExpress\, tried to run.
netsh http add urlacl url=http://localhost:62940/ user=everyone, rebooted and tried to run. (Actually user=Alla since Swedish Windows).
netsh http delete urlacl url=http://localhost:62940/, rebooted and changed from <binding protocol="http" bindingInformation="*:62940:localhost /> to <binding protocol="http" bindingInformation="*:62940:/> in %userprofile%\Documents\IISExpress\config\applicationhost.config and tried to run. (It did changed the error message to say ... URL "http://*:62940/" ....
Reinstalled IIS 8.0 Express
Reinstalled Visual Studio 2013
I'm at my wit's end, what am I doing wrong?
If I change the port of the project (e.g. to 55555) it starts... This is not a desirable solution since these projects are worked on by several people. Maybe the port is blocked by something else? If so, is there an easy way to check by what?
Port 62940 seems to be free. Running netstat does not show any application listening to it. Something else must be wrong.
I tried starting the project today after not touching it for a few months. It worked but I don't know why.
I solved the error by changing the port for the project.
I did the following steps:
1 - Right click on the project.
2 - Go to properties.
3 - Go to Server tab.
4 - On tab section, change the project URL for other port, like 8080 or 3000.
Good luck!
Yeah, I agree, top answers are really pro solutions. Here is one for intermediates:
Solution Explorer
Right click on project select Unload project
Again Right click and select Edit ProjectName.csproj
Remove these 3 lines
<DevelopmentServerPort>0</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>http://localhost:62940/</IISUrl>
Save and reload the project, and you are good to go.
try (as elevated administrator)
netsh http delete urlacl url=http://*:62940/
The ideal way to sort this out is to use the IIS Express tray icon to stop the web site that is causing the problem. To do this, click the little upward-pointing arrow in the right-hand end of the task bar and right-click the IIS Express icon. This will pop up a small window showing you the web sites that IIS Express is currently running...
If you click on one of the items under "View Sites" you have the option to stop that site. Or, you can click the Exit item at the bottom of the window to stop all web sites.
That should enable you to debug in Visual Studio. When you start debugging again, IIS Express will automatically restart the web site, and should be able to allocate the port.
If that fails, you have to do it the dirty way. Open Windows Task Manager and kill the Microsoft.VisualStudio.Web.Host.exe*32 process, then you can run the project fine. Note that this will kill IIS Express completely, meaning that all web sites will stop, so you'll have to restart each one in VS if you want to debug any others. Try the pop-up icon method first tough as it's cleaner and safer.
Don't know if this answers your issue, but it works for me.
Update Thanks to JasonCoder (see comment below) for adding that on Win10, the process is Microsoft.VsHub.Server.HttpHost.exe
When using Visual Studio 2015 the solution can be a bit different to the previous answers. VS2015 creates a hidden folder .vs under the same folder as your solution file. Under this is a config folder containing applicationhost.config. Deleting this file (or the entire .vs folder) then starting VS2015 to recreate it can fix this error.
Got this error as well lately. Tried all the above fixes, but none worked.
To disable it, type services.msc in command prompt, then right click and disable Internet Connection Sharing. I edited the properties of it as well to disable at startup. Mine looks like so now: services capture screenshot.
I got the same issue when running my application from Visual Studio 2019 on Windows 10.
After some time googling and trying various proposed solutions without success, I determined that the "Access Denied" error was a result of the port number my application uses (50403) falling in an "excluded port range".
You can view the excluded port ranges with the following command:
netsh interface ipv4 show excludedportrange protocol=tcp
After some more time googling I found that the two most likely culprits that create these exclusion ranges are Docker and Hyper-V. Docker was not installed on my computer but Hyper-V was.
My Solution
Disable Hyper-V: Control Panel-> Programs and Features-> Turn Windows features on or off. Untick Hyper-V
Restart the computer.
Add the port you are using to the port exclusion range: netsh int ipv4 add excludedportrange protocol=tcp startport=50403 numberofports=1 store=persistent
Reenable Hyper-V
Restart the computer
I added the port I am using to the exclusion list to ensure that I won't get this problem again after reenabling Hyper-V. After Step 4 and 5 when I viewed the excluded port range I can see that Hyper-V reserved a port range starting with the next port after my port.
My application now worked perfectly!
This is the only solution I found
net stop winnat
net start winnat
Thanks to Matt
This happened with me when I was trying to access my site from a remote location:
At first, applicationhost.config (VS2015) contained the standard:
<binding protocol="http" bindingInformation="*:64376:localhost" />
In order to access my site from a remote location within the network, I added (step 1):
<binding protocol="http" bindingInformation="*:64376:192.168.10.132" />
Then, I entered into CMD with Admin rights (step 2):
netsh http add urlacl url=http://*:64376/ user=Everyone
As step 3, I added it a rule to the firewall.
netsh advfirewall firewall add rule name=”IISExpressWeb” dir=in protocol=tcp localport=64376 profile=private,domain remoteip=localsubnet action=allow
Then, I got this error when trying to run the solution again.
Solution: I seemed to have done everything right, but it did not work until I ran netsh also for the existing localhost rule:
netsh http add urlacl url=http://localhost:64376/ user=Everyone
Now, it works again.
I just had a similar issue. I'm not totally sure how to describe the actual fault but it seems like the hostname in the reservation is incorrect. Try this in an elevated command prompt...
netsh http delete urlacl url=http://localhost:62940/
... then ...
netsh http add urlacl url=http://*:62940/ user=everyone
and restart your site. It should work.
I ran into this same error message, but it looks like it was produced from IIS Express. This article helped me resolve it
TL;DR
Run the following command from an Administrative command prompt:
> netsh http add iplisten ipaddress=::
After trying a number of suggested solutions without success I just rebooted my PC. After that the problem didn't occur anymore.
I ended up with cleaning the project file (csproj) and the applicationhost.config (iis express) with all entries regarding iis express configuration. After that, it worked.
If you're having this after installing Visual Studio 2015 and you can see Error messages in System event log such as this: Unable to bind to the underlying transport for [::]:{your_port}. . The IP Listen-Only list may contain a reference ... then you might be missing a registry entry.
Run this under administrative command prompt: netsh http add iplisten ipaddress=:: to fix it.
I found the solution described in detail here
After all of the steps listed here failed for me I got it working by running VS2015 as administrator.
This happened to me on Windows 10 and VS 2013.
Apparently there is a maximum port number IIS Express handles.
Ports above 62546 don't work for me.
The error can be solved if you just restart Visual Studio. It has the same effect as restarting the Microsoft.VisualStudio.Web.Host.exe*32 process.
Got the same issue where IIS express complained about http://localhost:50418/ and none of above solutions worked for me..
Went to projektFolder --> .vs --> config --> applicationhost.xml
In the tag <sites> I found that my web app had two bindnings registered.
<site name="myApp.Web" id="2">
<application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="C:\git\myApp\myApp.Web" />
</application>
<bindings>
<binding protocol="https" bindingInformation="*:44332:localhost" />
<binding protocol="http" bindingInformation="*:50418:localhost" />
</bindings>
</site>
Removing the binding pointing to *:50418:localhost solved the issue.
Using VS2017 and IISExpress v10.
My issue turned out to be that I had SSL Enabled on the project settings. I simply disabled this because I did not require SSL for running the project locally.
In Visual Studio 2015:
Select the project in the Solution Explorer.
In the Properties window set SSL Enabled to False.
I was able to run the project.
In my situation I was getting an error about port 443 in use because this was the port set on the SSL URL for the project.
Running netstat -abn I noticed that the software "Duet Display" was reserving thousands of ports in the ~51000 range.
Closing it solved my problem.
Sometimes this error my be another Visual Studio version running on the same machine.
Go to the project "Properties" => "Web", and on the "Servers" section change the port to something else that is not used in and save it. You will be asked to created a virtual directory and click "Yes". Now run the project and it will work now.
In my case it worked at first and after a while stopped working and IIS Express reported that the port was in use.
netstat -ab showed that Chrome was using the port. After I quit Chrome, it started working again.
I am not sure however, why Chrome would occupy that port.
This happened to me on Windows 7 and VS 2013 while viewing a project on the browser after build. I only had to close the browser "Chrome" then made sure that the port is not in use in my Network Activities using some utility (Kaspersky) then tried again and worked without any problems.
In Visual Studio 2015:
Find your startup page in your project (eg: mypage.aspx) , and right
click on it.
Click on Set as Start Page.
Right click on the project.
Click on Properties.
Click on the Web Tab on the left.
In Project URL, enter a different port, such as: http://localhost:1234/
In Start Action, select Specific Page: mypage.aspx or select Specific URL: http://localhost:1234/mypage.aspx?myparam=xxx
I write it for information.
Delete the file in the project.
After Clean>Build>Proje Start
I solved this issue by killing all instances of iexplorer and iexplorer*32. It looks like Internet Explorer was still in memory holding the port open even though the application window was closed.
I had this issue with JetBrains Rider, specifically for port 80 and 90 bit it was working with other ports as well as visual studio.
after running as admin this resolved the issue.
In Visual Studio 2019
Just remove Debug profile and create new one Do the Trick
Go to Project properties In debug tab
try first Changing ports Web Server Settings
if Changing ports not worked then Remove Debug Profile and Create new One-Warning Make Sure You Know Previous Settings
What worked for me is disabling all other network adapters, except the one I'm currently using. The event in event viewer was:
Unable to bind to the underlying transport for [::]:50064. The IP Listen-Only list may contain a reference to an interface which may not exist on this machine. The data field contains the error number.
Since I have VMware Workstation, Docker (and thus Hyper V) some VPN clients, I have a lot of network interfaces.

xampp apache not running

I want to install wordpress on localhost
I have downloaded and installed XAMPP.
I have downloaded the wordpress 3.4.1 and placed it in htdocs folder.and i renamed it as demo_folder.
when i type in navigation bar localhost/demo_folder it shows Unable to connect page.
As you can see the apache is not running as shown in fig.
when i click on start it doesnt get started
I dont know why?
can anyone help me out???
EDIT1
the below is netstat -an cmd screenshot
This is a fairly common problem with XAMPP/Windows. The usual suspect is that there is another application running on port 80, which you should terminate. Also please use the web, there is a wealth of information on this topic.
To view all currently open ports and the PID of the process using that port, open cmd and run
> netstat -o
This should help with changing the port Apache runs on: http://www.geckoandfly.com/7491/xampp-apache-wont-start-change-port-to-listen-85/ .
If you're on Windows 7, shut down the Web Deployment Agent Service. That should clear port 80.
XAMPP does have some problems with Windows. You could also try using WAMP. It seems to be a lot easier to install and use.
As for XAMPP, try making sure nothing else is using the port 80.
It seems you have tried to install the XAMP multiple times or PORT 80 has been used by other Application. If you are sure other applications is not using the Port 80 try this:
Close the XAMP and go to run and type services.msc and find the service named Apache 2.x.x etc go to its properties and get the exact name of it . For eg, mysql service name is mysql.
After you have found the service name , Open cmd with administrator privilege and type
sc delete apache
here is the manual to delete the service name :
http://technet.microsoft.com/en-us/library/cc742045(v=ws.10).aspx
after deleting the service name try opening the XAMP and click on Start next to Apache, hope it will be running now.
If nothing works above ,most of the cases I have seen Skype is the problem:
Go to Tools>Options>Advanced>Connections
Untick Use Port 80 for incoming connections

Visual Studio Development Server using wrong port

Related to a previous issue that I thought was resolved and actually isn't...
My Visual Studio 2008 installation may be a bit messed up, I think.
When my ASP.NET project is set up to use VS Dev Server with a fixed port, I get the "Port in use" error described in the linked question.
When my project is set up to use a random (auto-assigned) port number, it works, but it launches the browser using a port number 3 less than the actual Dev Server port number (e.g. if the port number is 1903, the browser launches to http://localhost:1900/)
If I make changes to the project settings, they do not "take" until I save and restart Visual Studio.
Any ideas how to track this one down?
Thanks!
I had a similar problem which hit my 2 main machines at the same time. On investigating I found it to be related to the Eset personal security (guessing a recent update messed something up). To solve it I excluded VS2008 from the active browser filtering - this is in:
setup -> advanced firewall setup -> antivirus & anti spyware -> web access protection -> HTTP -> webbrowsers
Deselecting vsdev in here fixed the problem - interestingly enough disabling the firewall and antivirus / antispyware did not solve the issue, so it is worth looking for a similar setting if you are running different security software
First try to kill all "WebDev.WebServer.exe" processes.
In Solution Explorer, click the name of the application.
In the Properties pane, click the down-arrow beside Use dynamic ports and select False from the dropdown list.This will enable editing of the Port number property.
In the Properties pane, click the text box beside Port number and type in a port number.
Click outside of the Properties pane. This saves the property settings.
Hope this helps
I do absolutely agree with Macros' answer. Just want to share solution for Eset Nod32 v5
In ESET NOD32 v5 to allow Visual Studio to run Development or IIS Express server you must uncheck Visual Studio in Nod32 Advanced Setup => Web and Email => Protocol filtering => Web and email clients
Weird!
The port number is stored in the .sln file. So, I'd blow that away the solution file first, re-create it and see what happens. If that doesn't help, I'd then move onto the web.config file and blow that away and start again too.
I also encountered the same error message:
Unable to launch Visual Studio development server because port [xxxx] is in use.
However, I do not have ESET installed. Instead, I had recently installed GlassFish server on my machine and that was causing the problem. Therefore, in Windows Task Manager, I killed the process it runs under which is java.exe and it fixed the problem.
This also applies to Visual Studio 2010.
And there is more to it.
Symptoms:
A Web (Services) project is configured to run at a specific port, e.g. 10080.
After a while Visual Studio compains “Unable to launch the Visual Studio Development Server because port ’10080′ is in use”
The reason is still unclear. It might have something to do with the webdev server crashing.
Restarting the pc doesn't solve the problem.
Netstat doen’t show an entry for the port 10080
Manually startin WebDev.WebServer40.exe at port 10080 works fine.
Since I'd like to start from within Visual Studio, I moved to port 10081, then to 10082, and today to 10083. I’m running out of ports.
Solutions that did not work:
Restart Visual Studio
Tweaking Trendmicro security settings (couldn't access them)
Disabling Forticlient antivirus/firewall
Workaround that DOES work:
Configuring my project to manually start the server
Right click the project, choose properties
Click the tab "Web"
Pick for start action "Start external program" and point it to Webdev.Webserver40.EXE
(for me: C:\Program Files (x86)\Common Files\Microsoft Shared\DevServer\10.0\WebDev.WebServer40.EXE)
Command line arguments: /port:10080 /path:C:\Solution\Project
Working directory: C:\Solution\Project
Under servers check "Use Custom Web Server"
Do not check any debugger checkbox
Side effect: my project thinks break points are not getting hit. ("no symbols loaded"). Turns out they work like they should.
I hope anybody ever finds a definitive solution, but up until then this workaround does the trick for me.
To solve your problem, just restart your PC. I've had the same problem, I did the same thing.

Resources