NutzCN Logo
问答 mainsetup中无法获取dao
发布于 2633天前 作者 qq_64f81159 1878 次浏览 复制 上一个帖子 下一个帖子
标签:

想创建表和插入原始数据,但是报错了

org.nutz.ioc.IocException: IocBean[dao] For object [dao] - type:[interface org.nutz.dao.Dao]
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:218)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:239)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:146)
	at com.kanq.MainSetup.init(MainSetup.java:19)
	at org.nutz.mvc.impl.NutLoading.evalSetup(NutLoading.java:274)
	at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:121)
	at org.nutz.mvc.ActionHandler.<init>(ActionHandler.java:19)
	at org.nutz.mvc.NutFilter._init(NutFilter.java:91)
	at org.nutz.mvc.NutFilter.init(NutFilter.java:69)
	at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:281)
	at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:262)
	at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:107)
	at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4746)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5399)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1276)
	at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1440)
	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:301)
	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
	at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
	at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1374)
	at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1530)
	at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1540)
	at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1519)
	at java.lang.Thread.run(Thread.java:744)
Caused by: org.nutz.ioc.ObjectLoadException: Object 'dao' without define!
	at org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:166)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:180)

mainsetup如下

public class MainSetup implements Setup {

	@Override
	public void init(NutConfig config) {
		// 特别留意一下,是init方法,不是destroy方法!!!!!
		Ioc ioc = config.getIoc();
        Dao dao = ioc.get(Dao.class);
		// 如果没有createTablesInPackage,请检查nutz版本
		Daos.createTablesInPackage(dao, "com.kanq.model", 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);
            user = new User();
            user.setName("张三丰");
            user.setPassword("123456");
            user.setCreateTime(new Date());
            user.setUpdateTime(new Date());
            dao.insert(user);
            user = new User();
            user.setName("张四丰");
            user.setPassword("123456");
            user.setCreateTime(new Date());
            user.setUpdateTime(new Date());
            dao.insert(user);
            user.setName("张三儿");
            user.setPassword("123456");
            user.setCreateTime(new Date());
            user.setUpdateTime(new Date());
            dao.insert(user);
            user.setName("张三123456");
            user.setPassword("123456");
            user.setCreateTime(new Date());
            user.setUpdateTime(new Date());
            dao.insert(user);
        }
	}

	@Override
	public void destroy(NutConfig nc) {

	}

}

mainmodule如下
@Modules(scanPackage = true, packages = "com.kanq")
@Ok("json:full")
@Fail("http:500")
@IocBy(type = ComboIocProvider.class, args = {"*json", "conf/ioc/",
"*anno", "com.kanq",
"*tx",
"*async"
})
@SetupBy(value = MainSetup.class)
public class MainModule {

}

dao.json如下

var ioc = {
        dataSource : {
            type : "com.alibaba.druid.pool.DruidDataSource",
            events : {
                create : "init",
                depose : 'close'
            },
            fields : {
                url : "jdbc:mysql://127.0.0.1:3306/ac",
                username : "root",
                password : "root",
                testWhileIdle : true, // 非常重要,预防mysql的8小时timeout问题
                //validationQuery : "select 1" , // Oracle的话需要改成 select 1 from dual
                maxActive : 100
            }
        },
        dao : {
            type : "org.nutz.dao.impl.NutDao",
            args : [{refer:"dataSource"}]
        }
};

不加入mainsetup没错 加入就报错了。

12 回复

贴启动日志

