NutzCN Logo
问答 nutz代码生成问题
发布于 3011天前 作者 Hamming 2957 次浏览 复制 上一个帖子 下一个帖子
标签:

有创建/code/code.json

"D:\Program Files\Java\jdk1.8.0_101\bin\java" -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:56679,suspend=y,server=n -Dfile.encoding=UTF-8 -classpath "D:\Program Files\Java\jdk1.8.0_101\jre\lib\charsets.jar;D:\Program Files\Java\jdk1.8.0_101\jre\lib\deploy.jar;D:\Program Files\Java\jdk1.8.0_101\jre\lib\javaws.jar;D:\Program Files\Java\jdk1.8.0_101\jre\lib\jce.jar;D:\Program Files\Java\jdk1.8.0_101\jre\lib\jfr.jar;D:\Program Files\Java\jdk1.8.0_101\jre\lib\jfxswt.jar;D:\Program Files\Java\jdk1.8.0_101\jre\lib\jsse.jar;D:\Program Files\Java\jdk1.8.0_101\jre\lib\management-agent.jar;D:\Program Files\Java\jdk1.8.0_101\jre\lib\plugin.jar;D:\Program Files\Java\jdk1.8.0_101\jre\lib\resources.jar;D:\Program Files\Java\jdk1.8.0_101\jre\lib\rt.jar;D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\access-bridge-64.jar;D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\cldrdata.jar;D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\dnsns.jar;D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\jaccess.jar;D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\jfxrt.jar;D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\localedata.jar;D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\nashorn.jar;D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\sunec.jar;D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\sunjce_provider.jar;D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\sunmscapi.jar;D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\sunpkcs11.jar;D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\zipfs.jar;E:\project\bluejay\target\classes;C:\Users\Administrator.USER-20160313MB\.m2\repository\org\nutz\nutz\1.r.57\nutz-1.r.57.jar;C:\Users\Administrator.USER-20160313MB\.m2\repository\org\nutz\nutz-web\1.r.57\nutz-web-1.r.57.jar;C:\Users\Administrator.USER-20160313MB\.m2\repository\org\eclipse\jetty\aggregate\jetty-all-server\7.6.18.v20150929\jetty-all-server-7.6.18.v20150929.jar;C:\Users\Administrator.USER-20160313MB\.m2\repository\org\eclipse\jetty\orbit\javax.servlet\2.5.0.v201103041518\javax.servlet-2.5.0.v201103041518.jar;C:\Users\Administrator.USER-20160313MB\.m2\repository\org\eclipse\jetty\orbit\javax.security.auth.message\1.0.0.v201108011116\javax.security.auth.message-1.0.0.v201108011116.jar;C:\Users\Administrator.USER-20160313MB\.m2\repository\org\eclipse\jetty\orbit\javax.mail.glassfish\1.4.1.v201005082020\javax.mail.glassfish-1.4.1.v201005082020.jar;C:\Users\Administrator.USER-20160313MB\.m2\repository\org\eclipse\jetty\orbit\javax.activation\1.1.0.v201105071233\javax.activation-1.1.0.v201105071233.jar;C:\Users\Administrator.USER-20160313MB\.m2\repository\org\eclipse\jetty\orbit\javax.annotation\1.1.0.v201108011116\javax.annotation-1.1.0.v201108011116.jar;C:\Users\Administrator.USER-20160313MB\.m2\repository\org\eclipse\jetty\orbit\javax.servlet.jsp\2.1.0.v201105211820\javax.servlet.jsp-2.1.0.v201105211820.jar;C:\Users\Administrator.USER-20160313MB\.m2\repository\org\eclipse\jetty\jetty-jsp\7.6.18.v20150929\jetty-jsp-7.6.18.v20150929.jar;C:\Users\Administrator.USER-20160313MB\.m2\repository\org\eclipse\jetty\orbit\org.apache.jasper.glassfish\2.1.0.v201110031002\org.apache.jasper.glassfish-2.1.0.v201110031002.jar;C:\Users\Administrator.USER-20160313MB\.m2\repository\org\eclipse\jetty\orbit\javax.servlet.jsp.jstl\1.2.0.v201105211821\javax.servlet.jsp.jstl-1.2.0.v201105211821.jar;C:\Users\Administrator.USER-20160313MB\.m2\repository\org\eclipse\jetty\orbit\org.apache.taglibs.standard.glassfish\1.2.0.v201112081803\org.apache.taglibs.standard.glassfish-1.2.0.v201112081803.jar;C:\Users\Administrator.USER-20160313MB\.m2\repository\org\eclipse\jetty\orbit\javax.el\2.1.0.v201105211819\javax.el-2.1.0.v201105211819.jar;C:\Users\Administrator.USER-20160313MB\.m2\repository\org\eclipse\jetty\orbit\com.sun.el\1.0.0.v201105211818\com.sun.el-1.0.0.v201105211818.jar;C:\Users\Administrator.USER-20160313MB\.m2\repository\org\eclipse\jetty\orbit\org.eclipse.jdt.core\3.7.1\org.eclipse.jdt.core-3.7.1.jar;C:\Users\Administrator.USER-20160313MB\.m2\repository\log4j\log4j\1.2.17\log4j-1.2.17.jar;C:\Users\Administrator.USER-20160313MB\.m2\repository\com\alibaba\druid\1.0.23\druid-1.0.23.jar;D:\Program Files\Java\jdk1.8.0_101\lib\jconsole.jar;D:\Program Files\Java\jdk1.8.0_101\lib\tools.jar;C:\Users\Administrator.USER-20160313MB\.m2\repository\org\apache\commons\commons-lang3\3.4\commons-lang3-3.4.jar;C:\Users\Administrator.USER-20160313MB\.m2\repository\org\apache\shiro\shiro-all\1.2.4\shiro-all-1.2.4.jar;C:\Users\Administrator.USER-20160313MB\.m2\repository\org\apache\shiro\shiro-guice\1.2.4\shiro-guice-1.2.4.jar;C:\Users\Administrator.USER-20160313MB\.m2\repository\org\apache\shiro\shiro-core\1.2.4\shiro-core-1.2.4.jar;C:\Users\Administrator.USER-20160313MB\.m2\repository\org\slf4j\slf4j-api\1.6.4\slf4j-api-1.6.4.jar;C:\Users\Administrator.USER-20160313MB\.m2\repository\commons-beanutils\commons-beanutils\1.8.3\commons-beanutils-1.8.3.jar;C:\Users\Administrator.USER-20160313MB\.m2\repository\com\google\inject\guice\3.0\guice-3.0.jar;C:\Users\Administrator.USER-20160313MB\.m2\repository\javax\inject\javax.inject\1\javax.inject-1.jar;C:\Users\Administrator.USER-20160313MB\.m2\repository\aopalliance\aopalliance\1.0\aopalliance-1.0.jar;C:\Users\Administrator.USER-20160313MB\.m2\repository\com\google\inject\extensions\guice-multibindings\3.0\guice-multibindings-3.0.jar;C:\Users\Administrator.USER-20160313MB\.m2\repository\mysql\mysql-connector-java\5.1.39\mysql-connector-java-5.1.39.jar;C:\Users\Administrator.USER-20160313MB\.m2\repository\org\apache\geronimo\bundles\commons-httpclient\3.1_2\commons-httpclient-3.1_2.jar;C:\Users\Administrator.USER-20160313MB\.m2\repository\org\dom4j\dom4j\2.0.0\dom4j-2.0.0.jar;C:\Users\Administrator.USER-20160313MB\.m2\repository\jaxen\jaxen\1.1.6\jaxen-1.1.6.jar;C:\Users\Administrator.USER-20160313MB\.m2\repository\cn\enilu\tools\nutzwk-code-generator\1.1\nutzwk-code-generator-1.1.jar;C:\Users\Administrator.USER-20160313MB\.m2\repository\org\atteo\evo-inflector\1.0.1\evo-inflector-1.0.1.jar;C:\Users\Administrator.USER-20160313MB\.m2\repository\commons-cli\commons-cli\1.2\commons-cli-1.2.jar;C:\Users\Administrator.USER-20160313MB\.m2\repository\org\apache\velocity\velocity\1.7\velocity-1.7.jar;C:\Users\Administrator.USER-20160313MB\.m2\repository\commons-collections\commons-collections\3.2.1\commons-collections-3.2.1.jar;C:\Users\Administrator.USER-20160313MB\.m2\repository\commons-lang\commons-lang\2.4\commons-lang-2.4.jar;E:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.0.3\lib\idea_rt.jar" cn.enilu.common.code.Generator -i Return_goods -u /private/bluejay -p nuoshang.bluejay -v index_add_detail_edit_ controller service view
Connected to the target VM, address: '127.0.0.1:56679', transport: 'socket'
2016-08-24 17:17:18,093 [main] DEBUG org.nutz.resource.Scans - Locations for Scans:
[JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\nutz\nutz\1.r.57\nutz-1.r.57.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\eclipse\jetty\orbit\javax.mail.glassfish\1.4.1.v201005082020\javax.mail.glassfish-1.4.1.v201005082020.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\eclipse\jetty\orbit\javax.servlet.jsp\2.1.0.v201105211820\javax.servlet.jsp-2.1.0.v201105211820.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\commons-lang\commons-lang\2.4\commons-lang-2.4.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\sunjce_provider.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\commons-beanutils\commons-beanutils\1.8.3\commons-beanutils-1.8.3.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\nashorn.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\apache\commons\commons-lang3\3.4\commons-lang3-3.4.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\jaxen\jaxen\1.1.6\jaxen-1.1.6.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\eclipse\jetty\orbit\javax.servlet.jsp.jstl\1.2.0.v201105211821\javax.servlet.jsp.jstl-1.2.0.v201105211821.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\nutz\nutz-web\1.r.57\nutz-web-1.r.57.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\jfr.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\dom4j\dom4j\2.0.0\dom4j-2.0.0.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\resources.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\deploy.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\rt.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\aopalliance\aopalliance\1.0\aopalliance-1.0.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\com\alibaba\druid\1.0.23\druid-1.0.23.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\apache\velocity\velocity\1.7\velocity-1.7.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\sunmscapi.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\eclipse\jetty\orbit\javax.annotation\1.1.0.v201108011116\javax.annotation-1.1.0.v201108011116.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\eclipse\jetty\orbit\com.sun.el\1.0.0.v201105211818\com.sun.el-1.0.0.v201105211818.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\lib\tools.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\commons-collections\commons-collections\3.2.1\commons-collections-3.2.1.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\log4j\log4j\1.2.17\log4j-1.2.17.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\cldrdata.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\dnsns.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\jsse.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\charsets.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\jfxswt.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\plugin.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\sunpkcs11.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\eclipse\jetty\orbit\org.eclipse.jdt.core\3.7.1\org.eclipse.jdt.core-3.7.1.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\eclipse\jetty\orbit\javax.el\2.1.0.v201105211819\javax.el-2.1.0.v201105211819.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\javax\inject\javax.inject\1\javax.inject-1.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\com\google\inject\guice\3.0\guice-3.0.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\sunec.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\atteo\evo-inflector\1.0.1\evo-inflector-1.0.1.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\eclipse\jetty\orbit\javax.servlet\2.5.0.v201103041518\javax.servlet-2.5.0.v201103041518.jar], FileSystemResourceLocation [root=E:\project\bluejay], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\javaws.jar], FileSystemResourceLocation [root=E:\project\bluejay\target\classes], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\cn\enilu\tools\nutzwk-code-generator\1.1\nutzwk-code-generator-1.1.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\eclipse\jetty\orbit\javax.security.auth.message\1.0.0.v201108011116\javax.security.auth.message-1.0.0.v201108011116.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\zipfs.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\eclipse\jetty\orbit\org.apache.jasper.glassfish\2.1.0.v201110031002\org.apache.jasper.glassfish-2.1.0.v201110031002.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\management-agent.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\lib\jconsole.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\eclipse\jetty\orbit\javax.activation\1.1.0.v201105071233\javax.activation-1.1.0.v201105071233.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\localedata.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\apache\shiro\shiro-core\1.2.4\shiro-core-1.2.4.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\apache\shiro\shiro-all\1.2.4\shiro-all-1.2.4.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\commons-cli\commons-cli\1.2\commons-cli-1.2.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\jce.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\access-bridge-64.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\jaccess.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\slf4j\slf4j-api\1.6.4\slf4j-api-1.6.4.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\apache\geronimo\bundles\commons-httpclient\3.1_2\commons-httpclient-3.1_2.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\apache\shiro\shiro-guice\1.2.4\shiro-guice-1.2.4.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\jfxrt.jar], JarResourceLocation [jarPath=E:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.0.3\lib\idea_rt.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\eclipse\jetty\aggregate\jetty-all-server\7.6.18.v20150929\jetty-all-server-7.6.18.v20150929.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\eclipse\jetty\orbit\org.apache.taglibs.standard.glassfish\1.2.0.v201112081803\org.apache.taglibs.standard.glassfish-1.2.0.v201112081803.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\eclipse\jetty\jetty-jsp\7.6.18.v20150929\jetty-jsp-7.6.18.v20150929.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\mysql\mysql-connector-java\5.1.39\mysql-connector-java-5.1.39.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\com\google\inject\extensions\guice-multibindings\3.0\guice-multibindings-3.0.jar]]
2016-08-24 17:17:18,124 [main] DEBUG org.nutz.resource.Scans - Found 1 resource by src( /code/code.json ) , regex( ^(.+[.])(js|json)$ )
2016-08-24 17:17:18,125 [main] DEBUG org.nutz.ioc.loader.json.JsonLoader - loading ioc js config from [code.json]
2016-08-24 17:17:18,134 [main] DEBUG org.nutz.ioc.loader.json.JsonLoader - Loaded 2 bean define from path=[/code/code.json] --> [dataSource, loader]
2016-08-24 17:17:18,137 [main] INFO  org.nutz.ioc.impl.NutIoc - NutIoc init begin ...
2016-08-24 17:17:18,141 [main] INFO  org.nutz.ioc.impl.NutIoc - ... NutIoc init complete
2016-08-24 17:17:18,142 [main] DEBUG org.nutz.ioc.impl.NutIoc - Get 'loader'<class cn.enilu.common.code.Loader>
2016-08-24 17:17:18,151 [main] DEBUG org.nutz.ioc.aop.SimpleAopMaker - Load AopConfigure for anno=org.nutz.ioc.aop.Aop by type=org.nutz.ioc.aop.config.impl.AnnotationAopConfigration
2016-08-24 17:17:18,152 [main] DEBUG org.nutz.ioc.impl.NutIoc - 	 >> Load definition name=loader
2016-08-24 17:17:18,153 [main] DEBUG org.nutz.ioc.loader.map.MapLoader - Loading define for name=loader
Exception in thread "main" org.nutz.ioc.IocException: [loader] # For object [loader] - type:[class cn.enilu.common.code.Loader]
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:226)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:265)
	at cn.enilu.common.code.Generator.main(Generator.java:153)
