• 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

Tomcat application returns 404 code in Spring MVC application

 
Ranch Hand
Posts: 443
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to run "http://localhost:8080/SpringMVC_Hibernate_Setup/" but I get the message
The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.
http://localhost:8080/SpringMVC_Hibernate_Setup/home also fails

In my pom I have
<name>SpringMVC_Hibernate_Setup</name>

For configuration I have


I also have
 
Ranch Hand
Posts: 85
2
Python Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should create a view/page named "home" and configure the View Resolver.
 
Alejandro Barrero
Ranch Hand
Posts: 443
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My apologies for not offering more details, but I have


Specifically

I also have home.jsp in src/maim/webapp/WEB_INF/view
 
M Khalid
Ranch Hand
Posts: 85
2
Python Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Alejandro Barrero wrote:My apologies for not offering more details, but I have

Specifically

I also have home.jsp in src/maim/webapp/WEB_INF/view



The path is incorrect, Check the path which is configured.
 
Alejandro Barrero
Ranch Hand
Posts: 443
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I downloaded the code in a zip file from a tutorial on the Internet. What path should I create on src?
 
M Khalid
Ranch Hand
Posts: 85
2
Python Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Alejandro Barrero wrote:I downloaded the code in a zip file from a tutorial on the Internet. What path should I create on src?



IMO you should understand it before implementing it and running into issues. I would suggest you to go through the tutorial thoroughly and then run the code.
 
Alejandro Barrero
Ranch Hand
Posts: 443
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are correct, that's the correct way to do it; however, I don't just download and run; I followed the tutorial and compared the code with the downloaded code. Of course, I am probably still doing something wrong.
 
M Khalid
Ranch Hand
Posts: 85
2
Python Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

M Khalid wrote:

Alejandro Barrero wrote:My apologies for not offering more details, but I have

Specifically

I also have home.jsp in src/maim/webapp/WEB_INF/view



The path is incorrect, Check the path which is configured.



Correct path is


 
Alejandro Barrero
Ranch Hand
Posts: 443
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"/WEB-INF/view/" didn't work either.
I would have to look at other tutorials, because my knowledge of Spring doesn't allow me to understand what is wrong.

Looking at the console I found out that there are many exceptions beyond me.

SEVERE: Exception sending context initialized event to listener instance of class [org.springframework.web.context.ContextLoaderListener]
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in com.javaspringclub.config.HibernateConfig: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: myJpaPersistenceUnit] Unable to build Hibernate SessionFactory
Caused by: javax.persistence.PersistenceException: [PersistenceUnit: myJpaPersistenceUnit] Unable to build Hibernate SessionFactory
Caused by: org.hibernate.exception.GenericJDBCException: Unable to open JDBC Connection for DDL execution
Caused by: java.sql.SQLException: Unknown initial character set index '255' received from server. Initial client character set can be forced via the 'characterEncoding' property.
... 61 more
 
M Khalid
Ranch Hand
Posts: 85
2
Python Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's better. You should refer a proper tutorial and then implement after you have understood it completely.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!