import net.sf.json.JSONArray;  
请问怎么不能通过编译?

解决方案 »

  1.   

    是不是缺少JAR包的原因。。使用依赖如下JAR包
    commons-logging.jar,
    commons-lang.jar,
    commons-collections.jar,
    json.jar,
    commons-beanUtils.jar,
    ezmorph.jar
    检查是否存在缺失。。
      

  2.   

     去下这个包:http://json-lib.sourceforge.net
      

  3.   

    就在http://json-lib.sourceforge.net下载的包。我用测试的时候可以通过测试,我启动项目也没问题,就是访问的时候包错:
    play.exceptions.CompilationException: net.sf.json.JSONArray cannot be resolved
            at play.classloading.ApplicationCompiler$2.acceptResult(ApplicationCompiler.java:246)
            at org.eclipse.jdt.internal.compiler.Compiler.handleInternalException(Compiler.java:672)
            at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:516)
            at play.classloading.ApplicationCompiler.compile(ApplicationCompiler.java:278)
            at play.classloading.ApplicationClassloader.getAllClasses(ApplicationClassloader.java:416)
            at play.Play.start(Play.java:416)
            at play.Play.detectChanges(Play.java:533)
            at play.Invoker$Invocation.init(Invoker.java:100)
            at Invocation.HTTP Request(Play!)