Exception in thread "main" java.lang.NoClassDefFoundError: org/json/JSONException

时间:2021-11-16 17:34:42


 小记:

  使用ormlite 创建配置文件的时候, 提示 

    

### begin...
Writing configurations to D:\zeng\workspace5_31\xFinal\.\res\raw\ormlite_config.txt
Wrote config for class com.xxx.model.User
Wrote config for class com.xxx.model.Catalog
Wrote config for class com.xxx.model.Product
Wrote config for class com.xxx.model.GroupGoods
Exception in thread "main" java.lang.NoClassDefFoundError: org/json/JSONException
	at java.lang.Class.getDeclaredFields0(Native Method)
	at java.lang.Class.privateGetDeclaredFields(Unknown Source)
	at java.lang.Class.getDeclaredFields(Unknown Source)
	at com.j256.ormlite.android.apptools.OrmLiteConfigUtil.writeConfigForTable(OrmLiteConfigUtil.java:220)
	at com.j256.ormlite.android.apptools.OrmLiteConfigUtil.writeConfigFile(OrmLiteConfigUtil.java:144)
	at com.j256.ormlite.android.apptools.OrmLiteConfigUtil.writeConfigFile(OrmLiteConfigUtil.java:133)
	at com.j256.ormlite.android.apptools.OrmLiteConfigUtil.writeConfigFile(OrmLiteConfigUtil.java:124)
	at com.xijiu.shop.ormlite.TableUtil.main(TableUtil.java:23)
Caused by: java.lang.ClassNotFoundException: org.json.JSONException
	at java.net.URLClassLoader$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClassInternal(Unknown Source)
	... 8 more


    具体原因不详......

           1、类里面有内部类,2  、public List<TestObj> getImg() {

    我的问题是2,里面有一个方法这样....  注释就ok,,,,  具体不知道- -