This question already has answers here:
Multiple contexts with the same path error running web service in Eclipse using Tomcat
(24 answers)
Closed 4 years ago.
I got following error when I tried to run a project on eclipse. Can someone please explain what can be done to resolve it.
Could not publish server configuration for Tomcat v7.0 Server at localhost.
Multiple Contexts have a path of "/CityHotel".
Multiple Contexts have a path of "/OOPEmployeeWebApp".
Possibly you have a context configured in Eclipse and a WAR file deployed in the Tomcat webapps directory, both with the same name.
check your tomcat folder and /conf and server.xml, and remove the duplicated contexts
It should be a configuration problem, might be you need some server specific configs you didnt set, thus it is throwing the error.
It could also be an actual duplication error, in which case check all class paths for duplications.
Related
This question already has answers here:
Where does Eclipse deploy web applications using WTP?
(2 answers)
Closed 14 days ago.
I have dynamic web project in my Eclipse with Java that was used to create simple SOAP web service that runs on Tomcat 9. Service was published and runs fine.
But I can't find where Eclipse puts java class files and other libraries when I start web service. I can't find any changes in Tomcat folder.
I'm usually doing this to find file location of classes
YourClass.getProtectionDomain().getCodeSource().getLocation().getPath()
Replace "YourClass" with any class in your project, debug and evaluate this line, then this will reveal file location.
Also another hint, as per my understanding, a web application can packaged as a war file and can put to tomcat/webapps folder or web application path can be specified manually in a context xml file of tomcat/conf/localhost folder
This question already has answers here:
How do I resolve ClassNotFoundException?
(28 answers)
Closed 2 years ago.
I'am trying to send an automatic email with JavaMail on Oracle. I added external JARs on Java Build Path (mail.jar and activation.jar). I don't know what I'm doing wrong because I get this error message:
java.lang.ClassNotFoundException: javax.mail.internet.AddressException
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1358)
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1180)
I'm using Tomcat v8.5.
You should add Javax mail dependency to make it work.
You need to add the JavaMail library Jars either to the Tomcat lib folder, or it has to be part of your WAR file when you deploy your WebApp. Adding it to the Build Path makes it only available during compile time. Although, depending on the configuration for the Deployment, it could be deployed, too – but obviously, not in your case.
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
org.apache.jasper.el.ELContextImpl cannot be cast to org.apache.jasper.runtime.ELContextImpl
I export a web service project (contains jsp pages) from Eclipse in a war file and deploy it in Jetty 8.1.5. It works fine on my machine. But after deploying the same war file on Jetty 8.1.3 on another machine (windows server 2003) it gives HTTP Error 500 and the following exception when I go to the index.jsp page:
org.apache.jasper.el.ELContextImpl cannot be cast to org.apache.jasper.runtime.ELContextImpl
the full trace and more details in this question which I posted two days ago. while all the jars that I have in WEB_INF/lib are provided in these two screenshots:
two days of looking around the internet for a solution resulted in knowing that the problem is caused by conflicts between the jars shipped in the war file and other jars (I guess the jetty jars).
The question is: how can I find out which jar is causing the problem? I tried browsing the contents of these jars looking for the class ElContextImpl but did not find anything ?
Any thoughts?
EDIT:
I tried copying my local whole Jetty 8.1.5 into the server and statrted jetty from there.. but still no success.
Your WAR file contains some unnecessary JARs like servlet-api-2.4.jar which should be part of the Jetty installation (maybe in another version).
At first sight you should remove all jetty-*.jar, servlet-api-2.4.jar, javax.servlet.*.jar. If you have taken these from your 8.1.5 Jetty installation then it could cause conflicts with your 8.1.3 installation.
When I'm changing some Java source code and my server is running, hot deploy fails, giving the following error message:
"Delete method not implemented"
How can I find out the root of this evil? My project has been recently deployed, so the sources on the server should be up to date.
The project uses JSF 1.2, if that's of any use for you.
I deploy the project as an exploded war.
Won't work with a zipped war either.
It's strange that the sources of dependencies are also not resolved in the debug mode. They're correctly read from the jar in the Eclipse Java view.
if you 'touch' the file (war/ear) in the deploy directory, this should trigger the deployment cycle, is this happening?
I've already asked a similar question more than one year ago. And my answer to it solved this problem too.
Uninstall all JDKs
Install only on JDK
Configure every program (Eclipse and JBoss) to use this JDK.
I have searched stackoverflow before posting this question.
In eclipse i am running a tomcat server. I deleted the .class files from the work folder of the tomcat server. From then on I am facing the issue saying the class couldnot be found.
I re-built the project. Didnt help
Can you please suggest how to fix this issue.
You should NOT run Tomcat as a normal program inside Eclipse. You should use the EE version of Eclipse, and then add Tomcat in the server view. This will allow you to deploy Dynamic Web Projects directly to Tomcat or any other supported server.
delete the server from eclipse server view and create it again.