Change remote glassfish server port in Netbeans 7.3 - netbeans

how can I change the default port 8080 when creating a new remote server instance in Netbeans 7.3?
The common way to change this for local glassfish instances is to edit the domain.xml file. But this doesn't work for remote instances. I even changed the local glassfish domain.xml file to use another port than 8080. This affects local glassfish server instances in Netbeans but not remote ones.
Any help would be appreciative.

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.
2.Go to the folder where Glassfish in installed.
3.Go into config folder which is as follows (yours might be different): c:\netbeans6.8\glassfish-3\glassfish\domains\domain1\config
4.Open domain.xml using any text editor.
5.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.
6.Save domain.xml.
7.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
8.Restart GlassFish, if it was already running.
I got my source from a blog post you can find here.

Related

Liferay homepage is not found after starting the server in Eclipse

I have set up a Liferay Tomcat Server in Eclipse. After the server starts and I go to localhost:8181 (where I configured the server), the page is empty. Also, if I right click the server in Eclipse and select Open Liferay Portal Home, a 404 Page Not Found is displayed.
When I start the server outside Eclipse, with startup.bat, the page loads just fine.
Does anyone have a clue about why this might happen?
This answer assumes you're using Liferay IDE in Eclipse. It might be accurate even if you're not.
Try making your edits in the Eclipse workspace's server.xml file. The workspace should have a Servers folder, with your Tomcat Liferay server underneath it. The path in my workspace is as follows:
eclipse-luna-workspace/Servers/Liferay v6.2 CE Server (Tomcat 7) at localhost-config
Underneath the directory for the server are copies of the Tomcat configuration files, including server.xml. Make your edits to this server.xml file, restart your server in Eclipse, and Eclipse should copy it to the Tomcat instance at startup.
Where you defined Tomcat http port? And in which way Tomcat is configured in Eclipse?
These questions because Eclipse is able (but it's not mandatory) to override Tomcat default configurations.
Just a note: do you try to use Liferay plugin for Eclipse? It can help you to proper configure a Liferay server in Eclipse (and help you for development also).

running java web projects using Eclipse and tomcat issue

I have installed tomcat 7.0.37 and Eclipse juno on ubuntu 12.10 and build my first jsp based web app. but when I hit run as -> run on server eclipse shuts down. one issue is that on restart tomcat does not start and pops the error:
Several ports (8005, 8081, 8009) required by Tomcat v7.0 Server at localhost (2) are 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).
In Tomcat installation folder, you can find a folder called conf and in that you can find a XML file server.xml.
This file contains the ports Tomcat has to use. Update that file with different port numbers and try again.
Okay, at last I solved it. first I changed the default browser from internal to system default and it solved the eclipse shut down. second I moved the files into the Web Content folder under project structure. and now I have a running JSP application. thanks to all geeks on web.
:)
If You use eclipse then double click on servers and double click on tomcat server then one file will open. in that change HTTP port to some other port number and save(ctrl+s) then again start the server . it may be work fine

Eclipse + JBoss Tools won't run webapp to configured JBoss AS

I am using Eclipse 3.7.2 with JBoss Tools 3.3 under Ubuntu 12 and have configured a locally installed copy of JBoss AS 7.1.1 in Eclipse under "Preferences::Server::Runtime" Environments.
However, when trying to run a Java EE application by double-clicking on the project or an .xhtml page I only see "Run As / Run" on Server as an option and I get an HTTP 404 from Apache Tomcat/7.0.26 at localhost:8080. That is, it seems like Eclipse is trying to deploy to a Tomcat server as opposed to the JBoss AS I have configured in "Preferences::Server::Runtime" and I don't get an option like "Run on JBoss" or anything. When I export my application as a war and manually deploy to JBoss AS the app runs fine.
The idea is to add your application to a specific server that you have configured. Additionally; just adding the server runtime isn't enough.
You need to open the Servers view, and from there right click on the background and select New, and then Server. If you choose JBoss Community -> JBoss AS 7.1 here, you can select your previously created Server runtime in the Server runtime environment, or optionally create a new one.
Then comes the mental twist that you need to make. In WTP you don't use the Run As command, but instead right click the server in the Servers view (default name should be JBoss 7.1 Runtime Server, and select Add and Remove. Select one or more applications from your workspace that you would like to run on your server. Click finish when done.
Now right click again on your server, and choose either Start or Debug.

Why eclipse always complain that the tomcat server port is in use?

I have a eclipse web project source code, the name of the project is "My-Proj" .
I download Eclipse Java EE version (Indigo) , extract the achive, then I started the eclipse IDE. After I successfully installed tomcat7 server into the Eclpse IDE. I import my existing project to Eclipse IDE.
Then I run my imported project by choose "Run on server", but eclipse pop up the error message window like below:
I saw the port has been used, so I change the server running port by double click on tomcat server V7 under Eclipse "server" tab, and change the port to 8085 as below (see the right side of the image):
Please right click the image and view the image if you can not see clearly.
I run the project on server again , but I got the same error, port 8080 is in use, why? I have changed the port number to 8085, why it still complain the port 8080?
You need to change the one labeled "HTTP/1.1" not "Tomcat admin port" (in your image above on the right hand side where ports are).
Second you probably have an existing tomcat running that was not shutdown (unless you purposely have something else running on 8080). Shutdown eclipse and then look for any running java process that look like tomcat and kill them.
As Adam said, you'll need to change the HTTP/1.1 port if you want to have Eclipse's tomcat running on a different port to avoid the conflict.
However, this conflict is usually because your installed Tomcat is also running outside eclipse. You probably don't need two Tomcat instances running at the same time, so you might want to shut down the non-eclipse one. You can do this using the services panel in Windows, or using init.d on linux.
If you have multiple tomcat instances, try to change all ports in elipse - tomcat admin port, http/1.1, AJP. It works for me - I have eclipse from tomcat and netbeans on one machine.
Remember about firewall - it may be problem.

Are Tomcat server and Tomcat linked with Eclipse different?

I have installed Tomcat 7 server on Windows on port 8088.
Now I have added the server in Eclipse.
But I am not sure whether I need to keep the Tomcat running by going in the Tomcat directory or I have to close that and run from Eclipse?
And how will Eclipse know that I have setup the Tomcat on port 8088?
In the server view, you can double-click on your tomcat server and change the ports. This means that the folder where you have tomcat running (CATALINA_HOME) can still be used run Tomcat "production" and eclipse will use the same binaries to run within WTP. However, all other folders will be confiurable for your "dev" instance.
Actually you'd better change the settings to make sure there is no collision between eclipse ports and the ports declared at windows level.
Another simple solution is to stop tomcat at the windows level. Eclipse will take care of its own instance.
Other useful settings you can modify are the timeouts (in debug it's sometimes necessary), the deploy folder and even add some more web apps (modules tab).
do i need to keep the tomcat running
by going in the tomcat directory or i
have to close that and run from
eclispe.
No you don't need to keep tomcat running outside. You can run/stop it whenever you want from eclipse.
how will eclipse know that i have
setup the 8088 port
You will find project named Server or Servers; depends on eclipse version; in your workspace; in which you have added tomcat. It has tomcat configuration file which tells eclipse how to manage tomcat. It has a file called server.xml which contain port information that is on which port tomcat will run.