NutzCN Logo
问答 nutz小demo正常启动,但是无法访问,貌似说没找到module。求助
发布于 2777天前 作者 qq_5a7ecf1c 1867 次浏览 复制 上一个帖子 下一个帖子
标签:
package com.cd.config;

import org.nutz.mvc.annotation.By;
import org.nutz.mvc.annotation.Filters;
import org.nutz.mvc.annotation.IocBy;
import org.nutz.mvc.annotation.Modules;
import org.nutz.mvc.annotation.SetupBy;
import org.nutz.mvc.ioc.provider.ComboIocProvider;

import com.cd.nutz.MainSetup;
@SetupBy(value=MainSetup.class)
@IocBy(type=ComboIocProvider.class, args={"*js", "ioc/",
                            "*anno", "com.cd",
                            "*tx",
                            "*async"})
@Filters(@By(type=MyFilters.class))
@Modules(scanPackage=true)
public class MainModule {
}

package com.cd.controller;

import org.nutz.dao.Dao;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Fail;
import org.nutz.mvc.annotation.Ok;

@IocBean
@At("/Route")
@Ok("json")
@Fail("http:500")
public class RouteController {
	@Inject
	protected Dao dao;

	@At("/main")
	@Ok("jsp:view/cmd")
	public Object main() {
		return true;
	}
}