八月 31, 2017 9:28:38 下午 org.apache.catalina.core.AprLifecycleListener init
信息: Loaded APR based Apache Tomcat Native library 1.1.27 using APR version 1.4.6.
八月 31, 2017 9:28:38 下午 org.apache.catalina.core.AprLifecycleListener init
信息: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
八月 31, 2017 9:28:39 下午 org.apache.catalina.core.AprLifecycleListener initializeSSL
信息: OpenSSL successfully initialized (OpenSSL 1.0.1d 5 Feb 2013)
八月 31, 2017 9:28:39 下午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["http-apr-8080"]
八月 31, 2017 9:28:39 下午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["ajp-apr-8009"]
八月 31, 2017 9:28:39 下午 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 1263 ms
八月 31, 2017 9:28:39 下午 org.apache.catalina.core.StandardService startInternal
信息: Starting service Catalina
八月 31, 2017 9:28:39 下午 org.apache.catalina.core.StandardEngine startInternal
信息: Starting Servlet Engine: Apache Tomcat/7.0.40
八月 31, 2017 9:28:39 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\tomcat7\webapps\docs
八月 31, 2017 9:28:40 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\tomcat7\webapps\examples
八月 31, 2017 9:28:40 下午 org.apache.catalina.core.ApplicationContext log
信息: ContextListener: contextInitialized()
八月 31, 2017 9:28:40 下午 org.apache.catalina.core.ApplicationContext log
信息: SessionListener: contextInitialized()
八月 31, 2017 9:28:40 下午 org.apache.catalina.core.ApplicationContext log
信息: ContextListener: attributeAdded('org.apache.jasper.compiler.TldLocationsCache', 'org.apache.jasper.compiler.TldLocationsCache@a45cceb')
八月 31, 2017 9:28:40 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\tomcat7\webapps\host-manager
八月 31, 2017 9:28:40 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\tomcat7\webapps\manager
八月 31, 2017 9:28:40 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\tomcat7\webapps\nutz
17-08-31 21:28:40.734 INFO [localhost-startStop-1] Select SystemLog as Nutz.Log implement
17-08-31 21:28:40.742 INFO [localhost-startStop-1] NutFilter[nutz] starting ...
17-08-31 21:28:40.774 DEBUG [localhost-startStop-1] Locations count=4 time use 15ms
17-08-31 21:28:40.804 DEBUG [localhost-startStop-1] Locations count=9 time use 30ms
17-08-31 21:28:40.898 DEBUG [localhost-startStop-1] Using 95 castor for Castors
17-08-31 21:28:40.920 DEBUG [localhost-startStop-1] Loading by class org.nutz.mvc.impl.NutLoading
17-08-31 21:28:40.924 INFO [localhost-startStop-1] Nutz Version : 1.r.61 
17-08-31 21:28:40.924 INFO [localhost-startStop-1] Nutz.Mvc[nutz] is initializing ...
17-08-31 21:28:40.925 DEBUG [localhost-startStop-1] Web Container Information:
17-08-31 21:28:40.926 DEBUG [localhost-startStop-1]  - Default Charset : GBK
17-08-31 21:28:40.927 DEBUG [localhost-startStop-1]  - Current . path  : D:\tomcat7\bin\.
17-08-31 21:28:40.927 DEBUG [localhost-startStop-1]  - Java Version    : 1.7.0_45
17-08-31 21:28:40.927 DEBUG [localhost-startStop-1]  - File separator  : \
17-08-31 21:28:40.927 DEBUG [localhost-startStop-1]  - Timezone        : Asia/Shanghai
17-08-31 21:28:40.928 DEBUG [localhost-startStop-1]  - OS              : Windows 7 amd64
17-08-31 21:28:40.928 DEBUG [localhost-startStop-1]  - ServerInfo      : Apache Tomcat/7.0.40
17-08-31 21:28:40.928 DEBUG [localhost-startStop-1]  - Servlet API     : 3.0
17-08-31 21:28:40.928 DEBUG [localhost-startStop-1]  - ContextPath     : /nutz
17-08-31 21:28:40.928 DEBUG [localhost-startStop-1]  - context.tempdir : D:\tomcat7\work\Catalina\localhost\nutz
17-08-31 21:28:40.929 DEBUG [localhost-startStop-1]  - MainModule      : com.kanq.MainModule
17-08-31 21:28:40.929 DEBUG [localhost-startStop-1] >> app.root = D:/tomcat7/webapps/nutz
17-08-31 21:28:40.934 DEBUG [localhost-startStop-1] @IocBy(type=org.nutz.mvc.ioc.provider.ComboIocProvider, args=["*json", "conf/ioc/", "*anno", "com.kanq", "*tx", "*async"],init=[])
17-08-31 21:28:41.062 DEBUG [localhost-startStop-1] Found 1 resource by src( conf/ioc/ ) , regex( ^(.+[.])(js|json)$ )
17-08-31 21:28:41.062 DEBUG [localhost-startStop-1] loading [conf/ioc/]
17-08-31 21:28:41.067 DEBUG [localhost-startStop-1] Loaded 0 bean define from path=[conf/ioc/] --> []
17-08-31 21:28:41.076 DEBUG [localhost-startStop-1] Found 5 resource by src( com/kanq/ ) , regex( ^.+[.]class$ )
17-08-31 21:28:41.088 DEBUG [localhost-startStop-1] Found @IocBean : class com.kanq.action.UserAction
17-08-31 21:28:41.097 DEBUG [localhost-startStop-1] Found @IocBean : class com.kanq.sevice.UserService
17-08-31 21:28:41.099 INFO [localhost-startStop-1] Found 2 classes in 1 base-packages!
beans = ["userService", "userAction"]
17-08-31 21:28:41.105 DEBUG [localhost-startStop-1] Loaded 5 bean define from reader --
[txREPEATABLE_READ, txREAD_COMMITTED, txNONE, txSERIALIZABLE, txREAD_UNCOMMITTED]
17-08-31 21:28:41.119 DEBUG [localhost-startStop-1] Load AopConfigure for anno=org.nutz.aop.interceptor.async.Async by type=org.nutz.aop.interceptor.async.AsyncAopIocLoader
17-08-31 21:28:41.122 INFO [localhost-startStop-1] NutIoc init begin ...
17-08-31 21:28:41.126 INFO [localhost-startStop-1] ... NutIoc init complete
17-08-31 21:28:41.130 INFO [localhost-startStop-1] Build URL mapping by org.nutz.mvc.impl.UrlMappingImpl ...
17-08-31 21:28:41.134 DEBUG [localhost-startStop-1] @Views(DefaultViewMaker.class)
17-08-31 21:28:41.142 DEBUG [localhost-startStop-1] @ChainBy(org.nutz.mvc.impl.NutActionChainMaker)
17-08-31 21:28:41.151 DEBUG [localhost-startStop-1]  > scan 'com.kanq'
17-08-31 21:28:41.153 DEBUG [localhost-startStop-1] Found 5 resource by src( com/kanq/ ) , regex( ^.+[.]class$ )
17-08-31 21:28:41.154 DEBUG [localhost-startStop-1]    >> add 'com.kanq.action.UserAction'
17-08-31 21:28:41.154 DEBUG [localhost-startStop-1] module class location 'file:/D:/tomcat7/webapps/nutz/WEB-INF/classes/com/kanq/MainModule.class'
17-08-31 21:28:41.154 DEBUG [localhost-startStop-1]  > scan 'com.kanq'
17-08-31 21:28:41.156 DEBUG [localhost-startStop-1] Found 5 resource by src( com/kanq/ ) , regex( ^.+[.]class$ )
17-08-31 21:28:41.157 DEBUG [localhost-startStop-1]    >> add 'com.kanq.action.UserAction'
17-08-31 21:28:41.179 INFO [localhost-startStop-1] Optional processor class not found, disabled : org.nutz.integration.shiro.NutShiroProcessor
17-08-31 21:28:41.209 INFO [localhost-startStop-1] Optional processor class not found, disabled : org.nutz.plugins.validation.ValidationProcessor
17-08-31 21:28:41.228 DEBUG [localhost-startStop-1]    '/user/'                    >> (UserAction.java:27).searchUserByName : String     | @Ok(raw  ) @Fail(http:500) | by 0 Filters | (I:UTF-8/O:UTF-8)
17-08-31 21:28:41.228 INFO [localhost-startStop-1] Found 1 module methods
17-08-31 21:28:41.229 DEBUG [localhost-startStop-1] @Localization not define
17-08-31 21:28:41.230 INFO [localhost-startStop-1] Setup application...
17-08-31 21:28:52.777 DEBUG [localhost-startStop-1] Get 'dao'<interface org.nutz.dao.Dao>
17-08-31 21:28:52.778 DEBUG [localhost-startStop-1] Get '$aop_async'<interface org.nutz.ioc.aop.config.AopConfigration>
17-08-31 21:28:52.784 DEBUG [localhost-startStop-1] 	 >> Load definition name=$aop_async
17-08-31 21:28:52.793 DEBUG [localhost-startStop-1] Found IocObject($aop_async) in AsyncAopIocLoader@1954691586
17-08-31 21:28:52.794 DEBUG [localhost-startStop-1] 	 >> Make...'$aop_async'<interface org.nutz.ioc.aop.config.AopConfigration>
17-08-31 21:28:52.799 DEBUG [localhost-startStop-1] Save object '$aop_async' to [app] 
17-08-31 21:28:52.810 DEBUG [localhost-startStop-1] Load AopConfigure for anno=org.nutz.ioc.aop.Aop by type=org.nutz.ioc.aop.config.impl.AnnotationAopConfigration
17-08-31 21:28:52.810 DEBUG [localhost-startStop-1] 	 >> Load definition name=dao
17-08-31 21:28:52.810 
ERROR [localhost-startStop-1] Error happend during start serivce!
org.nutz.ioc.IocException: IocBean[dao] For object [dao] - type:[interface org.nutz.dao.Dao]
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:218)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:239)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:146)
	at com.kanq.MainSetup.init(MainSetup.java:19)
	at org.nutz.mvc.impl.NutLoading.evalSetup(NutLoading.java:274)
	at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:121)
	at org.nutz.mvc.ActionHandler.<init>(ActionHandler.java:19)
	at org.nutz.mvc.NutFilter._init(NutFilter.java:91)
	at org.nutz.mvc.NutFilter.init(NutFilter.java:69)

	at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:281)
	at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:262)
	at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:107)
	at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4746)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5399)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)

	at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1114)

	at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1672)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:744)
