Tomcat - how to create multiple servers with separate configuration - eclipse

I'd like to run a separate Tomcat Server in my Eclipse/STS environment to mirror the production environment. I managed to create a new Tomcat server with copy/paste, but the "Server" section under navigator still shows only a single Tomcat server. Any idea how to fix this?

1st. Copy-paste the configuration located in Servers project, and rename it to the_new_server
2nd. Copy-paste the server in "Servers" view
3rd. Double click the newly created server, fill the fields as shown, use the Browse button for choosing the configuration path, otherwise won't work, and save
4th. Right click the new server and select Properties. Click "Switch location".
A dialog will appear asking you "Do you want to rename...", but this is not important, if you click "yes", the config folder will be automatically renamed to the_new_server-config.
5th. That's it.

Related

How do you export Servers in Eclipse/SpringToolSuite?

Is there a way to export both Server launch configurations and the actual Servers (e.g. as seen in the 'Servers' view)?
I have four Tomcat Servers configured in Eclipse/STS, corresponding to four Server launch configurations. I want to export both of these sets so I can import into another workspace.
The Eclipse Export wizard has an 'Export Launch Configurations' but there is no apparent option to export the actual Servers and their associated settings (server name, ports, modules, etc).
Given the maturity of Eclipse assume it is there and I'm just missing it.
I am not sure if there is a direct export present. But there seems to be another way of doing it. You can go the properties of the server you want you export. You will find 'Configuration path' over there. You can click on browser and copy the desired configurations.
All the configurations for that particular server are stored in that location. Sometimes this shows up in your package explorer as well if config is present inside workspace.
You may right click on the servers folder(inside pakage explorer) and then select show in>System explorer.
You can copy the server config and replace them on the other machine's workspace.
Similarly if you really want to copy servers, in server properties if you scroll down, you'll find 'server path' and 'deploy path'. You can navigate to that path and replace them on your new machine.

Running JBoss Server from eclipse [Adempiere project]

For testing the webui of adempiere, I need to build the code and deploy it every time with all change. Its much time consuming. The remote debugging is quite useful. But the build, setup and server running time remains the same.
Can we run the JBoss server through eclipse ? Hence can we write the code and test it on debug mode?
You Can run the jboss server in eclipse and deploy adempiere projects in jboss also
Download the jboss4.2.3 and place into your desire location in your drive.
Extract the jboss zip file (let say /home/Giri/Server/jboss4.2.3GA/....)
Open your eclipse IDE, and open the server pane
Click on the Window And choose Show View
It will open a popup and select the server (By writing the help text you will get)
Right click on the server editor, New---->Server
It will open the a new server pop-up
Select the jboss and select the jboss version as the 4.2
Click on the Next button
Here you need to select the your jboss server path (as previously i mentioned /home/Giri/Server/jboss4.2.3GA/ )
Click on the Next (no need to change the ports)---> Finish
Don't bother about the project Add And Remove Project
Now in server editor you will get a jboss server details in single line
Now double click on the server, or Right click on the jboss server And select the Open
It will open server details page
Now update the following settings
In Publishing :- Select Never select auotmatically
In Time Out :- Set start time as 5000
Save(CTRL+S) the settings and close the settings
Click on the Open launch configuration
It will open the a pop-up
Now Navigate into classpath tab, And select the User Entries and add the following mentioned jars by clicking on the Add Jars button at right side
trunk\tools\lib*.jars (Except cglib.jar, log4j.jar, jnlp.jar, javaee.jar)
trunk\japserreportstool\lib*.jars (Except jfreechart***.jar)
and add the javaw.jar from the jre library (by using Add external jars)
If you want to configure the properties files then add the properties files details into Arguments tab
Save it and close it
Right click on the server and Click on the Add And Remove Select available installers and add to right side tab, and click on Finish.
Run click on jboss and publish after that start it....
Hope your server will start properly .....

Tomcat 6 Eclipse config -- Server Locations locked for edit

I am trying to change the default location for my Tomcat server running out of Eclipse EE 1.4.1 so that it uses the original Tomcat installation (which works fine when run standalone out of the console) and not the one created by Eclipse in the workspace as per this thread. However, my Server Locations section on the Tomcat server configuration form is all grayed out (see red rectangle):
Why is that and how do I change it?
It says it all on the page you published :
Server must be published with no modules present to make changes.
Stop your server. Undeploy everything and then (the trick part) click on publish to be sure to have nothing deployed (ie no files copied to the deploy location, the click on publish with no module in your server will erase everything deployed).
Then you will be able to change the setting.
Before making any changes in Tomcat Server Location, you need to remove project(s) deployed on server.
To remove project:
expand tomcat server in "Servers" view
right click and select remove
Just stop your tomcat server first ;)

Eclipse: Apache Tomcat doesn't update my project until I restarted Eclipse

