Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Main class not found #5

Closed
vaishalilambe opened this issue Apr 18, 2018 · 19 comments
Closed

Main class not found #5

vaishalilambe opened this issue Apr 18, 2018 · 19 comments
Labels

Comments

@vaishalilambe
Copy link

Hi ,

I am new to spring framework and cloned your code. While running it on server it is giving me HTTP 404 . Can you please see
screen shot 2018-04-17 at 10 09 28 pm

@vaishalilambe
Copy link
Author

Please reply asap. Its urgent!

@zirconias
Copy link

just built the project and deployed it to tomcat 9, it's working fine.

@vaishalilambe
Copy link
Author

I mean I am getting this error after running on tomcat 9can you please elaborate steps

@arey arey added the question label Apr 19, 2018
@arey
Copy link
Member

arey commented Apr 19, 2018

Hi @vaishalilambe, do you have configure the context path with /petclinic?

@vaishalilambe
Copy link
Author

vaishalilambe commented Apr 19, 2018 via email

@vaishalilambe
Copy link
Author

Just downloaded the project, click run on server -> tomcat 9, and it opens this page. Please guide me I am not able to figure it out

@vaishalilambe
Copy link
Author

I removed that context root and just replaced with "/" still doesn't work

@vaishalilambe
Copy link
Author

BTW I am running it from STS

@arey
Copy link
Member

arey commented Apr 21, 2018

Could you please give us your stackstrace?
Moreover, are you using Java 8, Java 9 or Java 10?
It looks like that with Java 9, the application does not start:

java.lang.ClassNotFoundException: javax.xml.bind.JAXBException

With Java 9, you have to add the bellow JVM option :

--add-modules java.xml.bind

arey added a commit that referenced this issue Apr 21, 2018
@arey
Copy link
Member

arey commented Apr 21, 2018

@vaishalilambe could you try to git pull then to redeploy Petclinic into Tomcat 9?
I've fixed the issue between Java 9 and JAXB (see https://stackoverflow.com/questions/43574426/how-to-resolve-java-lang-noclassdeffounderror-javax-xml-bind-jaxbexception-in-j)

@vaishalilambe
Copy link
Author

I am using Java 8.

I need below help from you
use tomcat9, .
I am not able to see formatting for pages when I run my application PFA screenshot. Please provide me suggestions asap.

Also steps to achieve mysql connectivity as I am not connecting with my credentials to mysql
screen shot 2018-04-21 at 9 53 23 pm

@arey
Copy link
Member

arey commented Apr 22, 2018

Sorry but your screenshot does not look like the Spring Framework Petclinic one's.
Do you have any startup log?

@vaishalilambe
Copy link
Author

vaishalilambe commented Apr 22, 2018 via email

@arey
Copy link
Member

arey commented Apr 22, 2018

The readme gives you some information to run with a MySQL database instead of the HSQL default one: https://github.com/spring-petclinic/spring-framework-petclinic/blob/master/readme.md

@vaishalilambe
Copy link
Author

vaishalilambe commented Apr 22, 2018 via email

@arey
Copy link
Member

arey commented Apr 22, 2018

Yes, you have to add the mysql JDBC driver and configure the data-access.properties.

@vaishalilambe
Copy link
Author

vaishalilambe commented Apr 22, 2018 via email

@vaishalilambe
Copy link
Author

vaishalilambe commented Apr 22, 2018 via email

@arey
Copy link
Member

arey commented Jan 22, 2020

Should be fixed. Please reopen this issue if the problem persists.

@arey arey closed this as completed Jan 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants