ikismail / ShoppingCart

E-Commerce Website Using Java - Spring MVC in Maven - PROJECT IS NOT MAINTAINED
MIT License
360 stars 406 forks source link

Error : "Could not get database metadata" #26

Closed PrashantBahuguna closed 6 years ago

PrashantBahuguna commented 6 years ago

When the application is run on the server this exception is raised in the console. The webpage gets live but when new user is signed up the application crashes with the error : "Could not open connection". screenshot 34

ikismail commented 6 years ago

@PrashantB248 Please verify your Database credentials, You have configured wrong username or password of your h2Database to the application.

PrashantBahuguna commented 6 years ago

screenshot 35 screenshot 36 I have checked, its "prashant" everywhere.

ikismail commented 6 years ago

@PrashantB248 the problem is your H2 settings. Change your H2 Database Settings to Generic H2 (Server). so that the JDBC URL will change according to your properties.

image

PrashantBahuguna commented 6 years ago

screenshot 38 screenshot 39 The same issue is there..

ikismail commented 6 years ago

Your configuration is wrong verify it clearly.

PrashantBahuguna commented 6 years ago

Unable to find the problem..!

ikismail commented 6 years ago

Send the snapshot of current application-config.xml and h2 settings

PrashantBahuguna commented 6 years ago

screenshot 41 screenshot 42 Is there any issue in the DB url ?

ikismail commented 6 years ago

your application-context.xml database configuration should be like this.

<!-- database properties DataSouorce -->
   <bean id="dataSource"
       class="org.springframework.jdbc.datasource.DriverManagerDataSource">
     <property name="driverClassName" value="org.h2.Driver" />
     <property name="url" value="jdbc:h2:tcp://localhost/~/test" />
     <property name="username" value="prashant" />
     <property name="password" value="prashant" />
   </bean>

your h2 database settings should be like this.

image

now stop the server clean the server directory and start it.

PrashantBahuguna commented 6 years ago

screenshot 43 Made the changes. This issue has arised.

ikismail commented 6 years ago

reinstall your server

Fix Eclipse Tomcat not starting in 45 seconds

PrashantBahuguna commented 6 years ago

Solved..!! Live and running. Thank You so much for your help.!

ChillBoss commented 5 years ago

Bro..where is the database file?? like,i want the tables

ikismail commented 5 years ago

@ChillBoss I hope this will work How to open and export data from h2 bb.