2017-05-16 23:30:11,389 org.nutz.castor.Castors.reload(Castors.java:115) DEBUG - Using 95 castor for Castors
2017-05-16 23:30:11,406 org.nutz.mvc.config.AbstractNutConfig.createLoading(AbstractNutConfig.java:59) DEBUG - Loading by class org.nutz.mvc.impl.NutLoading
2017-05-16 23:30:11,409 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:55) INFO  - Nutz Version : 1.r.60 
2017-05-16 23:30:11,409 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:56) INFO  - Nutz.Mvc[nutz] is initializing ...
2017-05-16 23:30:11,409 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:60) DEBUG - Web Container Information:
2017-05-16 23:30:11,411 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:61) DEBUG -  - Default Charset : UTF-8
2017-05-16 23:30:11,411 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:62) DEBUG -  - Current . path  : G:\tomcat\apache-tomcat-7.0.57\.
2017-05-16 23:30:11,411 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:63) DEBUG -  - Java Version    : 1.7.0_06
2017-05-16 23:30:11,412 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:64) DEBUG -  - File separator  : \
2017-05-16 23:30:11,412 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:65) DEBUG -  - Timezone        : Asia/Shanghai
2017-05-16 23:30:11,412 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:66) DEBUG -  - OS              : Windows 8 amd64
2017-05-16 23:30:11,412 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:67) DEBUG -  - ServerInfo      : Apache Tomcat/7.0.57
2017-05-16 23:30:11,413 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:68) DEBUG -  - Servlet API     : 3.0
2017-05-16 23:30:11,413 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:73) DEBUG -  - ContextPath     : 
2017-05-16 23:30:11,413 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:74) DEBUG -  - context.tempdir : G:\tomcat\apache-tomcat-7.0.57\work\Catalina\localhost\_
2017-05-16 23:30:11,413 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:75) DEBUG -  - MainModule      : com.cd.config.MainModule
2017-05-16 23:30:11,414 org.nutz.mvc.impl.NutLoading.createContext(NutLoading.java:238) DEBUG - >> app.root = E:/Eclipse_file/CoderMusicCMD/WebContent
2017-05-16 23:30:11,417 org.nutz.mvc.impl.NutLoading.createIoc(NutLoading.java:379) DEBUG - @IocBy(type=org.nutz.mvc.ioc.provider.ComboIocProvider, args=["*js", "ioc/", "*anno", "com.cd", "*tx", "*async"],init=[])
2017-05-16 23:30:11,439 org.nutz.resource.Scans.scan(Scans.java:274) DEBUG - Found 1 resource by src( ioc/ ) , regex( ^(.+[.])(js|json)$ )
2017-05-16 23:30:11,439 org.nutz.ioc.loader.json.JsonLoader.<init>(JsonLoader.java:48) DEBUG - loading ioc js config from [dao.js]
2017-05-16 23:30:11,443 org.nutz.ioc.loader.json.JsonLoader.<init>(JsonLoader.java:56) DEBUG - Loaded 2 bean define from path=[ioc/] --> [dataSource, dao]
2017-05-16 23:30:11,447 org.nutz.resource.Scans.scan(Scans.java:274) DEBUG - Found 6 resource by src( com/cd/ ) , regex( ^.+[.]class$ )
2017-05-16 23:30:11,463 org.nutz.ioc.loader.annotation.AnnotationIocLoader.addClass(AnnotationIocLoader.java:74) DEBUG - Found @IocBean : class com.cd.controller.RouteController
2017-05-16 23:30:11,469 org.nutz.ioc.loader.annotation.AnnotationIocLoader.<init>(AnnotationIocLoader.java:50) INFO  - Found 1 classes in 1 base-packages!
beans = ["routeController"]
2017-05-16 23:30:11,470 org.nutz.ioc.loader.json.JsonLoader.<init>(JsonLoader.java:40) DEBUG - Loaded 5 bean define from reader --
[txREPEATABLE_READ, txREAD_COMMITTED, txNONE, txSERIALIZABLE, txREAD_UNCOMMITTED]
2017-05-16 23:30:11,471 org.nutz.ioc.aop.SimpleAopMaker.<init>(SimpleAopMaker.java:79) DEBUG - Load AopConfigure for anno=org.nutz.aop.interceptor.async.Async by type=org.nutz.aop.interceptor.async.AsyncAopIocLoader
2017-05-16 23:30:11,473 org.nutz.ioc.impl.NutIoc.<init>(NutIoc.java:98) INFO  - NutIoc init begin ...
2017-05-16 23:30:11,475 org.nutz.ioc.impl.NutIoc.<init>(NutIoc.java:115) INFO  - ... NutIoc init complete
2017-05-16 23:30:11,478 org.nutz.mvc.impl.NutLoading.evalUrlMapping(NutLoading.java:159) INFO  - Build URL mapping by org.nutz.mvc.impl.UrlMappingImpl ...
2017-05-16 23:30:11,480 org.nutz.mvc.impl.NutLoading.createViewMakers(NutLoading.java:369) DEBUG - @Views(DefaultViewMaker.class)
2017-05-16 23:30:11,486 org.nutz.mvc.impl.NutLoading.createChainMaker(NutLoading.java:266) DEBUG - @ChainBy(org.nutz.mvc.impl.NutActionChainMaker)
2017-05-16 23:30:11,492 org.nutz.mvc.impl.Loadings.scanModules(Loadings.java:154) DEBUG - module class location 'file:/E:/Eclipse_file/CoderMusicCMD/WebContent/WEB-INF/classes/com/cd/config/MainModule.class'
2017-05-16 23:30:11,492 org.nutz.mvc.impl.Loadings.scanModuleInPackage(Loadings.java:184) DEBUG -  > scan 'com.cd.config'
2017-05-16 23:30:11,494 org.nutz.resource.Scans.scan(Scans.java:274) DEBUG - Found 2 resource by src( com/cd/config/ ) , regex( ^.+[.]class$ )
2017-05-16 23:30:11,495 org.nutz.mvc.impl.NutLoading.evalUrlMapping(NutLoading.java:184) WARN  - None module classes found!!!
2017-05-16 23:30:11,495 org.nutz.mvc.impl.NutLoading.evalUrlMapping(NutLoading.java:218) WARN  - None @At found in any modules class!!
2017-05-16 23:30:11,496 org.nutz.mvc.impl.NutLoading.evalLocalization(NutLoading.java:334) DEBUG - @Localization not define
2017-05-16 23:30:11,496 org.nutz.mvc.impl.NutLoading.evalSetup(NutLoading.java:274) INFO  - Setup application...
2017-05-16 23:30:11,497 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get 'dao'<interface org.nutz.dao.Dao>
2017-05-16 23:30:11,497 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get '$aop_async'<interface org.nutz.ioc.aop.config.AopConfigration>
2017-05-16 23:30:11,498 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:177) DEBUG - 	 >> Load definition name=$aop_async
2017-05-16 23:30:11,499 org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:169) DEBUG - Found IocObject($aop_async) in AsyncAopIocLoader@1413706068
2017-05-16 23:30:11,500 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:209) DEBUG - 	 >> Make...'$aop_async'<interface org.nutz.ioc.aop.config.AopConfigration>
2017-05-16 23:30:11,501 org.nutz.ioc.impl.ScopeContext.save(ScopeContext.java:64) DEBUG - Save object '$aop_async' to [app] 
2017-05-16 23:30:11,505 org.nutz.ioc.aop.SimpleAopMaker.<init>(SimpleAopMaker.java:79) DEBUG - Load AopConfigure for anno=org.nutz.ioc.aop.Aop by type=org.nutz.ioc.aop.config.impl.AnnotationAopConfigration
2017-05-16 23:30:11,505 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:177) DEBUG - 	 >> Load definition name=dao
2017-05-16 23:30:11,506 org.nutz.ioc.loader.map.MapLoader.load(MapLoader.java:67) DEBUG - Loading define for name=dao
2017-05-16 23:30:11,508 org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:169) DEBUG - Found IocObject(dao) in JsonLoader(paths=[ioc/])
2017-05-16 23:30:11,509 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:209) DEBUG - 	 >> Make...'dao'<interface org.nutz.dao.Dao>
2017-05-16 23:30:11,520 org.nutz.ioc.aop.impl.DefaultMirrorFactory.getMirror(DefaultMirrorFactory.java:70) DEBUG - Load class org.nutz.dao.impl.NutDao without AOP
2017-05-16 23:30:11,521 org.nutz.ioc.impl.ScopeContext.save(ScopeContext.java:64) DEBUG - Save object 'dao' to [app] 
2017-05-16 23:30:11,522 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get 'dataSource'<>
2017-05-16 23:30:11,522 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:177) DEBUG - 	 >> Load definition name=dataSource
2017-05-16 23:30:11,522 org.nutz.ioc.loader.map.MapLoader.load(MapLoader.java:67) DEBUG - Loading define for name=dataSource
2017-05-16 23:30:11,528 org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:169) DEBUG - Found IocObject(dataSource) in JsonLoader(paths=[ioc/])
2017-05-16 23:30:11,528 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:209) DEBUG - 	 >> Make...'dataSource'<>
2017-05-16 23:30:11,545 org.nutz.ioc.aop.impl.DefaultMirrorFactory.getMirror(DefaultMirrorFactory.java:70) DEBUG - Load class com.alibaba.druid.pool.DruidDataSource without AOP
2017-05-16 23:30:11,547 org.nutz.ioc.impl.ScopeContext.save(ScopeContext.java:64) DEBUG - Save object 'dataSource' to [app] 
2017-05-16 23:30:11,604 com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:715) INFO  - {dataSource-1} inited
2017-05-16 23:30:11,606 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get 'dataSource'<>
2017-05-16 23:30:11,644 org.nutz.filepool.NutFilePool.<init>(NutFilePool.java:23) INFO  - Init file-pool by: C:\Users\anyan/.nutz/tmp/dao/ [200000]
2017-05-16 23:30:11,644 org.nutz.filepool.NutFilePool.<init>(NutFilePool.java:37) DEBUG - file-pool.home: 'C:\Users\anyan\.nutz\tmp\dao'
2017-05-16 23:30:11,645 org.nutz.filepool.NutFilePool.<init>(NutFilePool.java:66) INFO  - file-pool.cursor: 0
2017-05-16 23:30:11,654 org.nutz.dao.jdbc.Jdbcs.<clinit>(Jdbcs.java:90) DEBUG - Jdbcs init complete
2017-05-16 23:30:11,654 org.nutz.dao.jdbc.Jdbcs.getExpert(Jdbcs.java:103) INFO  - Get Connection from DataSource for JdbcExpert, if you lock at here, check your database server and configure
2017-05-16 23:30:11,809 org.nutz.dao.impl.DaoSupport.setDataSource(DaoSupport.java:188) DEBUG - select expert : org.nutz.dao.impl.jdbc.mysql.MysqlJdbcExpert
2017-05-16 23:30:11,814 org.nutz.dao.impl.DaoSupport$1.invoke(DaoSupport.java:199) DEBUG - JDBC Driver --> mysql-connector-java-5.1.40 ( Revision: 402933ef52cad9aa82624e80acbea46e3a701ce6 )
2017-05-16 23:30:11,814 org.nutz.dao.impl.DaoSupport$1.invoke(DaoSupport.java:200) DEBUG - JDBC Name   --> MySQL Connector Java
2017-05-16 23:30:11,815 org.nutz.dao.impl.DaoSupport$1.invoke(DaoSupport.java:202) DEBUG - JDBC URL    --> jdbc:mysql://127.0.0.1:3306/cd_cmd
2017-05-16 23:30:11,823 org.nutz.dao.impl.jdbc.mysql.MysqlJdbcExpert.checkDataSource(MysqlJdbcExpert.java:212) DEBUG - Mysql : character_set_client=utf8
2017-05-16 23:30:11,823 org.nutz.dao.impl.jdbc.mysql.MysqlJdbcExpert.checkDataSource(MysqlJdbcExpert.java:212) DEBUG - Mysql : character_set_connection=utf8
2017-05-16 23:30:11,824 org.nutz.dao.impl.jdbc.mysql.MysqlJdbcExpert.checkDataSource(MysqlJdbcExpert.java:212) DEBUG - Mysql : character_set_database=utf8
2017-05-16 23:30:11,824 org.nutz.dao.impl.jdbc.mysql.MysqlJdbcExpert.checkDataSource(MysqlJdbcExpert.java:212) DEBUG - Mysql : character_set_filesystem=binary
2017-05-16 23:30:11,824 org.nutz.dao.impl.jdbc.mysql.MysqlJdbcExpert.checkDataSource(MysqlJdbcExpert.java:212) DEBUG - Mysql : character_set_results=
2017-05-16 23:30:11,825 org.nutz.dao.impl.jdbc.mysql.MysqlJdbcExpert.checkDataSource(MysqlJdbcExpert.java:212) DEBUG - Mysql : character_set_server=utf8
2017-05-16 23:30:11,825 org.nutz.dao.impl.jdbc.mysql.MysqlJdbcExpert.checkDataSource(MysqlJdbcExpert.java:212) DEBUG - Mysql : character_set_system=utf8
2017-05-16 23:30:11,825 org.nutz.dao.impl.jdbc.mysql.MysqlJdbcExpert.checkDataSource(MysqlJdbcExpert.java:212) DEBUG - Mysql : character_sets_dir=C:\Program Files (x86)\MySQL\MySQL Server 5.5\share\charsets\
2017-05-16 23:30:11,826 org.nutz.dao.impl.jdbc.mysql.MysqlJdbcExpert.checkDataSource(MysqlJdbcExpert.java:219) DEBUG - Mysql : binlog_format=STATEMENT
2017-05-16 23:30:11,827 org.nutz.dao.impl.jdbc.mysql.MysqlJdbcExpert.checkDataSource(MysqlJdbcExpert.java:226) DEBUG - Mysql : database=cd_cmd
2017-05-16 23:30:11,828 org.nutz.dao.impl.jdbc.mysql.MysqlJdbcExpert.checkDataSource(MysqlJdbcExpert.java:232) DEBUG - Mysql : user=root@localhost
2017-05-16 23:30:11,840 org.nutz.dao.impl.DaoSupport.setDataSource(DaoSupport.java:221) DEBUG - Database info --> MYSQL:[MySQL - 5.5.25]
2017-05-16 23:30:11,843 org.nutz.resource.Scans.scan(Scans.java:274) DEBUG - Found 1 resource by src( com/cd/bean/ ) , regex( ^.+[.]class$ )
2 回复

推荐把MainModule放在com.cd

或者改一下

@Modules(scanPackage=true,packages="com.cd")

多谢,解决了

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