Caused by: org.nutz.ioc.ObjectLoadException: Object 'dao' without define!
	at org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:166)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:180)
	... 24 more
17-08-31 21:28:52.814
 ERROR [
localhost-startStop-1] 
try to depose ioc
17-08-31 21:28:52.815 INFO [localhost-startStop-1] org.nutz.ioc.impl.NutIoc@984357737 is closing. startup date [17-08-31 21:28:41.123]
17-08-31 21:28:52.815 DEBUG [localhost-startStop-1] Depose object '$aop_async' ...
17-08-31 21:28:52.816 INFO [localhost-startStop-1] org.nutz.ioc.impl.NutIoc@984357737 is deposed. startup date [17-08-31 21:28:41.123]
八月 31, 2017 9:28:52 下午 org.apache.catalina.core.StandardContext filterStart
严重: Exception starting filter nutz
org.nutz.mvc.LoadingException: org.nutz.ioc.IocException: IocBean[dao] For object [dao] - type:[interface org.nutz.dao.Dao]
	at org.nutz.mvc.LoadingException$FC$9a86caf9ff5d3b587784fcdf555a4a7d.invoke(LoadingException.java)
	at org.nutz.lang.born.AbstractConstructorBorning.call(AbstractConstructorBorning.java:25)
	at org.nutz.lang.born.ConstructorBorning.born(ConstructorBorning.java:19)
	at org.nutz.lang.born.BornContext.doBorn(BornContext.java:60)
	at org.nutz.lang.Mirror.born(Mirror.java:990)
	at org.nutz.lang.Lang.wrapThrow(Lang.java:200)
	at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:135)
	at org.nutz.mvc.ActionHandler.<init>(ActionHandler.java:19)
	at org.nutz.mvc.NutFilter._init(NutFilter.java:91)
	at org.nutz.mvc.NutFilter.init(NutFilter.java:69)
	at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:281)
	at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:262)
	at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:107)
	at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4746)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5399)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
	at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1114)
	at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1672)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:744)
