Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Maven/Dynamic Web project breaking when increasing DWM version(By increasing the Dynamic Web Module from 2.3 (default) to 2.5 or higher the project fails)
Maven/Dynamic Web project breaking when increasing DWM version [message #1822403] Thu, 05 March 2020 16:55 Go to next message
Leo Doms is currently offline Leo DomsFriend
Messages: 3
Registered: March 2020
Junior Member
Hello,
I'm new to java web apps. I have some experience with PHP and JSP scriptlets, and now want to learn more about servlets and JSTL/EL
I set up an environment as follows (Windows 10 64 bit)

  1. Eclipse 2019-12
  2. WildFly 18.0.1 final
  3. JDK 13


I created a Maven Dynamic web project from org.apache.maven.archetypes, and after setting up the runtime and java versions, the project builds without errors and shows the "Hello World" page.
I read that In order to use JSTL/EL, I must have dynamic web module version 2.5 or higher. The default that is set in the project is 2.3, so I increased it, and from then on everything goes terribly wrong.
There are some errors that I can't get rid off

  1. One or more constraints have not been satisfied.Cannot change version of project facet Dynamic Web Module to 2.3.
  2. One or more constraints have not been satisfied.

Despite the errors, I can run the project and it returns a http 403, forbidden status back from the server.

I've been fiddling around with facet versions for days, but I can't repair this project. Creating a new one always works fine, until I touch the dynamic web module version, which produces the 403 http error.

Is there a way out ?
Thanks
Leo
Re: Maven/Dynamic Web project breaking when increasing DWM version [message #1822558 is a reply to message #1822403] Mon, 09 March 2020 20:43 Go to previous messageGo to next message
Leo Doms is currently offline Leo DomsFriend
Messages: 3
Registered: March 2020
Junior Member
Meanwhile, I got rid of the build errors, by manually editing the web.xml file and changing the header information

from
<!DOCTYPE web-app SYSTEM "http://java.sun.com/dtd/web-app_2_3.dtd" PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN">

to

<!DOCTYPE web-app SYSTEM "http://java.sun.com/dtd/web-app_4_0.dtd" PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 4.0//EN">

And so it looks clean when I now set the facet to dynamic web module V4.0.0 and rebuild the project. Just a couple of warnings because I use JDK 13, and the max. compatibility level I can choose is JDK11

However, now the thing doesn't deploy to the server properly. So, it's still not runnable. What a mess.
Re: Maven/Dynamic Web project breaking when increasing DWM version [message #1822747 is a reply to message #1822558] Thu, 12 March 2020 17:18 Go to previous message
Leo Doms is currently offline Leo DomsFriend
Messages: 3
Registered: March 2020
Junior Member
Hello

I've finally actually managed to obtain a runnable project that uses EL.
I cannot exactly say what the steps were to get there, as I did and undid several things, but I can state a few guidelines that may save time for others with similar problems.

There seems to be an order to do certain things. i had the best success by first setting the target runtime, and then the java compiler, java build path, edit web.xml and pom.xml and finally adjust the project facets. Sometimes you change something and it undoes a change you made earlier. Based on this the above sequence is proposed.

Not everything can be set up in project properties. I was obliged to modify the servlet version in web.xml (I chose 4.0) and the java compiler version in pom.xml. They always stay on 2.3 and 1.7 respectively, no matter which version you choose in properties.

Choosing the compiler version may be tricky. I have 13, supported by wildfly 18, and had this set in the compiler version and java facet in the project properties. But when I also configured 13 in pom.xml, the targeted runtime and the wildfly library had disappeared.
I had to enter version 11 in POM and then these entities came back. Now I still have a warning about the mismatch between 11 and 13, but my simple EL hello-world project did build, deploy and run.

Because of the numerous problems I encountered with this project, I tried to switch to other webapp archetypes. There is a wildfly-18 one, and I also tried the apache TomEE. But every one I tried had crazy errors just on creation. Popups like "file cannot be renamed to ..." etc... I've restarted from scratch many times.
It is really a very hard IDE to begin with.
I hope that I can now continue to learn EL/JSTL and EJB without getting blocked again, because the farther you get, the lharder it is to restart from scratch.
Previous Topic:Where can I find the "error history" in the console?
Next Topic:Unable to "Open Declaration"
Goto Forum:
  


Current Time: Tue Nov 12 14:22:09 GMT 2024

Powered by FUDForum. Page generated in 0.06823 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top