NutzCN Logo
问答 Nutz-book Nutz烹调向导---搭建报错
发布于 2636天前 作者 Nooft 1587 次浏览 复制 上一个帖子 下一个帖子
标签:

使用工具idea+tomcat8.5+mysql

[2017-08-28 11:24:25,154] Artifact Somuns:war exploded: Artifact is being deployed, please wait...
28-Aug-2017 11:24:26.282 信息 [RMI TCP Connection(5)-127.0.0.1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
2017-8-28 11:24:26.347 INFO [RMI TCP Connection(5)-127.0.0.1] Select SystemLog as Nutz.Log implement
2017-8-28 11:24:26.355 INFO [RMI TCP Connection(5)-127.0.0.1] NutFilter[nutz] starting ...
2017-8-28 11:24:26.419 DEBUG [RMI TCP Connection(5)-127.0.0.1] Locations for Scans:
[Dir[path=C:\Program Files\apache-tomcat-8.5.20\bin], Jar[path=D:\workspace\Somuns\out\artifacts\Somuns_war_exploded\WEB-INF\lib\nutz-1.r.60.jar], Jar[path=C:\Program Files\apache-tomcat-8.5.20\bin\bootstrap.jar], Jar[path=C:\Program Files\apache-tomcat-8.5.20\bin\tomcat-juli.jar]]
2017-8-28 11:24:26.505 DEBUG [RMI TCP Connection(5)-127.0.0.1] Locations for Scans:
{C:\Program Files\apache-tomcat-8.5.20\bin=Dir[path=C:\Program Files\apache-tomcat-8.5.20\bin], D:\workspace\Somuns\out\artifacts\Somuns_war_exploded\WEB-INF\lib\nutz-1.r.60.jar=Jar[path=D:\workspace\Somuns\out\artifacts\Somuns_war_exploded\WEB-INF\lib\nutz-1.r.60.jar], C:\Program Files\apache-tomcat-8.5.20\bin\bootstrap.jar=Jar[path=C:\Program Files\apache-tomcat-8.5.20\bin\bootstrap.jar], C:\Program Files\apache-tomcat-8.5.20\bin\tomcat-juli.jar=Jar[path=C:\Program Files\apache-tomcat-8.5.20\bin\tomcat-juli.jar], D:\workspace\Somuns\out\artifacts\Somuns_war_exploded\WEB-INF\classes=Dir[path=D:\workspace\Somuns\out\artifacts\Somuns_war_exploded\WEB-INF\classes], D:\workspace\Somuns\out\artifacts\Somuns_war_exploded\WEB-INF\lib\mysql-connector-java-5.1.43-bin.jar=Jar[path=D:\workspace\Somuns\out\artifacts\Somuns_war_exploded\WEB-INF\lib\mysql-connector-java-5.1.43-bin.jar], D:\workspace\Somuns\out\artifacts\Somuns_war_exploded\WEB-INF\lib\druid-1.0.26.jar=Jar[path=D:\workspace\Somuns\out\artifacts\Somuns_war_exploded\WEB-INF\lib\druid-1.0.26.jar]}
2017-8-28 11:24:26.591 DEBUG [RMI TCP Connection(5)-127.0.0.1] Using 95 castor for Castors
2017-8-28 11:24:26.602 DEBUG [RMI TCP Connection(5)-127.0.0.1] Loading by class org.nutz.mvc.impl.NutLoading
2017-8-28 11:24:26.605 INFO [RMI TCP Connection(5)-127.0.0.1] Nutz Version : 1.r.60 
2017-8-28 11:24:26.606 INFO [RMI TCP Connection(5)-127.0.0.1] Nutz.Mvc[nutz] is initializing ...
2017-8-28 11:24:26.606 DEBUG [RMI TCP Connection(5)-127.0.0.1] Web Container Information:
2017-8-28 11:24:26.608 DEBUG [RMI TCP Connection(5)-127.0.0.1]  - Default Charset : GBK
2017-8-28 11:24:26.608 DEBUG [RMI TCP Connection(5)-127.0.0.1]  - Current . path  : C:\Program Files\apache-tomcat-8.5.20\bin\.
2017-8-28 11:24:26.609 DEBUG [RMI TCP Connection(5)-127.0.0.1]  - Java Version    : 1.8.0_141
2017-8-28 11:24:26.610 DEBUG [RMI TCP Connection(5)-127.0.0.1]  - File separator  : \
2017-8-28 11:24:26.610 DEBUG [RMI TCP Connection(5)-127.0.0.1]  - Timezone        : Asia/Shanghai
2017-8-28 11:24:26.611 DEBUG [RMI TCP Connection(5)-127.0.0.1]  - OS              : Windows 10 amd64
2017-8-28 11:24:26.612 DEBUG [RMI TCP Connection(5)-127.0.0.1]  - ServerInfo      : Apache Tomcat/8.5.20
2017-8-28 11:24:26.612 DEBUG [RMI TCP Connection(5)-127.0.0.1]  - Servlet API     : 3.1
2017-8-28 11:24:26.612 DEBUG [RMI TCP Connection(5)-127.0.0.1]  - ContextPath     : 
2017-8-28 11:24:26.612 DEBUG [RMI TCP Connection(5)-127.0.0.1]  - context.tempdir : C:\Users\Somuns\.IntelliJIdea2017.2\system\tomcat\Tomcat_8_5_20_Somuns\work\Catalina\localhost\ROOT
2017-8-28 11:24:26.613 DEBUG [RMI TCP Connection(5)-127.0.0.1]  - MainModule      : cn.com.somuns.MainModule
2017-8-28 11:24:26.615 DEBUG [RMI TCP Connection(5)-127.0.0.1] >> app.root = D:/workspace/Somuns/out/artifacts/Somuns_war_exploded
2017-8-28 11:24:26.617 DEBUG [RMI TCP Connection(5)-127.0.0.1] @IocBy(type=org.nutz.mvc.ioc.provider.ComboIocProvider, args=["*js", "ioc/", "*anno", "cn.com.somuns", "*tx", "*async"],init=[])
2017-8-28 11:24:26.643 DEBUG [RMI TCP Connection(5)-127.0.0.1] Found 1 resource by src( ioc/ ) , regex( ^(.+[.])(js|json)$ )
2017-8-28 11:24:26.643 DEBUG [RMI TCP Connection(5)-127.0.0.1] loading ioc js config from [dao.js]
2017-8-28 11:24:26.650 DEBUG [RMI TCP Connection(5)-127.0.0.1] Loaded 2 bean define from path=[ioc/] --> [dataSource, dao]
2017-8-28 11:24:26.653 DEBUG [RMI TCP Connection(5)-127.0.0.1] Found 3 resource by src( cn/com/somuns/ ) , regex( ^.+[.]class$ )
17-08-28 11:24:26.663 WARN [RMI TCP Connection(5)-127.0.0.1] NONE Annotation-Class found!! Check your ioc configure!! packages=[cn.com.somuns]
2017-8-28 11:24:26.663 DEBUG [RMI TCP Connection(5)-127.0.0.1] Loaded 5 bean define from reader --
[txREPEATABLE_READ, txSERIALIZABLE, txNONE, txREAD_UNCOMMITTED, txREAD_COMMITTED]
2017-8-28 11:24:26.666 DEBUG [RMI TCP Connection(5)-127.0.0.1] Load AopConfigure for anno=org.nutz.aop.interceptor.async.Async by type=org.nutz.aop.interceptor.async.AsyncAopIocLoader
2017-8-28 11:24:26.670 INFO [RMI TCP Connection(5)-127.0.0.1] NutIoc init begin ...
2017-8-28 11:24:26.673 INFO [RMI TCP Connection(5)-127.0.0.1] ... NutIoc init complete
2017-8-28 11:24:26.677 INFO [RMI TCP Connection(5)-127.0.0.1] Build URL mapping by org.nutz.mvc.impl.UrlMappingImpl ...
2017-8-28 11:24:26.681 DEBUG [RMI TCP Connection(5)-127.0.0.1] @Views(DefaultViewMaker.class)
2017-8-28 11:24:26.689 DEBUG [RMI TCP Connection(5)-127.0.0.1] @ChainBy(org.nutz.mvc.impl.NutActionChainMaker)
2017-8-28 11:24:26.697 DEBUG [RMI TCP Connection(5)-127.0.0.1] module class location 'file:/D:/workspace/Somuns/out/artifacts/Somuns_war_exploded/WEB-INF/classes/'
2017-8-28 11:24:26.698 DEBUG [RMI TCP Connection(5)-127.0.0.1]  > scan 'cn.com.somuns'
2017-8-28 11:24:26.700 DEBUG [RMI TCP Connection(5)-127.0.0.1] Found 3 resource by src( cn/com/somuns/ ) , regex( ^.+[.]class$ )
17-08-28 11:24:26.701 WARN [RMI TCP Connection(5)-127.0.0.1] None module classes found!!!
2017-8-28 11:24:26.702 DEBUG [RMI TCP Connection(5)-127.0.0.1] @Localization not define
17-08-28 11:24:26.701 WARN [RMI TCP Connection(5)-127.0.0.1] None @At found in any modules class!!
2017-8-28 11:24:26.705 INFO [RMI TCP Connection(5)-127.0.0.1] Nutz.Mvc[nutz] is up in 91ms
[2017-08-28 11:24:26,759] Artifact Somuns:war exploded: Artifact is deployed successfully
[2017-08-28 11:24:26,759] Artifact Somuns:war exploded: Deploy took 1,605 milliseconds
28-Aug-2017 11:24:34.876 信息 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [C:\Program Files\apache-tomcat-8.5.20\webapps\manager]
28-Aug-2017 11:24:34.961 信息 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [C:\Program Files\apache-tomcat-8.5.20\webapps\manager] has finished in [84] ms

4 回复
import org.nutz.mvc.NutConfig;

import java.util.Date;

public class MainSetup {
    // 特别留意一下,是init方法,不是destroy方法!!!!!
    public void init(NutConfig nc) {
        Ioc ioc = nc.getIoc();
        Dao dao = ioc.get(Dao.class);
        // 如果没有createTablesInPackage,请检查nutz版本
        Daos.createTablesInPackage(dao, "cn.com.somuns", false);
        if (dao.count(User.class) == 0) {
            User user = new User();
            user.setName("admin");
            user.setPassword("123456");
            user.setCreateTime(new Date());
            user.setUpdateTime(new Date());
            dao.insert(user);
        }
    }

    public void destroy(NutConfig nc) {
    }

}

D:\workspace\Somuns\Somuns\src\cn\com\somuns

@SetupBy忘记写了?

嗯嗯,是的。搞定了,麻烦了,兽总

添加回复
请先登陆
回到顶部