Caused by: org.nutz.ioc.ObjectLoadException: Wrong type name: 'nuoshang.bluejay.bean'
	at org.nutz.ioc.IocLoading.E(IocLoading.java:32)
	at org.nutz.ioc.IocLoading.map2iobj(IocLoading.java:59)
	at org.nutz.ioc.loader.map.MapLoader.load(MapLoader.java:86)
	at org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:155)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:188)
	... 2 more
Caused by: java.lang.ClassNotFoundException: nuoshang.bluejay.bean
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:264)
	at org.nutz.lang.Lang.loadClass(Lang.java:1994)
	at org.nutz.ioc.IocLoading.map2iobj(IocLoading.java:55)
	... 5 more
Disconnected from the target VM, address: '127.0.0.1:56679', transport: 'socket'

Process finished with exit code 1

15 回复

nuoshang.bluejay.bean 写在什么地方了?

@wendal
code.json

{
  dataSource : {
    type : "com.alibaba.druid.pool.DruidDataSource",
    events : {
      depose : 'close'
    },
    fields : {
      driverClassName : "com.mysql.jdbc.Driver",
      url : "jdbc:mysql://192.168.1.127:3306/bluejay",
      username : "root",
      password : "root",
      maxWait: 20000,
      defaultAutoCommit : false
    }
  },
  loader:{
    //根据实体生成代码
    type:'nuoshang.bluejay.bean.Return_goods'
    //根据表结构生成代码
    //        type:'cn.enilu.common.code.TableDescLoader'
  }
}
Connected to the target VM, address: '127.0.0.1:56861', transport: 'socket'
2016-08-24 17:24:44,072 [main] DEBUG org.nutz.resource.Scans - Locations for Scans:
[JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\nutz\nutz\1.r.57\nutz-1.r.57.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\eclipse\jetty\orbit\javax.mail.glassfish\1.4.1.v201005082020\javax.mail.glassfish-1.4.1.v201005082020.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\eclipse\jetty\orbit\javax.servlet.jsp\2.1.0.v201105211820\javax.servlet.jsp-2.1.0.v201105211820.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\commons-lang\commons-lang\2.4\commons-lang-2.4.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\sunjce_provider.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\commons-beanutils\commons-beanutils\1.8.3\commons-beanutils-1.8.3.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\nashorn.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\apache\commons\commons-lang3\3.4\commons-lang3-3.4.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\jaxen\jaxen\1.1.6\jaxen-1.1.6.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\eclipse\jetty\orbit\javax.servlet.jsp.jstl\1.2.0.v201105211821\javax.servlet.jsp.jstl-1.2.0.v201105211821.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\nutz\nutz-web\1.r.57\nutz-web-1.r.57.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\jfr.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\dom4j\dom4j\2.0.0\dom4j-2.0.0.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\resources.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\deploy.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\rt.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\aopalliance\aopalliance\1.0\aopalliance-1.0.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\com\alibaba\druid\1.0.23\druid-1.0.23.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\apache\velocity\velocity\1.7\velocity-1.7.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\sunmscapi.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\eclipse\jetty\orbit\javax.annotation\1.1.0.v201108011116\javax.annotation-1.1.0.v201108011116.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\eclipse\jetty\orbit\com.sun.el\1.0.0.v201105211818\com.sun.el-1.0.0.v201105211818.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\lib\tools.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\commons-collections\commons-collections\3.2.1\commons-collections-3.2.1.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\log4j\log4j\1.2.17\log4j-1.2.17.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\cldrdata.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\dnsns.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\jsse.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\charsets.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\jfxswt.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\plugin.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\sunpkcs11.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\eclipse\jetty\orbit\org.eclipse.jdt.core\3.7.1\org.eclipse.jdt.core-3.7.1.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\eclipse\jetty\orbit\javax.el\2.1.0.v201105211819\javax.el-2.1.0.v201105211819.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\javax\inject\javax.inject\1\javax.inject-1.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\com\google\inject\guice\3.0\guice-3.0.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\sunec.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\atteo\evo-inflector\1.0.1\evo-inflector-1.0.1.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\eclipse\jetty\orbit\javax.servlet\2.5.0.v201103041518\javax.servlet-2.5.0.v201103041518.jar], FileSystemResourceLocation [root=E:\project\bluejay], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\javaws.jar], FileSystemResourceLocation [root=E:\project\bluejay\target\classes], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\cn\enilu\tools\nutzwk-code-generator\1.1\nutzwk-code-generator-1.1.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\eclipse\jetty\orbit\javax.security.auth.message\1.0.0.v201108011116\javax.security.auth.message-1.0.0.v201108011116.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\zipfs.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\eclipse\jetty\orbit\org.apache.jasper.glassfish\2.1.0.v201110031002\org.apache.jasper.glassfish-2.1.0.v201110031002.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\management-agent.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\lib\jconsole.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\eclipse\jetty\orbit\javax.activation\1.1.0.v201105071233\javax.activation-1.1.0.v201105071233.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\localedata.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\apache\shiro\shiro-core\1.2.4\shiro-core-1.2.4.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\apache\shiro\shiro-all\1.2.4\shiro-all-1.2.4.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\commons-cli\commons-cli\1.2\commons-cli-1.2.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\jce.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\access-bridge-64.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\jaccess.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\slf4j\slf4j-api\1.6.4\slf4j-api-1.6.4.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\apache\geronimo\bundles\commons-httpclient\3.1_2\commons-httpclient-3.1_2.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\apache\shiro\shiro-guice\1.2.4\shiro-guice-1.2.4.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\jfxrt.jar], JarResourceLocation [jarPath=E:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.0.3\lib\idea_rt.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\eclipse\jetty\aggregate\jetty-all-server\7.6.18.v20150929\jetty-all-server-7.6.18.v20150929.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\eclipse\jetty\orbit\org.apache.taglibs.standard.glassfish\1.2.0.v201112081803\org.apache.taglibs.standard.glassfish-1.2.0.v201112081803.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\eclipse\jetty\jetty-jsp\7.6.18.v20150929\jetty-jsp-7.6.18.v20150929.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\mysql\mysql-connector-java\5.1.39\mysql-connector-java-5.1.39.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\com\google\inject\extensions\guice-multibindings\3.0\guice-multibindings-3.0.jar]]
2016-08-24 17:24:44,097 [main] DEBUG org.nutz.resource.Scans - Found 1 resource by src( /code/code.json ) , regex( ^(.+[.])(js|json)$ )
2016-08-24 17:24:44,098 [main] DEBUG org.nutz.ioc.loader.json.JsonLoader - loading ioc js config from [code.json]
2016-08-24 17:24:44,105 [main] DEBUG org.nutz.ioc.loader.json.JsonLoader - Loaded 2 bean define from path=[/code/code.json] --> [dataSource, loader]
2016-08-24 17:24:44,107 [main] INFO  org.nutz.ioc.impl.NutIoc - NutIoc init begin ...
2016-08-24 17:24:44,112 [main] INFO  org.nutz.ioc.impl.NutIoc - ... NutIoc init complete
2016-08-24 17:24:44,112 [main] DEBUG org.nutz.ioc.impl.NutIoc - Get 'loader'<class cn.enilu.common.code.Loader>
2016-08-24 17:24:44,120 [main] DEBUG org.nutz.ioc.aop.SimpleAopMaker - Load AopConfigure for anno=org.nutz.ioc.aop.Aop by type=org.nutz.ioc.aop.config.impl.AnnotationAopConfigration
2016-08-24 17:24:44,122 [main] DEBUG org.nutz.ioc.impl.NutIoc - 	 >> Load definition name=loader
2016-08-24 17:24:44,123 [main] DEBUG org.nutz.ioc.loader.map.MapLoader - Loading define for name=loader
2016-08-24 17:24:44,127 [main] DEBUG org.nutz.ioc.loader.combo.ComboIocLoader - Found IocObject(loader) in JsonLoader(paths=[/code/code.json])
2016-08-24 17:24:44,127 [main] DEBUG org.nutz.ioc.impl.NutIoc - 	 >> Make...'loader'<class cn.enilu.common.code.Loader>
2016-08-24 17:24:44,128 [main] DEBUG org.nutz.ioc.aop.impl.DefaultMirrorFactory - Load class nuoshang.bluejay.bean.Return_goods without AOP
2016-08-24 17:24:44,129 [main] DEBUG org.nutz.ioc.impl.ScopeContext - Save object 'loader' to [app] 
Disconnected from the target VM, address: '127.0.0.1:56861', transport: 'socket'
Exception in thread "main" java.lang.ClassCastException: nuoshang.bluejay.bean.Return_goods cannot be cast to cn.enilu.common.code.Loader
	at cn.enilu.common.code.Generator.main(Generator.java:153)

