Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I'm a long time trying to turn the architecture play-spring-hibernate but everytime I try the the following error:

I've tried reset and reconfigure often.

Is it that I am missing some dependency?

Is there any reported problem with this architecture?

I am using the example also left in the play site:

https://github.com/jamesward/play2bars/tree/java-spring

I had to modify the dependencies of the project to run.

But when I make a request he always, when I call the method Form form = Form.form (Bar.class) .bindFromRequest () it generates the error posted.

>    [info] Compiling 2 Java sources to C:\Users\Minhoca\Desktop\sistem\target\scala-
2.10\classes...
[info] play - database [default] connected at jdbc:h2:db
[info] play - Application started (Dev)
Hibernate: select bar0_.id as id0_, bar0_._ebean_intercept as column2_0_, bar0_.
name as name0_ from Bar bar0_
Uncaught error from thread [play-akka.actor.default-dispatcher-4] shutting down
JVM since 'akka.jvm-exit-on-fatal-error' is enabled for ActorSystem[play]
java.lang.ExceptionInInitializerError
        at play.data.Form.bind(Form.java:321)
[ERROR] [10/01/2014 17:10:15.168] [play-akka.actor.default-dispatcher-4] [ActorS
ystem(play)] Uncaught error from thread [play-ak        at play.data.Form.bindFr
omRequest(Form.java:216)
ka.actor.default-dispatcher-4] shutting down JVM since 'akka.jvm-exit-on-fatal-e
rror' is enabled
        at controllers.Application.addBar(Application.java:23)
java.lang.ExceptionInInitializerError
        at Routes$$anonfun$routes$1$$anonfun$applyOrElse$3$$anonfun$apply$7.appl
y(routes_routing.scala:73)
        at play.data.Form.bind(Form.java:321)
        at Routes$$anonfun$routes$1$$anonfun$applyOrElse$3$$anonfun$apply$7.appl
y(routes_routing.scala:73)
        at play.data.Form.bindFromRequest(Form.java:216)
        at play.core.Router$HandlerInvoker$$anon$7$$anon$2.invocation(Router.sca
la:183)
        at controllers.Application.addBar(Application.java:23)
        at play.core.Router$Routes$$anon$1.invocation(Router.scala:377)
        at Routes$$anonfun$routes$1$$anonfun$applyOrElse$3$$anonfun$apply$7.appl
y(routes_routing.scala:73)
        at play.core.j.JavaAction$$anon$1.call(JavaAction.scala:56)
        at Routes$$anonfun$routes$1$$anonfun$applyOrElse$3$$anonfun$apply$7.appl
y(routes_routing.scala:73)
        at play.GlobalSettings$1.call(GlobalSettings.java:64)
        at play.core.Router$HandlerInvoker$$anon$7$$anon$2.invocation(Router.sca
la:183)
        at play.core.j.JavaAction$$anon$3.apply(JavaAction.scala:91)
        at play.core.Router$Routes$$anon$1.invocation(Router.scala:377)
        at play.core.j.JavaAction$$anon$3.apply(JavaAction.scala:90)
        at play.core.j.JavaAction$$anon$1.call(JavaAction.scala:56)
        at play.core.j.FPromiseHelper$$anonfun$flatMap$1.apply(FPromiseHelper.sc
ala:82)
        at play.GlobalSettings$1.call(GlobalSettings.java:64)
        at play.core.j.FPromiseHelper$$anonfun$flatMap$1.apply(FPromiseHelper.sc
ala:82)
        at play.core.j.JavaAction$$anon$3.apply(JavaAction.scala:91)
        at scala.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:251)
        at play.core.j.JavaAction$$anon$3.apply(JavaAction.scala:90)
        at scala.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:249)
        at play.core.j.FPromiseHelper$$anonfun$flatMap$1.apply(FPromiseHelper.sc
ala:82)
        at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32)
        at play.core.j.FPromiseHelper$$anonfun$flatMap$1.apply(FPromiseHelper.sc
ala:82)
        at play.core.j.HttpExecutionContext$$anon$2.run(HttpExecutionContext.sca
la:37)
        at scala.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:251)
        at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:42)
        at scala.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:249)
        at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(Abst
ractDispatcher.scala:386)
        at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32)
        at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
        at play.core.j.HttpExecutionContext$$anon$2.run(HttpExecutionContext.sca
la:37)
        at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool
.java:1339)
        at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:42)
        at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:19
79)
        at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(Abst
ractDispatcher.scala:386)
        at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThre
ad.java:107)
        at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
Caused by: java.lang.IllegalArgumentException: Type must not be null
        at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool
.java:1339)
        at org.springframework.util.Assert.notNull(Assert.java:112)
        at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:19
79)
        at org.springframework.core.convert.TypeDescriptor.valueOf(TypeDescripto
r.java:493)
        at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThre
ad.java:107)
        at org.springframework.format.support.FormattingConversionService$Printe
rConverter.<init>(FormattingConversionService.java:123)Caused by: java.lang.Ille
galArgumentException: Type must not be null

        at org.springframework.util.Assert.notNull(Assert.java:112)
        at org.springframework.format.support.FormattingConversionService.addFor
>matterForFieldType(FormattingConversionService.java:80) at org.springframework.c
ore.convert.TypeDescriptor.valueOf(TypeDescriptor.java:493)

        at org.springframework.format.support.FormattingConversionService$Printe
>rConverter.<init>(FormattingConversionService.java:123) at play.data.format.Form
atters.register(Formatters.java:204)

        at play.data.format.Formatters.<clinit>(Formatters.java:101)
        at org.springframework.format.support.FormattingConversionService.addFor
>matterForFieldType(FormattingConversionService.java:80) ... 23 more

        at play.data.format.Formatters.register(Formatters.java:204)
        at play.data.format.Formatters.<clinit>(Formatters.java:101)
        ... 23 more

>[error] a.a.ActorSystemImpl - Uncaught error from thread [play-akka.actor.defaul
t-dispatcher-4] shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enable
d
java.lang.ExceptionInInitializerError: null
        at play.data.Form.bind(Form.java:321) ~[play-java_2.10.jar:2.2.4]
        at play.data.Form.bindFromRequest(Form.java:216) ~[play-java_2.10.jar:2.
2.4]
        at controllers.Application.addBar(Application.java:23) ~[classes/:na]
        at Routes$$anonfun$routes$1$$anonfun$applyOrElse$3$$anonfun$apply$7.appl
y(routes_routing.scala:73) ~[classes/:na]
        at Routes$$anonfun$routes$1$$anonfun$applyOrElse$3$$anonfun$apply$7.appl
y(routes_routing.scala:73) ~[classes/:na]
        at play.core.Router$HandlerInvoker$$anon$7$$anon$2.invocation(Router.sca
la:183) ~[play_2.10.jar:2.2.4]
Caused by: java.lang.IllegalArgumentException: Type must not be null
        at org.springframework.util.Assert.notNull(Assert.java:112) ~[spring-cor
e-4.0.0.RELEASE.jar:4.0.0.RELEASE]
        at org.springframework.core.convert.TypeDescriptor.valueOf(TypeDescripto
r.java:493) ~[spring-core-4.0.0.RELEASE.jar:4.0.0.RELEASE]
        at org.springframework.format.support.FormattingConversionService$Printe
rConverter.<init>(FormattingConversionService.java:123) ~[spring-context-4.0.0.R
ELEASE.jar:4.0.0.RELEASE]
        at org.springframework.format.support.FormattingConversionService.addFor
matterForFieldType(FormattingConversionService.java:80) ~[spring-context-4.0.0.R
ELEASE.jar:4.0.0.RELEASE]
        at play.data.format.Formatters.register(Formatters.java:204) ~[play-java
_2.10.jar:2.2.4]
        at play.data.format.Formatters.<clinit>(Formatters.java:101) ~[play-java
_2.10.jar:2.2.4]




