Unsuccessful attempt to use play with Postresql

204 views
Skip to first unread message

benimnetz

unread,
May 28, 2010, 7:48:40 AM5/28/10
to play-framework
Hi everyone,

im very excited using play for my bachelor thesis and really like how
programming with play "feels right".
I just ran into issues setting my play application in production mode
(just to try how this works) on a ubuntu 10.04.
i want to use postgresql as a datasource, so i installed libpg-java
wich did not help me with error driver "org.postresql.Driver" not
found, so i downloaded a postresql.jar and put it into my applications
lib folder. this seems to help, however, if i try to start my
application, i get the following error messages:

_ _
~ _ __ | | __ _ _ _| |
~ | '_ \| |/ _' | || |_|
~ | __/|_|\____|\__ (_)
~ |_| |__/
~
~ play! 1.0.2.1, http://www.playframework.org
~ framework ID is klickgeistJiffy
~
~ Ctrl+C to stop
~
13:41:03,138 INFO ~ Starting /home/play/klickgeist
13:41:03,141 INFO ~ Module secure is available (/opt/play-1.0.2.1/
modules/secure)
13:41:03,269 INFO ~ Precompiling ...
13:41:04,620 INFO ~ Connected to jdbc:postgresql:play
13:41:05,729 ERROR ~ Unsuccessful: create table User (id int8 not
null, email varchar(255), experience int4 not null, fullname
varchar(255), isAdmin bool not null, password varchar(255), primary
key (id))
13:41:05,729 ERROR ~ ERROR: syntax error at or near "User"
Position: 14
13:41:05,731 ERROR ~ Unsuccessful: alter table CSInstance add
constraint FK26599125A13B8A84 foreign key (reviewer_id) references
User
13:41:05,731 ERROR ~ ERROR: syntax error at or near "User"
Position: 95
13:41:05,732 ERROR ~ Unsuccessful: alter table CardSorting add
constraint FKCA98834A7CD013E foreign key (author_id) references User
13:41:05,732 ERROR ~ ERROR: syntax error at or near "User"
Position: 93
13:41:05,734 ERROR ~ Unsuccessful: alter table Project add constraint
FK50C8E2F9161598FA foreign key (admin_id) references User
13:41:05,734 ERROR ~ ERROR: syntax error at or near "User"
Position: 89
13:41:05,735 ERROR ~ Unsuccessful: alter table Project_User add
constraint FK41BE2971FFF686F0 foreign key (members_id) references User
13:41:05,735 ERROR ~ ERROR: syntax error at or near "User"
Position: 96
13:41:05,737 ERROR ~ Unsuccessful: alter table User_Project add
constraint FKB583CEA547140EFE foreign key (User_id) references User
13:41:05,737 ERROR ~ ERROR: syntax error at or near "User"
Position: 93
13:41:05,800 INFO ~ Application 'klickgeist Usability Framework' is
now started !
13:41:06,034 WARN ~ SQL Error: 0, SQLState: 42809
13:41:06,034 ERROR ~ ERROR: column notation .id applied to type name,
which is not a composite type
Position: 14
13:41:06,043 ERROR ~

@62jcjb908
Error during job execution (Bootstrap)

Java exception (In /app/Bootstrap.java around line 12)
PersistenceException occured :
org.hibernate.exception.SQLGrammarException: could not execute query

play.exceptions.JavaExecutionException:
org.hibernate.exception.SQLGrammarException: could not execute query
at play.jobs.Job.call(Job.java:119)
at Invocation.Job(Play!)
Caused by: javax.persistence.PersistenceException:
org.hibernate.exception.SQLGrammarException: could not execute query
at
org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:
614)
at org.hibernate.ejb.QueryImpl.getSingleResult(QueryImpl.java:128)
at models.User.count(User.java)
at Bootstrap.doJob(Bootstrap.java:12)
at play.jobs.Job.doJobWithResult(Job.java:37)
at play.jobs.Job.call(Job.java:110)
... 1 more
Caused by: org.hibernate.exception.SQLGrammarException: could not
execute query
at
org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:
90)
at
org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:
66)
at org.hibernate.loader.Loader.doList(Loader.java:2235)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2129)
at org.hibernate.loader.Loader.list(Loader.java:2124)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:401)
at
org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:
363)
at
org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:
196)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1149)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
at org.hibernate.ejb.QueryImpl.getSingleResult(QueryImpl.java:88)
... 5 more
Caused by: org.postgresql.util.PSQLException: ERROR: column
notation .id applied to type name, which is not a composite type
Position: 14
at
org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:
2062)
at
org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:
1795)
at
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:
257)
at
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:
479)
at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:
367)
at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:
271)
at
com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:
76)
at
org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:
208)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1812)
at org.hibernate.loader.Loader.doQuery(Loader.java:697)
at
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:
259)
at org.hibernate.loader.Loader.doList(Loader.java:2232)
... 13 more
Exception in thread "main" play.exceptions.JavaExecutionException:
org.hibernate.exception.SQLGrammarException: could not execute query
at play.jobs.Job.call(Job.java:119)
at Invocation.Job(Play!)
Caused by: javax.persistence.PersistenceException:
org.hibernate.exception.SQLGrammarException: could not execute query
at
org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:
614)
at org.hibernate.ejb.QueryImpl.getSingleResult(QueryImpl.java:128)
at models.User.count(User.java)
at Bootstrap.doJob(Bootstrap.java:12)
at play.jobs.Job.doJobWithResult(Job.java:37)
at play.jobs.Job.call(Job.java:110)
... 1 more
Caused by: org.hibernate.exception.SQLGrammarException: could not
execute query
at
org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:
90)
at
org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:
66)
at org.hibernate.loader.Loader.doList(Loader.java:2235)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2129)
at org.hibernate.loader.Loader.list(Loader.java:2124)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:401)
at
org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:
363)
at
org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:
196)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1149)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
at org.hibernate.ejb.QueryImpl.getSingleResult(QueryImpl.java:88)
... 5 more
Caused by: org.postgresql.util.PSQLException: ERROR: column
notation .id applied to type name, which is not a composite type
Position: 14
at
org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:
2062)
at
org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:
1795)
at
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:
257)
at
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:
479)
at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:
367)
at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:
271)
at
com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:
76)
at
org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:
208)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1812)
at org.hibernate.loader.Loader.doQuery(Loader.java:697)
at
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:
259)
at org.hibernate.loader.Loader.doList(Loader.java:2232)
... 13 more

Julien Tournay

unread,
May 28, 2010, 8:14:59 AM5/28/10
to play-fr...@googlegroups.com
User is a reserved keyword in SQL, you should not use this as a table name.



--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To post to this group, send email to play-fr...@googlegroups.com.
To unsubscribe from this group, send email to play-framewor...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.




--
Real Programmers don't need comments-- the code is obvious.
Reply all
Reply to author
Forward
0 new messages