当前位置: 首页 > 工具软件 > NutzBoot > 使用案例 >

nutz mysql 关键词_nutzboot如何配置mysql连接呢?

万俟铭
2023-12-01

使用

@Inject

protected Dao dao;

后报如下错误信息:

org.nutz.ioc.IocException: IocBean[mainLauncher] throw Exception when creating

at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:152)

at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:231)

at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:260)

at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:168)

at org.nutz.boot.NbApp._run(NbApp.java:192)

at org.nutz.boot.NbApp.run(NbApp.java:164)

at com.deepdata.linesum.MainLauncher.main(MainLauncher.java:73)

Caused by: java.lang.RuntimeException: IocBean[mainLauncher] fail at field=[dao]

at org.nutz.ioc.weaver.FieldInjector.inject(FieldInjector.java:40)

at org.nutz.ioc.weaver.DefaultWeaver.fill(DefaultWeaver.java:67)

at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:138)

... 6 more

Caused by: org.nutz.ioc.IocException: IocBean[dao -> dataSource] throw Exception when creating

at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:152)

at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:231)

at org.nutz.ioc.val.ReferTypeValue.get(ReferTypeValue.java:60)

at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:64)

at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:231)

at org.nutz.ioc.val.ReferTypeValue.get(ReferTypeValue.java:60)

at org.nutz.ioc.weaver.FieldInjector.inject(FieldInjector.java:32)

... 8 more

Caused by: org.nutz.lang.InvokingException: Fail to invoke [org.nutz.boot.starter.shardingjdbc.ShardingJdbcDataSourceStarter].getDataSource() by args:

For the reason: no such shardingjdbc configure file=shardingjdbc.yaml

at org.nutz.lang.Invoking.invoke(Invoking.java:195)

at org.nutz.lang.Mirror.invoke(Mirror.java:1120)

at org.nutz.ioc.impl.ObjectMakerImpl$1.born(ObjectMakerImpl.java:80)

at org.nutz.ioc.weaver.DefaultWeaver.born(DefaultWeaver.java:78)

at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:117)

... 14 more

Caused by: java.lang.RuntimeException: no such shardingjdbc configure file=shardingjdbc.yaml

at org.nutz.boot.starter.shardingjdbc.ShardingJdbcDataSourceStarter.getDataSource(ShardingJdbcDataSourceStarter.java:40)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.__invoke(DelegatingMethodAccessorImpl.java:43)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java)

at java.lang.reflect.Method.invoke(Method.java:498)

at org.nutz.lang.Invoking$NullArgInvoker.invoke(Invoking.java:77)

at org.nutz.lang.Invoking.invoke(Invoking.java:192)

... 18 more

@Inject

protected Dao dao;

@Inject

protected Dao dao;

 类似资料: