NutzCN Logo
问答 请问,nutz项目不想连接数据库了应该怎么改呢?
发布于 1624天前 作者 wx_0afqgeapaart9l9dsdd2 1215 次浏览 复制 上一个帖子 下一个帖子
标签:

开始的时候项目连的是MySQL,后来把方法都改成调用别人的webservice接口了,所以需要把MySQL完全从项目中脱离,涉及到的方法都删掉了,配置方面怎么改呢,是改@IocBy还是dao.js呢?自己试了下部署项目总是报错,请大佬们帮忙,谢谢!

4 回复

dao.js里面把dao和dataSource的声明去掉.

报啥错误

2020-06-05 13:48:17,761 org.nutz.mvc.impl.NutLoading.evalUrlMapping(NutLoading.java:221) INFO  - Found 55 module methods
2020-06-05 13:48:17,762 org.nutz.mvc.impl.NutLoading.evalLocalization(NutLoading.java:335) DEBUG - @Localization not define
2020-06-05 13:48:17,764 org.nutz.mvc.impl.NutLoading.evalSetup(NutLoading.java:275) INFO  - Setup application...
2020-06-05 13:48:17,768 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'dao'<interface org.nutz.dao.Dao>
2020-06-05 13:48:17,768 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get '$aop_async'<interface org.nutz.ioc.aop.config.AopConfigration>
2020-06-05 13:48:17,770 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:192) DEBUG - 	 >> Load definition name=$aop_async
2020-06-05 13:48:17,776 org.nutz.ioc.loader.combo.ComboIocLoader.printFoundIocBean(ComboIocLoader.java:226) DEBUG - Found IocObject($aop_async) in AsyncAopIocLoader@846254484
2020-06-05 13:48:17,776 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:223) DEBUG - 	 >> Make...'$aop_async'<interface org.nutz.ioc.aop.config.AopConfigration>
2020-06-05 13:48:17,943 org.nutz.ioc.impl.ScopeContext.save(ScopeContext.java:65) DEBUG - Save object '$aop_async' to [app] 
2020-06-05 13:48:17,956 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
2020-06-05 13:48:17,956 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:192) DEBUG - 	 >> Load definition name=dao
2020-06-05 13:48:17,958 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:125) ERROR - 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:250)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:271)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:161)
	at com.ybpt.MainSetup.init(MainSetup.java:19)
	at org.nutz.mvc.impl.NutLoading.evalSetup(NutLoading.java:278)
	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.getFilter(ApplicationFilterConfig.java:275)
	at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397)
	at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:108)
	at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3693)
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4340)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
	at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)
	at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)
	at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
	at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
	at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
	at org.apache.catalina.core.StandardService.start(StandardService.java:516)
	at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: org.nutz.ioc.ObjectLoadException: Object 'dao' without define!
	at org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:157)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:195)
	... 35 more
2020-06-05 13:48:17,963 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:127) ERROR - try to depose ioc
2020-06-05 13:48:17,967 org.nutz.ioc.impl.NutIoc.depose(NutIoc.java:287) INFO  - org.nutz.ioc.impl.NutIoc@442987331 is closing. startup date [20-06-05 13:48:17.550]
2020-06-05 13:48:17,968 org.nutz.ioc.impl.ScopeContext.clear(ScopeContext.java:109) DEBUG - Depose object '$aop_async' ...
2020-06-05 13:48:17,968 org.nutz.ioc.impl.NutIoc.depose(NutIoc.java:301) INFO  - org.nutz.ioc.impl.NutIoc@442987331 is deposed. startup date [20-06-05 13:48:17.550]
六月 05, 2020 1:48:17 下午 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$d228c3159216d23f4a3c87b0eb8f5dc9.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:1022)
	at org.nutz.lang.Lang.wrapThrow(Lang.java:203)
	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.getFilter(ApplicationFilterConfig.java:275)
	at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397)
	at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:108)
	at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3693)
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4340)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
	at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)
	at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)
	at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
	at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
	at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
	at org.apache.catalina.core.StandardService.start(StandardService.java:516)
	at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
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:250)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:271)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:161)
	at com.ybpt.MainSetup.init(MainSetup.java:19)
	at org.nutz.mvc.impl.NutLoading.evalSetup(NutLoading.java:278)
	at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:121)
	... 30 more
Caused by: org.nutz.ioc.ObjectLoadException: Object 'dao' without define!
	at org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:157)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:195)
	... 35 more

六月 05, 2020 1:48:17 下午 org.apache.catalina.core.StandardContext start
严重: Error filterStart
六月 05, 2020 1:48:17 下午 org.apache.catalina.core.StandardContext start
严重: Context [/vue_jkpt_back] startup failed due to previous errors
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

不要再注入dao了哦

谢谢帮主!MainSetup里面的dao没注意,注掉就好了!

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