Process finished with exit code 1

报错如下

@wendal
Return_goods

package nuoshang.bluejay.bean;
import java.io.Serializable;
import org.nutz.dao.entity.annotation.*;
/**
 * 通过 DBCodeCreateTool 代码自动生成
 * @author yuhaiming
 * @time 2016-08-09 09:35:16
 */
@Table("return_goods")
public class Return_goods implements Serializable{
    private static final long serialVersionUID = 1L;
    /********** attribute ***********/
    /****退货编号 ****/
    @Id
    @Column("return_id")
    private int return_id;

    /****商品编号 ****/
    @Column("re_goods_id")
    private int re_goods_id;
    /****副订单编号 ****/
    @Column("ret_order_item_id")
    private int ret_order_item_id;
    /****用户编号 ****/
    @Column("ret_user_id")
    private int ret_user_id;
    /****物流信息 ****/
    @Column("ret_logi_id")
    private String ret_logi_id;
    /****退货理由 ****/
    @Column("reason")
    private String reason;
    /****备注内容 ****/
    @Column("detail")
    private String detail;
    /****退货状态 ****/
    @Column("status")
    private int status;
    /****退货时间 ****/
    @Column("return_time")
    private java.sql.Timestamp return_time;
    /****收货时间 ****/
    @Column("delivery_time")
    private java.sql.Timestamp delivery_time;
    public Return_goods() {}
    public Return_goods(int return_id, int re_goods_id, int ret_order_item_id, int ret_user_id, String ret_logi_id, String reason, String detail, int status, java.sql.Timestamp return_time, java.sql.Timestamp delivery_time) {
        this.return_id = return_id;
        this.re_goods_id = re_goods_id;
        this.ret_order_item_id = ret_order_item_id;
        this.ret_user_id = ret_user_id;
        this.ret_logi_id = ret_logi_id;
        this.reason = reason;
        this.detail = detail;
        this.status = status;
        this.return_time = return_time;
        this.delivery_time = delivery_time;
    }
    /********** get/set ***********/
    public int getReturn_id() {
        return return_id;
    }
    public void setReturn_id(int return_id) {
        this.return_id = return_id;
    }
    public int getRe_goods_id() {
        return re_goods_id;
    }
    public void setRe_goods_id(int re_goods_id) {
        this.re_goods_id = re_goods_id;
    }
    public int getRet_order_item_id() {
        return ret_order_item_id;
    }
    public void setRet_order_item_id(int ret_order_item_id) {
        this.ret_order_item_id = ret_order_item_id;
    }
    public int getRet_user_id() {
        return ret_user_id;
    }
    public void setRet_user_id(int ret_user_id) {
        this.ret_user_id = ret_user_id;
    }
    public String getRet_logi_id() {
        return ret_logi_id;
    }
    public void setRet_logi_id(String ret_logi_id) {
        this.ret_logi_id = ret_logi_id;
    }
    public String getReason() {
        return reason;
    }
    public void setReason(String reason) {
        this.reason = reason;
    }
    public String getDetail() {
        return detail;
    }
    public void setDetail(String detail) {
        this.detail = detail;
    }
    public int getStatus() {
        return status;
    }
    public void setStatus(int status) {
        this.status = status;
    }
    public java.sql.Timestamp getReturn_time() {
        return return_time;
    }
    public void setReturn_time(java.sql.Timestamp return_time) {
        this.return_time = return_time;
    }
    public java.sql.Timestamp getDelivery_time() {
        return delivery_time;
    }
    public void setDelivery_time(java.sql.Timestamp delivery_time) {
        this.delivery_time = delivery_time;
    }
}

