jfinal 4.9 ActiveRecord 问题~

crud操作报错~

2020-06-19 11:26:46.781 [http-nio-8080-exec-7] ERROR com.jfinal.core.ActionHandler - com.workshop.space.common.controller.LoginController.adminLogin() : /workshop/login/adminLoginjava.lang.RuntimeException: java.lang.NoSuchMethodError: java.lang.Object.adminlogin(Ljava/lang/String;Ljava/lang/String;)Lcom/jfinal/plugin/activerecord/Record;


评论区

仙魔

2020-06-19 13:28

仙魔

2020-06-19 13:46

java.lang.RuntimeException: java.lang.NoSuchMethodError: java.lang.Object.adminlogin(Ljava/lang/String;Ljava/lang/String;)Lcom/jfinal/plugin/activerecord/Record;
at com.jfinal.aop.Invocation.invoke(Invocation.java:113)
at com.jfinal.ext.proxy.CglibCallback.intercept(CglibCallback.java:63)
at com.workshop.space.student.service.UserService$$EnhancerByCGLIB$$426786de.adminlogin()
at com.workshop.space.common.controller.LoginController.adminLogin(LoginController.java:268)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.jfinal.aop.Invocation.invoke(Invocation.java:97)
at com.workshop.space.interceptor.PublicInterceptor.intercept(PublicInterceptor.java:22)
at com.jfinal.aop.Invocation.invoke(Invocation.java:91)
at com.workshop.space.interceptor.LoginInterceptor.intercept(LoginInterceptor.java:48)
at com.jfinal.aop.Invocation.invoke(Invocation.java:91)
at com.workshop.space.interceptor.PublicInterceptor.intercept(PublicInterceptor.java:22)
at com.jfinal.aop.Invocation.invoke(Invocation.java:91)
at com.workshop.space.interceptor.LoginInterceptor.intercept(LoginInterceptor.java:48)
at com.jfinal.aop.Invocation.invoke(Invocation.java:91)
at com.jfinal.core.ActionHandler.handle(ActionHandler.java:89)
at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:90)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:509)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1104)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1520)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1476)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NoSuchMethodError: java.lang.Object.adminlogin(Ljava/lang/String;Ljava/lang/String;)Lcom/jfinal/plugin/activerecord/Record;
at com.workshop.space.student.service.UserService$$EnhancerByCGLIB$$426786de.CGLIB$adminlogin$18()
at com.workshop.space.student.service.UserService$$EnhancerByCGLIB$$426786de$$FastClassByCGLIB$$bd6ec928.invoke()
at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
at com.jfinal.ext.proxy.CglibCallback.lambda$intercept$0(CglibCallback.java:58)
at com.jfinal.ext.proxy.CglibCallback$$Lambda$5/1555271159.call(Unknown Source)
at com.jfinal.aop.Invocation.invoke(Invocation.java:101)
... 36 common frames omitted

仙魔

2020-06-19 13:48

DruidPlugin druidPlugin = new DruidPlugin(p.get("jdbcUrl"), p.get("user"),mingwen);
druidPlugin.setValidationQuery(" select 1 from dual ");
druidPlugin.setTestWhileIdle( true );
druidPlugin.setTestOnReturn(false);
druidPlugin.setTestOnBorrow(false);
plugins.add(druidPlugin);
ActiveRecordPlugin arp = new ActiveRecordPlugin("workShopDateSource",druidPlugin);
ActiveRecordPlugin arp2 = new ActiveRecordPlugin("crm",druidPlugin);
plugins.add(arp);
plugins.add(arp2);
tableMapping(arp);

仙魔

2020-06-19 14:07

public Record adminLogin(String username, String psd) {
String sql = "SELECT AI.ADMIN_ACCOUNT,AI.ADMIN_PASSWORD,AI.ADMIN_ID "
+ "FROM ADMIN_INFO AI "
+ "WHERE AI.ADMIN_ACCOUNT = ? AND AI.ADMIN_PASSWORD= ?
AND is_delete=1 AND forbidden=1 ";
Record result = Db.use("workShopDateSource").findFirst(sql, username, psd);
return result;
}

仙魔

2020-06-19 14:23

哪位大佬看到可以给提个解决方向~

糊搞

2020-06-19 16:42

@仙魔 URL不正确

仙魔

2020-06-19 17:11

@糊搞 怎么说?

糊搞

2020-06-19 17:39

@仙魔 /workshop/login/adminLogin错了

仙魔

2020-06-20 11:58

@糊搞 不应该啊是注解没注入成功~ @Inject

仙魔

2020-06-23 15:42

已从1.9成功升级到了4.9

JFinal

2020-06-23 17:54

热门反馈

扫码入社