if you are using sts and your server is pivotal just double click on the server and go to >modules tab >display configure the web modules on this server.>you can just remove modules and run once again.
//trying to do more than one thing to the object in the same context,
//the solution is to work on single context objects
public class singletoncontext<tcontext>
where tcontext: dbcontext,new()
private static tcontext _context;
public static tcontext getinstance()
if (_context == null)
_context = new tcontext();
remove the space or empty line in server.xml or context.xml at the beginning of your code
in my case i found duplicate paths in servers/tomcat5.5 at localhost-config/server.xml under tag. removing the duplicates solved the problem.
delete org.eclipse.wst.server.core and org.eclipse.wst.server.ui from .metadata/.plugins of wrokspace
delete the server from eclipse then reconfig the server in eclipse.
go to servers click right at tomcat click at add and remove then click at remove all
it is pretty easy to do for me. if you created the server and you know the path of the directory where the server files are located then one can simply open the server.xml file which is right inside the server's folder.
just edit the file to remove repeated <context...> tag for the specific project which on running threw the error previously.
- in eclipse, in servers, expand apache tomcat
- delete all the "contexts"
i had that problem before. i just solved it by expanding the tomcat tree and delete the folder that is causing the clash. in your case is
/firstapache. after you delete it. then you rerun it, you should be able to run. if it happens again, delete it and try again.
this error occurs when you copy a project than past it, and then you change the name of that project.
in such a case, follow the following steps.
step-1: you need to edit your web.xml file. remove servlet and servlet-mapping of the previous projects.
step-2: got to server--> server.xml--> find context
example :- context docbase="jspandservletdemo" path="/jspandservletdemo" reloadable="true" source="org.eclipse.jst.jee.server:jspandservletdemo"/>
now you just need to change the pathname to your current project name.
good luck happy coding :)
try to delete the existing tomcat server in the server console. if you don't have the console then you can go to "show view ->server", delete the server by right clicking on it, then add a new server.
if you are using tomcat 7 and eclipse, click on the tomcat server and then goto the modules tab. there you will find the duplicate entry. remove both the entry and redeploy the application. you are good to go now.
on a related note, if you have copied a project or in anycase, have the same context path for 2 'active' projects, you have to change the context path of one of them, then clean the tomcat server settings, then republish the servers
simply remove the server in eclipse and add tomcat server again. than shutdown the tomcat in tomcat/bin/shutdown.bat file and start the server in eclipse.
- in your project's properties, choose "web project settings".
- change "context root".
- clean your server
- now you can restart your server
eclipse >> project explorer >> servers >> server.xml >> tag >> remove duplicate tag of your project
in eclipse using tomcat you just open this server.xml file and find context tag and here you see your context name is more then one you just delete useless contexts and restart your server it will working....
go to the servers project in eclipse, under your runtime server configuration(in my case tomcat v7.0 server at localhost-config) go to server.xml file then search for <context> tag, normally you will find more than one context tag, delete them and run your application in the appropriate server that will work now.
in my case i have found duplicate context tag :
<context docbase="my-project" path="/my-project" reloadable="true" source="org.eclipse.jst.jee.server:my-project"/><context docbase="my-project" path="/smartphone-selfcare" reloadable="true" source="org.eclipse.jst.jee.server:my-project"/></host>
server.xml and search for
"context" tag with a property name
remove the duplicate lines here. then try to restart the server.
in eclipse, go to the servers project. open the tree for the tomcat version you are using. open file server.xml and verify your context tags.
in sts/eclipse go to "project explorer" or "package explorer" and
there is a folder called "server." open it and you will find
server.xml file. inside this file at the bottom you find a definition like
<context docbase="myproject" path="/myproject" reloadable="true"
you might find duplicates of the same definition that you would need to remove.
search for the
server.xml file and check your
<context> tags, probably there are multiple definitions for the same path. remove the duplicates and it should work for you.
check out the answer here.
auto-format the xml file (control + shift + f) since the second
<context> tag may be on the same line, but outside the viewport and really far away from the visible one.
- Multiple contexts with the same path error running web service in Eclipse using Tomcat
- Connection refused error in java using Google map API with eclipse IDE while the same URL is giving me the result in browsers
- Error 500 launching the Web Service Explorer with Eclipse
- Import multiple Eclipse projects using the same library projects to Android Studio without ending up with duplicate modules?
- When I am running in intellIj the same code is working properly but when running in eclipse with STS support I am gettinh below error
- Importing multiple projects with the same name in Eclipse
- How do I get Logcat for multiple devices running at the same time in Eclipse
- Using Eclipse with Arabic and English on the same line
- Eclipse Luna - Getting error - 'Could not publish server configuration for Tomcat v7.0 Server at localhost. Multiple Contexts have a path of "/abc"
- 404 error with a simple RESTeasy service on tomcat 8 running with eclipse luna
- Android and Eclipse. Must I include service code in my app? Multiple apps are using the same service
- Running Axis2 web service client is generating an error at the client and the server side
- Trying to remotely compile, using the command line, a Java program with multiple dependencies that I can currently only compile locally in Eclipse
- How can I automate installing eclipse with the same plugins and settings on multiple computers?
- Multiple Android projects using Crashlytics in the same Eclipse workspace
- Open web service explorer with http error 500 in eclipse
- git modifying code on multiple branches using the same eclipse workspace
- Running multiple instances of an application with different arguments using eclipse
- Using same ivy-settings.xml in Eclipse with IvyDE for the ant task
- Dealing with duplicate classes with multiple maven-jaxb2-plugin executions using different schemas with the same base schema
- A web application running in JBoss EAP through Eclipse cannot be accessed from another computer in the same network
- Eclipse with tomcat : java.lang.reflect.InvocationTargetException when I try running a web service client
- Running the same run configuration in eclipse multiple times
- What is the easiest way to have multiple eclipse installations using the same eclipse.ini file?
- Error in Eclipse while running a simple function on web service client
- Error when running the WordCount example pipeline on Dataflow with Eclipse
- in selenium web driver using eclipse how to clk on href link when two href with same text present in html code
- Running the suite from jenkins is throwing error of Element not found but same build passes smoothly when run as TestNG suite from Eclipse IDE
- Different behaviors when publishing the same Spring web application with J2EE eclipse (4.4.1) and STS eclipse (4.5.1)
- When I am running program with the help of appium on eclipse i am getting session not created error
More Query from same tag
- Error in building eclipse project after update sdk and play services [Unable to execute dex: method ID not in]
- How to manage free and paid app in Eclipse?
- Getting Error when opening Eclipse Market
- How to get my output to read from the text file?
- java.lang.SecurityException: Invalid signature file digest for Manifest main attributes
- Eclipse: I have added the JAR file. java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
- Worklight/MobileFirst Application Temp and Working Directories for Studio, clearing
- How to adjust size of second image from setImageResource()
- Eclipse Plugin Open a PDF file from inside a plugin package
- Save action in Eclipse IDE to convert the java code to the diamond notation
- Android: Refactoring XML files in Eclipse?
- Install new jboss server in eclipse luna
- Trouble creating a Hello World Web application (installing the Geronimo Eclipse Plugin)
- Resolving workspace dependencies for Virgo in Eclipse
- Android - MediaPlayer Crash
- Eclipse cannot find javaw.exe
- How to bind SASS plugin goal to tomcat7 deploy phase (maven)
- Get Network Strength (RSSI)
- Create a file locally on android(not on SD card)
- How do I make a splash screen load once?
- android - Unable to instantiate activity - ClassNotFound - Fails on one eclipse but not other
- javax.ejb.EJBException while Runing Java EE (JPA) application with GLassfish
- What should my ini file for Eclipse look like?
- Grails not listed in STS extensions
- Avoid building project in a loop for target/generated-sources
- How to install SVN on Eclipse Indigo
- issue in pushing changes to a repository
- GWT causes Eclipse to fail to launch on Windows XP
- Android: Take picture and save picture on SD Card
- Opening Data Source Explorer from Eclipse 4.3.0