"ORA-00902: invalid datatype" exception on startup with datasource configured

1,273 views
Skip to first unread message

AK

unread,
Nov 22, 2011, 3:33:55 PM11/22/11
to play-framework
I am building an application using Play 2.0-beta. I have configured 1
datasource in application.conf as follows:

db.csr.driver=oracle.jdbc.driver.OracleDriver
db.csr.url=jdbc:oracle:thin:@XX.X.XXX.XX:1521:SIDID
db.csr.user=***
db.csr.password=***

I've created a "lib" folder and copied Oracle 11G's ojdbc6.jar file
there. I am using the same driver in plain JDBC apps without problems.

After restarting play and accessing application entry point, I get the
following exception. I commented out all ORM related code but I'm
still getting this as long as the database configuration is present.

Separate question - how do I turn on Play logging? I set it to debug
in application.conf but that doesn't result in any more messages on
the console. Stack trace is below:

java.sql.SQLSyntaxErrorException: ORA-00902: invalid datatype
oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:439)
oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:395)
oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:802)
oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:436)
oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:186)
oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:521)
oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:194)
oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:
1000)

oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:
1307)

oracle.jdbc.driver.OracleStatement.executeInternal(OracleStatement.java:
1882)
oracle.jdbc.driver.OracleStatement.execute(OracleStatement.java:
1847)

oracle.jdbc.driver.OracleStatementWrapper.execute(OracleStatementWrapper.java:
301)
com.jolbox.bonecp.StatementHandle.execute(StatementHandle.java:
300)
play.api.db.evolutions.Evolutions$.play$api$db$evolutions
$Evolutions$$execute(Evolutions.scala:89)
play.api.db.evolutions.Evolutions
$.checkEvolutionsState(Evolutions.scala:147)
play.api.db.evolutions.Evolutions
$.databaseEvolutions(Evolutions.scala:293)
play.api.db.evolutions.Evolutions
$.evolutionScript(Evolutions.scala:269)
play.api.db.evolutions.EvolutionsPlugin$$anonfun$onStart
$1.apply(Evolutions.scala:385)
play.api.db.evolutions.EvolutionsPlugin$$anonfun$onStart
$1.apply(Evolutions.scala:383)
scala.collection.immutable.Map$Map1.foreach(Map.scala:118)
play.api.db.evolutions.EvolutionsPlugin.onStart(Evolutions.scala:
383)
play.api.Play$$anonfun$start$1.apply(Play.scala:58)
play.api.Play$$anonfun$start$1.apply(Play.scala:58)
scala.collection.LinearSeqOptimized
$class.foreach(LinearSeqOptimized.scala:59)
scala.collection.immutable.List.foreach(List.scala:45)
play.api.Play$.start(Play.scala:58)
play.core.ReloadableApplication$$anonfun$get$1$$anonfun
$1.apply(ApplicationProvider.scala:78)
play.core.ReloadableApplication$$anonfun$get$1$$anonfun
$1.apply(ApplicationProvider.scala:65)
scala.Option.map(Option.scala:133)
play.core.ReloadableApplication$$anonfun$get
$1.apply(ApplicationProvider.scala:65)
play.core.ReloadableApplication$$anonfun$get
$1.apply(ApplicationProvider.scala:63)
scala.Either$RightProjection.flatMap(Either.scala:277)
play.core.ReloadableApplication.get(ApplicationProvider.scala:63)
play.core.server.Server$class.sendAction$1(Server.scala:36)
play.core.server.Server$$anonfun$getActionFor$1$$anonfun$apply
$4.apply(Server.scala:44)
play.core.server.Server$$anonfun$getActionFor$1$$anonfun$apply
$4.apply(Server.scala:44)
scala.util.control.Exception$Catch$$anonfun$either
$1.apply(Exception.scala:110)
scala.util.control.Exception$Catch$$anonfun$either
$1.apply(Exception.scala:110)
scala.util.control.Exception$Catch.apply(Exception.scala:88)
scala.util.control.Exception$Catch.either(Exception.scala:110)
play.core.server.Server$$anonfun$getActionFor
$1.apply(Server.scala:44)
play.core.server.Server$$anonfun$getActionFor
$1.apply(Server.scala:46)
scala.Option.toLeft(Option.scala:252)
play.core.server.Server$class.getActionFor(Server.scala:42)
play.core.server.NettyServer.getActionFor(NettyServer.scala:29)
play.core.server.NettyServer
$PlayDefaultUpstreamHandler.messageReceived(NettyServer.scala:372)

