Nyeng Gyang

Ranch Hand
+ Follow
since Jan 11, 2021
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Nyeng Gyang

I resolved the issue by changing the https in the URI above to http. The URI, which is specified in the spring-form.tld file in the spring-webmvc-5.2.6.RELEASE.jar, does not have the secure version of the HTTP protocol in the URI to use (the URI specified in this file uses http, not https, and I had been using the latter, because this is what the textbook author provides in his book).
2 years ago
I do not fully understand your question, but I did not have to do anything with any JAR file(s), in order to fix this problem.

The problem had nothing to do with a dependency that is a corrupted file, so I did not need to re-import any such corrupted dependency file.

Thanks.
2 years ago
Yeap, I do have the following directory path in my computer (I earlier thought that you meant that I should be looking for a folder named "dependencies" under/inside the .m2/repository folder):

C:\Users\yeipe\.m2\repository\org\springframework\spring-webmvc\5.2.6.RELEASE.

Even though I have already found the cause of this problem, I am interested in learning more about the following advice, which you have furnished me (just so that I better understand how to handle a problem case involving corrupted dependencies, in case I ever find myself in that situation):

Remove those dependencies that may be corrupted. Then import them again.


Do you mean that I should delete the contents of the ...\5.2.6.RELEASE folder and then, afterwards, re-import them into the project (by using the dependencies element in the POM file)? By the way, the following files are the contents of this folder:

(1.) _remote.repositories.
(2.) spring-webmvc-5.2.6.RELEASE.jar.
(3.) spring-webmvc-5.2.6.RELEASE.jar.sha1.
(4.) spring-webmvc-5.2.6.RELEASE.pom.
(5.) spring-webmvc-5.2.6.RELEASE.pom.sha1.

Thanks for your kind assistance.
2 years ago
Thanks, Himai, for taking the time to respond to my inquiry.

You advise that I may be thinking that I have missed some JAR files. However, in the explanations that I have provided in my initial post above, I clearly provided the following information:

(1.) I have the spring-webmvc-5.2.6.RELEASE.jar in the external libraries folder of my project and it appears like Maven has also added this dependency to the application while building the application.

(2.) The spring-form.tld file in the spring-webmvc-5.2.6.RELEASE.jar file specifies that https://www.springframework.org/tags/form is the correct URI to use, which makes me to wonder why this URI cannot be resolved in the jar files deployed with my application.

I am not thinking that I have missed some JAR files.

As per the second piece of advice, which you have furnished me, I took a look at the .m2/repository folder in my Windows machine, but was unable to find a dependencies folder under the .m2/repository folder.
2 years ago
I encountered the org.apache.jasper.JasperException while running code discussed in Section 5.4.2 in this textbook. I encounter this exception whenever I insert the following JSP taglib reference/statement in one of the JSPs in a web application, in order to use Spring's Form Tag Library:
The application runs well, until I insert this JSP taglib reference/statement in one of the JSPs in the application. After inserting this JSP taglib reference/statement in one of the JSPs in the application and the application starts, I obtain the org.apache.jasper.JasperException when I try to access (in a browser) one of the Spring controllers that are implemented in the application. The occurence of this exception is also accompanied by my obtaining an Internal Server Error, status=500.

The following is the exception notice that is at the top of the stack trace of exceptions notices reported by the compiler:

org.apache.jasper.JasperException: The absolute uri: [https://www.springframework.org/tags/form] cannot be resolved in either web.xml or the jar files deployed with this application.

Since the entire stack trace of exceptions notices is quite long indeed, I have deferred furnishing the entire thread of these exceptions notices until someone feels that this information will assist in placing a finger on the cause of this exception.

My understanding is that this exception is thrown due to one of different possible reasons, namely:

(1.) The JAR file named spring-webmvc-<version>.jar either (A) Is not in the class path for the application (B) The dependency for the JAR file has not been added in the project's POM file or (C) The JAR file is not in the WEB-INF/lib directory of the web application.

(2.) There is a mismatch between the Servlet version in the Tomcat servlet engine and the version of JSTL used in the application.

As per the first possible cause of this problem, be advised that I have the spring-webmvc-5.2.6.RELEASE.jar in the external libraries folder of my project and it appears like Maven has also added this dependency to the application while building the application.

As per the second possible cause of this problem, be advised that the project, which I am working on, is a Maven archetype project that uses an embedded Tomcat version 9.0.35 as well as uses JSTL version 1.2 dependency in the project's POM file.

In any case, the exception notice suggests that the https://www.springframework.org/tags/form URI cannot be resolved in the jar files deployed with my application, even though the spring-form.tld file in the spring-webmvc-5.2.6.RELEASE.jar file specifies that this is the correct URI to use.

Another suggestion that I have received for the occurence of this exception is that the TLD files are not in the classpath. However, kindly be advised that (1) The files spring.tld and spring-form.tld are both in the spring-webmvc-5.2.6.RELEASE.jar archive file and (2) I have this spring-webmvc-5.2.6.RELEASE.jar archive file in the external libraries folder of my project (I can provide screenshots, if this will help).

My understanding is that a JAR file does not need to be placed in the classpath when a project build tool (like Maven) does either or even both of the following with the JAR file: (1) The project build tool adds the JAR file to the external libraries folder of a project and/or (2) The project build tool adds the JAR file as a dependency to the application while building the application (my understanding is that Maven accomplishes both of these steps by the programmer adding the appropriate dependency element in the project's POM file).

I am looking forward to obtaining assistance with resolving this problem issue.
2 years ago
As part of interviewing for a Java software engineer position, I started learning how to use Maven. Even though I haven’t gone farther than scratching the surface of what Maven is and how it is used, the little that I have learned about this “project management and comprehension tool” is that its project building approach is reminiscent to me of the use of the Java Platform Module System (JPMS) to build a (modular) Java project. While learning about Maven, I have seen that its use of CLI commands, a recommended project build directory structure, managing dependencies, etc. are all similar to JPMS’s use of CLI commands and a recommended directory structure to build modular Java programs, managing dependencies for such programs, etc.

Since Maven exists, and there evidently is a great use of it for building Java applications, I reckon that it must offer certain features, functionality that the JPMS doesn’t offer Java developers. What are these extra features, functionality that Maven offers, but which the JPMS doesn’t offer, to Java developers? While providing an answer to this question, note that I already have an academic understanding of lists of features, functionality that Maven offers, including lists of features, functionality provisioned in the following quotes, which have been excerpted from the links provided:

(1.) Maven Getting Started Guide: “… in a nutshell Maven is an attempt to apply patterns to a project’s build infrastructure in order to promote comprehension and productivity by providing a clear path in the use of best practices. Maven is essentially a project management and comprehension tool and as such provides a way to help with managing:

  • Builds
  • Documentation
  • Reporting
  • Dependencies
  • SCMs
  • Releases
  • Distribution


  • (2.) Introduction to the POM: “Some of the configuration that can be specified in the [Maven] POM are the project dependencies, the plugins or goals that can be executed, the build profiles, and so on. Other information such as the project version, description, developers, mailing lists and such can also be specified.

    One benefit of using Maven, which I don’t see the JPMS providing, is the convenience of using a CLI command to automate the creation of various build directories vs. manually creating these directories when using the JPMS.

    What I need is a real-world, industry (as opposed to an academic) view of the features, functionality that Maven offers, but which the JPMS doesn’t offer, to Java developers in the real world of engineering/crafting production Java applications.

    3 years ago

    Stephan van Hulst wrote:No, type parameters are not inherited. If you want to use the same symbol in the subclass, you must redeclare it ...


    This response is spot on, in terms of addressing my question, thanks.

    Stephan van Hulst wrote: .. and the pass it as a type argument to the base class.


    Even though I know what is meant by passing a type parameter as a type argument to a class, your remark in the quote I provide below (of what you wrote) makes me to not be sure of what you mean by passing a type parameter as a type argument to a base class.

    Stephan van Hulst wrote:If you don't pass any type arguments to the base class like you did in your example code...


    I am not sure what you mean by the code example I provided above does not pass any type arguments to the base class. The base class in my code example is the class with a (bounded) type parameter specified and the subclass is the class without a type parameter specified.

    My guess (correct me if I am wrong) is that you mean the following code will result in type erasure for the subclass (i.e., MySubClass):and that the following code will not result in type erasure for class MySubClass:
    3 years ago

    Campbell Ritchie wrote:Search your Java® installation folder for ....


    The information about where those abstract methods are implemented suffices for me, thanks.
    3 years ago

    Campbell Ritchie wrote:Where does that code come from?


    I created the code, in order to illustrate the question I asked. The code does not require attribution to someone else, since it came from me.

    Campbell Ritchie wrote:Why are you using an extends in a formal type parameter and extending a final class?


    I am using extends in a formal type parameter in order to specify a parameter bound (in this case, an upper bounded parameter). That a final class is being extended is irrelevant to the question and this is because the question pertains to the inheritance behavior of the parameters of generics; in other words, that class could be any class other than Integer and this would not alter the question being asked.

    Campbell Ritchie wrote:Have you tried using T in the subclass?

    Once again, the question pertains to the behavior and implications of different parameters of generics in classes and their subclasses.
    3 years ago

    Paul Clapham wrote:... if you wanted you could print out its name. Like so:


    In the foregoing line of code you provided, I guess you meant the following line of code, since it is the type/class of the returned iterator, rather than the type/class of the arraylist, that I am interested in knowing more about (recall that I already know the type/class of the reference identifier a):This line of code informs that the type/class of the returned iterator is java.util.ArrayList$Itr, which some Googling reveals is a nested class in class ArrayList that is named Itr.

    Jesse Silverman wrote:Everyone keeps telling you to code to Interface, not Implementation.


    Despite the utility of the foregoing remark you have made, once in a while, I nonetheless seek to peek into the inner workings of things, just for the sake of curiosity.  :-) For one, I imagined that that iterator was associated with class ArrayList and, in general, such an iterator would be associated with any collection that creates an interface Iterator<T> instance using the iterator() method.
    3 years ago
    Kindly refer to the following code segment for the questions I ask here: If class B is a subclass of parameterized/generic class A then will class B (implicitly) inherit a parameter and a parameter bound implemented in class A, even if this parameter and parameter bound are not explicitly implemented in class B (as shown in the code segment above)? In any case, I suppose that it doesn't make sense to implement class B in the following ways:

    (1.) (Explicitly) making class B to also be a parametrized/generic class, but making the parameter to be different from that of class A.

    (2.) (Explicitly) making class B to also be a parametrized/generic class, but making the parameter bound to be different from that of class A.
    3 years ago
    Kindly refer to the following code segment for the question I ask here:
    Since the hasNext() and next() methods of interface Iterator<T> are abstract methods of this interface, what implementations of these methods are executed when an instance of the interface invokes the methods on lines 7 and 9?
    3 years ago

    Paul Clapham wrote:So I believe that's what the study guide is referring to when it says "where the code is being called".


    I mistook "where the code is being called" to mean the location in one's program code from where the System.console() method is invoked (instead of the location from where the code, in which the method is invoked, is itself invoked). Thanks for this clarification.

    Jesse Silverman wrote:You can't access Console from JShell or Eclipse, and possibly many other ways your code may be running other than typing "java MyMainClass" at a command prompt.


    I just experimented with compiling and running a program, which invokes the System.console() method, from the Windows CLI and the class Console instance was available to the program (the instance wasn't available when I compiled the program using jGRASP, a very light-weight IDE).
    The study guide advises, in the note on page 955, that the Class Console instance "may not be available, depending on the where the code is being called."

    From where in the code of a Java program may the class Console instance be available?

    Jesse Silverman wrote:I thought the book(s) we are both reading made these terms clear ...


    If you used that term in the same sense as it is used in the study guide, to express the idea that a higher-level stream class is wrapped around a lower-level stream class, then I do get/understand that usage.

    I got you wrong by thinking that you meant the level a class occupies in the hierarchy of inheritance (i.e., the superclass of a class occupies a higher level than the level the class occupies in this hierarchy while the subclass of a class occupies a lower level than the level the class occupies in this hierarchy).