Caused by: org.nutz.ioc.IocException: IocBean[dao] For object [dao] - type:[interface org.nutz.dao.Dao]
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:218)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:239)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:146)
	at com.kanq.MainSetup.init(MainSetup.java:19)
	at org.nutz.mvc.impl.NutLoading.evalSetup(NutLoading.java:274)
	at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:121)
	... 19 more
Caused by: org.nutz.ioc.ObjectLoadException: Object 'dao' without define!
	at org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:166)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:180)
	... 24 more
八月 31, 2017 9:28:52 下午 org.apache.catalina.core.StandardContext startInternal
严重: Error filterStart
八月 31, 2017 9:28:52 下午 org.apache.catalina.core.StandardContext startInternal
严重: Context [/nutz] startup failed due to previous errors
八月 31, 2017 9:28:52 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\tomcat7\webapps\ROOT
八月 31, 2017 9:28:52 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["http-apr-8080"]
八月 31, 2017 9:28:52 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["ajp-apr-8009"]
八月 31, 2017 9:28:52 下午 org.apache.catalina.startup.Catalina start
信息: Server startup in 13086 ms

17-08-31 21:28:41.062 DEBUG [localhost-startStop-1] Found 1 resource by src( conf/ioc/ ) , regex( ^(.+[.])(js|json)$ )
17-08-31 21:28:41.062 DEBUG [localhost-startStop-1] loading [conf/ioc/]
17-08-31 21:28:41.067 DEBUG [localhost-startStop-1] Loaded 0 bean define from path=[conf/ioc/] --> []

