![]() Click image to access book information |
Web Development with Java Using Hibernate, JSPs and Servlets Downey, Tim
ISBN: 978-1-84628-862-3
Book Web Site
|
To see these errors on the ocelot host,
org.hibernate.exception.GenericJDBCException: Cannot open connection org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:91) org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:79)
mysql -u your-username -p Enter your password: your-password mysql> use your-database
props.setProperty("hibernate.connection.url", "jdbc:mysql://ocelot.aul.fiu.edu:3306/your-database"); props.setProperty("hibernate.connection.username", "your-username"); props.setProperty("hibernate.connection.password", "your-password");
org.hibernate.exception.SQLGrammarException: could not insert: [hw4.Controller3.RequestData] org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:65) org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:1985) org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2404)
If you have already done this and are still getting this error then keep reading...
Caused by: java.sql.SQLException: You have an error in your SQL syntax near 'order, food, side) values ('asd1234', 'asdf', null)' at line 1 at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2851) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1531) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1622)
Rename the offending property. The offending property will be the first one listed in the SQL syntax error message.
java.lang.IllegalStateException: Could not get property value org.hibernate.validator.ClassValidator.getMemberValue(ClassValidator.java:272) org.hibernate.validator.ClassValidator.getInvalidValues(ClassValidator.java:212) org.hibernate.validator.ClassValidator.getInvalidValues(ClassValidator.java:183)
Caused by: java.lang.IllegalArgumentException: wrong number of arguments at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
javax.servlet.ServletException: Unable to find a value for "hobb" in object of class "hw4.RequestData" using operator "." org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:867) org.apache.jasper.runtime.PageContextImpl.access$1100(PageContextImpl.java:109) org.apache.jasper.runtime.PageContextImpl$12.run(PageContextImpl.java:787)
javax.servlet.ServletException org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:324) org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:200) org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:153) root cause java.lang.ExceptionInInitializerError utilities.HibernateUtil.initSessionFactory(HibernateUtil.java:67) hw5.Controller.initSessionFactory(Controller.java:41) hw5.Controller.init(Controller.java:36)
Caused by: org.hibernate.MappingException: Could not determine type for: java.util.Map, for columns: [org.hibernate.mapping.Column(checked)] at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:266) at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:253) at org.hibernate.mapping.Property.isValid(Property.java:184)
Create the setter or mark the getter method with the @Transient annotation.
Caused by: org.hibernate.AnnotationException: No identifier specified for entity: ch4.persistentData.RequestDataPersistent at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:645) at org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:256) at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:191) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1138) at utilities.HibernateUtil.initSessionFactory(HibernateUtil.java:65)
Caused by: org.hibernate.AnnotationException: Annotated class should have a @javax.persistence.Entity, @javax.persistence.Embeddable or @javax.persistence.EmbeddedSuperclass annotation: hw3.RequestDataExtended at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:334) at org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:256) at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:191) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1138) at utilities.HibernateUtil.initSessionFactory(HibernateUtil.java:51)
@Entity public class MyBean { ...
org.hibernate.hql.ast.QuerySyntaxException: RequestDataPersistent is not mapped. [from RequestDataPersistent] org.hibernate.hql.ast.util.SessionFactoryHelper.requireClassPersister(SessionFactoryHelper.java:145) org.hibernate.hql.ast.tree.FromElementFactory.addFromElement(FromElementFactory.java:86) org.hibernate.hql.ast.tree.FromClause.addFromElement(FromClause.java:70) org.hibernate.hql.ast.HqlSqlWalker.createFromElement(HqlSqlWalker.java:262) org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElement(HqlSqlBaseWalker.java:3041) org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElementList(HqlSqlBaseWalker.java:2930) org.hibernate.hql.antlr.HqlSqlBaseWalker.fromClause(HqlSqlBaseWalker.java:688) org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:544) org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:281) org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:229) org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:216) org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:156) org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:103) org.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:473) org.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1060) org.hibernate.impl.SessionImpl.list(SessionImpl.java:1010) org.hibernate.impl.QueryImpl.list(QueryImpl.java:74) ch4.ControllerFull.getListData(ControllerFull.java:92)
Be sure that all references to a bean are for your bean.
org.hibernate.type.SerializationException: could not deserialize org.hibernate.util.SerializationHelper.deserialize(SerializationHelper.java:211) org.hibernate.util.SerializationHelper.deserialize(SerializationHelper.java:234) org.hibernate.type.SerializableType.fromBytes(SerializableType.java:78)
org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:65) org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:200)
Caused by: java.sql.BatchUpdateException: Table 'databaseName.RequestDataPersistent_wclass' doesn't exist at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1629) at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeBatch(NewProxyPreparedStatement.java:1723)
hibernate3.jar
and hibernate-annotations.jar
. Be sure that all the JAR files are up to date.