tomcat not running eclipse application - java

I was using eclipse and tomcat 7.0 fine for all web application till yesterday but unfortunately i lost my eclipse folder(which is i am running exe) and temp folder(which is workspace directory) so i tried to add new project in new workspace(home/xx/newtemp) and tried to run by tomcat 7.0 but i am getting "Could not clean server of obsolete files: null
java.lang.NullPointerException".Here i show my issue by images,
Even i tried,
1 stop server
2 project -> clean
3 project build (I had automatic build disabled)
4 delete server
5 delete Servers folder
6 restart Eclipse
and also,
Click on Servers tab and Stop the server in use if it's running
Right click on the server again and select Clean...
Right click again and select Clean Tomcat Work Directory...
when i do Clean Tomcat Work Directory, getting error like below image,
and also servers switch location in tomcat 7.0 only.
How to fix this?

you have to delete the .snap file located in the directory :
<workspace-directory>\.metadata\.plugins\org.eclipse.core.resources
After deleting this file, you could start Eclipse with no problem.
Source

Go to %CATALINA_HOME%\webapps\ROOT, and delete old existing project. %CATALINA_HOME% is your Tomcat install directory.

Related

Run on server option not appearing in Eclipse when right clicking on a .jsp file

Run on server not appearing when I right click on a . jsp file, but when I right click on the folder it show Run on Server, but I get a 404 ERROR.
What I'm using:
Eclipse IDE for Enterprise Java
Java 8 / 1.8 JRE
Tomcat 9
MySQL
What I done so far:
Delete Eclipse from my computer entirely and reinstalled Eclipse IDE for Enterprise Java developers
Deleted Tomcat 9 from server on Eclipse and re-added it.
Edited my Project Facet and have Dynamic Web Module Turned On
Checked my Java Build Path
I figured out the issue
My directory was messed up this is before and after so it didnt recognized the web content.
Your JSP file is not in the deployed WebContent folder. It can't be Run on the Server from where it is.

GlassFish 4.1 in Eclipse errors java.io.FileNotFoundException: null/config/domain.xml (file or directory does not exist)

I'm trying to start glassfish from eclipse luna but I have this error
Unable to start server due following issues:
java.io.FileNotFoundException: null/config/domain.xml (file or directory does not exist)
Glassfish works correctly if I start it with command
sudo ./asadmin start-domain domain1
from the shell.
How can I achieve the same result without going always through the terminal?
I faced exactly this problem today. The domain path is missing in GlassFish configuration. This can happen when you add GlassFish 4.x server in all hassle without completing the entire Add Server wizard. The domain path is set during 3rd step which would be skipped when you finish the wizard already during 1st or 2nd step.
You can put it back in server's properties. Rightclick GlassFish entry in Servers view, choose Properties, open GlassFish and set the Domain path accordingly (it would be blank when you faced this problem).
No need to reinstall the whole IDE and server as suggested in other answer. That's way too drastic.
Reinstall:
- Eclipse Luna
- GlassFish 4
Delete all old file. Then reinstall Eclipse-GlassFish connector (because start up GlassFish manually still working.)

Soleustions for Tomcat with eclipse

I get this problem running Apache server on eclipse
Could not load the Tomcat server configuration at \Servers\Tomcat v7.0 Server at localhost-config. The configuration may be corrupt or incomplete.
Resource is out of sync with the file system: '/Servers/Tomcat v7.0 Server at localhost-config/web.xml'.
I need your help please
The problem is that tomcat files have changed and your eclipse still have the old tomcat files... this might happen if you manually deploy something on your tomcat or for some other reasons.
I would try to refresh the Servers folder in eclipse (right click > refresh or just F5) and see if the problem disappears
If this does not work. I would delete the tomcat servers in eclipse and recreate it (right click in the server view and click "new Server")
Here are the steps to follow:
In Eclipse, Open the "Server" tab.
Double click on the "Tomcat7" entry to see the configuration.
Then click on the "Open launch configuration" link in the "General
information" block.
In the dialog, select the "Classpath" tab.
Click the "Add external jar" button.
Select the file "/usr/share/tomcat7/bin/tomcat-juli.jar"
Close the dialog.
Start tomcat 7 from Eclipse.
as described here: link
Cheers
Encountered the same issue and solved by doing following changes
First Close Eclipse
Copy all files from TOMCAT_7_HOME/conf
Paste inside to WORKSPACE_FOLDER/Servers/Tomcatv7.0Server-atlocalhostconfig
Start Eclipse
Open the Servers project, click on the Tomcat 7 project and refresh
Start Tomcat from Eclipse
final view of Ecclipse after fix server issue

