Maven/Dynamic Web project breaking when increasing DWM version [message #1822403] |
Thu, 05 March 2020 16:55 |
Leo Doms 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)
- Eclipse 2019-12
- WildFly 18.0.1 final
- 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
- One or more constraints have not been satisfied.Cannot change version of project facet Dynamic Web Module to 2.3.
- 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 #1822747 is a reply to message #1822558] |
Thu, 12 March 2020 17:18 |
Leo Doms 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.
|
|
|
Powered by
FUDForum. Page generated in 0.06823 seconds