Tomcat server could not start - java

I am developing a dynamic web application on JBoss developer, but I am getting an error message:
Could not load the Tomcat server configuration at
\Servers\Tomcat v6.0 Server at localhost-config. The Servers project
is closed.
Even when I try to start the server on the servers tab, it doesn't start.
Any suggestions?

Sounds to me as if you're doing this inside Eclipse with WTP?
If so then you need to make sure that the Eclipse project called Servers which is created and maintained by WTP is open.
Open the Navigator view
Locate the Servers project
right-mouse click
Open Project

You have been closed server project in eclipse which will come by default after adding tomcat into eclipse. So try to open server project and start Tomcat it will Work..
Steps:
Go to project explorer.
Double click on server project.

You installed Tomcat v6 within eclipse using the “Add server” wizard and the “download and install” button.
You tried to start Tomcat and got the following error:
****“Could not load the Tomcat server configuration at /Servers/Tomcat v6.0 Server at localhost-config. The configuration may be corrupt or incomplete”****
How to solve:
1) . Close Eclipse
2) . Copy all files from TOMCAT_6_HOME/conf to WORKSPACE_FOLDER/Servers/Tomcat v6.0 Server at localhost-config
3) . Start Eclipse
4) . Expand the Servers project, click on the Tomcat 6 project and hit F5
5) . Start Tomcat from Eclipse
6) . Enjoy!!!

Just after many trying I got the solution for this problem. The problem is when your server is created using your IDE(Eclipse, JBoss or any) that time the server is not getting the configuration file. To resolve this problem you need to copy all the configuration files from the tomcat conf directory to your IDE server directory. If I will step out the solution than I can list the steps as-
Locate your Tomcat installation directory
Find the conf directory, sometime you will get it into skel directory
Copy all the files from conf and now change the directory to your IDE workspace
In Server directory paste all the files in your Tomcat configuration directory.

If you are using a Linux-based Eclipse:
Check user and group ownership and permissions to your server directory and subdirectories inside Eclipse. It MUST allow read-write config files by the current Eclipse user. Test it copying config files directly to it and, after that, accessing it through Eclipse text/xml editor.
It's usefull too to check the same for tomcat directory, because Eclipse may be bloked if its owner doesn't have permissions to access that files.

the solution to this problem is :
cd /usr/local/tomcat//conf
chmod 777 *
and it's done

I got the same issue. This is because it's missing "Servers" folder that contains Tomcat in Project Explorer. I already downloaded and configured my Tomcat, but after I created another new java web project, Server stopped working.
To solve this problem right click on "Tomcat v6.0 Server at localhost
[Strated,Synchronized]"
at bottom of your Eclipse.
click "General"
click "Switch Location"
click "Apply"
enter image description here

This usually happens when the "Close unrelated projects" button is clicked. A simple and straightforward solution to this issue:
Go to the bottom of the Project Explorer tab and there will be a project named "Servers". If it's closed, the icon will have a different color than the projects that are open.
Double-click on "Servers". Now the project will be open and this issue will get resolved.

Related

Unable to launch war in vsCode

I have a problem i'm triing to launch a war with the tomcat server.
In fact, when i click to launch the war (run on tomcat server) and i go to a localhost:8080, the page of the server says that no wars are on server.
I have try to put the war directly in the application folder of the server, but it's the same thing.
Can someone help me ?
Is it a problem with the war ? i have try with an other war, it's the same thing ?
I'm using a window 10.
Thanks you
.war is a archive file.
You Must Open the file. You can rename the file to .tar and use any Tar Tape-archiver implementation.
Or you can use 7zip to Open the file.
Install the Extension Tomcat for Java
Turn to Tomcat Servers in left side, and add tomcat
Right click the tomcat and choose start, after it's started successfully, right click and choose Debug War Package, this will debug the war, if you don't want it, just stop the debugging
Rigth click the war then choose Open in Browser:

Http 404 not found tomcat 8.0 server

I have installed tomcat 8 server on eclipse and changed the port to 9009.I started the server and on visiting localhost:9009 it says 404 not found.
On changing the server location to the second option in the image,it worked.Can someone throw light on these three options ?
Click here to see the image
By default eclipse forgets to Copy root folder to eclipse workspace tomcat installation files. Hence it doesn't contains tomcat homepage files which in turn throws resource not found 404. But second option will take control of tomcat installation folder. Hence it works.
First option: webapps will be available in Eclipse workspace.
Second option: webapps will be available in tomcat installation directory.
Third option: webapps will be available in custom directory which we have given.
To make first option to work do this.
Copy root folder of tomcat installation dir under ../webapps to /wptwebapps of eclipse workspace something like org.eclipse.wst.server.core\tmp0\wtpwebapps (or .../tmp1/wtpwebapps if you already had another server registered in Eclipse).
Then restart tomcat server in Eclipse. Homepage of tomcat will be loaded.

Tomcat interrogation with eclipse under linux/mac

