NutzCN Logo
问答 请问一下nutz1.r.61 整合dubbo 报org.nutz.ioc.IocException: IocBean[service.sys.1] 异常?
发布于 37天前 作者 qq_221027b7 346 次浏览 复制 上一个帖子 下一个帖子
标签: nutzwk

七月 13, 2019 6:14:36 下午 org.apache.tomcat.util.digester.SetPropertiesRule begin
警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:wxjz_server' did not find a matching property.
七月 13, 2019 6:14:36 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server version: Apache Tomcat/8.5.34
七月 13, 2019 6:14:36 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server built: Sep 4 2018 22:28:22 UTC
七月 13, 2019 6:14:36 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server number: 8.5.34.0
七月 13, 2019 6:14:36 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: OS Name: Windows 10
七月 13, 2019 6:14:36 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: OS Version: 10.0
七月 13, 2019 6:14:36 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Architecture: amd64
七月 13, 2019 6:14:36 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Java Home: C:\Program Files\Java\jre1.8.0_111
七月 13, 2019 6:14:36 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: JVM Version: 1.8.0_111-b14
七月 13, 2019 6:14:36 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: JVM Vendor: Oracle Corporation
七月 13, 2019 6:14:36 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: CATALINA_BASE: D:\work\zjxx\workspace.metadata.plugins\org.eclipse.wst.server.core\tmp0
七月 13, 2019 6:14:36 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: CATALINA_HOME: D:\tools\apache-tomcat-8.5.34
七月 13, 2019 6:14:36 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dcatalina.base=D:\work\zjxx\workspace.metadata.plugins\org.eclipse.wst.server.core\tmp0
七月 13, 2019 6:14:36 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dcatalina.home=D:\tools\apache-tomcat-8.5.34
七月 13, 2019 6:14:36 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dwtp.deploy=D:\work\zjxx\workspace.metadata.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps
七月 13, 2019 6:14:36 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Djava.endorsed.dirs=D:\tools\apache-tomcat-8.5.34\endorsed
七月 13, 2019 6:14:36 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dfile.encoding=GBK
七月 13, 2019 6:14:36 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [C:\Program Files\Java\jre1.8.0_111\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:/Program Files/Java/jre1.8.0_111/bin/server;C:/Program Files/Java/jre1.8.0_111/bin;C:/Program Files/Java/jre1.8.0_111/lib/amd64;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;D:\tools\apache-maven-3.5.4\bin;C:\Program Files\Java\jdk1.8.0_111\bin;C:\Program Files\Java\jdk1.8.0_111\jre\bin;C:\WINDOWS\System32\OpenSSH\;D:\workspace\cms\nodejs\node_global\node_modules;D:\workspace\cms\nodejs\;C:\Program Files\Java\jdk1.8.0_111\bin;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies\;C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\;D:\Program Files\Git\cmd;C:\Program Files\TortoiseGit\bin;C:\Users\ll.app\;C:\Users\ll\AppData\Local\Microsoft\WindowsApps;D:\workspace\cms\nodejs\node_global;C:\Users\ll\AppData\Roaming\npm;C:\Users\ll\AppData\Local\Programs\EmEditor;C:\Users\ll\Desktop;;.]
七月 13, 2019 6:14:36 下午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["http-nio-8081"]
七月 13, 2019 6:14:36 下午 org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
信息: Using a shared selector for servlet write/read
七月 13, 2019 6:14:36 下午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["https-jsse-nio-8443"]
七月 13, 2019 6:14:37 下午 org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
信息: Using a shared selector for servlet write/read
七月 13, 2019 6:14:37 下午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["ajp-nio-8009"]
七月 13, 2019 6:14:37 下午 org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
信息: Using a shared selector for servlet write/read
七月 13, 2019 6:14:37 下午 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 1906 ms
七月 13, 2019 6:14:37 下午 org.apache.catalina.core.StandardService startInternal
信息: Starting service [Catalina]
七月 13, 2019 6:14:37 下午 org.apache.catalina.core.StandardEngine startInternal
信息: Starting Servlet Engine: Apache Tomcat/8.5.34
七月 13, 2019 6:14:42 下午 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.
七月 13, 2019 6:14:53 下午 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.
七月 13, 2019 6:14:53 下午 org.apache.catalina.core.ApplicationContext log
信息: No Spring WebApplicationInitializer types detected on classpath
七月 13, 2019 6:14:53 下午 org.apache.catalina.core.ApplicationContext log
信息: Initializing Shiro environment
2019-07-13 18:14:53,692 org.apache.shiro.config.ReflectionBuilder.createNewInstance(ReflectionBuilder.java:138) INFO - An instance with name 'authc' already exists. Redefining this object as a new instance of type cn.server.app.web.commons.shiro.filter.PlatformAuthenticationFilter
2019-07-13 18:14:54,515 org.apache.shiro.config.IniSecurityManagerFactory.isAutoApplyRealms(IniSecurityManagerFactory.java:112) INFO - Realms have been explicitly set on the SecurityManager instance - auto-setting of realms will not occur.
2019-07-13 18:14:54,540 org.nutz.mvc.NutFilter._init(NutFilter.java:85) INFO - NutFilter[nutz] starting ...
2019-07-13 18:14:54,849 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:55) INFO - Nutz Version : 1.r.61-SNAPSHOT
2019-07-13 18:14:54,849 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:56) INFO - Nutz.Mvc[nutz] is initializing ...
2019-07-13 18:14:55,647 org.nutz.ioc.loader.annotation.AnnotationIocLoader.(AnnotationIocLoader.java:50) INFO - Found 117 classes in 1 base-packages!
beans = ["wxTplListController", "redisService", "uploadController", "wxReplyTxtServiceImpl", "cmsChannelTag", "wxReplyNewsServiceImpl", "sysLoginController", "wxTplLogServiceImpl", "sysUserServiceImpl", "cmsArticlelListTag", "dateTag", "dateUtil", "sysRoleServiceImpl", "qrcodeService", "sysRouteController", "idcardUtil", "cmsTplController", "cmsController", "cmsChannelServiceImpl", "cmsArticleController", "wxMenuController", "weixinController", "code128Util", "wxMsgReplyServiceImpl", "cmsLinkClassController", "cmsArticleServiceImpl", "wxReplyController", "cmsFwClController", "sysConfigServiceImpl", "cookieUtil", "wxMsgServiceImpl", "cmsTplServiceImpl", "wxReplyServiceImpl", "bdController", "cmsGrapController", "cmsArticleTag", "cmsWenjuanXuanxiangServiceImpl", "grapService", "sysTaskController", "cmsSiteController", "cmsGrapHistoryController", "sysDictServiceImpl", "wxConfigServiceImpl", "apiTestController", "sysMenuController", "cmsSiteServiceImpl", "cmsLinkController", "sysRoleController", "cmsWenjuanReplayServiceImpl", "wechatController", "sysUnitController", "cmsFwClServiceImpl", "wxMsgUserController", "cmsTplVersionServiceImpl", "sysDictController", "wxMassSendServiceImpl", "cmsGrapServiceImpl", "wxConfigController", "stringUtil", "wxTplListServiceImpl", "cmsChannelListTag", "tplService", "sysPluginServiceImpl", "wxUserServiceImpl", "sysHelloService", "jedisAgent", "cmsArticleFwServiceImpl", "cmsGrapHistoryServiceImpl", "captchaModule", "dynamicInterceptor", "nutShiroMethodInterceptor", "sysLogController", "wxMassController", "emailService", "wxMenuServiceImpl", "wxReplyNewsController", "cmsLinkClassServiceImpl", "grapJob", "sysRouteServiceImpl", "sysHomeController", "wxMassNewsServiceImpl", "wxMassServiceImpl", "sysMenuServiceImpl", "wxHandler", "cmsChannelController", "wxController", "ifTag", "sysTaskServiceImpl", "sysLogServiceImpl", "wxTplIdServiceImpl", "cmsWenjuanController", "shiroUtil", "$aop_syslog", "wxReplyTxtController", "cmsWenjuanServiceImpl", "cmsWenjuanDaanServiceImpl", "cmsWenjuanWentiServiceImpl", "sysPluginController", "pubSubService", "wxTplLogController", "sysApiServiceImpl", "wxUserController", "sLogService", "tokenController", "sysApiController", "cmsLinkServiceImpl", "sysUnitServiceImpl", "wxTplIdController", "cmsSurveyController", "cmsGrapHistoryDetailServiceImpl", "cmsGrapDetailController", "sysUserController", "platformAuthorizingRealm", "sysConfController", "pluginMaster", "testJob", "$aop_1_plugin"]
2019-07-13 18:14:55,715 org.nutz.ioc.impl.NutIoc.(NutIoc.java:98) INFO - NutIoc init begin ...
2019-07-13 18:14:55,721 org.nutz.ioc.impl.NutIoc.(NutIoc.java:115) INFO - ... NutIoc init complete
2019-07-13 18:14:55,729 org.nutz.mvc.impl.NutLoading.evalUrlMapping(NutLoading.java:159) INFO - Build URL mapping by org.nutz.mvc.impl.UrlMappingImpl ...
2019-07-13 18:14:57,187 org.nutz.filepool.NutFilePool.(NutFilePool.java:23) INFO - Init file-pool by: ~/nutzwk/upload/tmp [1000]
2019-07-13 18:14:57,198 org.nutz.filepool.NutFilePool.(NutFilePool.java:66) INFO - file-pool.cursor: 34
2019-07-13 18:14:57,294 org.nutz.mvc.impl.UrlMappingImpl.add(UrlMappingImpl.java:68) WARN - Duplicate @At mapping ? path=/platform/cms/wenjuan/addWenti/?
2019-07-13 18:14:58,400 com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:785) INFO - {dataSource-1} inited
2019-07-13 18:14:58,756 org.nutz.filepool.NutFilePool.(NutFilePool.java:23) INFO - Init file-pool by: C:\Users\ll/.nutz/tmp/dao/ [200000]
2019-07-13 18:14:58,757 org.nutz.filepool.NutFilePool.(NutFilePool.java:66) INFO - file-pool.cursor: 0
2019-07-13 18:14:59,028 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
2019-07-13 18:14:59,706 org.nutz.mvc.impl.NutLoading.evalUrlMapping(NutLoading.java:217) INFO - Found 321 module methods
2019-07-13 18:14:59,721 org.nutz.mvc.impl.NutLoading.createSessionProvider(NutLoading.java:410) INFO - SessionBy --> cn.server.framework.shiro.ShiroSessionProvider@219facd6
2019-07-13 18:14:59,721 org.nutz.mvc.impl.NutLoading.evalSetup(NutLoading.java:271) INFO - Setup application...
2019-07-13 18:14:59,723 cn.server.app.web.commons.core.Setup.init(Setup.java:49) WARN - This project must run in UTF-8, pls add -Dfile.encoding=UTF-8 to JAVA_OPTS
2019-07-13 18:15:01,245 org.quartz.impl.StdSchedulerFactory.instantiate(StdSchedulerFactory.java:1172) INFO - Using default implementation for ThreadExecutor
2019-07-13 18:15:01,255 org.quartz.simpl.SimpleThreadPool.initialize(SimpleThreadPool.java:268) INFO - Job execution threads will use class loader of thread: localhost-startStop-1
2019-07-13 18:15:01,277 org.quartz.core.SchedulerSignalerImpl.(SchedulerSignalerImpl.java:61) INFO - Initialized Scheduler Signaller of type: class org.quartz.core.SchedulerSignalerImpl
2019-07-13 18:15:01,278 org.quartz.core.QuartzScheduler.(QuartzScheduler.java:240) INFO - Quartz Scheduler v.2.2.3 created.
2019-07-13 18:15:01,279 org.quartz.plugins.management.ShutdownHookPlugin.initialize(ShutdownHookPlugin.java:120) INFO - Registering Quartz shutdown hook.
2019-07-13 18:15:01,282 org.quartz.impl.jdbcjobstore.JobStoreSupport.initialize(JobStoreSupport.java:667) INFO - Using db table-based data access locking (synchronization).
2019-07-13 18:15:01,288 org.quartz.impl.jdbcjobstore.JobStoreTX.initialize(JobStoreTX.java:59) INFO - JobStoreTX initialized.
2019-07-13 18:15:01,288 org.quartz.core.QuartzScheduler.initialize(QuartzScheduler.java:305) INFO - Scheduler meta-data: Quartz Scheduler (v2.2.3) 'defaultScheduler' with instanceId 'DESKTOP-0Q21F251563012901253'
Scheduler class: 'org.quartz.core.QuartzScheduler' - running locally.
NOT STARTED.
Currently in standby mode.
Number of jobs executed: 0
Using thread pool 'org.quartz.simpl.SimpleThreadPool' - with 2 threads.
Using job-store 'org.quartz.impl.jdbcjobstore.JobStoreTX' - which supports persistence. and is clustered.

