NutzCN Logo
问答 nutzwk4.0.1转NB项目,有一些疑问想请教
发布于 1958天前 作者 码农 1559 次浏览 复制 上一个帖子 下一个帖子
标签: nutzwk

Fail to born or cast to 'org.nutz.dao.Dao',另外一个项目链接数据库是正常的,也加入了参考文档中的
org.nutz
nutz

在application.properties文件相关配置:

nutz.application.name=zsxx
server.port=8080
server.host=127.0.0.1

#oracle
jdbc.name=ws
jdbc.url=jdbc:oracle:thin:@//192.168.255.128/ORCL
jdbc.username=ws
jdbc.password=123456
jdbc.validationQuery=select 1 from dual
jdbc.maxActive=100
jdbc.testWhileIdle=true
jdbc.filters=mergeStat
jdbc.connectionProperties=druid.stat.slowSqlMillis=2000
jdbc.defaultAutoCommit=true




beetl.RESOURCE_LOADER=org.beetl.core.resource.WebAppResourceLoader
beetl.ENGINE=org.beetl.core.engine.DefaultTemplateEngine
beetl.RESOURCE.root= /WEB-INF/views
beetl.RESOURCE.functionSuffix = html
beetl.RESOURCE.autoCheck= true
beetl.DELIMITER_STATEMENT_START=<%
beetl.DELIMITER_STATEMENT_END=%>

FT.escape=cn.wizzer.framework.view.beetl.HtmlEscapeFormat

#==============================================================
#Configure Main Scheduler Properties
#==============================================================
org.quartz.scheduler.instanceName = defaultScheduler
org.quartz.scheduler.instanceId = AUTO

#==============================================================
#Configure JobStore   
#==============================================================
org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreTX
org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.StdJDBCDelegate
org.quartz.jobStore.dataSource=myDS
org.quartz.jobStore.tablePrefix = SYS_QRTZ_
org.quartz.jobStore.isClustered = true
org.quartz.jobStore.clusterCheckinInterval = 20000
org.quartz.jobStore.maxMisfiresToHandleAtATime = 120
org.quartz.jobStore.misfireThreshold = 120000
org.quartz.jobStore.txIsolationLevelSerializable = false

#==============================================================
#Configure ThreadPool
#==============================================================
org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
org.quartz.threadPool.threadCount = 5
org.quartz.threadPool.threadPriority = 5
org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread = true

#==============================================================
#Skip Check Update
#update:true
#not update:false
#==============================================================
org.quartz.scheduler.skipUpdateCheck = true

#============================================================================
# Configure Plugins
#============================================================================
org.quartz.plugin.triggHistory.class = org.quartz.plugins.history.LoggingJobHistoryPlugin
org.quartz.plugin.shutdownhook.class = org.quartz.plugins.management.ShutdownHookPlugin
org.quartz.plugin.shutdownhook.cleanShutdown = true
#============================================================================
# NutDao dataSource
#============================================================================
org.quartz.dataSource.myDS.connectionProvider.class = org.nutz.integration.quartz.NutConnectionProvider


[main]
# cacheManager
#-------------Redis作为shiro二级缓存时注释掉这里---------
cacheManager = org.apache.shiro.cache.ehcache.EhCacheManager
cacheManager.cacheManagerConfigFile = classpath:ehcache.xml
#-------------Redis作为shiro二级缓存时注释掉这里---------

#-------------Redis作为shiro二级缓存时启用这里---------
#jedisAgent = org.nutz.integration.jedis.JedisAgent
#cacheManager_ehcache = org.apache.shiro.cache.ehcache.EhCacheManager
#cacheManager_ehcache.cacheManagerConfigFile=classpath:ehcache.xml
#cacheManager_redis = org.nutz.plugins.cache.impl.redis.RedisCacheManager
#cacheManager_redis.mode=kv
#cacheManager_redis.debug=true
#cacheManager = org.nutz.plugins.cache.impl.lcache.LCacheManager
#cacheManager.jedisAgent = $jedisAgent
#cacheManager.level1 = $cacheManager_ehcache
#cacheManager.level2 = $cacheManager_redis
#-------------Redis作为shiro二级缓存时启用这里---------

