JFinal启动报错

"C:\Program Files\Java\jdk1.7.0_80\bin\java.exe" -Dfile.encoding=UTF-8 "-javaagent:F:\idea\IntelliJ IDEA 2019.2\lib\idea_rt.jar=56464:F:\idea\IntelliJ IDEA 2019.2\bin" -classpath "F:\idea\IntelliJ IDEA 2019.2\lib\idea_rt.jar" com.intellij.rt.execution.CommandLineWrapper C:\Users\lenovo\AppData\Local\Temp\idea_classpath420345026 com.jfinal.core.JFinal WebRoot 80 / 5

Starting JFinal 2.0

Starting scanner at interval of 5 seconds.

Starting web server on port: 80

Starting Shiro environment initialization.

Shiro environment initialization failed

org.apache.shiro.config.ConfigurationException: Unable to set property 'credentialsMatcher' with value [org.apache.shiro.authc.credential.PasswordMatcher@92d4709] on object of type com.dhcfaster.yueyun.shiro.ShiroDbRealm.  If 'org.apache.shiro.authc.credential.PasswordMatcher@92d4709' is a reference to another (previously defined) object, prefix it with '$' to indicate that the referenced object should be used as the actual value.  For example, $org.apache.shiro.authc.credential.PasswordMatcher@92d4709

at org.apache.shiro.config.ReflectionBuilder.setProperty(ReflectionBuilder.java:501)

at org.apache.shiro.config.ReflectionBuilder.applyProperty(ReflectionBuilder.java:450)

at org.apache.shiro.config.ReflectionBuilder.applyProperty(ReflectionBuilder.java:562)

at org.apache.shiro.config.ReflectionBuilder.applySingleProperty(ReflectionBuilder.java:206)

at org.apache.shiro.config.ReflectionBuilder.applyProperty(ReflectionBuilder.java:167)

at org.apache.shiro.config.ReflectionBuilder.buildObjects(ReflectionBuilder.java:124)

at org.apache.shiro.config.IniSecurityManagerFactory.buildInstances(IniSecurityManagerFactory.java:161)

at org.apache.shiro.config.IniSecurityManagerFactory.createSecurityManager(IniSecurityManagerFactory.java:124)

at org.apache.shiro.config.IniSecurityManagerFactory.createSecurityManager(IniSecurityManagerFactory.java:102)

at org.apache.shiro.config.IniSecurityManagerFactory.createInstance(IniSecurityManagerFactory.java:88)

at org.apache.shiro.config.IniSecurityManagerFactory.createInstance(IniSecurityManagerFactory.java:46)

at org.apache.shiro.config.IniFactorySupport.createInstance(IniFactorySupport.java:123)

at org.apache.shiro.util.AbstractFactory.getInstance(AbstractFactory.java:47)

at org.apache.shiro.web.env.IniWebEnvironment.createWebSecurityManager(IniWebEnvironment.java:203)

org.apache.shiro.config.ConfigurationException: Unable to set property 'credentialsMatcher' with value [org.apache.shiro.authc.credential.PasswordMatcher@92d4709] on object of type com.dhcfaster.yueyun.shiro.ShiroDbRealm.  If 'org.apache.shiro.authc.credential.PasswordMatcher@92d4709' is a reference to another (previously defined) object, prefix it with '$' to indicate that the referenced object should be used as the actual value.  For example, $org.apache.shiro.authc.credential.PasswordMatcher@92d4709

at org.apache.shiro.web.env.IniWebEnvironment.configure(IniWebEnvironment.java:99)

at org.apache.shiro.config.ReflectionBuilder.setProperty(ReflectionBuilder.java:501)

at org.apache.shiro.web.env.IniWebEnvironment.init(IniWebEnvironment.java:92)

at org.apache.shiro.config.ReflectionBuilder.applyProperty(ReflectionBuilder.java:450)

at org.apache.shiro.util.LifecycleUtils.init(LifecycleUtils.java:45)

at org.apache.shiro.config.ReflectionBuilder.applyProperty(ReflectionBuilder.java:562)

at org.apache.shiro.config.ReflectionBuilder.applySingleProperty(ReflectionBuilder.java:206)

at org.apache.shiro.util.LifecycleUtils.init(LifecycleUtils.java:40)

at org.apache.shiro.config.ReflectionBuilder.applyProperty(ReflectionBuilder.java:167)

at org.apache.shiro.config.ReflectionBuilder.buildObjects(ReflectionBuilder.java:124)

at org.apache.shiro.web.env.EnvironmentLoader.createEnvironment(EnvironmentLoader.java:221)

at org.apache.shiro.web.env.EnvironmentLoader.initEnvironment(EnvironmentLoader.java:133)

at org.apache.shiro.config.IniSecurityManagerFactory.buildInstances(IniSecurityManagerFactory.java:161)

at org.apache.shiro.config.IniSecurityManagerFactory.createSecurityManager(IniSecurityManagerFactory.java:124)

at org.apache.shiro.config.IniSecurityManagerFactory.createSecurityManager(IniSecurityManagerFactory.java:102)

at org.apache.shiro.web.env.EnvironmentLoaderListener.contextInitialized(EnvironmentLoaderListener.java:58)

at org.apache.shiro.config.IniSecurityManagerFactory.createInstance(IniSecurityManagerFactory.java:88)

at org.apache.shiro.config.IniSecurityManagerFactory.createInstance(IniSecurityManagerFactory.java:46)

at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:771)

at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:424)

at org.apache.shiro.config.IniFactorySupport.createInstance(IniFactorySupport.java:123)

