Hi,
Not completely sure if it is a problem raised from Play 2.1 or Scala 2.10, but after I upgrade my application from Play 2.0.4 to Play 2.1, my application raise the following exception at runtime when loading a page,
java.lang.ExceptionInInitializerError: null
at models.database.entities.Bookstore$.<init>(Bookstore.scala:118) ~[na:na]
at models.database.entities.Bookstore$.<clinit>(Bookstore.scala) ~[na:na]
at controllers.Admin$.<init>(Admin.scala:61) ~[na:na]
at controllers.Admin$.<clinit>(Admin.scala) ~[na:na]
at Routes$$anonfun$routes$1$$anonfun$applyOrElse$5$$anonfun$apply$5.apply(routes_routing.scala:125) ~[na:na]
at Routes$$anonfun$routes$1$$anonfun$applyOrElse$5$$anonfun$apply$5.apply(routes_routing.scala:125) ~[na:na]
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [database/hibernate.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.util.ArrayList' to required type 'java.lang.Class[]' for property 'annotatedClasses'; nested exception is java.lang.IllegalArgumentException: Cannot find class [models.database.entities.Bookstore]
It seems like the Spring was unable to resolve the class I defined in "models.database.entities.Bookstore." when it is tries to initiate application-context. The hibernate bean definition looks like this
<bean id="hibernateClasses" class="org.springframework.beans.factory.config.ListFactoryBean">
<property name="sourceList">
<list>
<value>models.database.entities.Bookstore</value>
<value>models.database.entities.BookstoreFile</value>
<value>models.database.entities.BookstoreLogoFile</value>
<value>models.database.entities.SystemProperty</value>
</list>
</property>
</bean>
I am completely puzzled about this error because when I run my scala-test unit tests, all the spring/hibernate work fine. But when I run my application, the error raise. Do anyone have clue what could be the problem? Thanks you guys help for so much!