springboot security oauth2 报错 java.lang.IllegalArgumentException: URI must not be null 5C
 2018-11-14 17:12:11.816 [http-nio-8081-exec-1] WARN  o.s.s.o.p.token.RemoteTokenServices-Null Client ID or Client Secret detected. Endpoint that requires authentication will reject request with 401 error. 
2018-11-14 17:12:11.823 [http-nio-8081-exec-1] ERROR o.a.c.c.C.[.[.[.[dispatcherServlet]-Servlet.service() for servlet [dispatcherServlet] in context with path [/smartHome] threw exception 
java.lang.IllegalArgumentException: URI must not be null
    at org.springframework.util.Assert.notNull(Assert.java:193)
    at org.springframework.web.util.UriComponentsBuilder.fromUriString(UriComponentsBuilder.java:197)
    at org.springframework.web.util.DefaultUriBuilderFactory$DefaultUriBuilder.initUriComponentsBuilder(DefaultUriBuilderFactory.java:218)
    at org.springframework.web.util.DefaultUriBuilderFactory$DefaultUriBuilder.<init>(DefaultUriBuilderFactory.java:214)
    at org.springframework.web.util.DefaultUriBuilderFactory.uriString(DefaultUriBuilderFactory.java:197)
    at org.springframework.web.util.DefaultUriBuilderFactory.expand(DefaultUriBuilderFactory.java:191)
    at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:679)
    at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:600)
    at org.springframework.security.oauth2.provider.token.RemoteTokenServices.postForMap(RemoteTokenServices.java:147)
    at org.springframework.security.oauth2.provider.token.RemoteTokenServices.loadAuthentication(RemoteTokenServices.java:106)
    at org.springframework.security.oauth2.provider.authentication.OAuth2AuthenticationManager.authenticate(OAuth2AuthenticationManager.java:83)
    at org.springframework.security.oauth2.provider.authentication.OAuth2AuthenticationProcessingFilter.doFilter(OAuth2AuthenticationProcessingFilter.java:150)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    at com.lx.smarthome.securityoauth.permit.PermitAuthenticationFilter.doFilterInternal(PermitAuthenticationFilter.java:122)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:116)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:66)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:215)
    at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:178)
    at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:357)
    at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:270)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:109)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:93)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:496)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803)
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1468)
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:748)

2个回答

正常情况下:

![![



图片说明](https://img-ask.csdn.net/upload/201811/15/1542243751_545443.png)


图片说明](https://img-ask.csdn.net/upload/201811/15/1542243674_674681.png)

 2018-11-15 08:57:16.697 [http-nio-8081-exec-3] INFO  c.l.s.s.p.PermitAuthenticationFilter-请求信息==== { url : /smartHome/user/Login | remoteAddr : 127.0.0.1 | requestMethod : POST
param : {phone:["13553406767"],code:null,userLoginType["0"]} 
2018-11-15 08:57:16.698 [http-nio-8081-exec-3] DEBUG o.apache.commons.beanutils.BeanUtils-BeanUtils.populate(User{, userId=null, username=null, password=null, phone=null, email=null, salt=null, userGateways=null}, org.apache.catalina.util.ParameterMap@2a18900e) 
2018-11-15 08:57:16.698 [http-nio-8081-exec-3] DEBUG o.a.commons.beanutils.ConvertUtils-Convert string '13553406767' to class 'java.lang.String' 
2018-11-15 08:57:16.698 [http-nio-8081-exec-3] DEBUG o.a.c.b.converters.StringConverter-Converting 'String' value '13553406767' to type 'String' 
2018-11-15 08:57:16.698 [http-nio-8081-exec-3] DEBUG o.a.commons.beanutils.ConvertUtils-Convert string '667788' to class 'java.lang.String' 
2018-11-15 08:57:16.698 [http-nio-8081-exec-3] DEBUG o.a.c.b.converters.StringConverter-Converting 'String' value '667788' to type 'String' 
2018-11-15 08:57:16.698 [http-nio-8081-exec-3] DEBUG o.a.commons.beanutils.ConvertUtils-Convert string '0' to class 'java.lang.String' 
2018-11-15 08:57:16.698 [http-nio-8081-exec-3] DEBUG o.a.c.b.converters.StringConverter-Converting 'String' value '0' to type 'String' 
2018-11-15 08:57:16.698 [http-nio-8081-exec-3] DEBUG org.mybatis.spring.SqlSessionUtils-Creating a new SqlSession 
2018-11-15 08:57:16.698 [http-nio-8081-exec-3] DEBUG org.mybatis.spring.SqlSessionUtils-SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@21c4eece] was not registered for synchronization because synchronization is not active 
2018-11-15 08:57:16.721 [http-nio-8081-exec-3] DEBUG o.m.s.t.SpringManagedTransaction-JDBC Connection [com.alibaba.druid.proxy.jdbc.ConnectionProxyImpl@2c9baf1] will not be managed by Spring 
2018-11-15 08:57:16.721 [http-nio-8081-exec-3] DEBUG c.l.s.a.user.dao.UserMapper.getUser-==>  Preparing: SELECT userId, nickname,username, password, phone, email, salt FROM user where phone=? and username=?  
2018-11-15 08:57:16.722 [http-nio-8081-exec-3] DEBUG c.l.s.a.user.dao.UserMapper.getUser-==> Parameters: 13553406767(String), 13553406767(String) 
2018-11-15 08:57:16.735 [http-nio-8081-exec-3] DEBUG c.l.s.a.user.dao.UserMapper.getUser-<==      Total: 1 

异常情况:

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
springboot与security oauth2整合例子
springboot与security oauth2+jwt控制安全整合例子。。
Tomcat start java.lang.IllegalArgumentException: 'name' must not be null
[code=Java]rnorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'domainObjectDao': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.InstantiationException: could not instantiate test objectcom.lijunjiang.domain.i18n.Translationrn at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessPropertyValues(CommonAnnotationBeanPostProcessor.java:300)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1074)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580)rn at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)rn at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)rn at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)rn at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)rn at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3764)rn at org.apache.catalina.core.StandardContext.start(StandardContext.java:4216)rn at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)rn at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)rn at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)rn at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:626)rn at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:553)rn at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:488)rn at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)rn at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)rn at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)rn at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)rn at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)rn at org.apache.catalina.core.StandardService.start(StandardService.java:448)rn at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)rn at org.apache.catalina.startup.Catalina.start(Catalina.java:552)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:585)rn at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)rn at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)rnCaused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.InstantiationException: could not instantiate test objectcom.lijunjiang.domain.i18n.Translationrn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)rn at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.autowireResource(CommonAnnotationBeanPostProcessor.java:435)rn at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.getResource(CommonAnnotationBeanPostProcessor.java:409)rn at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor$ResourceElement.getResourceToInject(CommonAnnotationBeanPostProcessor.java:541)rn at org.springframework.beans.factory.annotation.InjectionMetadata$InjectedElement.inject(InjectionMetadata.java:156)rn at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:84)rn at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessPropertyValues(CommonAnnotationBeanPostProcessor.java:297)rn ... 37 morernCaused by: org.hibernate.InstantiationException: could not instantiate test objectcom.lijunjiang.domain.i18n.Translationrn at org.hibernate.engine.UnsavedValueFactory.instantiate(UnsavedValueFactory.java:25)rn at org.hibernate.engine.UnsavedValueFactory.getUnsavedIdentifierValue(UnsavedValueFactory.java:44)rn at org.hibernate.tuple.PropertyFactory.buildIdentifierProperty(PropertyFactory.java:44)rn at org.hibernate.tuple.entity.EntityMetamodel.(EntityMetamodel.java:124)rn at org.hibernate.persister.entity.AbstractEntityPersister.(AbstractEntityPersister.java:434)rn at org.hibernate.persister.entity.SingleTableEntityPersister.(SingleTableEntityPersister.java:109)rn at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)rn at org.hibernate.impl.SessionFactoryImpl.(SessionFactoryImpl.java:226)rn at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1300)rn at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:859)rn at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:860)rn at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:779)rn at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)rn ... 49 morernCaused by: java.lang.reflect.InvocationTargetExceptionrn at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)rn at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)rn at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)rn at java.lang.reflect.Constructor.newInstance(Constructor.java:494)rn at org.hibernate.engine.UnsavedValueFactory.instantiate(UnsavedValueFactory.java:22)rn ... 63 morernCaused by: java.lang.IllegalArgumentException: 'name' must not be nullrn[/code]
请教异常java.lang.IllegalArgumentException: Source must not be null
java.lang.IllegalArgumentException: Source must not be nullrn at org.springframework.util.Assert.notNull(Assert.java:112)rn at org.springframework.beans.BeanUtils.copyProperties(BeanUtils.java:567)rn at org.springframework.beans.BeanUtils.copyProperties(BeanUtils.java:509)rn at zucc.edu.cn.serviceImpl.StudentManagerImpl.regStudent(StudentManagerImpl.java:31)rn at zucc.edu.cn.action.StudentRegisterAction.execute(StudentRegisterAction.java:33)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)rn at java.lang.reflect.Method.invoke(Unknown Source)rn at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:452)rn at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:291)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:254)rn at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:176)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:263)rn at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:138)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:207)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:207)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:190)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:243)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:270)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:145)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:171)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:176)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:190)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:187)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)rn at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:498)rn at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)rn at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)rn at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)rn at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:436)rn at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1078)rn at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625)rn at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318)rn at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)rn at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)rn at java.lang.Thread.run(Unknown Source)rn
springboot启动出错:java.lang.IllegalArgumentException: Sources must not be empty
springboot启动出错:java.lang.IllegalArgumentException: Sources must not be empty。具体是以SpringApplication方式启动的,如下图:rn[img=https://img-bbs.csdn.net/upload/201908/08/1565257632_489173.png][/img]rnrn 出错信息如下:rn[img=https://img-bbs.csdn.net/upload/201908/08/1565257648_198871.png][/img]
java.lang.IllegalArgumentException: n must be positive ??????????????
I am sorry ,my compture doesn`t have Chinese, who know this error message ?
java.lang.IllegalArgumentException: Unknown URI content:
复制源项目program1,粘贴更名为program2。rn更改AndroidManifest.xml:rn program1中rnrn program2中rnrn当program1和program2安装在同一个模拟器中运行时,出错了:rnrn04-18 01:34:36.591: E/DatabaseUtils(833): Writing exception to parcelrn04-18 01:34:36.591: E/DatabaseUtils(833): java.lang.IllegalArgumentException: Unknown URI content://com.coperator.db/accountsrn04-18 01:34:36.591: E/DatabaseUtils(833): at com.coperator.db.DBProvider.delete(DBProvider.java:286)rn04-18 01:34:36.591: E/DatabaseUtils(833): at android.content.ContentProvider$Transport.delete(ContentProvider.java:222)rn04-18 01:34:36.591: E/DatabaseUtils(833): at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:186)rn04-18 01:34:36.591: E/DatabaseUtils(833): at android.os.Binder.execTransact(Binder.java:320)rn04-18 01:34:36.591: E/DatabaseUtils(833): at dalvik.system.NativeStart.run(Native Method)rnrn忘高手给点指示和解决的方法,谢谢!!!
HttpClient java.lang.IllegalArgumentException: Invalid uri
使用HttpClientrnString uri = "http://10.207.40.191:9080/eup-transaction/monitor/doLogin.douserName=施主&password=88888888";rnGetMethod getMethod = new GetMethod(uri);rn抛出如下异常:java.lang.IllegalArgumentException: Invalid uri http://10.207.40.191:9080/eup-transaction/monitor/doLogin.douserName=施主&password=88888888': Invalid queryrn此问题如何解决?
SpringBoot OAuth2
采用Spring Boot 2 搭建Spring Security OAuth2 支持授权码模式和客户端模式,同时搭建的有多数据源
Httpclient报错:java.lang.IllegalArgumentException: HTTP parameters may not be null
我在Android上使用HttpClient的时候,Execute的时候提示有错误。rn错误log见下面。rn请问是什么问题?rn11-24 21:39:22.546: W/System.err(30708): java.lang.IllegalArgumentException: HTTP parameters may not be nullrn11-24 21:39:22.547: W/System.err(30708): at org.apache.http.params.HttpProtocolParams.getUserAgent(HttpProtocolParams.java:150)rn11-24 21:39:22.548: W/System.err(30708): at org.apache.http.impl.client.AbstractHttpClient.isMoMMS(AbstractHttpClient.java:803)rn11-24 21:39:22.548: W/System.err(30708): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:576)rn11-24 21:39:22.548: W/System.err(30708): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:533)rn11-24 21:39:22.548: W/System.err(30708): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:511)rn11-24 21:39:22.549: W/System.err(30708): at com.net.netdaily.loginActivity.doLoginNew(loginActivity.java:259)rn11-24 21:39:22.549: W/System.err(30708): at com.net.netdaily.loginActivity.access$7(loginActivity.java:224)rn11-24 21:39:22.549: W/System.err(30708): at com.net.netdaily.loginActivity$doLoginTask.doInBackground(loginActivity.java:218)rn11-24 21:39:22.549: W/System.err(30708): at com.net.netdaily.loginActivity$doLoginTask.doInBackground(loginActivity.java:1)rn11-24 21:39:22.550: W/System.err(30708): at android.os.AsyncTask$2.call(AsyncTask.java:288)rn11-24 21:39:22.550: W/System.err(30708): at java.util.concurrent.FutureTask.run(FutureTask.java:237)rn11-24 21:39:22.550: W/System.err(30708): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)rn11-24 21:39:22.550: W/System.err(30708): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)rn11-24 21:39:22.555: W/System.err(30708): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)rn11-24 21:39:22.560: W/System.err(30708): at java.lang.Thread.run(Thread.java:841)rn11-24 21:39:22.587: I/System.out(30708): [socket][1] connection /220.249.88.170:8009;LocalPort=49543(0)rn11-24 21:39:22.588: I/System.out(30708): [CDS]connect[/220.249.88.170:8009] tm:90rn11-24 21:39:22.588: D/Posix(30708): [Posix_connect Debug]Process com.net.netdaily :8009 rn11-24 21:39:22.613: I/System.out(30708): [socket][/192.168.1.104:49543] connectedrn11-24 21:39:22.614: I/System.out(30708): [CDS]rx timeout:0rn11-24 21:39:22.614: I/System.out(30708): [CDS]SO_SND_TIMEOUT:0rn11-24 21:39:22.615: I/System.out(30708): [CDS]close[49543]rn11-24 21:39:22.616: I/System.out(30708): close [socket][/0.0.0.0:49543]rn11-24 21:39:22.616: I/System.out(30708): close [socket][/0.0.0.0:49543]rn11-24 21:39:22.617: W/System.err(30708): org.apache.http.client.ClientProtocolExceptionrn11-24 21:39:22.617: W/System.err(30708): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:643)rn11-24 21:39:22.618: W/System.err(30708): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:533)rn11-24 21:39:22.618: W/System.err(30708): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:511)rn11-24 21:39:22.618: W/System.err(30708): at com.net.netdaily.loginActivity.doLoginNew(loginActivity.java:259)rn11-24 21:39:22.618: W/System.err(30708): at com.net.netdaily.loginActivity.access$7(loginActivity.java:224)rn11-24 21:39:22.618: W/System.err(30708): at com.net.netdaily.loginActivity$doLoginTask.doInBackground(loginActivity.java:218)rn11-24 21:39:22.618: W/System.err(30708): at com.net.netdaily.loginActivity$doLoginTask.doInBackground(loginActivity.java:1)rn11-24 21:39:22.619: W/System.err(30708): at android.os.AsyncTask$2.call(AsyncTask.java:288)rn11-24 21:39:22.619: W/System.err(30708): at java.util.concurrent.FutureTask.run(FutureTask.java:237)rn11-24 21:39:22.620: W/System.err(30708): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)rn11-24 21:39:22.621: W/System.err(30708): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)rn11-24 21:39:22.622: W/System.err(30708): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)rn11-24 21:39:22.623: W/System.err(30708): at java.lang.Thread.run(Thread.java:841)rn11-24 21:39:22.624: W/System.err(30708): Caused by: org.apache.http.ProtocolException: Content-Length header already presentrn11-24 21:39:22.625: W/System.err(30708): at org.apache.http.protocol.RequestContent.process(RequestContent.java:70)rn11-24 21:39:22.625: W/System.err(30708): at org.apache.http.protocol.BasicHttpProcessor.process(BasicHttpProcessor.java:290)rn11-24 21:39:22.625: W/System.err(30708): at org.apache.http.protocol.HttpRequestExecutor.preProcess(HttpRequestExecutor.java:167)rn11-24 21:39:22.625: W/System.err(30708): at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:413)rn11-24 21:39:22.625: W/System.err(30708): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:641)rn11-24 21:39:22.626: W/System.err(30708): ... 12 morern11-24 21:39:22.626: E/NetDaily(30708): httpResponse is nullrnrn代码见下面。rn[code=java]rnprivate boolean doLoginNew()rn Log.i(netdailyConstant.log.tag, "loginActivity "+"[IN] doLogin");rn UrlEncodedFormEntity params = null;rn HttpResponse httpResponse = null;rn HttpClient httpClient =new DefaultHttpClient();rn rn HttpPost httpPost = new HttpPost(netdailyConstant.url.loginURLString);rn httpPost.setHeader("Accept","image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-silverlight, application/x-ms-application, application/x-ms-xbap, application/vnd.ms-xpsdocument, application/xaml+xml, */*");rn httpPost.setHeader("Referer","http://220.249.88.170:8009/dws/");rn httpPost.setHeader("Accept-Language","zh-cn");rn httpPost.setHeader("User-Agent","Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; QQDownload 760; .NET CLR 2.0.50727; CIBA; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C)");rn httpPost.setHeader("Content-Type","application/x-www-form-urlencoded");rn httpPost.setHeader("Accept-Encoding","gzip, deflate");rn httpPost.setHeader("Host","220.249.88.170:8009");rn httpPost.setHeader("Content-Length","86");rn httpPost.setHeader("Connection", "Keep-Alive");rn httpPost.setHeader("Cache-Control", "no-cache");rn httpPost.setHeader("Cookie", "xxx");rn rn List paramList = new ArrayList();rn paramList.add( new BasicNameValuePair("checkcode",login_checkCode));rn paramList.add( new BasicNameValuePair("loginName",login_name));rn paramList.add( new BasicNameValuePair("Password",login_pwd));rn paramList.add(new BasicNameValuePair("cache","1"));rn paramList.add(new BasicNameValuePair("max_per_page","20"));rn paramList.add(new BasicNameValuePair("Submit","??¼"));rn try rn params = new UrlEncodedFormEntity(paramList, "UTF-8");rn catch (UnsupportedEncodingException e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn rn httpPost.setEntity(params);rn rn try rn httpResponse = httpClient.execute(httpPost);rn catch (ClientProtocolException e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn catch (IOException e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn rn rn if (null != httpResponse) rn if (httpResponse.getStatusLine().getStatusCode() == 200) rn String strResult = null;rn HttpEntity entity = httpResponse.getEntity();rn try rn strResult = EntityUtils.toString(entity);rn catch (ParseException e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn catch (IOException e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn rnrn String strContentTypeElementString = entity.getContentType().getElements()[0].toString();rn showNotifyPopup(strResult+":"+strContentTypeElementString);rn else rn showNotifyPopup("Error Response" + httpResponse.getStatusLine().toString());rn rn else rn Log.e(netdailyConstant.log.tag, "httpResponse is null");rn rn rnrn return true;rn rn[/code]
java.lang.illegalargumentexception: width and height must be >0
我知道是什么意思,关键是我的程序中,width和height是大于0的啊。源码如下:rn Matrix mtx=new Matrix();rn degree=Math.toDegrees(Math.atan(yy/xx));rn mtx.setRotate((float)degree, (float)x+bm.getWidth()/2, (float)y+bm.getHeight()/2);rn Bitmap bm1=Bitmap.createBitmap(bm, 0, 0, bm.getWidth(), bm.getHeight(), mtx, false);//这句出错rn canvas.drawBitmap(bm1,(float) x, (float)y, paint);
spring security oauth2 单点登录
NULL 博文链接:https://chun521521.iteye.com/blog/2268953
java.lang.IllegalArgumentException报错
rnrn@RequestMapping(value="/checkUser",produces = "application/json")rn public boolean checkUser(String userName) rn System.out.print(userName);rn String name = "zhangsan";rn if(userName.equals(name)) rn return false;rn rn return true;rn
spring security oauth2整合
spring security oauth2整合的详细说明文档,demo下载地址在文档中已经给出。其中demo中包含了详细的代码注释。
Spring Cloud Security OAuth2
基于springcloud是新年Security OAuth2服务的构建,通过视频直接撸代码,让你更直接的了解其应用。
security + oauth2 认证问题
各位大佬, rn "error": "unsupported_grant_type",rn "error_description": "Unsupported grant type: password"rnrn这个问题弄两天了。rn[code=java]rnrn认证服务器 代码:rnrn@Slf4jrn@Configurationrn@EnableAuthorizationServerrnpublic class AuthorizationConfig extends AuthorizationServerConfigurerAdapter rnrn @Autowiredrn private AuthServiceConfig authServiceConfig;rnrn @Autowiredrn private AuthenticationManager authenticationManager;rnrn @Autowiredrn private UserDetailsService userDetailsService;rnrn @Autowiredrn private RedisConnectionFactory redisConnectionFactory;rnrn /**rn * 要认证的客户端配置rn * @param clientsrn * @throws Exceptionrn */rn @Overridern public void configure(ClientDetailsServiceConfigurer clients) throws Exception rn log.info("configure(ClientDetailsServiceConfigurer clients)==============加载");rn /**rn * 配置客户端详情信息(Client Details)rn * clientId:(必须的)用来标识客户的Id。rn * secret:(需要值得信任的客户端)客户端安全码,如果有的话。rn * scope:用来限制客户端的访问范围,如果为空(默认)的话,那么客户端拥有全部的访问范围。rn * authorizedGrantTypes:此客户端可以使用的授权类型,默认为空。rn * authorities:此客户端可以使用的权限(基于Spring Security authorities)。rn */rn clients.inMemory()rn .withClient(authServiceConfig.getClientId())rn .secret(authServiceConfig.getClientSecret())rn .scopes(authServiceConfig.getScope())rn .authorizedGrantTypes("client_credentials", "password", "refresh_token")rn .accessTokenValiditySeconds(1200)rn .refreshTokenValiditySeconds(50000);rn rnrn /**rn * 使配置的token生效 redisTokenStore()rn * @param endpointsrn */rn @Overridern public void configure(AuthorizationServerEndpointsConfigurer endpoints) rn log.info("configure(AuthorizationServerEndpointsConfigurer endpoints)==============加载");rn endpointsrn // token存储rn .tokenStore(redisTokenStore())rn // 自定义token生成方案rn .accessTokenConverter(accessTokenConverter())rn // 身份认证管理器, 主要用于"password"授权模式rn .authenticationManager(authenticationManager)rn // 配合身份认证管理器, 检查用户名密码有效性rn .userDetailsService(userDetailsService); //告诉security 用自己的实现daorn rnrnrn /**rn * 认证服务器的安全配置rn * @param securityrn * @throws Exceptionrn */rn @Overridern public void configure(AuthorizationServerSecurityConfigurer security) throws Exception rn log.info("configure(AuthorizationServerSecurityConfigurer security)==============加载");rn securityrn .allowFormAuthenticationForClients()rn .tokenKeyAccess("isAuthenticated()") //访问tokenKey 的时候须要认证rn .checkTokenAccess("permitAll()");rn rnrn @Beanrn public PasswordEncoder passwordEncoder() rn //用户验证的时候使用加密处理rn return new BCryptPasswordEncoder();rn rnrnrn /**rn * tokenstorern */rn @Beanrn public TokenStore redisTokenStore() rn RedisTokenStore tokenStore = new RedisTokenStore(redisConnectionFactory);rn tokenStore.setPrefix(SecurityConstant.SK_PREFIX);rn return tokenStore;rn rnrn @Beanrn public AccessTokenConverter accessTokenConverter() rn JwtAccessTokenConverter jwtAccessTokenConverter = new JwtAccessTokenConverter();rn // 设置签名rn jwtAccessTokenConverter.setSigningKey(SecurityConstant.SIGN_KEY);rn return jwtAccessTokenConverter;rn rnrnrn[/code]rnrn我启动认证服务器的时候rn首先加载configure(AuthorizationServerEndpointsConfigurer endpoints) 这个configure ,rn[img=https://img-bbs.csdn.net/upload/201805/02/1525233684_938798.jpg][/img]rn我发现authenticationManager 是空的,然后我查看上面注入的rn[img=https://img-bbs.csdn.net/upload/201805/02/1525233063_78622.jpg][/img] 这三个都是空的,rnrn这三个的加载顺序rn[img=https://img-bbs.csdn.net/upload/201805/02/1525234835_720512.jpg][/img]rnrn最后请求rn[img=https://img-bbs.csdn.net/upload/201805/02/1525234875_227348.jpg][/img]rnrnrn跪求各位大佬帮忙看看,这是啥问题啊,搞两天了rn
spring security oauth2
spring security 整合oauth2,进行权限授权管理,例子简单好用。
Spring Security oauth2
#OAuth2-Defender ##主要技术 Maven<br/> Spring Boot<br/> Spring Security<br/> Spring Security OAuth2.0<br/> MySQL<br/> ##修改数据库配置 修改defender-oauth2-authorization\src\main\resources\application.properties中MySQL的主机配置<br/> 修改defender-oauth2-resource\src\main\resources\application.properties中MySQL的主机配置<br/> ##初始化数据库 在MySQL客户端执行SQL脚本:<br/> defender-oauth2-authorization\doc\schema.sql<br/> defender-oauth2-authorization\doc\data.sql<br/> ##启动服务器 ###启动认证服务器 运行defender-oauth2-authorization模块下AuthorizationApplication类的main方法。<br/> ###启动资源服务器 运行defender-oauth2-resource模块下ResourceApplication类的main方法。<br/> ###启动客户端服务器 运行defender-oauth2-client模块下ClientApplication类的main方法。<br/> ##访问客户端主页面 在浏览器访问:localhost:8882/defender,测试5中不同授权模式。<br/> ##后期工作 支持缓存<br/> 添加Spring Security防御功能<br/>
spring security oauth2 demo
代码直接导入eclipse,然后把数据库语句添加到mysql,启动AlanOAuthApplication就可以跑起来了,详细说明在项目的README.md里面。
oauth2 for spring security
oauth2 for spring security 想学习 oauth的同学 可以研究一下。
springboot报错JPA metamodel must be present!
使用junit测试springboot项目,一直报这个错误,网上说的多数据源解决办法n对我不起作用.我把异常项目及异常信息放到github上了,大神帮我看下是什么异常?n[项目代码](https://github.com/leesonwei/demo.git "")
spring boot security oauth2例子
一个springboot为框架的security oauth2应用例子,同时集成了swagger2的 restful API查看页面,druid数据源监控, mybatis自动生成和分页插件,远程资源服务器的认证和授权,也可以去github下载 https://github.com/ustcwudi/SpringBoot-Seed https://github.com/ustcwudi/SpringBoot-Seed-Service
Spring Security Oauth2搭建服务器的问题
Spring Security Oauth2搭建服务器的问题。rn 最近在搭建Spring Security Oauth2的服务器,能够获得access_token了,不过,客户端不能得到授权用户的名称。不知道是不是用哪个url加上access_token的值,还是怎么弄,我试过 的方法是:rn Authentication auth = SecurityContextHolder.getContext().getAuthentication();rn String username = auth.getName();rn 确实能够得到一个值,不过是anonymousUser匿名用户。。。。rn 哪位大神,有研究过此方面的内容的麻烦帮我解答解答,由于最近三帖都没人回答,也就只给这个贴20分。。。其实我是特别急着用的,非常感谢!!!
Springboot Security Oauth2 第一篇:构建一个简单例子
本文主要讲解了Springboot集成Security Oauth2的一个简单例子,通过该例子进而学习该方面的知识。 内容简介:使用password密码授权方式,让用户通过账号密码去服务器获取token,并通过token来访问接口。 技术:springboot2.x ,springsecurity5.x
Class must not be null
在使用XFire的时候。加载Bean时候出现异常了。本地没问题,但是打包打测试环境就抛出以下异常。搞了一天了。都没搞出来,求大神指导!rn在XFire-servlet.xml中增加新的WebService定义:rn rn rn rn rn rn rn rn rn rn rn rn rn rn抛出如下异常:rnorg.springframework.beans.factory.BeanCreationException:rn Error creating bean with name 'org.springframework.web.servlet.handler.SimpleUrlHandlerMapping' defined in ServletContext resource rn [/WEB-INF/xfire-servlet.xml]: rn Cannot resolve reference to bean 'CMSServiceByDayEndService' while setting bean property 'urlMap' with key rn [TypedStringValue: value [/CMSServiceByDayEnd.ws], target type [null]]; rn nested exception is org.springframework.beans.factory.BeanCreationException: rn Error creating bean with name 'CMSServiceByDayEndService' defined in ServletContext resource rn [/WEB-INF/xfire-servlet.xml]: rn Cannot resolve reference to bean 'CMSServiceByDayEndBean' while setting bean property 'serviceBean'; rn nested exception is org.springframework.beans.factory.BeanCreationException: rn Error creating bean with name 'CMSServiceByDayEndBean' defined in ServletContext resource rn [/WEB-INF/xfire-servlet.xml]: rn Instantiation of bean failed; rn nested exception is org.springframework.beans.BeanInstantiationException: rn Could not instantiate bean class rn [com.webservice.hr.service.impl.CMSServiceByDayEnd]: rn Constructor threw exception; rn nested exception is org.springframework.beans.factory.BeanCreationException: rn Error creating bean with name 'IT020206Bs' defined in file rn [/home/wasadmin/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/TKCMS-RPAY1Node01Cell/tkcms_war.ear/tkcms.war/WEB-INF/conf/applicationContext/applicationContext-recvpay.xml]: rn Cannot resolve reference to bean 'IT020206Bs_target' while setting bean property 'target'; rn nested exception is org.springframework.beans.factory.BeanCreationException: rn Error creating bean with name 'IT020206Bs_target' defined in file rn [/home/wasadmin/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/TKCMS-RPAY1Node01Cell/tkcms_war.ear/tkcms.war/WEB-INF/conf/applicationContext/applicationContext-recvpay.xml]: rn Cannot resolve reference to bean 'IBankAccountBs' while setting bean property 'bankAccountBs'; rn nested exception is org.springframework.beans.factory.BeanCreationException: rn Error creating bean with name 'IBankAccountBs' defined in file rn [/home/wasadmin/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/TKCMS-RPAY1Node01Cell/tkcms_war.ear/tkcms.war/WEB-INF/conf/applicationContext/applicationContext-account.xml]: rn Cannot resolve reference to bean 'IBankAccountBs_target' while setting bean property 'target'; rn nested exception is org.springframework.beans.factory.BeanCreationException: rn Error creating bean with name 'IBankAccountBs_target' defined in file rn [/home/wasadmin/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/TKCMS-RPAY1Node01Cell/tkcms_war.ear/tkcms.war/WEB-INF/conf/applicationContext/applicationContext-account.xml]: rn Cannot resolve reference to bean 'IProofImportSapBs_target' while setting bean property 'proofImportSapBs'; rn nested exception is org.springframework.beans.factory.BeanCreationException: rn Error creating bean with name 'IProofImportSapBs_target' defined in file rn [/home/wasadmin/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/TKCMS-RPAY1Node01Cell/tkcms_war.ear/tkcms.war/WEB-INF/conf/applicationContext/applicationContext-sapservice.xml]: rn Cannot resolve reference to bean 'IAuditEntDetailBs_target' while setting bean property 'auditEntDetailBs'; rn nested exception is org.springframework.beans.factory.BeanCreationException: rn Error creating bean with name 'IAuditEntDetailBs_target' defined in file rn [/home/wasadmin/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/TKCMS-RPAY1Node01Cell/tkcms_war.ear/tkcms.war/WEB-INF/conf/applicationContext/applicationContext-bankAudit.xml]: rn Cannot resolve reference to bean 'IBankAccountBs' while setting bean property 'bankAccountBs'; rn nested exception is org.springframework.beans.factory.BeanCreationException: rn Error creating bean with name 'IBankAccountBs': rn FactoryBean threw exception on object creation; rn nested exception is java.lang.IllegalArgumentException: rn Class must not be nullrnrn
基于security和oauth2实现单点登录
第一步引入pom文件:&amp;lt;dependency&amp;gt; &amp;lt;groupId&amp;gt;org.springframework.boot&amp;lt;/groupId&amp;gt; &amp;lt;artifactId&amp;gt;spring-boot-starter-security&amp;lt;/artifactId&amp;gt; &amp;lt;/dependency&amp;gt; &amp;lt;dependency&amp;gt;
springboot后台服务搭建(八 整合security + oauth2)
总览:https://blog.csdn.net/qq_22037575/article/details/86687765 本文概要:springboot2.x 整合 security + oauth2 码云:https://gitee.com/RichterGit/csdn/tree/master/springboot-radmin/008/ 目录 1.pom导入依赖 2.全局配置 ...
SpringBoot OAuth2支持跨域访问
什么是跨域访问 在 HTML 中,&lt;a&gt;, &lt;form&gt;, &lt;img&gt;, &lt;script&gt;, &lt;iframe&gt;, &lt;link&gt; 等标签以及 Ajax 都可以指向一个资源地址,而所谓的跨域请求就是指:当前发起请求的域与该请求指向的资源所在的域不一样。这里的域指的是这样的一个概念:我们认为若协议 + 域名 + 端口号均相同,那么...
java.lang.IllegalArgumentException: parameter must be a descendant of this view
[code=java]rnjava.lang.IllegalArgumentException: parameter must be a descendant of this viewrn11-27 09:28:40.759 E/AndroidRuntime(32585): at android.view.ViewGroup.offsetRectBetweenParentAndChild(ViewGroup.java:4312)rn11-27 09:28:40.759 E/AndroidRuntime(32585): at android.view.ViewGroup.offsetDescendantRectToMyCoords(ViewGroup.java:4249)rn11-27 09:28:40.759 E/AndroidRuntime(32585): at android.view.ViewGroup$ViewLocationHolder.init(ViewGroup.java:6107)rn11-27 09:28:40.759 E/AndroidRuntime(32585): at android.view.ViewGroup$ViewLocationHolder.obtain(ViewGroup.java:6033)rn11-27 09:28:40.759 E/AndroidRuntime(32585): at android.view.ViewGroup$ChildListForAccessibility.init(ViewGroup.java:5977)rn11-27 09:28:40.759 E/AndroidRuntime(32585): at android.view.ViewGroup$ChildListForAccessibility.obtain(ViewGroup.java:5934)rn11-27 09:28:40.759 E/AndroidRuntime(32585): at android.view.ViewGroup.addChildrenForAccessibility(ViewGroup.java:1643)rn11-27 09:28:40.759 E/AndroidRuntime(32585): at android.view.ViewGroup.onInitializeAccessibilityNodeInfoInternal(ViewGroup.java:2485)rn11-27 09:28:40.759 E/AndroidRuntime(32585): at android.view.View$AccessibilityDelegate.onInitializeAccessibilityNodeInfo(View.java:18125)rn11-27 09:28:40.759 E/AndroidRuntime(32585): at android.support.v4.view.AccessibilityDelegateCompatIcs.onInitializeAccessibilityNodeInfo(Unknown Source)rn11-27 09:28:40.759 E/AndroidRuntime(32585): at android.support.v4.view.AccessibilityDelegateCompat$AccessibilityDelegateIcsImpl.onInitializeAccessibilityNodeInfo(Unknown Source)rn11-27 09:28:40.759 E/AndroidRuntime(32585): at android.support.v4.view.AccessibilityDelegateCompat.onInitializeAccessibilityNodeInfo(Unknown Source)rn11-27 09:28:40.759 E/AndroidRuntime(32585): at android.support.v4.view.ViewPager$MyAccessibilityDelegate.onInitializeAccessibilityNodeInfo(Unknown Source)rn11-27 09:28:40.759 E/AndroidRuntime(32585): at android.support.v4.view.AccessibilityDelegateCompat$AccessibilityDelegateJellyBeanImpl$1.onInitializeAccessibilityNodeInfo(Unknown Source)rn11-27 09:28:40.759 E/AndroidRuntime(32585): at android.support.v4.view.AccessibilityDelegateCompatJellyBean$1.onInitializeAccessibilityNodeInfo(Unknown Source)rn11-27 09:28:40.759 E/AndroidRuntime(32585): at android.view.View.onInitializeAccessibilityNodeInfo(View.java:4832)rn11-27 09:28:40.759 E/AndroidRuntime(32585): at android.view.View.createAccessibilityNodeInfo(View.java:4795)rn11-27 09:28:40.759 E/AndroidRuntime(32585): at android.view.AccessibilityInteractionController$AccessibilityNodePrefetcher.prefetchDescendantsOfRealNode(AccessibilityInteractionController.java:825)rn11-27 09:28:40.759 E/AndroidRuntime(32585): at android.view.AccessibilityInteractionController$AccessibilityNodePrefetcher.prefetchAccessibilityNodeInfos(AccessibilityInteractionController.java:734)rn11-27 09:28:40.759 E/AndroidRuntime(32585): at android.view.AccessibilityInteractionController.findAccessibilityNodeInfoByAccessibilityIdUiThread(AccessibilityInteractionController.java:205)rn11-27 09:28:40.759 E/AndroidRuntime(32585): at android.view.AccessibilityInteractionController.access$400(AccessibilityInteractionController.java:49)rn11-27 09:28:40.759 E/AndroidRuntime(32585): at android.view.AccessibilityInteractionController$PrivateHandler.handleMessage(AccessibilityInteractionController.java:985)rn11-27 09:28:40.759 E/AndroidRuntime(32585): at android.os.Handler.dispatchMessage(Handler.java:99)rn11-27 09:28:40.759 E/AndroidRuntime(32585): at android.os.Looper.loop(Looper.java:155)rn11-27 09:28:40.759 E/AndroidRuntime(32585): at android.app.ActivityThread.main(ActivityThread.java:5536)rn11-27 09:28:40.759 E/AndroidRuntime(32585): at java.lang.reflect.Method.invokeNative(Native Method)rn11-27 09:28:40.759 E/AndroidRuntime(32585): at java.lang.reflect.Method.invoke(Method.java:511)rn11-27 09:28:40.759 E/AndroidRuntime(32585): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1074)rn11-27 09:28:40.759 E/AndroidRuntime(32585): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:841)rn11-27 09:28:40.759 E/AndroidRuntime(32585): at dalvik.system.NativeStart.main(Native Method)rn[/code]rnrnlog日志如下,问题是在提交testin时发现的,目前无法重现,上面是log日志,和网上大多数的log并不一样,拒绝复制粘贴。rn错误报在首页,布局使用的是一个禁止横向滚动的ViewPager嵌套Listview,listView的header为一个轮播图rnrn尝试过的解决方案:在ListView的getView()及onScroll中做clearFocus操作,未解决。rn
FC错误 :java.lang.IllegalArgumentException: x + width must be <= bitmap.width()
调用截图方法时应用强制退出:rn[code=Java]rnpublic Bitmap takeScreenShot(Activity activity) rn //View是你需要截图的View rn View view = activity.getWindow().getDecorView(); rn view.setDrawingCacheEnabled(true); rn view.buildDrawingCache(); rn b1 = view.getDrawingCache(); rn rn //获取状态栏高度 rn Rect frame = new Rect(); rn activity.getWindow().getDecorView().getWindowVisibleDisplayFrame(frame); rn int statusBarHeight = frame.top; rn //获取屏幕长和高 rn int width = activity.getWindowManager().getDefaultDisplay().getWidth(); rn //去掉标题栏 rn b = Bitmap.createBitmap(b1, 0, statusBarHeight, width, b1.getHeight()-statusBarHeight); rn view.destroyDrawingCache(); rn return b; rn rn[/code]rn有知道怎么避免这个问题的吗?
基于Springboot集成security、oauth2实现认证鉴权、资源管理源码
基于Springboot集成security、oauth2实现认证鉴权、资源管理源码,具体相关博文我发表在https://www.cnblogs.com/xiaofengxzzf/p/10733955.html
JScrollPanel报错java.lang.IllegalArgumentException
jScrollPane1.add(jList1, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);rn该行报错, 非法参数, 但是jList1可以显示出来. 不解, 求教.rnrnjava.lang.IllegalArgumentException: illegal component positionrnat java.awt.Container.addImpl(Container.java:1011)rnat java.awt.Container.add(Container.java:935)rnat com.st.format.PDFToTxt.jButton2ActionPerformed(PDFToTxt.java:355)
错误!!!java.lang.IllegalArgumentException:Request cannot be null
为什么我在我的机子上应用struts的时候老是报这样一个错误rn用别人编好的程序会这样rn自己写的一个很小的程序也会这样
Struts2上传视频报错java.lang.IllegalArgumentException
![图片说明](https://img-ask.csdn.net/upload/201702/19/1487506508_443518.png)!![图片说明](https://img-ask.csdn.net/upload/201702/19/1487506530_160869.png)![图片说明](https://img-ask.csdn.net/upload/201702/19/1487506553_822928.png)![图片说明](https://img-ask.csdn.net/upload/201702/19/1487506567_768222.png)![图片说明](https://img-ask.csdn.net/upload/201702/19/1487506577_606347.png)
java.lang.IllegalArgumentException: Host name may not be null
路径 https://mbapp_it.mybanker.co.jp/api/financialrnandroid http 请求出错 rn路径好像需要静态ip
springboot OAuth2授权码登录
基于springboot security-oauth2框架,jwt签名的授权码模式登录验证,获取授权url在readME文档中,postman调用截图在static中,直接可用
异常:Cookie value must not be null
/**n * 入口n * @param argsn */n public static void main(String[] args) n System.out.println("输出什么?");n Login login = new Login();n login.getPersonInfo();n nn // 返会一个list对象n public List getPersonInfo() // 返回一个list对象n List list = new ArrayList();n try n // 得到session ,进行模拟登陆,(如果有验证码,我就不知道了)。--博客园老牛大讲堂n Connection.Response res = Jsoup.connect("http://www.51job.com")n .data(n "loginname", "15217727459"n , "password", "15217727459."n )// 进行模拟登陆n .method(Connection.Method.POST).timeout(10000).execute();// 设置请求时间和登陆用的用户名,密码。n// Document doc = res.parse();n // 根据session进行爬虫n // 注释:不是所有网站他们都需要cook,也不是所有的网站cook都是iPlanetDirectoryPro。n // 不同网站网址的cookie不一样。而且每次访问都不一样,所以不要想着把session保存起来。n String guid = res.cookie("guid");n String _ujz = res.cookie("_ujz");n n System.out.println("guid === " + guid);n System.out.println("_ujz === " + _ujz);n n Document objectDoc = Jsoupn .connect("http://i.51job.com/resume/resume_preview.php?lang=c&resumeid=358968976&3658907287")// 里面的网址(就是你想要爬取的网页)n .cookie("guid", guid)n .cookie("_ujz", _ujz) // 异常提示行n .timeout(10000).post();// 设置请求的时间(这里设置的请求时间是10秒)n System.out.println("objectDoc === " + objectDoc);n Element htmlElement = objectDoc.getElementsByClass("name").get(0);// 得到class为name的第一个对象n Elements trElements = htmlElement.getElementsByTag("tr");// 得到tr标签的对象nn System.out.println(trElements.size());// 输出多少个tr标签nn for (int i = 1; i < trElements.size(); i++) n Elements divElments = trElements.get(i).getElementsByAttributeValue("align", "left");// 根据class进行得到对象。n for (int j = 0; j < trElements.size(); j++) n Element d = divElments.get(j);// 获取每一个对象n list.add(d.text());// 得到这个对象对应的值n n n catch (IOException e) n e.printStackTrace();n n return list;n
listview滑动的时候报错java.lang.IllegalArgumentException
06-17 10:53:59.880: E/AndroidRuntime(940): at android.view.ViewGroup.offsetDescendantRectToMyCoords(ViewGroup.java:2564)rn06-17 10:53:59.880: E/AndroidRuntime(940): at android.view.FocusFinder.findNextFocus(FocusFinder.java:73)rn06-17 10:53:59.880: E/AndroidRuntime(940): at android.widget.ScrollView.arrowScroll(ScrollView.java:820)rn06-17 10:53:59.880: E/AndroidRuntime(940): at android.widget.ScrollView.executeKeyEvent(ScrollView.java:350)rn06-17 10:53:59.880: E/AndroidRuntime(940): at android.widget.ScrollView.dispatchKeyEvent(ScrollView.java:318)rn06-17 10:53:59.880: E/AndroidRuntime(940): at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:788)rn06-17 10:53:59.880: E/AndroidRuntime(940): at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:788)rn06-17 10:53:59.880: E/AndroidRuntime(940): at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:788)rn06-17 10:53:59.880: E/AndroidRuntime(940): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchKeyEvent(PhoneWindow.java:1667)rn06-17 10:53:59.880: E/AndroidRuntime(940): at com.android.internal.policy.impl.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:1102)rn06-17 10:53:59.880: E/AndroidRuntime(940): at android.app.Activity.dispatchKeyEvent(Activity.java:2063)rn06-17 10:53:59.880: E/AndroidRuntime(940): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:1643)rn06-17 10:53:59.880: E/AndroidRuntime(940): at android.view.ViewRoot.deliverKeyEventToViewHierarchy(ViewRoot.java:2471)rn06-17 10:53:59.880: E/AndroidRuntime(940): at android.view.ViewRoot.handleFinishedEvent(ViewRoot.java:2441)rn06-17 10:53:59.880: E/AndroidRuntime(940): at android.view.ViewRoot.handleMessage(ViewRoot.java:1735)rn06-17 10:53:59.880: E/AndroidRuntime(940): at android.os.Handler.dispatchMessage(Handler.java:99)rn06-17 10:53:59.880: E/AndroidRuntime(940): at android.os.Looper.loop(Looper.java:123)rn06-17 10:53:59.880: E/AndroidRuntime(940): at android.app.ActivityThread.main(ActivityThread.java:4627)rn06-17 10:53:59.880: E/AndroidRuntime(940): at java.lang.reflect.Method.invokeNative(Native Method)rn06-17 10:53:59.880: E/AndroidRuntime(940): at java.lang.reflect.Method.invoke(Method.java:521)rn06-17 10:53:59.880: E/AndroidRuntime(940): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)rn06-17 10:53:59.880: E/AndroidRuntime(940): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)rn06-17 10:53:59.880: E/AndroidRuntime(940): at dalvik.system.NativeStart.main(Native Method)
后台报错java.lang.IllegalArgumentException: No bean specified
这个错误我在网上查看了,说是没有实例化类,但是我的类里的所有的字段全部都有get和set方法,这个是什么原因呢
【Spring Security OAuth2笔记系列】- Security控制授权- 权限表达式
权限表达式 看源码得知,最后都会转成一个表达式,然后进行投票评估; 那么有哪些表达式呢? 这些表达式的由来,由代码中的配置而来。 .antMatchers().xxx 每个函数都包装了一个表达式生成。 跟着源码得到 返回的是一个 ExpressionUrlAuthorizationConfigurer.AuthorizedUrl 对象 联合使用是通过access方法,自己写...
基于Spring Security的Oauth2授权实现
前言 经过一段时间的学习Oauth2,在网上也借鉴学习了一些大牛的经验,推荐在学习的过程中多看几遍阮一峰的《理解OAuth 2.0》,经过对Oauth2的多种方式的实现,个人推荐Spring Security和Oauth2的实现是相对优雅的,理由如下: 1、相对于直接实现Oauth2,减少了很多代码量,也就减少的查找问题的成本。 2、通过调整配置文件,灵活配置Oauth相关配置。 3、通过...
相关热词 c# 标准差 计算 c#siki第五季 c#入门推荐书 c# 解码海康数据流 c# xml的遍历循环 c# 取 查看源码没有的 c#解决高并发 委托 c#日期转化为字符串 c# 显示问号 c# 字典对象池