org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:
80)

org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:
564)
org.jboss.netty.channel.DefaultChannelPipeline
$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:
783)

org.jboss.netty.handler.stream.ChunkedWriteHandler.handleUpstream(ChunkedWriteHandler.java:
149)

org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:
564)
org.jboss.netty.channel.DefaultChannelPipeline
$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:
783)

org.jboss.netty.handler.codec.http.HttpChunkAggregator.messageReceived(HttpChunkAggregator.java:
116)

org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:
80)

org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:
564)
org.jboss.netty.channel.DefaultChannelPipeline
$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:
783)

org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:
302)

org.jboss.netty.handler.codec.replay.ReplayingDecoder.unfoldAndFireMessageReceived(ReplayingDecoder.java:
522)

org.jboss.netty.handler.codec.replay.ReplayingDecoder.callDecode(ReplayingDecoder.java:
506)

org.jboss.netty.handler.codec.replay.ReplayingDecoder.messageReceived(ReplayingDecoder.java:
443)

org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:
80)

org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:
564)

org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:
559)

org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:
274)

org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:
261)
org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:
351)

org.jboss.netty.channel.socket.nio.NioWorker.processSelectedKeys(NioWorker.java:
282)
org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:
202)

org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:
108)
org.jboss.netty.util.internal.DeadLockProofWorker
$1.run(DeadLockProofWorker.java:44)
java.util.concurrent.ThreadPoolExecutor
$Worker.runTask(ThreadPoolExecutor.java:886)
java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor.java:908)
java.lang.Thread.run(Thread.java:662)

AK

unread,
Nov 22, 2011, 5:28:18 PM11/22/11
to play-framework
I made some progress on this. I set the logging to DEBUG for
everything at the ROOT level. I saw that Play was trying to create
table play_evolutions and that statement fails causing the exception.

Documentation suggests that this should only be happening if I have db/
evolutions directory, which I don't. I even tried setting
evolutions.enabled=false in application.conf to disable this feature
but no luck.

Any ideas?

Guillaume Bort

unread,
Nov 22, 2011, 5:53:32 PM11/22/11
to play-fr...@googlegroups.com
Yes it seems that evolutions are broken when using Oracle. We will fix that.

> --
> 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.
>
>

--
Guillaume Bort

AK

unread,
Nov 22, 2011, 7:14:55 PM11/22/11
to play-framework
Yup. Not only that, but looks like your current code base doesn't
check "evolutions.enabled" conf flag. I worked around this by adding

if (!app.configuration.getBoolean("evolutions.enabled").get) {
return
}

to EvolutionsPlugin and patched playframework.jar. Crude hack because
I don't know Scala yet :-) Probably there's a neater way of checking
if the flag is present and true, but I just needed to get past the
issue, and it worked for me.

If I'm successful with Play I would volunteer some time to help fix
issues like that. Right now I'm in learning mode.

Any idea on when RC will be coming out? I plan to advocate for Play in
my current org and I really like the concepts behind Play, but 2.0
feels very raw at the moment. And I don't want to go to 1.x knowing
that it's so different from 2.0.

wrast

unread,
Dec 12, 2011, 1:51:48 PM12/12/11
to play-framework
I have this problem as well. Looks like it's this statement:

create table play_evolutions (
id int not null primary key,
hash varchar(255) not null,
applied_at timestamp not null,
apply_script text,
revert_script text,
state varchar(255),
last_problem text)

The text data type is invalid with Oracle. Also worth noting is that
"varchar" is deprecated and "varchar2" should be used. See
http://docs.oracle.com/cd/B28359_01/server.111/b28318/datatype.htm#i1835

Any ETA on a fix in 1.2.x?

On Nov 22, 3:53 pm, Guillaume Bort <guillaume.b...@gmail.com> wrote:
> Yes it seems that evolutions are broken when usingOracle. We will fix that.


>
>
>
>
>
>
>
>
>
> On Tue, Nov 22, 2011 at 11:28 PM, AK <alex.kalinov...@creamtec.com> wrote:
> > I made some progress on this. I set the logging to DEBUG for
> > everything at the ROOT level. I saw that Play was trying to create

