0.0 请问大佬 dubbo在生产环境用main启动,应该如何写,是新启动一个线程还是?
public class DubboStart {
public static void main(String[] args) throws IOException {
ComboIocLoader loader;
try {
loader = new ComboIocLoader("*anno", "com.tiankong","*json", "config/ioc/", "*async", "48","*dubbo", "dubbo-provider.xml");
Ioc ioc = new NutIoc(loader);
Server.getInstance().setIoc(ioc);
Server.getInstance().init();
} catch (Exception e) {
System.out.println("服务启动失败。。。");
e.printStackTrace();
}
}
}
生产环境这样写能行吗。。
@tiankongkm 不报错就是可以啦
@wendal 奥奥,总担心出问题。怕怕的-。-
[ERROR] 21:49:06.957 org.nutz.boot.NbApp.execute(NbApp.java:218) - something happen!!
org.nutz.ioc.IocException: IocBean[dubboManager] For object [dubboManager] - type:[class org.nutz.integration.dubbo.DubboManager]
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 org.nutz.boot.starter.dubbo.DubboStarter.start(DubboStarter.java:17)
at org.nutz.boot.AppContext.startServers(AppContext.java:306)
at org.nutz.boot.NbApp.execute(NbApp.java:204)
at org.nutz.boot.NbApp.run(NbApp.java:177)
at cn.wizzer.app.sys.commons.core.DubboRpcSysMainLauncher.main(DubboRpcSysMainLauncher.java:39)
Caused by: org.nutz.ioc.ObjectLoadException: Object 'dubboManager' without define!
at org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:157)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:195)
... 7 more
[INFO ] 21:49:06.962 org.nutz.ioc.impl.NutIoc.depose(NutIoc.java:287) - org.nutz.ioc.impl.NutIoc@1902260856 is closing.
linux 运行 java -jar wk-nb-service-sys-5.0.1-SNAPSHOT-jar-with-depen dencies.jar
wk-nb-service-sys 打包:
run as --maven build...---goals--package
报错:
[ERROR] 21:55:35.889 org.nutz.boot.NbApp.execute(NbApp.java:218) - something hap pen!!
org.nutz.ioc.IocException: IocBean[dubboManager] For object [dubboManager] - typ e:[class org.nutz.integration.dubbo.DubboManager]
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 org.nutz.boot.starter.dubbo.DubboStarter.start(DubboStarter.java:17)
at org.nutz.boot.AppContext.startServers(AppContext.java:306)
at org.nutz.boot.NbApp.execute(NbApp.java:204)
at org.nutz.boot.NbApp.run(NbApp.java:177)
at cn.wizzer.app.sys.commons.core.DubboRpcSysMainLauncher.main(DubboRpcS ysMainLauncher.java:39)
Caused by: org.nutz.ioc.ObjectLoadException: Object 'dubboManager' without defin e!
at org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:157 )
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:195)
... 7 more
[INFO ] 21:55:35.894 org.nutz.ioc.impl.NutIoc.depose(NutIoc.java:287) - org.nutz
请问是什么问题?