# Session
sessionManager = org.apache.shiro.web.session.mgt.DefaultWebSessionManager
sessionManager.sessionValidationSchedulerEnabled = true

# Session Cache
#sessionDAO = org.apache.shiro.session.mgt.eis.EnterpriseCacheSessionDAO
#sessionDAO.cacheManager = $cacheManager
#sessionDAO.activeSessionsCacheName = shiro-activeSessionCache
#sessionManager.sessionDAO = $sessionDAO
securityManager.sessionManager = $sessionManager

# Cookie
sessionIdCookie = org.apache.shiro.web.servlet.SimpleCookie
sessionIdCookie.name = sid
#sessionIdCookie.domain=wizzer.cn
#sessionIdCookie.path=
sessionIdCookie.maxAge = 946080000
sessionIdCookie.httpOnly = true
sessionManager.sessionIdCookie = $sessionIdCookie
sessionManager.sessionIdCookieEnabled = true
sessionManager.globalSessionTimeout = 7200000

#bak...
#sessionManager=org.apache.shiro.web.session.mgt.DefaultWebSessionManager
#sessionListener1 = cn.wizzer.common.shiro.listener.MySessionListener
#sessionManager.sessionListeners = $sessionListener1
#sessionManager.globalSessionTimeout=50000
#securityManager.sessionManager=$sessionManager

rememberMeCookie = org.apache.shiro.web.servlet.SimpleCookie
rememberMeCookie.name = remember
rememberMeCookie.maxAge = 604800
rememberMeCookie.httpOnly = true
rememberMeManager = cn.wizzer.framework.shiro.remember.LightCookieRememberMeManager
rememberMeManager.cookie = $rememberMeCookie

sha256Matcher = org.apache.shiro.authc.credential.Sha256CredentialsMatcher
sha256Matcher.storedCredentialsHexEncoded = false
sha256Matcher.hashIterations = 1024
sha256Matcher.hashSalted = true

shiroDbRealm = cn.wizzer.app.web.commons.shiro.realm.PlatformAuthorizingRealm
shiroDbRealm.credentialsMatcher = $sha256Matcher

securityManager.realms = $shiroDbRealm
authcStrategy = cn.wizzer.framework.shiro.pam.AnySuccessfulStrategy
securityManager.authenticator.authenticationStrategy = $authcStrategy
securityManager.cacheManager = $cacheManager
securityManager.rememberMeManager = $rememberMeManager

authc = cn.wizzer.app.web.commons.shiro.filter.PlatformAuthenticationFilter
authc.captchaParam=platformCaptcha
authc.loginUrl = /platform/login
logout.redirectUrl = /platform/login

[urls]
/platform/doLogin = anon
/assets/** = anon
/** = anon
/platform/** = authc
/api/** = authc

报错如下:

16:44:06.517 [main] DEBUG org.nutz.mvc.impl.NutActionChainMaker - Eval FAIL!! : public java.lang.Object cn.wizzer.app.web.modules.controllers.platform.zswres.ZswresVectorbasicinfoController.addDo(cn.wizzer.app.zswres.modules.models.Zswres_vectorbasicinfo,org.nutz.mvc.upload.TempFile,org.nutz.mvc.upload.TempFile,org.nutz.mvc.upload.TempFile,javax.servlet.http.HttpServletRequest,org.nutz.dao.Dao)
org.nutz.lang.born.BorningException: Fail to born or cast to 'org.nutz.dao.Dao'
 by args: []
 because: No suitable Constructor or Factory Method!!
	at org.nutz.lang.Mirror.getBorning(Mirror.java:983)
	at org.nutz.mvc.adaptor.injector.ObjectPairInjector.<init>(ObjectPairInjector.java:39)
	at org.nutz.mvc.adaptor.PairAdaptor.evalInjectorBy(PairAdaptor.java:57)
	at org.nutz.mvc.upload.UploadAdaptor.evalInjectorBy(UploadAdaptor.java:165)
	at org.nutz.mvc.adaptor.AbstractAdaptor.evalInjector(AbstractAdaptor.java:221)
	at org.nutz.mvc.adaptor.AbstractAdaptor.init(AbstractAdaptor.java:160)
	at org.nutz.mvc.adaptor.AbstractAdaptor.init(AbstractAdaptor.java:81)
	at org.nutz.mvc.upload.UploadAdaptor.init(UploadAdaptor.java:215)
	at org.nutz.mvc.impl.processor.AdaptorProcessor.evalHttpAdaptor(AdaptorProcessor.java:46)
	at org.nutz.mvc.impl.processor.AdaptorProcessor.init(AdaptorProcessor.java:22)
	at org.nutz.mvc.impl.NutActionChainMaker.eval(NutActionChainMaker.java:38)
	at org.nutz.mvc.impl.UrlMappingImpl.add(UrlMappingImpl.java:54)
	at org.nutz.mvc.impl.NutLoading.evalUrlMapping(NutLoading.java:205)
	at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:108)
	at org.nutz.boot.starter.nutz.mvc.NbMvcLoading.load(NbMvcLoading.java:28)
	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.eclipse.jetty.servlet.FilterHolder.initialize(FilterHolder.java:136)
	at org.eclipse.jetty.servlet.ServletHandler.lambda$initialize$0(ServletHandler.java:750)
	at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
	at java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:742)
	at java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:742)
	at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580)
	at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:744)
	at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:369)
	at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1497)
	at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1459)
	at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:854)
	at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:278)
	at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:545)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:167)
	at org.eclipse.jetty.server.Server.start(Server.java:418)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:110)
	at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
	at org.eclipse.jetty.server.Server.doStart(Server.java:382)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
	at org.nutz.boot.starter.jetty.JettyStarter.start(JettyStarter.java:160)
	at org.nutz.boot.AppContext.startServers(AppContext.java:310)
	at org.nutz.boot.NbApp.execute(NbApp.java:210)
	at org.nutz.boot.NbApp.run(NbApp.java:182)
	at cn.wizzer.app.web.commons.core.MainLauncher.main(MainLauncher.java:35)
16:44:06.518 [main] ERROR org.nutz.mvc.impl.NutLoading - Error happend during start serivce!
org.nutz.lang.born.BorningException: Fail to born or cast to 'org.nutz.dao.Dao'
 by args: []
 because: No suitable Constructor or Factory Method!!
	at org.nutz.lang.Mirror.getBorning(Mirror.java:983)
	at org.nutz.mvc.adaptor.injector.ObjectPairInjector.<init>(ObjectPairInjector.java:39)
	at org.nutz.mvc.adaptor.PairAdaptor.evalInjectorBy(PairAdaptor.java:57)
	at org.nutz.mvc.upload.UploadAdaptor.evalInjectorBy(UploadAdaptor.java:165)
	at org.nutz.mvc.adaptor.AbstractAdaptor.evalInjector(AbstractAdaptor.java:221)
	at org.nutz.mvc.adaptor.AbstractAdaptor.init(AbstractAdaptor.java:160)
	at org.nutz.mvc.adaptor.AbstractAdaptor.init(AbstractAdaptor.java:81)
	at org.nutz.mvc.upload.UploadAdaptor.init(UploadAdaptor.java:215)
	at org.nutz.mvc.impl.processor.AdaptorProcessor.evalHttpAdaptor(AdaptorProcessor.java:46)
	at org.nutz.mvc.impl.processor.AdaptorProcessor.init(AdaptorProcessor.java:22)
	at org.nutz.mvc.impl.NutActionChainMaker.eval(NutActionChainMaker.java:38)
	at org.nutz.mvc.impl.UrlMappingImpl.add(UrlMappingImpl.java:54)
	at org.nutz.mvc.impl.NutLoading.evalUrlMapping(NutLoading.java:205)
	at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:108)
	at org.nutz.boot.starter.nutz.mvc.NbMvcLoading.load(NbMvcLoading.java:28)
	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.eclipse.jetty.servlet.FilterHolder.initialize(FilterHolder.java:136)
	at org.eclipse.jetty.servlet.ServletHandler.lambda$initialize$0(ServletHandler.java:750)
	at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
	at java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:742)
	at java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:742)
	at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580)
	at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:744)
	at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:369)
	at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1497)
	at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1459)
	at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:854)
	at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:278)
	at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:545)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:167)
	at org.eclipse.jetty.server.Server.start(Server.java:418)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:110)
	at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
	at org.eclipse.jetty.server.Server.doStart(Server.java:382)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
	at org.nutz.boot.starter.jetty.JettyStarter.start(JettyStarter.java:160)
	at org.nutz.boot.AppContext.startServers(AppContext.java:310)
	at org.nutz.boot.NbApp.execute(NbApp.java:210)
	at org.nutz.boot.NbApp.run(NbApp.java:182)
	at cn.wizzer.app.web.commons.core.MainLauncher.main(MainLauncher.java:35)
16:44:06.518 [main] ERROR org.nutz.mvc.impl.NutLoading - try to depose ioc
16:44:06.521 [main] INFO org.nutz.ioc.impl.NutIoc - org.nutz.ioc.impl.NutIoc@1048128739 is closing. startup date [19-08-13 16:44:00.633]
16:44:06.521 [main] DEBUG org.nutz.ioc.impl.ScopeContext - Depose object 'tmpFilePool' ...
16:44:06.521 [main] DEBUG org.nutz.ioc.impl.ScopeContext - Depose object 'nutFilter' ...
16:44:06.521 [main] DEBUG org.nutz.ioc.impl.ScopeContext - Depose object 'shiroFilter' ...
16:44:06.521 [main] DEBUG org.nutz.ioc.impl.ScopeContext - Depose object 'whaleFilter' ...
16:44:06.521 [main] DEBUG org.nutz.ioc.impl.ScopeContext - Depose object 'shiroRememberMeManager' ...
16:44:06.521 [main] DEBUG org.nutz.ioc.impl.ScopeContext - Depose object 'platformAuthorizingRealm' ...
16:44:06.521 [main] DEBUG org.nutz.ioc.impl.ScopeContext - Depose object 'shiroCacheManager' ...
16:44:06.521 [main] DEBUG org.nutz.ioc.impl.ScopeContext - Depose object 'shiroWebSessionManager' ...
16:44:06.521 [main] DEBUG org.nutz.ioc.impl.ScopeContext - Depose object 'shiroWebSecurityManager' ...
16:44:06.521 [main] DEBUG org.nutz.ioc.impl.ScopeContext - Depose object 'shiroEnvironmentLoaderListener' ...
16:44:06.521 [main] DEBUG org.nutz.ioc.impl.ScopeContext - Depose object 'loglevelProperty' ...
16:44:06.521 [main] DEBUG org.nutz.ioc.impl.ScopeContext - Depose object 'logbackStarter' ...
16:44:06.521 [main] DEBUG org.nutz.ioc.impl.ScopeContext - Depose object 'nbServletContextListener' ...
16:44:06.521 [main] DEBUG org.nutz.ioc.impl.ScopeContext - Depose object 'jettyStarter' ...
16:44:06.521 [main] DEBUG org.nutz.ioc.impl.ScopeContext - Depose object 'ftpStarter' ...
16:44:06.521 [main] DEBUG org.nutz.ioc.impl.ScopeContext - Depose object 'quartzStarter' ...
16:44:06.521 [main] DEBUG org.nutz.ioc.impl.ScopeContext - Depose object 'shiroEnvStarter' ...
16:44:06.521 [main] DEBUG org.nutz.ioc.impl.ScopeContext - Depose object 'shiroFilterStarter' ...
16:44:06.521 [main] DEBUG org.nutz.ioc.impl.ScopeContext - Depose object 'tomcatStarter' ...
16:44:06.521 [main] DEBUG org.nutz.ioc.impl.ScopeContext - Depose object 'druidWebStatServletStarter' ...
16:44:06.521 [main] DEBUG org.nutz.ioc.impl.ScopeContext - Depose object 'druidWebStatFilterStarter' ...
16:44:06.521 [main] DEBUG org.nutz.ioc.impl.ScopeContext - Depose object 'dataSourceStarter' ...
16:44:06.521 [main] DEBUG org.nutz.boot.starter.jdbc.DataSourceStarter - shutdown slave datasource count=0
16:44:06.521 [main] DEBUG org.nutz.ioc.impl.ScopeContext - Depose object 'nutDaoStarter' ...
16:44:06.521 [main] DEBUG org.nutz.ioc.impl.ScopeContext - Depose object 'whaleFilterStarter' ...
16:44:06.521 [main] DEBUG org.nutz.ioc.impl.ScopeContext - Depose object 'nutFilterStarter' ...
16:44:06.521 [main] DEBUG org.nutz.ioc.impl.ScopeContext - Depose object '$aop_wkcache' ...
16:44:06.521 [main] DEBUG org.nutz.ioc.impl.ScopeContext - Depose object '$aop_syslog' ...
16:44:06.521 [main] DEBUG org.nutz.ioc.impl.ScopeContext - Depose object '$aop_async' ...
16:44:06.522 [main] DEBUG org.nutz.ioc.impl.ScopeContext - Depose object 'dynamicInterceptor' ...
16:44:06.522 [main] DEBUG org.nutz.ioc.impl.ScopeContext - Depose object '$aop_1_plugin' ...
16:44:06.522 [main] DEBUG org.nutz.ioc.impl.ScopeContext - Depose object 'scheduler' ...
16:44:06.522 [main] DEBUG org.nutz.ioc.impl.ScopeContext - Depose object 'counterService' ...
16:44:06.522 [main] DEBUG org.nutz.ioc.impl.ScopeContext - Depose object 'nbApp' ...
16:44:06.522 [main] DEBUG org.nutz.ioc.impl.ScopeContext - Depose object 'conf' ...
16:44:06.522 [main] DEBUG org.nutz.ioc.impl.ScopeContext - Depose object 'appContext' ...
16:44:06.522 [main] INFO org.nutz.ioc.impl.NutIoc - org.nutz.ioc.impl.NutIoc@1048128739 is deposed. startup date [19-08-13 16:44:00.633]
16:44:06.524 [main] DEBUG org.eclipse.jetty.servlet.ServletHandler - EXCEPTION 
org.nutz.mvc.LoadingException: org.nutz.lang.born.BorningException: Fail to born or cast to 'org.nutz.dao.Dao'
 by args: []
 because: No suitable Constructor or Factory Method!!
	at org.nutz.mvc.LoadingException$FC$ea86c19f63d257f4e49c243bba1db3c3.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:1025)
	at org.nutz.lang.Lang.wrapThrow(Lang.java:207)
	at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:135)
	at org.nutz.boot.starter.nutz.mvc.NbMvcLoading.load(NbMvcLoading.java:28)
	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.eclipse.jetty.servlet.FilterHolder.initialize(FilterHolder.java:136)
	at org.eclipse.jetty.servlet.ServletHandler.lambda$initialize$0(ServletHandler.java:750)
	at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
	at java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:742)
	at java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:742)
	at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580)
	at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:744)
	at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:369)
	at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1497)
	at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1459)
	at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:854)
	at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:278)
	at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:545)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:167)
	at org.eclipse.jetty.server.Server.start(Server.java:418)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:110)
	at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
	at org.eclipse.jetty.server.Server.doStart(Server.java:382)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
	at org.nutz.boot.starter.jetty.JettyStarter.start(JettyStarter.java:160)
	at org.nutz.boot.AppContext.startServers(AppContext.java:310)
	at org.nutz.boot.NbApp.execute(NbApp.java:210)
	at org.nutz.boot.NbApp.run(NbApp.java:182)
	at cn.wizzer.app.web.commons.core.MainLauncher.main(MainLauncher.java:35)
Caused by: org.nutz.lang.born.BorningException: Fail to born or cast to 'org.nutz.dao.Dao'
 by args: []
 because: No suitable Constructor or Factory Method!!
	at org.nutz.lang.Mirror.getBorning(Mirror.java:983)
	at org.nutz.mvc.adaptor.injector.ObjectPairInjector.<init>(ObjectPairInjector.java:39)
	at org.nutz.mvc.adaptor.PairAdaptor.evalInjectorBy(PairAdaptor.java:57)
	at org.nutz.mvc.upload.UploadAdaptor.evalInjectorBy(UploadAdaptor.java:165)
	at org.nutz.mvc.adaptor.AbstractAdaptor.evalInjector(AbstractAdaptor.java:221)
	at org.nutz.mvc.adaptor.AbstractAdaptor.init(AbstractAdaptor.java:160)
	at org.nutz.mvc.adaptor.AbstractAdaptor.init(AbstractAdaptor.java:81)
	at org.nutz.mvc.upload.UploadAdaptor.init(UploadAdaptor.java:215)
	at org.nutz.mvc.impl.processor.AdaptorProcessor.evalHttpAdaptor(AdaptorProcessor.java:46)
	at org.nutz.mvc.impl.processor.AdaptorProcessor.init(AdaptorProcessor.java:22)
	at org.nutz.mvc.impl.NutActionChainMaker.eval(NutActionChainMaker.java:38)
	at org.nutz.mvc.impl.UrlMappingImpl.add(UrlMappingImpl.java:54)
	at org.nutz.mvc.impl.NutLoading.evalUrlMapping(NutLoading.java:205)
	at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:108)
	... 29 common frames omitted
12 回复

是不是写了@IocBy

另外,nutzboot项目不要手动添加nutz依赖!

@wendal 没写@IocBy

@IocBean(create="init", depose="depose")
@Modules(packages = "cn.wizzer")
@Localization(value = "locales/", defaultLocalizationKey = "zh_CN")
@Encoding(input = "UTF-8", output = "UTF-8")
@Views({BeetlViewMaker.class, PdfViewMaker.class})
@ChainBy(args = "chain/nutzwk-mvc-chain.json")
@SessionBy(ShiroSessionProvider.class)
public class MainLauncher {

    @Inject
    protected PropertiesProxy conf;
    @Inject
    protected Dao dao;

    public void init() {
    }
    public void depose() {}

    public static void main(String[] args) throws Exception {
        //new NbApp().setArgs(args).setPrintProcDoc(true).run();
        NbApp nb = new NbApp().setArgs(args).setPrintProcDoc(true);
        nb.getAppContext().setMainPackage("cn.wizzer");
        nb.run();
    }

}

加nutzboot-starter-nutz-dao 了吗?

@wendal 从官网下来的时候自带着了,检查过了,

public java.lang.Object cn.wizzer.app.web.modules.controllers.platform.zswres.ZswresVectorbasicinfoController.addDo(cn.wizzer.app.zswres.modules.models.Zswres_vectorbasicinfo,org.nutz.mvc.upload.TempFile,org.nutz.mvc.upload.TempFile,org.nutz.mvc.upload.TempFile,javax.servlet.http.HttpServletRequest,org.nutz.dao.Dao)

入口方法放个Dao属性干毛线, 去掉

@wendal ,还有一个小小的疑问,我按照v5-mini中,将views文件放到resources下,然后application.properties中这样配置,但是找不到模板

beetl.RESOURCE_LOADER=org.beetl.core.resource.WebAppResourceLoader
beetl.ENGINE=org.beetl.core.engine.DefaultTemplateEngine
beetl.RESOURCE.root= views/
beetl.RESOURCE.functionSuffix = html
beetl.RESOURCE.autoCheck= true
beetl.DELIMITER_STATEMENT_START=<%
beetl.DELIMITER_STATEMENT_END=%>
21:38:19.606 [qtp2064883371-35] DEBUG org.apache.shiro.web.servlet.SimpleCookie - Added HttpServletResponse Cookie [sid=2ppogrocqkgc9oncu60pa3pk65; Path=/; Max-Age=946080000; Expires=Thu, 05-Aug-2049 13:38:19 GMT; HttpOnly]
TEMPLATE_LOAD_ERROR
	at org.beetl.core.resource.FileResource.openReader(FileResource.java:45)
	at org.beetl.core.GroupTemplate.loadTemplate(GroupTemplate.java:646)
	at org.beetl.core.GroupTemplate.getTemplateByLoader(GroupTemplate.java:595)
	at org.beetl.core.GroupTemplate.getTemplate(GroupTemplate.java:559)
	at org.beetl.ext.web.WebRender.render(WebRender.java:86)
	at org.beetl.ext.nutz.BeetlView.render(BeetlView.java:28)
	at org.nutz.mvc.view.ViewZone.render(ViewZone.java:53)
	at org.nutz.mvc.impl.processor.ViewProcessor.process(ViewProcessor.java:60)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.MethodInvokeProcessor.process(MethodInvokeProcessor.java:33)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.AdaptorProcessor.process(AdaptorProcessor.java:38)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.ActionFiltersProcessor.process(ActionFiltersProcessor.java:58)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at cn.wizzer.app.web.commons.processor.XssSqlFilterProcessor.process(XssSqlFilterProcessor.java:37)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at cn.wizzer.app.web.commons.processor.NutShiroProcessor.process(NutShiroProcessor.java:52)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.java:123)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.EncodingProcessor.process(EncodingProcessor.java:27)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor.process(UpdateRequestAttributesProcessor.java:15)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at cn.wizzer.app.web.commons.processor.GlobalsSettingProcessor.process(GlobalsSettingProcessor.java:36)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at cn.wizzer.app.web.commons.processor.LogTimeProcessor.process(LogTimeProcessor.java:21)
	at org.nutz.mvc.impl.NutActionChain.doChain(NutActionChain.java:44)
	at org.nutz.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:67)
	at org.nutz.mvc.ActionHandler.handle(ActionHandler.java:31)
	at org.nutz.mvc.NutFilter.doFilter(NutFilter.java:202)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1610)
	at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
	at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
	at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
	at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
	at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383)
	at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
	at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1610)
	at com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:124)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1610)
	at org.nutz.mvc.WhaleFilter.doFilter(WhaleFilter.java:171)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1602)
	at org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:214)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1610)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:540)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146)
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1711)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1347)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:480)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1678)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1249)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
	at org.eclipse.jetty.server.Server.handle(Server.java:505)
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:370)
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:267)
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:305)
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
	at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:781)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:917)
	at java.lang.Thread.run(Thread.java:748)
21:38:19.705 [qtp2064883371-35] DEBUG org.beetl.ext.nutz.LogErrorHandler -  模板根目录为 G:\studyCodeSpace\slope\
>>09:38:19:错找不到指定模板或者加载错(TEMPLATE_LOAD_ERROR): 位于0行 资源:/platform/sys/login.html 模板根目录为 G:\studyCodeSpace\slope\
WebAppResourceLoader,Root=G:\studyCodeSpace\slope\

怎么有那么多空格

mini里面的beetl肯定不是这样配的啦,统统删掉

@wendal 参考社区里面的类似的问题,解决了上面的问题。
根据v5-mini中PlatformAuthorizingRealm相关代码,获取userservice为null

/**
 * Created by wizzer on 2017/1/11.
 */
@IocBean(name = "platformRealm")
public class PlatformAuthorizingRealm extends AuthorizingRealm {
    private static final Log log = Logs.get();
    @Inject
    private SysUserService sysUserService;
    @Inject
    private SysRoleService sysRoleService;
    @Inject
    private RedisService redisService;

    protected SysUserService getUserService() {
        return sysUserService;
    }

    protected SysRoleService getRoleService() {
        return sysRoleService;
    }

    protected RedisService getRedisService() {
        return redisService;
    }

@wendal 哦,可以了,忘了加上@Inject,粗心大意了

能弄好就行

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