I have tested my a simple form.html. I change something on here, and right click on project, run on server. My server (Apache Tomcat) will run my project.
But, I don't know why, it rarely update my project. (mean form.html no change !!!) until I restart eclipse and run project again.
Maybe the strange thing is : no message box appear asked me: "Do you want to restart server" like before. But I have config in Eclipse that "always restarted server when required" to "always". But, after I change something like some space in form.html, I just see that Eclipse save and run project. (not stop and start server again). Maybe the problem here !!!
(before that, I have clicked that not restart server, and remember this action), but I don't know how to config again for this
Thanks :)
Open the "Server" view and doubleclick on your server. Check the server location and deploy path. Open the publish tab and make sure "automatically publish when resource changes" is selected. Static resources will be hot deployed and there's no need to restart the server.
You can always republish resources by clicking your servers name in the Server view and then clicking the icon to the very right (in the header), Ctrl+Alt+P.
The "restart server" function can be modified here: window > prefereces > server > launching.

Server configuration is missing in Eclipse

Im using Eclipse Galileo, and have configured it for Apache Tomcat . I have added Apache Tomcat 6.0 to Windows->Server->Runtime Environments, with the following settings:
Tomcat Installation Directory - C:\apache-tomcat-6.0.24\apache-tomcat-6.0.24
JRE - Workbench Default JRE (This points to C:\Program Files\Java\jre6)
Now, I create a Dynamic Web Project, and add a JSP file to it. But, when I run the project I get the following error:
The Tomcat server configuration at \Servers\Tomcat v6.0 Server at localhost-config is missing. Check the server for errors.
Any way to fix this?
Probably, you have some problems with your server's configuration.
Follow these steps to remove and create a new one, it might help you.
In Eclipse
1. Window -> Show view -> Servers (If you cannot see it, you might need to choose Others -> Server)
2. From Server view -> Delete the server which has problems.
3. Right click -> New -> Server : to create a new one
In my case, after new server was created, I get rid of this "localhost-config is missing"
I faced the same problem once. THe reason for this is that even though the server is available, the config files are missing. You can see the server at Windows -> Show view -> Servers. Their configuration files can be seen at Project Explorer -> Servers. For some reason this second mentioned config files were missing.
I simply deleted the existing server and created a new one with this the config files were also created and the problem was solved!
Similar solution is given at here by Emertana EM
java.lang.NoClassDefFoundError: org/apache/juli/logging/LogFactory
In Eclipse Neo
1. Window -> Show view -> Servers
2. Right click on server -> choose Properties
3. From General Tab -> Switch Location
As Yoni already mentioned, you probably deleted the project named "Servers" from your Project Explorer. If config files for the server still present on a file system, the quickest way to restore it will be Right Click in Project Explorer->Import->General->Existing Projects into Workspace, then select the root dir where Servers dir located, set checkbox near "Servers" and finally click Finish. If everything works as expected, you should see the 'Servers' project added to the Project Explorer view and your old config files will be there. Finally, save the tomcat configuration which you had open. You can startup your Tomcat server without errors now.
From project explorer ,just make sure that Servers is not closed
You need to define the server instance in the Servers view.
In the box at the right bottom, press the Servers tab and add the server there. You by the way don't necessarily need to add it through global IDE preferences. It will be automagically added when you define it in Servers view. The preference you've modified just defines default locations, not the whole server instance itself. If you for instance upgrade/move the server, you can change the physical location there.
Once defining the server in the Servers view, you need to add the newly created server instance to the project through its Server and Targeted runtime preference.
If you're not too attached to your current workspace you can create a new workspace, follow BalusC's steps for server creation, and recreate your project in the new workspace.
I got the same error after installing Eclipse Java EE IDE for Web Developers(Juno) but using the workspace of a much older Eclipse installation. When I created a new workspace I was able to get my Tomcat server running without this error.
Did you, by any chance, deleted stuff from your workspace, or moved it around?
When you create a server for the first time, either globally or through the project's "run on server" settings, Eclipse creates a project in the Servers view, as BalusC pointed out. Eclipse stores this server inside your workspace, in a project called Servers. The project needs to be open for tomcat to run.
(If you want, you can store the server settings elsewher. You can right click and open the server instance from the Servers view and configure various parameters and locations)
This happens when Eclipse shuts down incorrectly - delete the server and then re-create it again.
Remove the server from IDE and install again to it.
In my case, the server list was empty for Apache in "Run Configurations" when I opened
Run > Run Configurations
I fixed this by creating a server in the Servers Panel as in other answers:
Window -> Show view -> Servers
Right click -> New -> Server : to create a new one
this worked for me
In the Server's tab in Eclipse, Stop the Tomcat server
Right-click the server and select "Clean..."
Right-click the server again and select "Clean Tomcat Work Directory..."
In the Eclipse, select the top-level menu option, Project > Clean ...
Be sure your project is selected and click Ok
Restart Eclipse
4th Step is most important.
Go to Servers remove the existing server by clicking delete.
Click the blue link to launch the server.
Set a new runtime environment.
Close the Eclipse and launch it again.
Boom it works!