-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Hibernate and Maven Exception
PostPosted: Sat Feb 18, 2017 6:55 pm 
Newbie

Joined: Tue Feb 14, 2017 10:19 am
Posts: 2
I have been working with online tutorials for Hibernate in java applications and my applications have been running well so now I've decided to move onto maven for better management and as stated here: http://docs.jboss.org/hibernate/orm/5.2 ... _artifacts I've added hibernate-core and mysqlconnector dependencies into a new maven project, the new testing app I am building has just the same code as one of my non-maven Java app but in maven I got an exception wich I can't figure out the cause of I share my code in gist https://gist.github.com/Paulwerito/5e9e ... 5c23738cfc.

The things I did after creating my pom.xml:

1.-I created my persistence.xml as in gist.

2.-Then I created a sample Entity Prueba and I added a JPA ControllerClass from Entity through NetBeans wizard next, to that I created a quick Dao for testing Hibernate.

Thanks.


Top
 Profile  
 
 Post subject: Re: Hibernate and Maven Exception
PostPosted: Mon Feb 20, 2017 5:35 am 
Hibernate Team
Hibernate Team

Joined: Fri Sep 09, 2011 3:18 am
Posts: 295
Hi,
I'm not overly familiar with MySQL but it seems sometihng is wrong with the timezone:

Quote:
Caused by: java.sql.SQLException: The server time zone value 'Hora est?ndar central (M?xico' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.


This is a post on stackoverflow that seems related to your problem:
http://stackoverflow.com/questions/7605 ... connection

In particular, this paragraph:
Quote:
t's possible MySQL my complain that the server time zone is ambiguous. For example, if your database is set to use EST, there might be several possible EST time zones in Java, so you can clarify this for mysql-connector by telling it exactly what the database time zone is:

String url = "jdbc:mysql://localhost/mydb?useLegacyDatetimeCode=false&serverTimezone=America/New_York";

You only need to do this if it complains.


I haven't tried it so I'm not sure it will work.

Good luck


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.