Can not deploy web project to myeclipse+tomcat

I'm a new comer for java web development.
I can now start my tomcat6.0 with myeclipse 10.0,and have that famous tomcat welcome page on localhost:8080.
Then I try to create an empty web project.And right click to tomcat 6.0 under the server tab, choose "Add deployment",I choose project name and other things left with default.
then run my tomcat server, visit localhost:8080/projectname/index.jsp in my browser, it reply 404 error to me,"description The requested resource is not available.".
What I've repeated done:
1.Window->reference->server->tomcat 6.x, select the folder of tomcat.make sure the jdk version.
2.file->new->web project input name and done.
3.right click tomcat 6.0 in server tab, add deployment, choose project then done.
4.start server
5.goto browser ,input localhost:8080/projectname/index.jsp, got 404 error
6.select this project, try to run as myeclipse server application, it tell me could not redeploy
There are two signs maybe help.First is, when I right click tomcat under servers tab and add deployment, there is a yellow exclamation mark before it, and "deployment status" says "Deployment is out of date due to changes in the underlying project contents. You'll need to manually 'Redeploy' the project to update the deployed archive."
The second on is, I can not find any thing related to my project under webapps.Is it because I installed tomcat under C driver and myeclipse have no privilege to write things into there?
I don't know why this happen, I followed everything tutorial about this topic show me. Is there anything I missed?Please, any help will be appreciate!!
If you create empty Dynamic Web Project from Eclipse it will produce no result as it have no code your scr and WEB-INF folders will be emplty
Did you stop tomcat wich you run manually before start it from Ecliple? By default when you start your tomcat from Eclipse you not able to see welcome Tomcat page. Please post link with your tutorial here.
Alright, problem is solved.
I did several steps, and I'm not sure which one is the key move, I just have the content within index.jsp.
First I uninstalled my tomcat in C driver.
Then instead of exe binary format tomcat installer, I unzip my tomcat rar package into D driver.
Then change CATALINA_HOME,point it to new path
I also changed my MyEclipse's default workbench. Because there's also a Eclipse in my computer, they two were share the same bench, now I seperate them.
Pay attention, after change the workbench, the eclipse tomcat become enable again,which has been disabled in earlier operation, and jdk for my tomcat 6.0 has to be redeclare.
Last step, I point tomcat to the new one on D driver, and deploy again, everything just rock and roll.
ENV:Win7 32bit, myeclipse 10.6, tomcat 6.0

Running a duplicate Java Project on Tomcat 7

I'm working on Java project for a portal. I checked out a sample portal from an svn, and pasted a renamed copy of it in the eclipse package explorer.
When I tried to run this new project on a Tomcat 7 server, I got the error message:
Could not publish server configuration for Tomcat v7.0 Server at localhost.
Multiple Contexts have a path of "/SamplePortal".
What do I need to do to get this new project to run?
All the suggestions in this thread are valid. If you extract the war file into a folder inside of Tomcat's webapps folder, it should work.
If you are trying to do it from Eclipse, make sure the file server.xml is not corrupted, or that Eclipse is not misreading it. Restart Eclipse if that is the case.
You need to change the name of your project directory or .war file so it doesn't conflict with the existing SamplePortal project.

Categories