Question

I have deployed my play framework 1.2.5 app on amazon ec2 ubuntu instance. And I did configuration according to what play.1.2.5 production tutorial says. After starting my app it throws exception for hibernate configuration. I am really struggling with deploying and configuring my app on production. The Information trace is like that.

    2014-02-09 16:51:41,531 - Precompiling ...
2014-02-09 16:52:36,885 - Connected to jdbc:mysql://127.0.0.1/emirbazaridb?useUnicode=yes&characterEncoding=UTF-8&connectionCollation=utf8_general_ci
2014-02-09 16:52:37,194 - Hibernate Commons Annotations 3.2.0.Final
2014-02-09 16:52:37,202 - Hibernate 3.6.10.Final
2014-02-09 16:52:37,203 - hibernate.properties not found
2014-02-09 16:52:37,206 - Bytecode provider name : javassist
2014-02-09 16:52:37,212 - using JDK 1.4 java.sql.Timestamp handling
2014-02-09 16:52:37,325 - Hibernate EntityManager 3.6.10.Final
2014-02-09 16:52:37,426 - Binding entity from annotated class: models.Comments
2014-02-09 16:52:37,463 - Bind entity models.Comments on table Comments
2014-02-09 16:52:37,583 - Binding entity from annotated class: models.Prod
2014-02-09 16:52:37,663 - Binding entity from annotated class: models.CommentDetail
2014-02-09 16:52:37,663 - Bind entity models.CommentDetail on table commentdetail
2014-02-09 16:52:37,667 - Binding entity from annotated class: models.UserMetaData
2014-02-09 16:52:37,668 - Bind entity models.UserMetaData on table usermetadata
2014-02-09 16:52:37,683 - Binding entity from annotated class: models.Messages
2014-02-09 16:52:37,683 - Bind entity models.Messages on table messages
2014-02-09 16:52:38,636 - Database ->
       name : MySQL
    version : 5.5.35-0ubuntu0.12.04.2
      major : 5
      minor : 5
2014-02-09 16:52:38,636 - Driver ->
       name : MySQL-AB JDBC Driver
    version : mysql-connector-java-5.1.20 ( Revision: tonci.grgin@oracle.com-20111003110438-qfydx066wsbydkbw )
      major : 5
      minor : 1
2014-02-09 16:52:38,646 - Using default transaction strategy (direct JDBC transactions)
2014-02-09 16:52:38,649 - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
2014-02-09 16:52:38,649 - Automatic flush during beforeCompletion(): disabled
2014-02-09 16:52:38,649 - Automatic session close at end of transaction: disabled
2014-02-09 16:52:38,649 - JDBC batch size: 15
2014-02-09 16:52:38,649 - JDBC batch updates for versioned data: disabled
2014-02-09 16:52:38,650 - Scrollable result sets: enabled
2014-02-09 16:52:38,650 - JDBC3 getGeneratedKeys(): enabled
2014-02-09 16:52:38,650 - Connection release mode: auto
2014-02-09 16:52:38,650 - Maximum outer join fetch depth: 2
2014-02-09 16:52:38,650 - Default batch fetch size: 1
2014-02-09 16:52:38,650 - Generate SQL with comments: disabled
2014-02-09 16:52:38,651 - Order SQL updates by primary key: disabled
2014-02-09 16:52:38,651 - Order SQL inserts for batching: disabled
2014-02-09 16:52:38,651 - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
2014-02-09 16:52:38,657 - Using ASTQueryTranslatorFactory
2014-02-09 16:52:38,657 - Query language substitutions: {}
2014-02-09 16:52:38,658 - JPA-QL strict compliance: enabled
2014-02-09 16:52:38,658 - Second-level cache: enabled
2014-02-09 16:52:38,658 - Query cache: disabled
2014-02-09 16:52:38,658 - Cache region factory : org.hibernate.cache.impl.NoCachingRegionFactory
2014-02-09 16:52:38,659 - Optimize cache for minimal puts: disabled
2014-02-09 16:52:38,659 - Structured second-level cache entries: disabled
2014-02-09 16:52:38,671 - Statistics: disabled
2014-02-09 16:52:38,671 - Deleted entity synthetic identifier rollback: disabled
2014-02-09 16:52:38,671 - Default entity-mode: pojo
2014-02-09 16:52:38,671 - Named query checking : enabled
2014-02-09 16:52:38,671 - Check Nullability in Core (should be disabled when Bean Validation is on): disabled
2014-02-09 16:52:38,704 - building session factory
2014-02-09 16:52:38,714 - Type registration [clob] overrides previous : org.hibernate.type.ClobType@5df7b6e1
2014-02-09 16:52:38,714 - Type registration [java.sql.Clob] overrides previous : org.hibernate.type.ClobType@5df7b6e1
2014-02-09 16:52:38,714 - Type registration [wrapper_materialized_blob] overrides previous : org.hibernate.type.WrappedMaterializedBlobType@32079df9
2014-02-09 16:52:38,714 - Type registration [characters_clob] overrides previous : org.hibernate.type.PrimitiveCharacterArrayClobType@12146018
2014-02-09 16:52:38,714 - Type registration [wrapper_characters_clob] overrides previous : org.hibernate.type.CharacterArrayClobType@77b0d0ed
2014-02-09 16:52:38,714 - Type registration [blob] overrides previous : org.hibernate.type.BlobType@7964b4fe
2014-02-09 16:52:38,714 - Type registration [java.sql.Blob] overrides previous : org.hibernate.type.BlobType@7964b4fe
2014-02-09 16:52:38,714 - Type registration [materialized_clob] overrides previous : org.hibernate.type.MaterializedClobType@42a6cdf5
2014-02-09 16:52:38,715 - Type registration [materialized_blob] overrides previous : org.hibernate.type.MaterializedBlobType@551bb202
2014-02-09 16:52:39,801 - Not binding factory to JNDI, no JNDI name configured
2014-02-09 16:52:40,421 - Application 'EB' is now started !
2014-02-09 16:52:41,196 - Listening for HTTP on port 9000 ...