code.js改错了呢, 里面只需要改数据库连接参数, 其他不要动嘛

// 这些不需要改的.
loader:{
//根据实体生成代码
type:'cn.enilu.common.code.EntityDescLoader'
//根据表结构生成代码
//type:'cn.enilu.common.code.TableDescLoader'
}

@wendal 恩 改回来了 报错如下

Connected to the target VM, address: '127.0.0.1:57066', transport: 'socket'
2016-08-24 17:34:54,800 [main] DEBUG org.nutz.resource.Scans - Locations for Scans:
[JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\nutz\nutz\1.r.57\nutz-1.r.57.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\eclipse\jetty\orbit\javax.mail.glassfish\1.4.1.v201005082020\javax.mail.glassfish-1.4.1.v201005082020.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\eclipse\jetty\orbit\javax.servlet.jsp\2.1.0.v201105211820\javax.servlet.jsp-2.1.0.v201105211820.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\commons-lang\commons-lang\2.4\commons-lang-2.4.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\sunjce_provider.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\commons-beanutils\commons-beanutils\1.8.3\commons-beanutils-1.8.3.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\nashorn.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\apache\commons\commons-lang3\3.4\commons-lang3-3.4.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\jaxen\jaxen\1.1.6\jaxen-1.1.6.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\eclipse\jetty\orbit\javax.servlet.jsp.jstl\1.2.0.v201105211821\javax.servlet.jsp.jstl-1.2.0.v201105211821.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\nutz\nutz-web\1.r.57\nutz-web-1.r.57.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\jfr.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\dom4j\dom4j\2.0.0\dom4j-2.0.0.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\resources.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\deploy.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\rt.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\aopalliance\aopalliance\1.0\aopalliance-1.0.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\com\alibaba\druid\1.0.23\druid-1.0.23.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\apache\velocity\velocity\1.7\velocity-1.7.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\sunmscapi.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\eclipse\jetty\orbit\javax.annotation\1.1.0.v201108011116\javax.annotation-1.1.0.v201108011116.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\eclipse\jetty\orbit\com.sun.el\1.0.0.v201105211818\com.sun.el-1.0.0.v201105211818.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\lib\tools.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\commons-collections\commons-collections\3.2.1\commons-collections-3.2.1.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\log4j\log4j\1.2.17\log4j-1.2.17.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\cldrdata.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\dnsns.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\jsse.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\charsets.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\jfxswt.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\plugin.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\sunpkcs11.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\eclipse\jetty\orbit\org.eclipse.jdt.core\3.7.1\org.eclipse.jdt.core-3.7.1.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\eclipse\jetty\orbit\javax.el\2.1.0.v201105211819\javax.el-2.1.0.v201105211819.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\javax\inject\javax.inject\1\javax.inject-1.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\com\google\inject\guice\3.0\guice-3.0.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\sunec.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\atteo\evo-inflector\1.0.1\evo-inflector-1.0.1.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\eclipse\jetty\orbit\javax.servlet\2.5.0.v201103041518\javax.servlet-2.5.0.v201103041518.jar], FileSystemResourceLocation [root=E:\project\bluejay], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\javaws.jar], FileSystemResourceLocation [root=E:\project\bluejay\target\classes], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\cn\enilu\tools\nutzwk-code-generator\1.1\nutzwk-code-generator-1.1.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\eclipse\jetty\orbit\javax.security.auth.message\1.0.0.v201108011116\javax.security.auth.message-1.0.0.v201108011116.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\zipfs.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\eclipse\jetty\orbit\org.apache.jasper.glassfish\2.1.0.v201110031002\org.apache.jasper.glassfish-2.1.0.v201110031002.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\management-agent.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\lib\jconsole.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\eclipse\jetty\orbit\javax.activation\1.1.0.v201105071233\javax.activation-1.1.0.v201105071233.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\localedata.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\apache\shiro\shiro-core\1.2.4\shiro-core-1.2.4.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\apache\shiro\shiro-all\1.2.4\shiro-all-1.2.4.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\commons-cli\commons-cli\1.2\commons-cli-1.2.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\jce.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\access-bridge-64.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\jaccess.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\slf4j\slf4j-api\1.6.4\slf4j-api-1.6.4.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\apache\geronimo\bundles\commons-httpclient\3.1_2\commons-httpclient-3.1_2.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\apache\shiro\shiro-guice\1.2.4\shiro-guice-1.2.4.jar], JarResourceLocation [jarPath=D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\jfxrt.jar], JarResourceLocation [jarPath=E:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.0.3\lib\idea_rt.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\eclipse\jetty\aggregate\jetty-all-server\7.6.18.v20150929\jetty-all-server-7.6.18.v20150929.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\eclipse\jetty\orbit\org.apache.taglibs.standard.glassfish\1.2.0.v201112081803\org.apache.taglibs.standard.glassfish-1.2.0.v201112081803.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\org\eclipse\jetty\jetty-jsp\7.6.18.v20150929\jetty-jsp-7.6.18.v20150929.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\mysql\mysql-connector-java\5.1.39\mysql-connector-java-5.1.39.jar], JarResourceLocation [jarPath=C:\Users\Administrator.USER-20160313MB\.m2\repository\com\google\inject\extensions\guice-multibindings\3.0\guice-multibindings-3.0.jar]]
2016-08-24 17:34:54,828 [main] DEBUG org.nutz.resource.Scans - Found 1 resource by src( /code/code.json ) , regex( ^(.+[.])(js|json)$ )
2016-08-24 17:34:54,829 [main] DEBUG org.nutz.ioc.loader.json.JsonLoader - loading ioc js config from [code.json]
2016-08-24 17:34:54,835 [main] DEBUG org.nutz.ioc.loader.json.JsonLoader - Loaded 2 bean define from path=[/code/code.json] --> [dataSource, loader]
2016-08-24 17:34:54,837 [main] INFO  org.nutz.ioc.impl.NutIoc - NutIoc init begin ...
2016-08-24 17:34:54,841 [main] INFO  org.nutz.ioc.impl.NutIoc - ... NutIoc init complete
2016-08-24 17:34:54,841 [main] DEBUG org.nutz.ioc.impl.NutIoc - Get 'loader'<class cn.enilu.common.code.Loader>
2016-08-24 17:34:54,849 [main] DEBUG org.nutz.ioc.aop.SimpleAopMaker - Load AopConfigure for anno=org.nutz.ioc.aop.Aop by type=org.nutz.ioc.aop.config.impl.AnnotationAopConfigration
2016-08-24 17:34:54,850 [main] DEBUG org.nutz.ioc.impl.NutIoc - 	 >> Load definition name=loader
2016-08-24 17:34:54,851 [main] DEBUG org.nutz.ioc.loader.map.MapLoader - Loading define for name=loader
2016-08-24 17:34:54,854 [main] DEBUG org.nutz.ioc.loader.combo.ComboIocLoader - Found IocObject(loader) in JsonLoader(paths=[/code/code.json])
2016-08-24 17:34:54,854 [main] DEBUG org.nutz.ioc.impl.NutIoc - 	 >> Make...'loader'<class cn.enilu.common.code.Loader>
2016-08-24 17:34:54,855 [main] DEBUG org.nutz.ioc.aop.impl.DefaultMirrorFactory - Load class cn.enilu.common.code.EntityDescLoader without AOP
2016-08-24 17:34:54,856 [main] DEBUG org.nutz.ioc.impl.ScopeContext - Save object 'loader' to [app] 
Disconnected from the target VM, address: '127.0.0.1:57066', transport: 'socket'
Exception in thread "main" java.lang.NullPointerException
	at cn.enilu.common.code.EntityDescLoader.loadTables(EntityDescLoader.java:28)
	at cn.enilu.common.code.Generator.main(Generator.java:154)