at org.apache.shiro.util.AbstractFactory.getInstance(AbstractFactory.java:47)

at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:763)

at org.apache.shiro.web.env.IniWebEnvironment.createWebSecurityManager(IniWebEnvironment.java:203)

at org.apache.shiro.web.env.IniWebEnvironment.configure(IniWebEnvironment.java:99)

at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:249)

at org.apache.shiro.web.env.IniWebEnvironment.init(IniWebEnvironment.java:92)

at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)

at org.apache.shiro.util.LifecycleUtils.init(LifecycleUtils.java:45)

at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:706)

at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:492)

at org.apache.shiro.util.LifecycleUtils.init(LifecycleUtils.java:40)

at org.apache.shiro.web.env.EnvironmentLoader.createEnvironment(EnvironmentLoader.java:221) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)

at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)

at org.eclipse.jetty.server.Server.doStart(Server.java:277)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)

at com.jfinal.server.JettyServer.doStart(JettyServer.java:121)

at com.jfinal.server.JettyServer.start(JettyServer.java:64)


at com.jfinal.core.JFinal.main(JFinal.java:159)

at org.apache.shiro.web.env.EnvironmentLoader.initEnvironment(EnvironmentLoader.java:133)

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

at org.apache.shiro.web.env.EnvironmentLoaderListener.contextInitialized(EnvironmentLoaderListener.java:58)

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

at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:771)

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

at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:424)

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

at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:763)

at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:249)

at com.intellij.rt.execution.CommandLineWrapper.main(CommandLineWrapper.java:66)

Caused by: java.lang.IllegalArgumentException: Cannot invoke org.apache.shiro.realm.AuthenticatingRealm.setCredentialsMatcher on bean class 'class com.dhcfaster.yueyun.shiro.ShiroDbRealm' - argument type mismatch - had objects of type "org.apache.shiro.authc.credential.PasswordMatcher" but expected signature "org.apache.shiro.authc.credential.CredentialsMatcher"

at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)

at org.apache.commons.beanutils.PropertyUtilsBean.invokeMethod(PropertyUtilsBean.java:2181)

at org.apache.commons.beanutils.PropertyUtilsBean.setSimpleProperty(PropertyUtilsBean.java:2097)

at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:706)

at org.apache.commons.beanutils.PropertyUtilsBean.setNestedProperty(PropertyUtilsBean.java:1903)

at org.apache.commons.beanutils.PropertyUtilsBean.setProperty(PropertyUtilsBean.java:2010)

at org.apache.commons.beanutils.BeanUtilsBean.setProperty(BeanUtilsBean.java:1011)

at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:492)

at org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:454)

at org.apache.shiro.config.ReflectionBuilder.setProperty(ReflectionBuilder.java:493)

... 39 more

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)

Caused by: java.lang.IllegalArgumentException: argument type mismatch

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

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

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

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

at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)

at org.apache.commons.beanutils.PropertyUtilsBean.invokeMethod(PropertyUtilsBean.java:2116)

... 45 more

at org.eclipse.jetty.server.Server.doStart(Server.java:277)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)

at com.jfinal.server.JettyServer.doStart(JettyServer.java:121)

at com.jfinal.server.JettyServer.start(JettyServer.java:64)

at com.jfinal.core.JFinal.main(JFinal.java:159)

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

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

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

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

at com.intellij.rt.execution.CommandLineWrapper.main(CommandLineWrapper.java:66)

Caused by: java.lang.IllegalArgumentException: Cannot invoke org.apache.shiro.realm.AuthenticatingRealm.setCredentialsMatcher on bean class 'class com.dhcfaster.yueyun.shiro.ShiroDbRealm' - argument type mismatch - had objects of type "org.apache.shiro.authc.credential.PasswordMatcher" but expected signature "org.apache.shiro.authc.credential.CredentialsMatcher"

at org.apache.commons.beanutils.PropertyUtilsBean.invokeMethod(PropertyUtilsBean.java:2181)

at org.apache.commons.beanutils.PropertyUtilsBean.setSimpleProperty(PropertyUtilsBean.java:2097)

at org.apache.commons.beanutils.PropertyUtilsBean.setNestedProperty(PropertyUtilsBean.java:1903)

at org.apache.commons.beanutils.PropertyUtilsBean.setProperty(PropertyUtilsBean.java:2010)

at org.apache.commons.beanutils.BeanUtilsBean.setProperty(BeanUtilsBean.java:1011)

at org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:454)

at org.apache.shiro.config.ReflectionBuilder.setProperty(ReflectionBuilder.java:493)

... 39 more

Caused by: java.lang.IllegalArgumentException: argument type mismatch

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

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

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

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

at org.apache.commons.beanutils.PropertyUtilsBean.invokeMethod(PropertyUtilsBean.java:2116)

... 45 more


Process finished with exit code 100




报错加载的Shiro.ini有问题 百度的说 

sessionIdCookie=sessionIdCookie.name=sessionIdCookie.path=sessionIdCookie.maxAge=sessionIdCookie.httpOnly=passwordService = passwordMatcher = passwordMatcher.passwordService = shiroDbRealm = shiroDbRealm.credentialsMatcher = securityManager.realms = authcStrategy = securityManager.authenticator.authenticationStrategy = cacheManager = cacheManager.cacheManagerConfigFile=securityManager.cacheManager =

重复创建了???

评论区

JFinal

2019-11-08 14:52

应该是 shiro 配置的问题,异常提示:
Caused by: java.lang.IllegalArgumentException: argument type mismatch

参数类型不匹配

热门反馈

扫码入社