I added my local tomcat 8.0.14 with eclipse successfully. My local tomcat is located at /Users/masum/tool/tomcat-8.0.14. I can see it form eclipse runtime Environment as well. Whenever I deploy any webapp to eclipse's tomcat. It doesn't appear in local tomcat-8.0.14/webapps directory. I expected it should go there. But it doesn't.
Also is I do any changes in tomcat/conf/server.xml. These changes doesn't effect in eclipse integrated tomcat. Also if local tomcat is running, port number conflicts with eclipse's tomcat. I have to stop local tomcat to work with eclipse tomcat. Looks like two different instance of tomcat.
My question is where does eclipse tomcat physically located? If I deploy any web app in eclipse tomcat where it actually goes? How can I configure Tomcat so that I can control it both from eclipse and also manually?
Thanks in advance.
Double click your tomcat server in the servers tab. In the servers tab you will see "Server path" under server locations. This is the location of eclipse's tomcat working directory. If you stop tomcat and undeploy all web apps, start and stop again, you will be able to select other options. Click "Use custom location" to set the location to a place of your choosing. In project Explorer you should see a tomcat folder. Under that folder you will find server.xml and the other config files, which you can modify as needed.

build-impl.xml:1031: The module has not been deployed

I have been working on a Java web application and i am using SmartGwt on Netbeans 7.3 and out of a sudden I encountered this problem. I tried cleaning the build-impl.xml then restarting the IDE and I should say I have fairly low knowledge on this. Can someone please tell me why it is giving an error and how I can fix that?
The error message says :
nbproject/build-impl.xml:1031: The module has not been deployed. See the server log for details.
BUILD FAILED (total time: 4 seconds)
Note: i am using Tomcat 7.0.34
may its so late but the response useful for others so :
Sometimes, when you don't specify a server or servlet container at the
creation of the project, NetBeans fails to create a context.xml file.
In your project under Web Pages, create a folder called META-INF.
Do this by right mouse button clicking on Web pages, and select:
New->Other->Other->File Folder
Name the folder META-INF. Case is important, even on Windows.
Create a file called context.xml in the META-INF folder.
Do this by right mouse button clicking on the new META-INF folder, and
select:
New->Other->XML->XML Document
Name it context (NetBeans adds the .xml)
Select Well-formed Document
Press Finish
Edit the new document (context.xml), and add the following:
<?xml version="1.0" encoding="UTF-8"?>
<Context antiJARLocking="true" path="/app-name"/>
Replace app-name with the name of your application.
Now your in-place deployment should work. If not, make sure that the
file can be read by everyone.
The context.xml file is specific to Tomcat. For more information about
that file, see the Tomcat documentation at tomcat.apache.org.
Start your IDE with administrative privilege( Windows: right click and run as admin), so that it has read write access to tomact folder for deployment. It worked for me.
Take a look at the server logs!
I had been with this for hours. The awful Tomcat servlet is not very helpful neither but if you can see the stacktrace that should be enough.
For instance, I read the following error message there:
As you can see, the message was pretty clear and easy to fix :-)
Check if there any other instance of the server is running already
Check if the port that will be used by the server is free.
If you add jars in tomcat's lib folder you can see this error
Close Netbeans.
Delete all libraries in the folder "yourprojectfolder"\build\web\WEB-INF\lib
Open Netbeans.
Clean and Build project.
Deploy project.
One of the main reason for this error is due to permission not granted to all users. so remove this error, follow the following steps :
1) Go to the C:/Programme Files/Apache Software Foundation/Tomcat 7.0
2) Right click on the Tomcat 7.0 folder and click on properties.
3) go to Security Tab.
4) Select the User and click on Edit... button
5) Grant all the permission to the user and click on apply and ok.
Refresh the system and now try. I hope it will work
if you still getting this error try this.
Go to Netbeans services
Remove Apache Tomcat.
Add Apache Tomcat again.
Build Project.
Deploy Project
in my case , it said that the 8080 port is in use , so I change the server port of Tomcat to 8081 and it works
Check whether you placed the within the .. or outside the ...
If you placed it outside the server tag , and if you try to access the init-parameter then it will give error.

Location of localhost folder in Ubuntu 12.04

I'm running eclipse Juno, with Tomcat 7.0.29. I have some files that are saved to the root of the webapp by my webapp and I want to delete them. I'm trying to find the localhost folder in order to be able to do this. Everything I'm reading tells me it should be at /var/www, however there is not /www directory in var. Where could it be?
Since you're using Eclipse IDE and you don't know where your Tomcat installation folder is, you can find it using the IDE by going to Windows/Preferences. It will pop a Preferences window, select the Server/Runtime Environment option in the left tree, in the right side must appear Apache Tomcat v7.x. Select it from the list and select the Edit... option, it will show you the tomcat installation directory. Let's call this folder <tomcat>
Now you know the folder installation, but maybe Eclipse is not using it to deploy the Java Web applications. To make sure of this, in your Eclipse, go to the Servers view (if it's not visible in the IDE, go to Window/Show view/Servers), it will show you your tomcat server (and others), double click on it. In the Tomcat overview window, check the Server locations panel, expand it and check where the webapp is deployed:
If selected option is Use Tomcat installation then the web app must be in <tomcat>webapps
If selected option is Use workspace metadata then the web app must be in your workspace inside .metadata/.plugins/org.eclipse.wst.server.core/tmp[number]/wtpwebapps (thanks to Lars Vogel blog post). This is a special folder created by Eclipse.
Default tomcat folder is at /var/lib/tomcat7. Your webapps are under /var/lib/tomcat7/webapps
Not sure what localhost folder you are referring to. There is /etc/tomcat7/Catalina/localhost but I dont see a reason why you should be touching it.
This assumes you used standard Ubuntu tools to install tomcat.

Categories

Resources