Process finished with exit code 1

code.json

{
  dataSource : {
    type : "com.alibaba.druid.pool.DruidDataSource",
    events : {
      depose : 'close'
    },
    fields : {
      driverClassName : "com.mysql.jdbc.Driver",
      url : "jdbc:mysql://192.168.1.127:3306/bluejay",
      username : "root",
      password : "root",
      maxWait: 20000,
      defaultAutoCommit : false
    }
  },
  loader:{
    //根据实体生成代码
    type:'cn.enilu.common.code.EntityDescLoader'
    //根据表结构生成代码
    //        type:'cn.enilu.common.code.TableDescLoader'
  }
}

@wendal 我不知道怎么加这些参数 我是通过右键 Generator-》nutz mvc

运行Generator类的时候加上如下参数:

-i dic_country -p cn.wizzer.modules.back.sys  -u /private/sys

idea里面不是弹窗填的吗?

@wendal 有两行 可以输入值的
一个是
/private/bluejay

另外一个是
nuoshang.bluejay
不知道怎么输入参数

Exception in thread "main" java.lang.NullPointerException
	at cn.enilu.common.code.EntityDescLoader.loadTables(EntityDescLoader.java:28)
	at cn.enilu.common.code.Generator.main(Generator.java:154)

Process finished with exit code 1

