Eclipse 3.6.1 and Tomcat 7 problems - eclipse

Well, it is trivial problems... In fact I started using Tomcat 7 (why not) but when I do Run on Server, Eclipse always fails to get the right URL for the servlet, resulting in my trying to find the right combo for minutes. It's so annoying. Do you have any suggestions? Other servers work correctly, like Spring tc server.

I think the real problem is that the project doesn't get deployed at all (or do you actually manage to find it in the browser?).
I'm having problems running a project on Tomcat 7 from inside Eclipse, and have so far found no other "solution" than to manually package (using maven) the project and copy the war file into my tomcats webapps dir.
If the problem is really only the initial URL being wrong, then please disregard my answer :P
Otherwise, here's another question of similar sort: Troubleshoot Eclipse's "Run on server" deploy.
EDIT:
I've done some more research, and it turns out that the mojo plugin version 1.1. doesn't work (as well) with tomcat 7, because the deploy path has changed. I'm working on fixing it by adding this line to the pom.xml inside the <plugin> <configuration> tags:
<url>http://localhost:8080/manager/text</url>
But am still having some problems. Will update if I get it working.

Related

JSTL doesn't work when running from within eclipse

I'm trying to add JSTL support to an spring boot application, but I'm getting this error message when running it from within eclipse:
The absolute uri: [http://java.sun.com/jsp/jstl/core] cannot be resolved in either web.xml or the jar files deployed with this application
If i generare an executable war and run it, JSTL works correclty.
I've tried almost all the solutions described in the other questions but none of it seems to focus on running it from eclipse.
I've created this tiny repo to demostrate it:
https://github.com/rroman-encora/brokenjstl
This is my setup:
Spring Boot 1.5.7
Eclipse Version: 2021-03 (4.19.0)
JDK 11.0.11
The project runs with source and target java 1.8
Thankyou
If another poor soul finds him self in this situation, may this be the answer:
Just copy all the *.tld files from the jstl jar inside your WEB-INF directory and this should work.
Obviously there's a "proper" way to do this, maybe it's just a setting on spring boot, maybe you need to configure the embedded tomcat/jasper TLD Scanner, but today I'm so tired to keep looking for the perfect aswer.
BTW this also keeps working if you deploy your application as an excecutable war.

Apache Tomcat or Eclipse redirect to localhost:8080/ instead of localhost:8080/projectname/index.jsp

I'm getting the same problem described in this question:
Intellij web application on tomcat server shows http://localhost:8080/index.jsp instead of http://localhost:8080/myapp/index.jsp
But in Eclipse. I cannot setup the URL to open the correct index.jsp and it's not trivial how to do it en Eclipse from that answer.
So, the problem was a misconfiguration I might have made in the process and I couldn't find. I solved the issue simply restarting a new project and copying my files there. The issue was gone by then.

Tomcat on Eclipse Juno and Luna. One works, the other one doesn't

I am working on JavaEE webprojects using maven for dependencies and so on. The testing environment is Tomcat 7 for eclipse.
Now, when I made the transition to the newer eclipse (Luna) and deploy the webapp on tomcat, the tomcat instance refuses to serve the project. It gives 404 and the request on localhost:8080 doesn't produce any unusual console or log entries except the normal startup output (the exact same as on Juno).
I compared the server access log files located in /.metadata/... and the startup scripts. They are equal. No error messages, and no other clues on why the Luna Tomcat does not work. Don't get me wrong, the server 'works', as it provides a 404 message, it just does not serve the webapp that is deployed.
Does somebody have an idea on how to debug this further, or what the reason for the different behaviour could be? Thanks for any hints or advice.
-a
EDIT:
Just a few things I already did:
- Check and set project root (set to / in both cases)
- One suggestion found via google was to fiddle with the Libraries and Order and Export in Project Settings Build Path. (just move them up and down to get rid of a bug -> did not work)
- In Project Properties, set the targeted runtime to Tomcat 7 (the server in question)
- Reinstall the server
- Copy all configuration from one server path to the other.
- Set the server base path of Luna to the exact same as the working Juno instance (yes, they are in different places)
EDIT2:
Updating Eclipse to the newest version (MARS) did the job. Sadly I will now never know what the cause of the problem was. Luckily everything works again and I can focus on actually doing something :D

Eclipse Jboss processess

I have a couple of questions concerning the way Eclipse 4.3 and JBoss EAP 6.1 work together.
The first would be concerning the Server clean function. Does it matter if the server is running or not when that function is selected within Eclipse? I have tried both ways and get no indication one way or the other that it has preformed the task.
The other question concerns the hot deploy. I'm just starting a project so I have errors in my files, mostly the configuration files. Everything complies clean. When Eclipse deploys my war file it does so with something like 0.0.1-SNAPSHOT.war. It's always the same name so I can't tell if mu updates have been deployed.
The way I'm currently processing my deploys is to:
1. Undeploy the war file from within the Server Admin page
2. Do a Maven clean
3. Do a project clean
4. Do a war build
5. Redeploy from within the Server Admin page.
So this question would be how to determine if my current changes have been deployed? Is there a better way of doing it than the way I currently doing it?
Thanks for the support.
Since you are using Maven, you could use the Maven JBoss Deployment plugin. This would make the entire process automated. Sometimes the Eclipse integration doesn't work like you expect it to. Additionally, you should see on the JBoss command line console from where you started JBoss, that the old war is undeployed and deployed.

Why does eclipse/maven does not always deploy my project with last update?

Here is my work environment: Eclipse Juno as IDE with maven2 plugin on it - it uses maven 3.0.4 installation from my system - and my maven web project is deployed to a remote server on an Apace Tomcat java server. (The server is in the same LAN with my machine.) Every thing works perfect, except some rare situations: it happens randomly.
Problem: At some times, when I try to redeploy my updated project to Tomcat, through tomcat-maven-plugin, the JavaScript files in the Tomcat's project directory, DO NOT change. They stay intact (even if I did changes to them), and my application has lack in behavior. No errors are reported by maven during redeployment.
Question: do you have any idea about what's happening?
N.B.
In the rare situations when I got that problem, I got it working finally, after rebooting the Tomcat server, deleting the Tomcat's project directory, cleaning maven installed artifact and other actions that I did - I just tried all what I could do, because I didn't have any logical clue for what happend.
I updated Eclipse Galileo to Eclipse Juno two days ago, and I encountered this problem in both of them. So, I think that's an issue rather related to maven not to Eclipse.
I found it: I wasn't right when I said that the files are not updated on the server. My problem was the browser. It loads the Javascript file from cache.
So Ctrl+F5 resolved the problem.