End Error Trace :

@6h7p4k2lk
Internal Server Error (500) for request GET /

Execution exception (In /app/controllers/ControllerUtility.java around line 33)
PersistenceException occured : org.hibernate.exception.SQLGrammarException: could not execute query

play.exceptions.JavaExecutionException: org.hibernate.exception.SQLGrammarException: could not execute query
    at play.mvc.ActionInvoker.invoke(ActionInvoker.java:237)
    at Invocation.HTTP Request(Play!)
Caused by: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute query
    at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1389)
    at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1317)
    at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:255)
    at play.db.jpa.JPQL.findAll(JPQL.java:32)
    at models.Categories.findAll(Categories.java)
    at controllers.ControllerUtility.checkPopUp(ControllerUtility.java:33)
    at play.mvc.ActionInvoker.invoke(ActionInvoker.java:510)
    at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:484)
    at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:479)
    at play.mvc.ActionInvoker.handleBefores(ActionInvoker.java:328)
    at play.mvc.ActionInvoker.invoke(ActionInvoker.java:142)
    ... 1 more
Caused by: org.hibernate.exception.SQLGrammarException: could not execute query
    at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:92)
    at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
    at org.hibernate.loader.Loader.doList(Loader.java:2545)
    at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2276)
    at org.hibernate.loader.Loader.list(Loader.java:2271)
    at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:459)
    at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:365)
    at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
    at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1268)
    at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
    at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:246)
    ... 9 more
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'emirbazaridb.CATEGORIES' doesn't exist
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
    at com.mysql.jdbc.Util.getInstance(Util.java:386)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1052)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4096)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4028)
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2490)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2651)
    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2683)
    at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2144)
    at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2310)
    at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:208)
    at org.hibernate.loader.Loader.getResultSet(Loader.java:1953)
    at org.hibernate.loader.Loader.doQuery(Loader.java:802)
    at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274)
    at org.hibernate.loader.Loader.doList(Loader.java:2542)
    ... 17 more
2014-02-09 16:53:33,457 - Table 'emirbazaridb.CATEGORIES' doesn't exist
Was it helpful?

Solution

I think the hibernate.properties not found message is possibly a red herring. The last line of your stacktrace might be where the problem lies:

Table 'emirbazaridb.CATEGORIES' doesn't exist

Does the CATEGORIES table exist?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top