从这个错误可以判断,你的包名不对。

右键 Generator-》nutz mvc 必须在你要生成的那个java bean文件里,点击右键。
按照你要生成Return_goods这个类来看,最后生成的参数应该是这样的
-i Return_goods -p nuoshang.bluejay(这个是Return_goods所在的包的上级包名) -u /private/bluejay ...
@TonyYule

刚才用你的代码试了下,没有问题呢,是你项目所在目录比较特殊?

@enilu 回到家重新装了插件 然后输入包名

Connected to the target VM, address: '127.0.0.1:50300', transport: 'socket'
2016-08-24 22:22:24,169 [main] DEBUG org.nutz.resource.Scans - Locations for Scans:
[JarResourceLocation [jarPath=C:\Program Files (x86)\Java\jdk1.8.0_45\jre\lib\ext\jfxrt.jar], JarResourceLocation [jarPath=E:\apache-maven-3.3.9\repository\org\eclipse\jetty\jetty-jsp\7.6.18.v20150929\jetty-jsp-7.6.18.v20150929.jar], JarResourceLocation [jarPath=E:\apache-maven-3.3.9\repository\commons-cli\commons-cli\1.2\commons-cli-1.2.jar], JarResourceLocation [jarPath=E:\apache-maven-3.3.9\repository\org\eclipse\jetty\orbit\com.sun.el\1.0.0.v201105211818\com.sun.el-1.0.0.v201105211818.jar], JarResourceLocation [jarPath=E:\apache-maven-3.3.9\repository\org\nutz\nutz-web\1.r.57\nutz-web-1.r.57.jar], JarResourceLocation [jarPath=E:\apache-maven-3.3.9\repository\org\atteo\evo-inflector\1.0.1\evo-inflector-1.0.1.jar], JarResourceLocation [jarPath=C:\Program Files (x86)\Java\jdk1.8.0_45\jre\lib\ext\zipfs.jar], JarResourceLocation [jarPath=E:\apache-maven-3.3.9\repository\org\quartz-scheduler\quartz\2.2.1\quartz-2.2.1.jar], JarResourceLocation [jarPath=E:\apache-maven-3.3.9\repository\org\eclipse\jetty\orbit\javax.el\2.1.0.v201105211819\javax.el-2.1.0.v201105211819.jar], JarResourceLocation [jarPath=C:\Program Files (x86)\Java\jdk1.8.0_45\lib\tools.jar], JarResourceLocation [jarPath=C:\Program Files (x86)\Java\jdk1.8.0_45\jre\lib\deploy.jar], JarResourceLocation [jarPath=E:\apache-maven-3.3.9\repository\org\eclipse\jetty\orbit\org.eclipse.jdt.core\3.7.1\org.eclipse.jdt.core-3.7.1.jar], JarResourceLocation [jarPath=D:\Program Files (x86)\JetBrains\IntelliJ IDEA 2016.2.1\lib\idea_rt.jar], JarResourceLocation [jarPath=E:\apache-maven-3.3.9\repository\org\eclipse\jetty\orbit\org.apache.taglibs.standard.glassfish\1.2.0.v201112081803\org.apache.taglibs.standard.glassfish-1.2.0.v201112081803.jar], JarResourceLocation [jarPath=C:\Program Files (x86)\Java\jdk1.8.0_45\jre\lib\jfr.jar], JarResourceLocation [jarPath=C:\Program Files (x86)\Java\jdk1.8.0_45\jre\lib\ext\cldrdata.jar], JarResourceLocation [jarPath=C:\Program Files (x86)\Java\jdk1.8.0_45\jre\lib\jce.jar], JarResourceLocation [jarPath=E:\apache-maven-3.3.9\repository\org\apache\velocity\velocity\1.7\velocity-1.7.jar], JarResourceLocation [jarPath=C:\Program Files (x86)\Java\jdk1.8.0_45\jre\lib\plugin.jar], JarResourceLocation [jarPath=E:\apache-maven-3.3.9\repository\org\apache\shiro\shiro-web\1.2.3\shiro-web-1.2.3.jar], JarResourceLocation [jarPath=C:\Program Files (x86)\Java\jdk1.8.0_45\jre\lib\jsse.jar], JarResourceLocation [jarPath=C:\Program Files (x86)\Java\jdk1.8.0_45\jre\lib\ext\sunec.jar], JarResourceLocation [jarPath=C:\Program Files (x86)\Java\jdk1.8.0_45\jre\lib\ext\sunmscapi.jar], JarResourceLocation [jarPath=E:\apache-maven-3.3.9\repository\org\slf4j\slf4j-api\1.6.6\slf4j-api-1.6.6.jar], JarResourceLocation [jarPath=E:\apache-maven-3.3.9\repository\jstl\jstl\1.2\jstl-1.2.jar], JarResourceLocation [jarPath=C:\Program Files (x86)\Java\jdk1.8.0_45\jre\lib\ext\access-bridge-32.jar], JarResourceLocation [jarPath=C:\Program Files (x86)\Java\jdk1.8.0_45\jre\lib\jfxswt.jar], JarResourceLocation [jarPath=C:\Program Files (x86)\Java\jdk1.8.0_45\jre\lib\ext\nashorn.jar], JarResourceLocation [jarPath=C:\Program Files (x86)\Java\jdk1.8.0_45\jre\lib\ext\sunjce_provider.jar], JarResourceLocation [jarPath=E:\apache-maven-3.3.9\repository\log4j\log4j\1.2.17\log4j-1.2.17.jar], JarResourceLocation [jarPath=E:\apache-maven-3.3.9\repository\commons-logging\commons-logging\1.1.1\commons-logging-1.1.1.jar], JarResourceLocation [jarPath=E:\apache-maven-3.3.9\repository\com\alibaba\druid\1.0.23\druid-1.0.23.jar], JarResourceLocation [jarPath=C:\Program Files (x86)\Java\jdk1.8.0_45\lib\jconsole.jar], JarResourceLocation [jarPath=E:\apache-maven-3.3.9\repository\org\eclipse\jetty\orbit\javax.annotation\1.1.0.v201108011116\javax.annotation-1.1.0.v201108011116.jar], JarResourceLocation [jarPath=E:\apache-maven-3.3.9\repository\org\apache\shiro\shiro-core\1.2.3\shiro-core-1.2.3.jar], JarResourceLocation [jarPath=E:\apache-maven-3.3.9\repository\commons-collections\commons-collections\3.2.1\commons-collections-3.2.1.jar], JarResourceLocation [jarPath=C:\Program Files (x86)\Java\jdk1.8.0_45\jre\lib\resources.jar], JarResourceLocation [jarPath=E:\apache-maven-3.3.9\repository\org\nutz\nutz-integration-quartz\1.r.56\nutz-integration-quartz-1.r.56.jar], FileSystemResourceLocation [root=E:\Workspaces\newlook\target\classes], JarResourceLocation [jarPath=E:\apache-maven-3.3.9\repository\org\eclipse\jetty\orbit\javax.activation\1.1.0.v201105071233\javax.activation-1.1.0.v201105071233.jar], JarResourceLocation [jarPath=E:\apache-maven-3.3.9\repository\org\eclipse\jetty\orbit\org.apache.jasper.glassfish\2.1.0.v201110031002\org.apache.jasper.glassfish-2.1.0.v201110031002.jar], JarResourceLocation [jarPath=E:\apache-maven-3.3.9\repository\org\eclipse\jetty\orbit\javax.servlet.jsp.jstl\1.2.0.v201105211821\javax.servlet.jsp.jstl-1.2.0.v201105211821.jar], JarResourceLocation [jarPath=E:\apache-maven-3.3.9\repository\org\nutz\nutz\1.r.57\nutz-1.r.57.jar], JarResourceLocation [jarPath=C:\Program Files (x86)\Java\jdk1.8.0_45\jre\lib\ext\jaccess.jar], JarResourceLocation [jarPath=E:\apache-maven-3.3.9\repository\org\eclipse\jetty\orbit\javax.security.auth.message\1.0.0.v201108011116\javax.security.auth.message-1.0.0.v201108011116.jar], JarResourceLocation [jarPath=E:\apache-maven-3.3.9\repository\org\eclipse\jetty\orbit\javax.servlet\2.5.0.v201103041518\javax.servlet-2.5.0.v201103041518.jar], JarResourceLocation [jarPath=C:\Program Files (x86)\Java\jdk1.8.0_45\jre\lib\ext\localedata.jar], JarResourceLocation [jarPath=C:\Program Files (x86)\Java\jdk1.8.0_45\jre\lib\management-agent.jar], JarResourceLocation [jarPath=C:\Program Files (x86)\Java\jdk1.8.0_45\jre\lib\ext\sunpkcs11.jar], JarResourceLocation [jarPath=E:\apache-maven-3.3.9\repository\org\eclipse\jetty\orbit\javax.mail.glassfish\1.4.1.v201005082020\javax.mail.glassfish-1.4.1.v201005082020.jar], JarResourceLocation [jarPath=E:\apache-maven-3.3.9\repository\cn\enilu\tools\nutzwk-code-generator\1.1\nutzwk-code-generator-1.1.jar], JarResourceLocation [jarPath=C:\Program Files (x86)\Java\jdk1.8.0_45\jre\lib\ext\dnsns.jar], JarResourceLocation [jarPath=E:\apache-maven-3.3.9\repository\org\eclipse\jetty\orbit\javax.servlet.jsp\2.1.0.v201105211820\javax.servlet.jsp-2.1.0.v201105211820.jar], JarResourceLocation [jarPath=E:\apache-maven-3.3.9\repository\mysql\mysql-connector-java\5.1.39\mysql-connector-java-5.1.39.jar], JarResourceLocation [jarPath=E:\apache-maven-3.3.9\repository\commons-lang\commons-lang\2.4\commons-lang-2.4.jar], JarResourceLocation [jarPath=C:\Program Files (x86)\Java\jdk1.8.0_45\jre\lib\rt.jar], JarResourceLocation [jarPath=E:\apache-maven-3.3.9\repository\commons-beanutils\commons-beanutils\1.8.3\commons-beanutils-1.8.3.jar], FileSystemResourceLocation [root=E:\Workspaces\newlook], JarResourceLocation [jarPath=C:\Program Files (x86)\Java\jdk1.8.0_45\jre\lib\charsets.jar], JarResourceLocation [jarPath=E:\apache-maven-3.3.9\repository\org\nutz\nutz-integration-shiro\1.r.56\nutz-integration-shiro-1.r.56.jar], JarResourceLocation [jarPath=E:\apache-maven-3.3.9\repository\org\eclipse\jetty\aggregate\jetty-all-server\7.6.18.v20150929\jetty-all-server-7.6.18.v20150929.jar], JarResourceLocation [jarPath=C:\Program Files (x86)\Java\jdk1.8.0_45\jre\lib\javaws.jar]]
2016-08-24 22:22:24,199 [main] DEBUG org.nutz.resource.Scans - Found 1 resource by src( /code/code.json ) , regex( ^(.+[.])(js|json)$ )
2016-08-24 22:22:24,199 [main] DEBUG org.nutz.ioc.loader.json.JsonLoader - loading ioc js config from [code.json]
2016-08-24 22:22:24,209 [main] DEBUG org.nutz.ioc.loader.json.JsonLoader - Loaded 2 bean define from path=[/code/code.json] --> [dataSource, loader]
2016-08-24 22:22:24,209 [main] INFO  org.nutz.ioc.impl.NutIoc - NutIoc init begin ...
2016-08-24 22:22:24,209 [main] INFO  org.nutz.ioc.impl.NutIoc - ... NutIoc init complete
2016-08-24 22:22:24,209 [main] DEBUG org.nutz.ioc.impl.NutIoc - Get 'loader'<class cn.enilu.common.code.Loader>
2016-08-24 22:22:24,219 [main] DEBUG org.nutz.ioc.aop.SimpleAopMaker - Load AopConfigure for anno=org.nutz.ioc.aop.Aop by type=org.nutz.ioc.aop.config.impl.AnnotationAopConfigration
Exception in thread "main" 2016-08-24 22:22:24,229 [main] DEBUG org.nutz.ioc.impl.NutIoc - 	 >> Load definition name=loader
2016-08-24 22:22:24,229 [main] DEBUG org.nutz.ioc.loader.map.MapLoader - Loading define for name=loader
2016-08-24 22:22:24,229 [main] DEBUG org.nutz.ioc.loader.combo.ComboIocLoader - Found IocObject(loader) in JsonLoader(paths=[/code/code.json])
2016-08-24 22:22:24,229 [main] DEBUG org.nutz.ioc.impl.NutIoc - 	 >> Make...'loader'<class cn.enilu.common.code.Loader>
2016-08-24 22:22:24,229 [main] DEBUG org.nutz.ioc.aop.impl.DefaultMirrorFactory - Load class cn.enilu.common.code.EntityDescLoader without AOP
2016-08-24 22:22:24,229 [main] DEBUG org.nutz.ioc.impl.ScopeContext - Save object 'loader' to [app] 
Disconnected from the target VM, address: '127.0.0.1:50300', transport: 'socket'
java.lang.NullPointerException
	at cn.enilu.common.code.EntityDescLoader.loadTables(EntityDescLoader.java:28)
	at cn.enilu.common.code.Generator.main(Generator.java:154)