conf/ioc文件夹的完整路径是什么,本地文件系统的完整路径

是用maven构建的,配置文件放在src/main/resources下,Java文件放在src/main/java下,我改了下把配置文件放到了src/main/java下倒是可以了,不过我以前放在resources下是没有问题的捏。

不需要放在 src/main/java

贴你的pom.xml

pom没啥啊 就是引入的jar包 没有插件

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>com.kanq</groupId>
	<artifactId>nutz</artifactId>
	<packaging>war</packaging>
	<version>0.0.1-SNAPSHOT</version>
	<name>nutz Maven Webapp</name>
	<url>http://maven.apache.org</url>
	<dependencies>
		<dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>3.1.0</version>
            <scope>provided</scope>
        </dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>3.8.1</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.nutz</groupId>
			<artifactId>nutz</artifactId>
			<version>1.r.61</version>
		</dependency>
		<dependency>
			<groupId>com.alibaba</groupId>
			<artifactId>druid</artifactId>
			<version>1.0.13</version>
		</dependency>
		<dependency>
			<groupId>mysql</groupId>
			<artifactId>mysql-connector-java</artifactId>
			<version>5.1.34</version>
		</dependency>
		<dependency>
			<groupId>asm</groupId>
			<artifactId>asm</artifactId>
			<version>3.2</version>
		</dependency>
	</dependencies>
	<build>
		<finalName>nutz</finalName>
	</build>
</project>

src/main/resources/conf/ioc 这样的路径?

是这样的路径啊 ,不过在Java Build Path中 Deafult output folder 都是nutz/target/classes

dao.json是不是放错位置了??? nutz/target/classes/conf/ioc/ 下面有dao.json吗?

最后编译部署以后json 在 \WEB-INF\classes\conf\ioc中

现在有可以了。。放在src/main/resources下 坑爹 。。。。。。。哎

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