> > tableplay_evolutionsand that statement fails causing the exception.


>
> > Documentation suggests that this should only be happening if I have db/
> > evolutions directory, which I don't. I even tried setting
> > evolutions.enabled=false in application.conf to disable this feature
> > but no luck.
>
> > Any ideas?
>
> > --
> > 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.

Clint

unread,
Jan 26, 2012, 5:14:55 PM1/26/12
to play-framework
I ran into the same problem. Has this been fixed? Is there a way to
track progress on it?

Thanks!
Clint

On Dec 12 2011, 1:51 pm, wrast <winston.r...@gmail.com> wrote:
> I have this problem as well. Looks like it's this statement:
>
> create table play_evolutions (
> id int not null primary key,
> hash varchar(255) not null,
> applied_at timestamp not null,
> apply_script text,
> revert_script text,
> state varchar(255),
> last_problem text)
>
> The text data type is invalid with Oracle. Also worth noting is that
> "varchar" is deprecated and "varchar2" should be used. Seehttp://docs.oracle.com/cd/B28359_01/server.111/b28318/datatype.htm#i1835

canavar

unread,
Jan 27, 2012, 5:43:21 AM1/27/12
to play-fr...@googlegroups.com

Are you using Oracle10gDialect?

27 Oca 2012 00:15 tarihinde "Clint" <cl...@ccombs.net> yazdı:

Clint Combs

unread,
Jan 27, 2012, 9:48:39 AM1/27/12
to play-fr...@googlegroups.com
Are you're referring to "Oracle10gDialect" from Hibernate(?).   I'm using an Oracle 11g driver and I get this error.

What I'm trying to do is configure a connection pool in Play 2.0.  I dropped the Oracle 11g driver into my lib directory and configured the connection as described in the docs.  I've got some legacy JDBC code and I'd like to inject connections into it, but I get this stack trace when accessing the app.

I think I just need the ability to turn off evolutions.  Is that possible?

-Clint

SQLSyntaxErrorException: ORA-00902: invalid datatype

No source available, here is the exception stack trace:

->java.sql.SQLSyntaxErrorException: ORA-00902: invalid datatype
     oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:445)
     oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
     oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:879)
     oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:450)
     oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:192)
     oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:531)
     oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:193)
     oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:1033)
     oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1329)
     oracle.jdbc.driver.OracleStatement.executeInternal(OracleStatement.java:1909)
     oracle.jdbc.driver.OracleStatement.execute(OracleStatement.java:1871)
     oracle.jdbc.driver.OracleStatementWrapper.execute(OracleStatementWrapper.java:318)
     com.jolbox.bonecp.StatementHandle.execute(StatementHandle.java:300)
...

Mark T

unread,
Jan 27, 2012, 11:33:49 AM1/27/12
to play-framework
I ran into this issue myself, and it appears that a fix is
forthcoming:

https://play.lighthouseapp.com/projects/82401/tickets/79-how-can-i-disable-playapidbevolutions

On Jan 27, 9:48 am, Clint Combs <cl...@ccombs.net> wrote:
> Are you're referring to "Oracle10gDialect" from Hibernate(?).   I'm using
> an Oracle 11g driver and I get this error.
>
> What I'm trying to do is configure a connection pool in Play 2.0.  I
> dropped the Oracle 11g driver into my lib directory and configured the
> connection as described in the docs.  I've got some legacy JDBC code and
> I'd like to inject connections into it, but I get this stack trace when
> accessing the app.
>
> I think I just need the ability to turn off evolutions.  Is that possible?
>
> -Clint
>
> SQLSyntaxErrorException: ORA-00902: invalid datatype
> No source available, here is the exception stack trace:
>
> ->java.sql.SQLSyntaxErrorException: ORA-00902: invalid datatype
>
>      oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:445)
>
>      oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
>
>      oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:879)
>
>      oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:450)
>
>      oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:192)
>
>      oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:531)
>
>      oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:193)
>
>      oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:1033)
>
>      oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.jav a:1329)
>
>      oracle.jdbc.driver.OracleStatement.executeInternal(OracleStatement.java:190 9)
>
>      oracle.jdbc.driver.OracleStatement.execute(OracleStatement.java:1871)
>
>      oracle.jdbc.driver.OracleStatementWrapper.execute(OracleStatementWrapper.ja va:318)
Reply all
Reply to author
Forward
0 new messages