java.lang.NoClassDefFoundError: Could not initialize class play.data.format.Formatters -


i'm using play 2.1.2 , want use dynamic forms. tried in own small hello world project , worked fine, when use forms in other bigger project i'm getting exception. here code (in both project same):

controller

public static result signinform() {     dynamicform form = form.form().bindfromrequest();   //exception on line     return renderjapid(form); } 

routes

get     /sign-in                                            controllers.authentication.signinform() 

when go localhost:9000/sign-in exception:

caused by: java.lang.noclassdeffounderror: not initialize class play.data.format.formatters @ play.data.form.bind(form.java:320) ~[play-java_2.10.jar:2.1.2] @ play.data.dynamicform.bind(dynamicform.java:100) ~[play-java_2.10.jar:2.1.2] @ play.data.dynamicform.bindfromrequest(dynamicform.java:71) ~[play-java_2.10.jar:2.1.2] @ controllers.authentication.signinform(authentication.java:310) ~[na:na] @ routes$$anonfun$routes$1$$anonfun$applyorelse$19$$anonfun$apply$19.apply(routes_routing.scala:305) ~[na:na] @ routes$$anonfun$routes$1$$anonfun$applyorelse$19$$anonfun$apply$19.apply(routes_routing.scala:305) ~[na:na] 

please, can me? problem? i've checked global.java , application.conf in both projects didn't find cause problem.

update:

i've tried put code

formattingconversionservice fcs = formatters.conversion; 

before line dynamic form call. after reloading localhost:9000/sign-in in browser got exception on new line:

caused by: java.lang.nullpointerexception: null @ play.data.format.formatters.register(formatters.java:186) ~[play-java_2.10.jar:2.1.2] @ play.data.format.formatters.<clinit>(formatters.java:100) ~[play-java_2.10.jar:2.1.2] @ controllers.authentication.signinform(authentication.java:310) ~[na:na] @ routes$$anonfun$routes$1$$anonfun$applyorelse$19$$anonfun$apply$19.apply(routes_routing.scala:305) ~[na:na] @ routes$$anonfun$routes$1$$anonfun$applyorelse$19$$anonfun$apply$19.apply(routes_routing.scala:305) ~[na:na] @ play.core.router$handlerinvoker$$anon$6$$anon$2.invocation(router.scala:175) ~[play_2.10.jar:2.1.2] 

so seems formatters in classpath. when hit reload button in browser again same noclassdeffounderror before (this time on line added).

noclassdeffounderror means class not on classpath. possibly there when compiled it, missing (seen shared libraries mostly).

noclassdeffounderror documentation

looks not finding play-java_2.10.jar.

edit:(to sum comments)

the play jar uses spring binding data. initial thought spring not included on classpath, was. however, spring on classpath appears have conflict spring jars in lib folder. removing jars in lib folder seems have cleared error. :)


Comments

Popular posts from this blog

Unable to remove the www from url on https using .htaccess -