Jan Dales

+ Follow
since Oct 19, 2018
Jan likes ...
IntelliJ IDE Angular Framework Java
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jan Dales

Problem solved!!!

The problem was in the IDE, IntelliJ.

The code compiled when I used "mvn clean install", so it couldn't be a problem of maven and, in my humble opinion, it had to be something in the IDE. We, a fellow java programmer, started with "mvn --version" this gives the following result

D:\Projecten\sponsor>mvn --version
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: C:\Program Files\Java\apache-maven-3.6.3\bin\..
Java version: 11, vendor: Oracle Corporation, runtime: C:\Program Files\Java\openjdk-11-28\jdk-11
Default locale: nl_NL, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

When we looked in IntelliJ we found in the settings (Ctrl+Alt+S) > Build, Execution, Deployment > Build Tools > Maven the setting for "Maven home directory".

As you can see, the Bundled Maven is divergent because of the version number. Version 3.6.3 via mvn -v and 3.6.1 in the settings.

We changed the value in "Maven home directory" to "C:/Program Files/Java/apache-maven-3.6.3".

After that we tried to build again and the result was that it build without any problem. Besides that, all the errors in the Idea, bases on the missing javax.servlet, has disappeared.

So in the end the problem turned out not te be as big as I expected, fortunately.

Last but not least, I want to thank Stephan and Tim for their support.
1 year ago

I tried so many things to make the project build again, that I unfortenately can't tell you which specific action causes this problem. I'm sorry.
But this mistake is also a new lesson learned...

At this point I want to focus on recovery instead of finding the cause of the problem.

I tried an exlusion in the pom, but that didn't work.

Hopefully someone on the forum has an idea in which direction to look for a solution.

1 year ago
Thank you for the information. I thought it was something like this.

A few weeks ago I ran into this issue for the first time. As a newbee to Java my thoughts were that when the javax.servlet couldn't be found I have to download it so Java could find it. Now, it's using the javax.servlet-api-4.0.0-b01.jar who is in the default download folder op my laptop.
When I rename this file I also get the message.

But because of this stupid action my dependency tree messed up. How do I repair this. My goal is that the local javax.servlet will not be used anymore and I have the right javax.servlet version "on board" in my project.

Is there a clear solution for this. I have experience with programming for years in an IBM environment and MS Dynamics NAV. The java language is not the most difficult, but to me the environment is.

Kind regards,
1 year ago
Hi there,

I have a problem with javax.servlet. A part of my dependencie tree lookes like

[INFO] +- io.micrometer:micrometer-registry-prometheus:jar:1.1.5:runtime
[INFO] |  \- io.prometheus:simpleclient_common:jar:0.5.0:runtime
[INFO] |     \- io.prometheus:simpleclient:jar:0.6.0:runtime
[INFO] +- io.dropwizard.metrics:metrics-core:jar:4.1.0:compile
[INFO] +- org.springframework.boot:spring-boot-starter-undertow:jar:2.1.6.RELEASE:compile
[INFO] |  +- io.undertow:undertow-core:jar:2.0.21.Final:compile
[INFO] |  |  +- org.jboss.xnio:xnio-api:jar:3.3.8.Final:compile
[INFO] |  |  \- org.jboss.xnio:xnio-nio:jar:3.3.8.Final:runtime
[INFO] |  +- io.undertow:undertow-servlet:jar:2.0.21.Final:compile
[INFO] |  |  \- org.jboss.spec.javax.annotation:jboss-annotations-api_1.2_spec:jar:1.0.2.Final:compile
[INFO] |  +- io.undertow:undertow-websockets-jsr:jar:2.0.21.Final:compile
[INFO] |  |  \- org.jboss.spec.javax.websocket:jboss-websocket-api_1.1_spec:jar:1.1.4.Final:compile
[INFO] |  +- javax.servlet:javax.servlet-api:jar:4.0.1:compile
[INFO] |  \- org.glassfish:javax.el:jar:3.0.0:compile
[INFO] \- org.springframework.boot:spring-boot-devtools:jar:2.1.6.RELEASE:compile
[INFO] ------------------------------------------------------------------------

The main thing here is that you can see that the javax.servlet is in the tree

In the pom I defined a java.version.

The fact is that I have installed java 11 on my new laptop and of course in the pom I first used version 11.

When I build with version 11 I get the error shown here under. This is of course a part of the messages

  • Information:java: Hibernate JPA 2 Static-Metamodel Generator 5.3.10.Final
    Information:java: Errors occurred while compiling module 'sponsor'
    Information:javac 11.0.5 was used to compile java sources
    Information:Module "sponsor" was fully rebuilt due to project configuration/dependencies changes
    Information:5-2-2020 19:48 - Build completed with 18 errors and 10 warnings in 5 s 304 ms
    Warning:java: Supported source version 'RELEASE_6' from annotation processor 'net.java.dev.hickory.prism.internal.PrismGenerator' less than -source '11'
    Error:(19, 8) java: cannot access javax.servlet.Filter
     class file for javax.servlet.Filter not found
    Error:(21, 25) java: cannot access javax.servlet.Filter
     class file for javax.servlet.Filter not found
    Error:(8, 21) java: package javax.servlet does not exist
    Error:(9, 21) java: package javax.servlet does not exist
    Error:(10, 21) java: package javax.servlet does not exist
    Error:(11, 21) java: package javax.servlet does not exist
    Error:(12, 26) java: package javax.servlet.http does not exist

  • ------------------------------------------------------------------------------------------------------------------

    The only thing I have to change to make the project build is changing java.version from 11 to 1.8 in the pom

    Why does java 11 not see the javax.servlet in de dependency tree??? I can't stand that I can't figure out what causes the problem. I hope someone knows.

    1 year ago
    Thank you for the explanation.

    I typed "GET" and "IS" in uppercase to emphasize them. I know in the real world they should be typed in lowercase. But anyway, I now know what to use with booleans and non-booleans. For me that was the main thing because, to my humble opinion, it is very important to use standards so everyone is able to read my code.

    3 years ago
    Hello Ritchie,

    The title of the book is:
    OCA Oracle Certified Associate Java SE 8 Programmer I Study Guide
    By Jeanne Boyarsky and Scott Selikoff

    The ISBN: 978-1-118-95740-0

    Pagenr of table 4.5: 206
    Pagenr of summary: 215, but the specific sentence is on page 216
    Pagenr of question 9 in the book: 220

    Kind regards,
    3 years ago
    Hi there,

    In chapter 4 in table 4.5 about naming conventions I read that "Getter methods begin with IS or GET if eht property is BOOLEAN." In the summary of chapter 4 is stated that "Javabeans use methods beginning with IS and GET  for BOOLEAN and NON_BOOLEAN property type, respectively." These 2 lines contradicts.

    Besides that, question 9 in the book and question 9 at Wileys testbanks about the naming conventions are exactly the same. But the answer in the book differ from the answer at Wileys testbanks. The book uses the theory of the table, the online question the theory of the summary. S

    So I have the following questions:
    1. Is it possible that the theory in table 4.5 and the summary are explained the same way.
    2. Is it possible that the book and the online quizz give the same answer and last but not least
    3. Can someone explain to me which is right. Table 4.5 or the summary?

    3 years ago