• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

What should be in the Java Build Path in Eclipse ?

 
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Currently, I am getting a Https 404 resource not found error after submitting a form.

I suspect it is the build path problem.

Thus, I hope to verify what should be in my Build Path other than the src folder.

Please find screen shot of my build path.

Hope someone can advise what it should be.

Tks.

java-build-path.jpg
[Thumbnail for java-build-path.jpg]
 
Sheriff
Posts: 6029
157
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unless you tell it otherwise, Maven expects the source directory to be <project_dir>/src/main/java and <project_dir>/src/main/resources.

However, getting an HTTP error 404 is not directly dependent on Maven, but on your server configuration.

Nevertheless, Maven will move resources it knows about into the war file, and the container server will make them accessible.  So see if your resource directory is somewhere Maven can find it.

If you need more help, post your pom file here and surround it with XML code tags.
 
tangara goh
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Knute Snortum wrote:Unless you tell it otherwise, Maven expects the source directory to be <project_dir>/src/main/java and <project_dir>/src/main/resources.

However, getting an HTTP error 404 is not directly dependent on Maven, but on your server configuration.

Nevertheless, Maven will move resources it knows about into the war file, and the container server will make them accessible.  So see if your resource directory is somewhere Maven can find it.

If you need more help, post your pom file here and surround it with XML code tags.



Here's my pom.xml file :



There were alot of things that added automatically and then I excluded it manually cos I don't need them.
Another thing is that now when I run debug on server - the file name is the maven snapshot name.  It used to be my project name only.

Hope you can tell me if there's anything wrong with above.  Thanking you in advance.

And now, the form can't appear, all I get is a straight HTTPS 404 resource not found error.

 
Sheriff
Posts: 21759
102
Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From a quick glance I can see two things that aren't right:
* maven-war-plugin shouldn't be included as a dependency, but instead as a plugin (build -> plugins -> plugin). You don't need it inside your application, you only need it to build your application.
* jsp-api should be provided.

That doesn't explain a 404 though. Can you also show us your web.xml file?
 
Knute Snortum
Sheriff
Posts: 6029
157
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

tangara goh wrote:There were alot of things that added automatically and then I excluded it manually cos I don't need them.


How were things added automatically to the pom?  How did you know you didn't need them?

Another thing is that now when I run debug on server - the file name is the maven snapshot name.  It used to be my project name only.


Could this be one of the things you excluded?  By default the filename is the project name plus a dash plus the project version.  You can change this default by adding this:


And now, the form can't appear, all I get is a straight HTTPS 404 resource not found error.


Maven has defaults for where the resource files are expected:

You can change those defaults in the pom like this:


Hope you can tell me if there's anything wrong with above.


When I see a dependency that looks like the below, and nothing in a repository section, I get worried.  Are you having dependency issues?
This usually means that you're going to add a repository with this URL to the repositories section:
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!