Process finished with exit code 1

创建的类

package com.newlook.bean;

import java.io.Serializable;
import org.nutz.dao.entity.annotation.ColDefine;
import org.nutz.dao.entity.annotation.ColType;
import org.nutz.dao.entity.annotation.Column;
import org.nutz.dao.entity.annotation.Id;
import org.nutz.dao.entity.annotation.Name;
import org.nutz.dao.entity.annotation.One;
import org.nutz.dao.entity.annotation.Table;

@Table("t_permission")
public class Permission extends BasePojo implements Serializable {

	private static final long serialVersionUID = 1L;

	@Id
	protected long id;
	@Name
	protected String name;
	@Column("al")
	protected String alias;
	@Column("dt")
	@ColDefine(type = ColType.VARCHAR, width = 500)
	private String description;

	@Column("permission_category_id")
	private String permissionCategoryId;

	@One(target = PermissionCategory.class, field = "permissionCategoryId")
	private PermissionCategory permissionCategory;

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getAlias() {
		return alias;
	}

	public void setAlias(String alias) {
		this.alias = alias;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getPermissionCategoryId() {
		return permissionCategoryId;
	}

	public void setPermissionCategoryId(String permissionCategoryId) {
		this.permissionCategoryId = permissionCategoryId;
	}

	public PermissionCategory getPermissionCategory() {
		return permissionCategory;
	}

	public void setPermissionCategory(PermissionCategory permissionCategory) {
		this.permissionCategory = permissionCategory;
	}
}

@tonyyule 问题找到了,代码生生成中默认将model类所在目录当作是models了,对于你这个model在bean目录下,无法处理了。

@tonyyule 闹半天,你这都不是基于nutzwk的项目。插件名字叫做nutzwk-code-generator,不是什么地方都能用的,
如果要用,可以通过自己更改下模板再使用
如果还满足不了需求,自己下载源码改吧https://github.com/enilu/nutzwk-code-generator

-mod bean -i Permission -u /private/newlook -p com.newlook -v index_add_detail_edit_ controller service view
添加回复
请先登陆
回到顶部