2019-07-13 18:15:01,288 org.quartz.impl.StdSchedulerFactory.instantiate(StdSchedulerFactory.java:1327) INFO - Quartz scheduler 'defaultScheduler' initialized from default resource file in Quartz package: 'quartz.properties'
2019-07-13 18:15:01,288 org.quartz.impl.StdSchedulerFactory.instantiate(StdSchedulerFactory.java:1331) INFO - Quartz scheduler version: 2.2.3
2019-07-13 18:15:01,400 org.quartz.core.QuartzScheduler.setJobFactory(QuartzScheduler.java:2311) INFO - JobFactory set to: org.nutz.integration.quartz.NutQuartzJobFactory@56c11af6
2019-07-13 18:15:01,519 org.quartz.impl.jdbcjobstore.JobStoreSupport.logWarnIfNonZero(JobStoreSupport.java:3583) INFO - ClusterManager: detected 1 failed or restarted instances.
2019-07-13 18:15:01,520 org.quartz.impl.jdbcjobstore.JobStoreSupport.clusterRecover(JobStoreSupport.java:3442) INFO - ClusterManager: Scanning for instance "DESKTOP-0Q21F251563012731074"'s failed in-progress jobs.
2019-07-13 18:15:01,537 org.quartz.core.QuartzScheduler.start(QuartzScheduler.java:575) INFO - Scheduler defaultScheduler_$_DESKTOP-0Q21F251563012901253 started.
2019-07-13 18:15:02,049 org.nutz.ioc.loader.annotation.AnnotationIocLoader.(AnnotationIocLoader.java:55) WARN - NONE Annotation-Class found!! Check your ioc configure!! packages=[com.sunivo.nutzdubbo.services, com.sunivo.messagecenter.services]
2019-07-13 18:15:02,055 org.nutz.ioc.impl.NutIoc.(NutIoc.java:98) INFO - NutIoc init begin ...
2019-07-13 18:15:02,056 org.nutz.ioc.impl.NutIoc.(NutIoc.java:115) INFO - ... NutIoc init complete
2019-07-13 18:15:02,311 INFO - using logger: com.alibaba.dubbo.common.logger.log4j.Log4jLoggerAdapter
Exception in thread "Thread-8" org.nutz.ioc.IocException: IocBean[service.sys.1] throw Exception when creating
at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:149)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:210)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:239)
at cn.server.app.web.commons.core.Setup$1.run(Setup.java:821)
Caused by: java.lang.RuntimeException: IocBean[service.sys.1] fail at field=[ref]
at org.nutz.ioc.weaver.FieldInjector.inject(FieldInjector.java:40)
at org.nutz.ioc.weaver.DefaultWeaver.fill(DefaultWeaver.java:56)
at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:135)
... 3 more
Caused by: org.nutz.ioc.IocException: IocBean[sysHelloService] For object [sysHelloService] - type:[]
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:218)
at org.nutz.ioc.val.ReferValue.get(ReferValue.java:24)
at org.nutz.ioc.weaver.FieldInjector.inject(FieldInjector.java:32)
... 5 more
Caused by: org.nutz.ioc.ObjectLoadException: Object 'sysHelloService' without define!
at org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:166)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:180)
... 7 more

6 回复

sysHelloService是怎样定义的,记得用插入代码按钮呀

import cn.common.app.sys.modules.models.Sys_sayHello;
import cn.server.app.sys.modules.services.SysHelloService;
import cn.common.framework.base.service.BaseServiceImpl;
import org.nutz.dao.Dao;
import org.nutz.ioc.loader.annotation.IocBean;

@IocBean(args = {"refer:dao"},name = "sysHelloService")
public class SysHelloServiceImpl extends BaseServiceImpl<Sys_sayHello> implements SysHelloService {

    public SysHelloServiceImpl(Dao dao) {
        super(dao);
    }


    @Override
    public void say(Sys_sayHello sys_sayHello) {
        System.out.println(sys_sayHello.getUserName());
    }
}

是nutzwk 4.x改的?

这是provider.js代码

/*
 * 
 */
var provider = {
	provider.application : {
		type : 'com.alibaba.dubbo.config.ApplicationConfig',
		fields : {
			name : 'provider'
		}
	},
	protocol : {
		type : 'com.alibaba.dubbo.config.ProtocolConfig',
		fields : {
			name : 'dubbo',
			port : 9090,
			threads : 200
		}
	},
	baseService :{
		type : 'com.alibaba.dubbo.config.ServiceConfig',
		fields : {
			application : {
				refer : 'provider.application'
			},
			registry : {
				refer : 'registry'
			},
			protocol : {
				refer : 'protocol'
			}
		}
	}
}
这是service.js




/*
*
*/
var service = {
service.sample.1 : {
parent : 'baseService',
fields : {
interfaceName : 'com.sunivo.nutzdubbo.services.IPetService',
ref : {
refer:'petService'
},
version : '1.0.0'
}
},
service.sample.2 : {
parent : 'baseService',
fields : {
interfaceName : 'com.sunivo.nutzdubbo.services.IPetService',
ref : {
refer : 'myPetService'
},
version : '1.0.1'
}
},
service.sample.3 : {
parent : 'baseService',
fields : {
interfaceName : 'com.sunivo.nutzdubbo.services.IHelloService',
ref : {
refer : 'helloService'
},
version : '1.0.0'
}
}
}
这是 consumer.js

var consumer = {
	consumer.application : {
		type : 'com.alibaba.dubbo.config.ApplicationConfig',
		fields : {
			name : 'consumer'
		}
	},
	reference :{
		type :'com.alibaba.dubbo.config.ReferenceConfig',
		singleton : false,
		fields :{
			application : {
				refer : 'consumer.application'
			},
			registry : {
				refer : 'registry',
			}
		}
	}
}

没印象这样配过,找你们项目的同事配一下吧

好的,谢谢!

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