Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Play Framework and DB2

I'm develloping a web application over Play Framework 2.0.

Since I need to access a DB2 database, I added the following lines to my application's application.conf file:

db.mydb.driver=com.ibm.db2.jcc.DB2Driver
db.mydb.url="jdbc:db2://host:port/databaseName"
db.mydb.user=user
db.mydb.password=pass
db.mydb.jndiName=databaseName

I connected sucessfully to this DB but got the following exceptions:

[info] play - datasource [jdbc:db2://host:port/databaseName] bound to JNDI as databaseName
[info] play - database [databaseName] connected at jdbc:db2://host:port/databaseName
[warn] application - play_evolutions table already existed
[error] application -

! @6a8ib4hd7 - Internal server error, for request [GET /] ->

play.api.UnexpectedException: Unexpected exception [SqlSyntaxErrorException: DB2
 SQL Error: SQLCODE=-204, SQLSTATE=42704, SQLERRMC=DB2ADMIN.PLAY_EVOLUTIONS, DRI
VER=4.12.55]
        at play.core.ReloadableApplication$$anonfun$get$1$$anonfun$apply$3$$anon
fun$1.apply(ApplicationProvider.scala:134) ~[play_2.9.1.jar:2.0]
        at play.core.ReloadableApplication$$anonfun$get$1$$anonfun$apply$3$$anon
fun$1.apply(ApplicationProvider.scala:112) ~[play_2.9.1.jar:2.0]
        at scala.Option.map(Option.scala:133) ~[scala-library.jar:0.11.2]
        at play.core.ReloadableApplication$$anonfun$get$1$$anonfun$apply$3.apply
(ApplicationProvider.scala:112) ~[play_2.9.1.jar:2.0]
        at play.core.ReloadableApplication$$anonfun$get$1$$anonfun$apply$3.apply
(ApplicationProvider.scala:110) ~[play_2.9.1.jar:2.0]
        at scala.Either$RightProjection.flatMap(Either.scala:277) ~[scala-librar
y.jar:0.11.2]
Caused by: com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-2
04, SQLSTATE=42704, SQLERRMC=DB2ADMIN.PLAY_EVOLUTIONS, DRIVER=4.12.55
        at com.ibm.db2.jcc.am.hd.a(hd.java:676) ~[db2jcc4.jar:na]
        at com.ibm.db2.jcc.am.hd.a(hd.java:60) ~[db2jcc4.jar:na]
        at com.ibm.db2.jcc.am.hd.a(hd.java:127) ~[db2jcc4.jar:na]
        at com.ibm.db2.jcc.am.mn.c(mn.java:2621) ~[db2jcc4.jar:na]
        at com.ibm.db2.jcc.am.mn.d(mn.java:2609) ~[db2jcc4.jar:na]
        at com.ibm.db2.jcc.am.mn.a(mn.java:2085) ~[db2jcc4.jar:na]

In order to solve this I tried to disable Evolutions setting the following line in application.conf file:

evolutions=disabled
evolutions.enable=false

But I am allways getting the above exceptions.

Can anyone help me on this?

Thanks

like image 292
RedEagle Avatar asked May 02 '12 15:05

RedEagle


1 Answers

OK... Finally found out the origin of the problem...

Like I said I am using Play Framework 2.0 and was working in the forms tutorial project that comes with this version of Play...

As it turns out the command to disable Evolutions is neither:

evolutions=disabled evolution=disabled

... But rather:

evolutionplugin=disabled

Thanks

like image 50
RedEagle Avatar answered Oct 21 '22 08:10

RedEagle