> import sbt._
>import Keys._
>import play.Project._

>object ApplicationBuild extends Build {

>    val appName         = "play2bars-java-spring"
    val appVersion      = "1.0-SNAPSHOT"

    val appDependencies = Seq(
      javaCore,
      "com.h2database" % "h2" % "1.3.168",
      "org.springframework" % "spring-core" % "4.0.0.RELEASE",
      "org.springframework" % "spring-expression" % "4.0.0.RELEASE",
      "org.springframework" % "spring-context" % "4.0.0.RELEASE",
      "org.springframework" % "spring-orm" % "4.0.0.RELEASE",
      "org.springframework" % "spring-jdbc" % "4.0.0.RELEASE",
      "org.springframework" % "spring-tx" % "4.0.0.RELEASE",
      "org.springframework" % "spring-test" % "4.0.0.RELEASE" % "test",
      "org.hibernate" % "hibernate-entitymanager" % "4.1.9.Final",
      "cglib" % "cglib" % "2.2.2"
    )

    val main = play.Project(appName, appVersion, appDependencies).settings(
      // Add your own project settings here      
    )

>}
share|improve this question
    
You get "Caused by: java.lang.IllegalArgumentException: Type must not be null" problobly returned null by "org.springframework.core.convert.TypeDescriptor.valueOf(TypeDescriptor.java:493‌​) ~[spring-core-4.0.0.RELEASE.jar:4.0.0.RELEASE]" Can you place breakpoint there and check where this null comes from? BTW There is spring 4.1.1, maybe will solve the issue too. –  Leszek Gruchała Oct 2 '14 at 7:00
    
I initialized my form that: public static Form<entities.ServidorModel> formServidorModel = Form.form(entities.ServidorModel.class); and the error occurred when I do Map<String,String> map = new HashMap<String,String>(); map.put("cpf", "cpf"); formServidorModel.bind(map).get(); // kill vm The most of variables is null, but in play framework manual was doing like i show. I think that framework not initialized correctly the object Form (I don't know if error occur because the spring) do you have some idea? –  Edson Bollis Oct 2 '14 at 14:19
    
First of all, update to Spring 4.1.1. Then place breakpoint in place where this IllegalArgumentException arrises. I see in Spring source code, that the type is passed to Spring's method as parameter and is missing/null. Check where it comes from. Maybe this will give you an idea why is this null. –  Leszek Gruchała Oct 3 '14 at 9:10

1 Answer 1

I update my references and now all work fine.

My libs:

val appDependencies = Seq(
      javaCore,
      "com.h2database" % "h2" % "1.4.181",
       "org.springframework" % "spring-context" % "4.1.1.RELEASE",
       "org.springframework" % "spring-expression" % "3.2.1.RELEASE",
       "org.springframework" % "spring-core" % "4.1.1.RELEASE",
       "org.springframework" % "spring-beans" % "4.1.1.RELEASE",
      "org.springframework" % "spring-aop" % "4.1.1.RELEASE",
      "org.springframework" % "spring-orm" % "4.1.1.RELEASE",
      "org.springframework" % "spring-jdbc" % "4.1.1.RELEASE",
      "org.springframework" % "spring-tx" % "4.1.1.RELEASE",
      "org.springframework" % "spring-test" % "4.1.1.RELEASE" % "test",
      "org.springframework" % "spring-web" % "4.1.1.RELEASE",
      "org.springframework" % "spring-webmvc" % "4.1.1.RELEASE",
      "commons-dbcp" % "commons-dbcp" % "1.4",
      "commons-collections" % "commons-collections" % "3.2.1",
      "commons-logging" % "commons-logging" % "1.1.3",
      "org.hibernate" % "hibernate-c3p0" % "4.3.6.Final",
      "org.hibernate" % "hibernate-core" % "4.3.6.Final",
      "org.hibernate" % "hibernate-entitymanager" % "4.3.6.Final",
      "cglib" % "cglib" % "2.2.2",
      "mysql" % "mysql-connector-java" % "5.1.28"
    )
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.