swaldman/c3p0-play

JNDI Support doesn't work fine

Opened this issue · 13 comments

Hi,

I've try to use the play plugin with JNDI but I got always an Exception. At least an
javax.naming.NameNotFoundException: hugo-datasource not found.

The configuration looks like:

dbplugin=disabled
c3p0.play.enabled=true
db.default.autocommit=false
db.default.driver=oracle.jdbc.OracleDriver
db.default.url="jdbc:oracle:thin:...."
db.default.user="hugo"
db.default.password="boss"
extensions.jndiName="hugo-datasource"
c3p0.acquireIncrement=5
c3p0.minPoolSize=10
c3p0.maxPoolSize=30

I've tried something but nothing helps. May be a bug?
I use "com.mchange" %% "c3p0-play" % "0.1.2"

Best
Sven

hi,

you'll want...

db.default.jndiName="hugo-datasource"

Can you give that a try if you haven't?

Thanks.

Hi,

thanks for fast answer. Yes I try it before but once again. The result is the same and in addition I get an warn:
[warn] com.mchange.v2.c3p0.cfg.C3P0Config - Unexpected compound property, ignored: "extensions.jndiName"

Best

so you don't want any property at all in your config called 'extensions.jndiName'.

internally, the jndiName you set should get mapped to c3p0.extensions.jndiName. You shouldn't have to set that yourself -- db.default.jndiName should suffice. But you'd have to use the full name c3p0.extensions.jndiName if you were going to set it explicitly.

I'll try to verify that db.default.jndiName works for me (but it'll have to wait a bit).

:-) of course, I've only once configuration property set.
Only: db.default.jndiName as you wrote.

I'll try the explicit name

Oh... this might be it! Please be sure that the version of c3p0 you are using is a recent c3p0-0.9.5-pre release. c3p0-play 0.1.2 should pull in c3p0-0.9.5-pre8 as a transitive dependency, but perhaps you have an older version of c3p0 in your stack that does not support user-extended config (a new c3p0 feature).

(c3p0-0.9.5-pre9 is the latest prerelease, but I've not yet updated c3p0-play to it. If you can override to bring in c3p0-0.9.5-pre9, that'd be even better.)

no the explicit name doesn't work :-(

Ok, I've use the c3p0-play 0.1.2 and yes this version used the c3p0-0.9.5-pre8
How can I use the c3p0-0.9.5-pre ?

you already are using the right version... they are always -preX, never just -pre.

i'll try to give this a shot later on and get back to you. sorry!

OK, thanks for now.
Hear from you, thanks

in the comment before I've a typeo :-) Imean the ...pre9 instead of pre.

Iv checked out the play sources and switch to the pre9 version build .jar and try to use. But now I've got and exception: java.lang.ClassNotFoundException: com.mchange.sc.v1.log.MLogger
That's only a notice for you.

May be I do something wrong. I'm not totally firm with sbt ...
I'll be wait if you are back

Thanks

I'm very sorry for the much too slow response.

jndiName binding was indeed broken. It is fixed now, with the new release c3p0-play-0.1.3. (I hope! Please verify at your end if you can!)

com.mchange.sc.v1.log.MLogger should come in with the transitive dependency mlog-scala.