创建名为“userRealm”的bean时出错:通过字段“adminService”表示的未满足的依赖关系;嵌套异常是org.springframe .bean .factory

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userRealm': Unsatisfied dependency expressed through field 'adminService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'adminServiceImpl': Unsatisfied dependency expressed through field 'sysAdminLoginMapper'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sysAdminLoginMapper' defined in file [G:\IdeaProjects\anyoufang-java\framerwork-management\admin\target\classes\com\chuangting\admin\dao\SysAdminLoginMapper.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [G:\IdeaProjects\anyoufang-java\root\target\classes\mapper\house\HHouseAccessoriesMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for com.chuangting.house.dao.HHouseAccessoriesMapper.BaseResultMap
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:587) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:91) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:373) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1344) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:502) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:312) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:310) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:760) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:868) ~[spring-context-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549) ~[spring-context-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140) ~[spring-boot-2.0.0.RELEASE.jar:2.0.0.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:752) [spring-boot-2.0.0.RELEASE.jar:2.0.0.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:388) [spring-boot-2.0.0.RELEASE.jar:2.0.0.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:327) [spring-boot-2.0.0.RELEASE.jar:2.0.0.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1246) [spring-boot-2.0.0.RELEASE.jar:2.0.0.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1234) [spring-boot-2.0.0.RELEASE.jar:2.0.0.RELEASE]
at com.chuangting.Application.main(Application.java:14) [classes/:na]
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'adminServiceImpl': Unsatisfied dependency expressed through field 'sysAdminLoginMapper'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sysAdminLoginMapper' defined in file [G:\IdeaProjects\anyoufang-java\framerwork-management\admin\target\classes\com\chuangting\admin\dao\SysAdminLoginMapper.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [G:\IdeaProjects\anyoufang-java\root\target\classes\mapper\house\HHouseAccessoriesMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for com.chuangting.house.dao.HHouseAccessoriesMapper.BaseResultMap
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:587) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:91) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:373) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1344) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:502) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:312) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:310) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:251) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1138) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1065) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:584) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
... 19 common frames omitted
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sysAdminLoginMapper' defined in file [G:\IdeaProjects\anyoufang-java\framerwork-management\admin\target\classes\com\chuangting\admin\dao\SysAdminLoginMapper.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [G:\IdeaProjects\anyoufang-java\root\target\classes\mapper\house\HHouseAccessoriesMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for com.chuangting.house.dao.HHouseAccessoriesMapper.BaseResultMap
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType(AbstractAutowireCapableBeanFactory.java:1439) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1326) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:502) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:312) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:310) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:251) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1138) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1065) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:584) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
... 32 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [G:\IdeaProjects\anyoufang-java\root\target\classes\mapper\house\HHouseAccessoriesMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for com.chuangting.house.dao.HHouseAccessoriesMapper.BaseResultMap
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:587) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1250) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1099) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:502) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:312) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:310) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:251) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1138) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1065) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType(AbstractAutowireCapableBeanFactory.java:1424) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
... 43 common frames omitted
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [G:\IdeaProjects\anyoufang-java\root\target\classes\mapper\house\HHouseAccessoriesMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for com.chuangting.house.dao.HHouseAccessoriesMapper.BaseResultMap
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:579) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
... 55 common frames omitted
Caused by: org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [G:\IdeaProjects\anyoufang-java\root\target\classes\mapper\house\HHouseAccessoriesMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for com.chuangting.house.dao.HHouseAccessoriesMapper.BaseResultMap
at org.mybatis.spring.SqlSessionFactoryBean.buildSqlSessionFactory(SqlSessionFactoryBean.java:523) ~[mybatis-spring-1.3.1.jar:1.3.1]
at org.mybatis.spring.SqlSessionFactoryBean.afterPropertiesSet(SqlSessionFactoryBean.java:380) ~[mybatis-spring-1.3.1.jar:1.3.1]
at org.mybatis.spring.SqlSessionFactoryBean.getObject(SqlSessionFactoryBean.java:547) ~[mybatis-spring-1.3.1.jar:1.3.1]
at org.mybatis.spring.boot.autoconfigure.MybatisAutoConfiguration.sqlSessionFactory(MybatisAutoConfiguration.java:153) ~[mybatis-spring-boot-autoconfigure-1.3.1.jar:1.3.1]
at org.mybatis.spring.boot.autoconfigure.MybatisAutoConfiguration$$EnhancerBySpringCGLIB$$420f5dd4.CGLIB$sqlSessionFactory$0() ~[mybatis-spring-boot-autoconfigure-1.3.1.jar:1.3.1]
at org.mybatis.spring.boot.autoconfigure.MybatisAutoConfiguration$$EnhancerBySpringCGLIB$$420f5dd4$$FastClassBySpringCGLIB$$953f7cc1.invoke() ~[mybatis-spring-boot-autoconfigure-1.3.1.jar:1.3.1]
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) ~[spring-core-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:361) ~[spring-context-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.mybatis.spring.boot.autoconfigure.MybatisAutoConfiguration$$EnhancerBySpringCGLIB$$420f5dd4.sqlSessionFactory() ~[mybatis-spring-boot-autoconfigure-1.3.1.jar:1.3.1]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_111]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_111]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_111]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_111]
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
... 56 common frames omitted
Caused by: org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for com.chuangting.house.dao.HHouseAccessoriesMapper.BaseResultMap
at org.apache.ibatis.builder.xml.XMLMapperBuilder.configurationElement(XMLMapperBuilder.java:120) ~[mybatis-3.4.5.jar:3.4.5]
at org.apache.ibatis.builder.xml.XMLMapperBuilder.parse(XMLMapperBuilder.java:92) ~[mybatis-3.4.5.jar:3.4.5]
at org.mybatis.spring.SqlSessionFactoryBean.buildSqlSessionFactory(SqlSessionFactoryBean.java:521) ~[mybatis-spring-1.3.1.jar:1.3.1]
... 69 common frames omitted
Caused by: java.lang.IllegalArgumentException: Result Maps collection already contains value for com.chuangting.house.dao.HHouseAccessoriesMapper.BaseResultMap
at org.apache.ibatis.session.Configuration$StrictMap.put(Configuration.java:872) ~[mybatis-3.4.5.jar:3.4.5]
at org.apache.ibatis.session.Configuration$StrictMap.put(Configuration.java:844) ~[mybatis-3.4.5.jar:3.4.5]
at org.apache.ibatis.session.Configuration.addResultMap(Configuration.java:626) ~[mybatis-3.4.5.jar:3.4.5]
at org.apache.ibatis.builder.MapperBuilderAssistant.addResultMap(MapperBuilderAssistant.java:214) ~[mybatis-3.4.5.jar:3.4.5]
at org.apache.ibatis.builder.ResultMapResolver.resolve(ResultMapResolver.java:47) ~[mybatis-3.4.5.jar:3.4.5]
at org.apache.ibatis.builder.xml.XMLMapperBuilder.resultMapElement(XMLMapperBuilder.java:285) ~[mybatis-3.4.5.jar:3.4.5]
at org.apache.ibatis.builder.xml.XMLMapperBuilder.resultMapElement(XMLMapperBuilder.java:252) ~[mybatis-3.4.5.jar:3.4.5]
at org.apache.ibatis.builder.xml.XMLMapperBuilder.resultMapElements(XMLMapperBuilder.java:244) ~[mybatis-3.4.5.jar:3.4.5]
at org.apache.ibatis.builder.xml.XMLMapperBuilder.configurationElement(XMLMapperBuilder.java:116) ~[mybatis-3.4.5.jar:3.4.5]
... 71 common frames omitted

Process finished with exit code 1


2个回答

adminService看下实现类有没有@service注解

继续往下看报错信息,HHouseAccessoriesMapper.xml配置有问题,看下是不是重复了BaseResultMap配置(2个以上)

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
合并2个表字段并插入同一记录中的另一个字段

<div class="post-text" itemprop="text"> <p>I am not sure if what I am trying to do is even possible but, if it is, I am obviously not Googling properly and would appreciate any assistance I can get here, even if it is just a link to an "Idiot Guide".</p> <p>Okay, at the moment, I have a database table of 150-odd records. Each record contains basic details (name, location, contact information, etc.) and login credentials (UserID, password, et al). These details are captured by the website admins (i.e. no general public registration) after the prospective user has undergone a successful interview process. When a record is created, a 6-char "username prefix" is assigned to the user (e.g. 'UNPREF') and this, along with the auto-incremental UserID (e.g. 125), is used as the username (e.g. UNPREF125) to log into the website. However, the username is not actually stored in the the database. Instead, when a user logs in, the login script splits the provided username and the two chunks are checked against their relevant fields.</p> <p>In addition to this primary user table, there are a number of other tables which contain additional information (for instance, educational qualifications, work history, etc), which are linked to the user by means of the UserID, as per the primary table. Now, both users and admins can update a user's data and, therefore, I have created a field for each row that logs who last modified the record (<code>modby</code>) and when (<code>modon</code>) so that, if there are any shenanigans, I can ascertain who fiddled last and, in theory, deal with that particular individual without any "he said/she said" nonsense.</p> <p>Now here is the tricky bit. My users and admins are stored in separate databases on separate servers (the latter being beyond my control) but I have recently discovered the joys of Federated Tables, which work brilliantly. One small quirk, tho; because my users and admins are stored in separate databases and because I want to maximise the number of records I can store in a single database (there is a size limit of 100mb per database), with the company's current rate of expansion and each branch requiring two admin accounts, it is not an improbable scenario that a user and an admin will end up with the same UserID. Therefore, the <code>modby</code> fields store the full username (i.e. UNPREF125 - admins get their own, unique Username Prefix so as to differentiate between admins and users)</p> <p>Now, perhaps it is because I am such a newbie at Federated Tables but I can't seem to find a way to compare a field in a table on Server A (i.e. <code>modby</code>) with 2 separate fields (i.e. <code>unprefix</code> and <code>userid</code>) in the Federated Table, called from Server B, but I have come up with a workaround by creating an additional field in Server B's table, namely <code>username</code>, which stores the merged values (namely 'DBPREF125') and <code>modby</code> is checked against this instead, which works fine (I'm sure there is an easier way but I will save that lesson for another time).</p> <p>Now, here is my question. The admin table is currently small (only 26 records) and so I captured the usernames manually, using phpMyAdmin, but I would prefer to avoid having to manually create usernames for the 150+ records in my users table. Is there any way I can get MySQL to pull the values of the <code>userid</code> and <code>unprefix</code> fields, join them together and store the result into the <code>username</code> field of the same record or would I need to turn to PHP for this and, if so, how would I go about this?</p> <p>I apologise for the length of my question but I hope this will help explain why Google was <em>not</em> my friend today.</p> <p>Many thanks in advance.</p> </div>

sonata管理包中的一个模型的不同列表

<div class="post-text" itemprop="text"> <p>How can I create two different lists for one model? In my case I have one model User. And for this model in my dashboard I must have two lists: Members and Admins. I create for members:</p> <pre><code>sonata.admin.members: class: Project\AdminBundle\Admin\MemberAdmin tags: - { name: sonata.admin, manager_type: orm, model_manager: sonata.admin.manager.project, group: Members, label: Members} arguments: [null, %fos_user.model.user.class%, SonataAdminBundle:CRUD] calls: - [setTranslationDomain, [ProjectUserBundle]] </code></pre> <p>and for admins:</p> <pre><code>sonata.admin.user: class: Project\UserBundle\Admin\UserAdmin tags: - { name: sonata.admin, manager_type: orm, model_manager: sonata.admin.manager.project, group: Admins, label: Admin Users} arguments: [null, %fos_user.model.user.class%, ProjectUserBundle:CRUD] calls: - [setTranslationDomain, [ProjectUserBundle]] </code></pre> <p>So, I have two tabs in admin panel, but it has one url, and work only with one Admin class. </p> <p>Any ideas?</p> </div>

SSH框架应用的一个例子,不知道错在哪里,很郁闷

[b]开发环境:[/b] MyEclipse7+Tomcat5+MySQL5+Struts1.2+Hibernate3.2+Spring2.0 [b]相关代码:[/b] [color=indigo]index.jsp中代码:[/color] <body> <form action="addAdmin.do"> <input type="submit" value="OK" /> </form> </body> [color=indigo]AddAdmin.java代码:[/color] package edu.bhu.Kupid.actions; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.Action; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import edu.bhu.Kupid.domain.Admins; import edu.bhu.Kupid.service.AdminsService; public class AddAdmin extends Action { private AdminsService admServer; public AdminsService getAdmServer() { return admServer; } public void setAdmServer(AdminsService admServer) { this.admServer = admServer; } public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception{ request.setCharacterEncoding("utf-8"); String loginname="admin"; String pwd="admin"; Admins adm=new Admins(); adm.setPwd(pwd); adm.setId("1234665"); adm.setLoginname(loginname); adm.setLevel(0); admServer.addAdmin(adm); return mapping.findForward("ok"); } } [color=indigo]AdminsService.java代码:[/color] package edu.bhu.Kupid.service; import java.util.List; import edu.bhu.Kupid.domain.Admins; public interface AdminsService { public void addAdmin(Admins adm); public List<Admins> findAdminsByName(String name); } [color=indigo]AdminsServiceImpl代码:[/color] package edu.bhu.Kupid.service; import java.util.List; import edu.bhu.Kupid.domain.Admins; import edu.bhu.Kupid.persist.AdminsDao; public class AdminsServiceImpl implements AdminsService { private AdminsDao admDao; public void addAdmin(Admins adm) { admDao.insert(adm); } public AdminsDao getAdmDao() { return admDao; } public void setAdmDao(AdminsDao admDao) { this.admDao = admDao; } public List<Admins> findAdminsByName(String name) { return null; } } [color=indigo]AdminsDao.java代码:[/color] package edu.bhu.Kupid.persist; import edu.bhu.Kupid.domain.Admins; public interface AdminsDao extends BaseDao<Admins,String>{ } [color=indigo]AdminsDaoImpl.java代码:[/color] package edu.bhu.Kupid.persist; import edu.bhu.Kupid.domain.Admins; import edu.bhu.Kupid.persist.BaseDaoImpl; public class AdminsDaoImpl extends BaseDaoImpl<Admins,String> implements AdminsDao { } [color=indigo]BaseDao.java代码:[/color] package edu.bhu.Kupid.persist; import java.io.Serializable; public interface BaseDao<T, PK extends Serializable> { public void insert(T entity); public void update(T entity); public void delete(T entity); public void deleteById(PK id); public T findById(PK id); } [color=indigo]BaseDaoImpl.java代码:[/color] package edu.bhu.Kupid.persist; import java.io.Serializable; import org.springframework.orm.hibernate3.support.HibernateDaoSupport; public class BaseDaoImpl<T,PK extends Serializable> extends HibernateDaoSupport implements BaseDao<T, PK> { protected Class entityClass; public void delete(T entity) { getHibernateTemplate().delete(entity); } public void deleteById(PK id) { getHibernateTemplate().delete(getHibernateTemplate().get(entityClass, id)); } public T findById(PK id) { return (T)getHibernateTemplate().get(entityClass, id); } public void insert(T entity) { getHibernateTemplate().save(entity); } public void update(T entity) { getHibernateTemplate().update(entity); } } [color=indigo] Admins.java代码(这个BEAN的代码是利用MyEclipse的DBExplorer的Hibernate Reverse Engineering生成的)[/color] package edu.bhu.Kupid.domain; /** * Admins entity. @author MyEclipse Persistence Tools */ public class Admins implements java.io.Serializable { // Fields private String id; private String loginname; private String pwd; private Integer level; // Constructors /** default constructor */ public Admins() { } /** full constructor */ public Admins(String id, String loginname, String pwd, Integer level) { this.id = id; this.loginname = loginname; this.pwd = pwd; this.level = level; } // Property accessors public String getId() { return this.id; } public void setId(String id) { this.id = id; } public String getLoginname() { return this.loginname; } public void setLoginname(String loginname) { this.loginname = loginname; } public String getPwd() { return this.pwd; } public void setPwd(String pwd) { this.pwd = pwd; } public Integer getLevel() { return this.level; } public void setLevel(Integer level) { this.level = level; } } [color=indigo]Admins.hbm.xml代码:[/color] <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <hibernate-mapping> <class name="edu.bhu.Kupid.domain.Admins" table="admins" catalog="graduation"> <id name="id" type="java.lang.String"> <column name="id" length="128" /> <generator class="uuid.hex" /> </id> <property name="loginname" type="java.lang.String"> <column name="loginname" length="20" not-null="true" /> </property> <property name="pwd" type="java.lang.String"> <column name="pwd" length="20" not-null="true" /> </property> <property name="level" type="java.lang.Integer"> <column name="level" not-null="true" /> </property> </class> </hibernate-mapping> [color=indigo]spring-admins.xml代码:[/color] <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"> <bean id="adminsDao" class="edu.bhu.Kupid.persist.AdminsDaoImpl" parent="baseDao"> </bean> <bean id="adminsServer" class="edu.bhu.Kupid.service.AdminsServiceImpl"> <property name="admDao"> <ref bean="adminsDao"/> </property> </bean> <bean name="/addAdmin" class="edu.bhu.Kupid.actions.AddAdmin"> <property name="admServer"> <ref bean="adminsServer" /> </property> </bean> </beans> [color=indigo] applicationContext.xml代码:[/color] <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"> <import resource="spring-admins.xml" /> <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="location"> <value>/WEB-INF/classes/configure.properties</value> </property> </bean> <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"> <property name="driverClassName"> <value>${jdbc.driverClassName}</value> </property> <property name="url"> <value>${jdbc.url}</value> </property> <property name="username"> <value>${jdbc.username}</value> </property> <property name="password"> <value>${jdbc.password}</value> </property> </bean> <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="dataSource"> <ref bean="dataSource" /> </property> <property name="mappingResources"> <list> <value>/edu/bhu/Kupid/domain/Admins.hbm.xml </value> <!-- 好多好多Hibernate --> </list> </property> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect"> ${hibernate.dialect} </prop> <prop key="hibernate.show_sql">true</prop> <prop key="hibernate.format_sql">true</prop> </props> </property> </bean> <bean id="baseDao" class="edu.bhu.Kupid.persist.BaseDaoImpl" abstract="true"> <property name="sessionFactory"> <ref bean="sessionFactory" /> </property> </bean> </beans> [color=indigo]struts-config.xml代码:[/color] <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://struts.apache.org/dtds/struts-config_1_2.dtd"> <struts-config> <data-sources /> <form-beans /> <global-exceptions /> <global-forwards /> <action-mappings > <action path="/addAdmin" type="edu.bhu.Kupid.actions.AddAdmin" validate="false" > <forward name="ok" path="/ok.jsp" ></forward> </action> </action-mappings> <message-resources parameter="edu.bhu.Kupid.resource.ApplicationResources" /> </struts-config> [color=indigo]web.xml代码:[/color] <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.5" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> <servlet> <servlet-name>action</servlet-name> <servlet-class>org.apache.struts.action.ActionServlet</servlet-class> <init-param> <param-name>config</param-name> <param-value>/WEB-INF/struts-config.xml</param-value> </init-param> <init-param> <param-name>debug</param-name> <param-value>3</param-value> </init-param> <init-param> <param-name>detail</param-name> <param-value>3</param-value> </init-param> <load-on-startup>0</load-on-startup> </servlet> <servlet-mapping> <servlet-name>action</servlet-name> <url-pattern>*.do</url-pattern> </servlet-mapping> <context-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/classes/applicationContext.xml</param-value> </context-param> <servlet> <servlet-name>SpringContextServlet</servlet-name> <servlet-class> org.springframework.web.context.ContextLoaderServlet </servlet-class> <load-on-startup>1</load-on-startup> </servlet> <filter> <filter-name>OpenSessionInView</filter-name> <filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class> <init-param> <param-name>singleSession</param-name> <param-value>false</param-value> </init-param> </filter> <filter-mapping> <filter-name>OpenSessionInView</filter-name> <url-pattern>*.do</url-pattern> </filter-mapping> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> </web-app> [b]程序目的:[/b] index.jsp上的按钮被点击后,一条Admin的信息入库。 [b] 产生错误:[/b] 浏览器中错误信息: HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception javax.servlet.ServletException org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:535) org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:433) org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236) org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196) org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414) javax.servlet.http.HttpServlet.service(HttpServlet.java:689) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:173) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77) root cause java.lang.NullPointerException edu.bhu.Kupid.actions.AddAdmin.execute(AddAdmin.java:37) org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431) org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236) org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196) org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414) javax.servlet.http.HttpServlet.service(HttpServlet.java:689) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:173) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77) note The full stack trace of the root cause is available in the Apache Tomcat/5.0.30 logs. Apache Tomcat/5.0.30 MyEclipse中错误信息: 无。 最后感谢您的帮助。祝您好运。棘手问题郁闷中。。。 [b]问题补充:[/b] AddAdmin第37行是:admServer.addAdmin(adm); [b]问题补充:[/b] 我说的嘛,怎么出空指针,昨天晚上做了这样一个试验: 注释掉原来37行的代码,然后手工创建spring上下文,就能通过。果然是SSH整合中有错误。 //admServer.addAdmin(adm); ApplicationContext ctx=new ClassPathXmlApplicationContext(new String[] {"applicationContext.xml"}); AdminsService admServer=(AdminsService)ctx.getBean("adminsServer"); admServer.addAdmin(adm); 我是第一次做SSH,不太会弄,请各位多指教。 现在还有一个很头疼的地方,就是struts,我用了tiles来做页面的分帧,于是给struts-config.xml文件加入了 <controller processorClass="org.apache.struts.tiles.TilesRequestProcessor" contentType="text/html; charset=UTF-8" /> <message-resources parameter="edu.bhu.Kupid.resource.ApplicationResources" /> <plug-in className="org.apache.struts.tiles.TilesPlugin"> <set-property property="definitions-config" value="/WEB-INF/tiles-config.xml" /> </plug-in> 结果这段代码一加进来,jsp提交表单到action的时候就找不到action了,浏览器报404异常。 PS:回lewhwa :因为有一次我发项目,有个仁兄说下载太麻烦,不如直接贴代码的好,于是我就贴了代码。。。

Wordpress:CalderaWP将MySQL字段值存储为字符串“Array”。 如何用$ wpdb解析?

<div class="post-text" itemprop="text"> <p>I've built a survey site with Wordpress and CalderaWP forms and I'm running into an issue with the data storage for checkbox field values. My concern is that the data for these types of form submissions are being stored in the MySQL database as the string, "Array". Here is an example:</p> <p><a href="https://i.stack.imgur.com/QLikN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QLikN.png" alt="enter image description here"></a></p> <p>I have a number of things I'd like to do with this data, such as export it to a csv file, allow admins to change values via custom fields, etc. and in every front end form I've created the value shows up as the string, "Array". Here is a shot of one of the custom fields:</p> <p><a href="https://i.stack.imgur.com/dF9Kq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dF9Kq.png" alt="enter image description here"></a></p> <p>I've decided to write a wp cron that reformats this data into a front-end, usable format. The first part is getting the data and converting it. I've managed to use the $wpdb object to get all the fields that have the value "Array". It looks like this:</p> <pre><code>function reformat_mysql_arrays() { global $wpdb; $table_name = '`wp_mydatabase`.`wp_cf_form_entry_values`'; $results = $wpdb-&gt;get_results("SELECT * FROM $table_name WHERE `value` LIKE 'Array' "); // Loop through the rows for the query foreach($results as $key =&gt; $row) { // Loop through the current row's columns foreach($row as $column =&gt; $value) { if($column == 'id') { echo 'ID: ' . $value . ' | '; } if($column == 'value') { var_dump($value); } } }// END foreach column loop } reformat_mysql_arrays(); </code></pre> <p>My concern is that when I <code>var_dump()</code> the field value from the 'value' column, it appears to literally be the string, "Array", rather than an array I can parse. Here's a screen shot of the output of this function:</p> <p><a href="https://i.stack.imgur.com/1ReQ4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1ReQ4.png" alt="enter image description here"></a></p> <p>I've attempted every way I can think of to parse the values -- explode, implode, foreach, unserialize, array_values, etc. -- and I still cannot get any value out of the apparent array. Any help would be greatly appreciated. Am I missing something here?</p> </div>

vue跑项目跑不起来,求解一下

C:\Users\zsj>d: D:\>cd work D:\work>cd admins D:\work\admins>npm run ip > vue-admin@0.1.12 ip D:\work\admins > cross-env NODE_ENV=development node build/dev-server.js [HPM] Proxy created: /MODApis -> http://dev.markitondemand.com webpack: wait until bundle finished: webpack: wait until bundle finished: /index.html webpack built de040423250ca96e6acb in 8676ms Hash: de040423250ca96e6acb Version: webpack 2.6.1 Time: 8676ms Asset Size Chunks Chunk Names assets/img/fontawesome-webfont.912ec66.svg 444 kB assets/fonts/fontawesome-webfont.674f50d.eot 166 kB assets/fonts/fontawesome-webfont.b06871f.ttf 166 kB assets/fonts/fontawesome-webfont.af7ae50.woff2 77.2 kB assets/fonts/fontawesome-webfont.fee66e7.woff 98 kB app.js 3.72 MB 0 app vendor.js 1.03 MB 1 vendor ERROR in ./client/store/modules/menu/lazyLoading.js Module build failed: SyntaxError: D:/work/admins/client/store/modules/menu/lazyL oading.js: Unexpected token (3:46) 1 | // lazy loading Components 2 | // https://github.com/vuejs/vue-router/blob/dev/examples/lazy-loading/app. js#L8 > 3 | export default (name, index = false) => () => import(`views/${name}${index ? '/index' : ''}.vue`) | ^ 4 | @ ./client/store/modules/menu/index.js 2:0-40 @ ./client/store/index.js @ ./client/app.js @ ./client/index.js @ multi ./build/dev-client ./client/index.js ERROR in ./client/components/layout/index.js Module build failed: SyntaxError: D:/work/admins/client/components/layout/index. js: Unexpected token, expected { (1:7) > 1 | export Navbar from './Navbar' | ^ 2 | 3 | export Sidebar from './Sidebar' 4 | @ ./~/babel-loader/lib!./~/vue-loader/lib/selector.js?type=script&index=0!./cli ent/App.vue 13:0-73 @ ./client/App.vue @ ./client/app.js @ ./client/index.js @ multi ./build/dev-client ./client/index.js ERROR in ./~/vue-bulma-jump/src/index.js Module build failed: SyntaxError: D:/work/admins/node_modules/vue-bulma-jump/src /index.js: Unexpected token, expected { (1:7) > 1 | export BackToTop from './BackToTop' | ^ 2 | export default from './Jump' 3 | @ ./~/babel-loader/lib!./~/vue-loader/lib/selector.js?type=script&index=0!./cli ent/views/Home.vue 147:0-43 @ ./client/views/Home.vue @ ./client/router/index.js @ ./client/app.js @ ./client/index.js @ multi ./build/dev-client ./client/index.js Child html-webpack-plugin for "index.html": Asset Size Chunks Chunk Names index.html 1.48 MB 0 webpack: Failed to compile. > Listening at http://localhost:8080

Spring3 security tomcat 启动报错

报错信息: 严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.filterChains': Cannot resolve reference to bean 'org.springframework.security.web.DefaultSecurityFilterChain#0' while setting bean property 'sourceList' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.web.DefaultSecurityFilterChain#0': Cannot resolve reference to bean 'userLoginFilter' while setting constructor argument with key [4]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userLoginFilter' defined in class path resource [spring-security.xml]: Cannot resolve reference to bean 'userLoginAuthenticationManager' while setting bean property 'authenticationManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.authenticationManager': Cannot resolve reference to bean 'org.springframework.security.authentication.dao.DaoAuthenticationProvider#0' while setting constructor argument with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.authentication.dao.DaoAuthenticationProvider#0': Cannot resolve reference to bean 'loginUserDetailsService' while setting bean property 'userDetailsService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'loginUserDetailsService' defined in class path resource [spring-security.xml]: Instantiation of bean failed; nested exception is java.lang.IllegalStateException: No bean class specified on bean definition at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:329) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:107) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedList(BeanDefinitionValueResolver.java:353) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:154) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1387) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1128) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:610) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479) at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:389) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4973) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5467) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Web.xml 相关配置: <!-- 配置监听 --> <listener> <listener-class> org.springframework.web.context.ContextLoaderListener </listener-class> </listener> <!-- Spring Security1 --> <filter> <filter-name>springSecurityFilterChain</filter-name> <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class> </filter> <filter-mapping> <filter-name>springSecurityFilterChain</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> spring-security.xml的相关配置 <?xml version="1.0" encoding="UTF-8"?> <beans:beans xmlns="http://www.springframework.org/schema/security" xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.2.xsd" default-lazy-init="true"> <http use-expressions="true" auto-config='true'> <form-login login-page="/login.jsp" authentication-failure-url="/accessDenied.jsp" /> <http-basic /> <logout invalidate-session="true" logout-success-url="/login.jsp?login_error=succLogout" logout-url="/userOut.html" /> <!-- 防止多个用户同时登陆一个账号 --> <session-management> <concurrency-control max-sessions="1" error-if-maximum-exceeded="false"/> </session-management> <!-- 认证 --> <custom-filter ref="userLoginFilter" before="FORM_LOGIN_FILTER"/> </http> <!-- 配置过滤器 --> <beans:bean id="userLoginFilter" class="com.smile.common.filter.userlogin.UserLoginFilter"> <beans:property name="filterProcessesUrl" value="/login.do"></beans:property> <beans:property name="authenticationManager" ref="userLoginAuthenticationManager"></beans:property> </beans:bean> <authentication-manager alias="userLoginAuthenticationManager"> <authentication-provider user-service-ref="loginUserDetailsService" /> </authentication-manager> <beans:bean id="loginUserDetailsService"> <beans:property name="target"> <beans:bean class="com.smile.service.user.UserDetailServiceImpl"> <beans:property name="userDAO" ref="userDAO"></beans:property> </beans:bean> </beans:property> </beans:bean> </beans:beans>

Laravel 5路由到CSS文件夹问题

<div class="post-text" itemprop="text"> <p>I have the following route which loads the page but the <code>css</code> of the page doesn't loads.</p> <pre><code>Route::get('admins', function () { return view('admins/index'); }); </code></pre> <p>In the contrast the following route loads the same page but here I added <code>index</code> and the page loads correctly. but I also adds <code>index</code> with <code>admins</code> in the browser address bar.</p> <pre><code>Route::get('admins/index', function () { return view('admins/index'); }); </code></pre> <p>I am calling <code>css</code> files in the views like:</p> <pre><code>&lt;link href="../assets/css/animate.min.css" rel="stylesheet" /&gt; </code></pre> <p>I searched for the solutions but didn't got anything.</p> </div>

Laravel 5.5错误基表或视图已存在:1050表'用户'已存在

<div class="post-text" itemprop="text"> <p><strong>Specifications:</strong></p> <ul> <li>Laravel Version: 5.5.3</li> <li>PHP Version: 7.1</li> <li>Database Driver &amp; Version: MariaDB 10.1.26</li> </ul> <p><strong>Description:</strong></p> <pre><code>C:/Users/user/code/blog/&gt;php artisan migrate [Illuminate\Database\QueryException] SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'users' already exists (SQL: create table users (id int unsigned not null aut o_increment primary key, name varchar(255) not null, email varchar(255) not null, password varchar(255) not null, remember_token varchar (100) null, created_at timestamp null, updated_at timestamp null) default character set utf8mb4 collate utf8mb4_unicode_ci engine = InnoDB R OW_FORMAT=DYNAMIC) [PDOException] SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'users' already exists </code></pre> <p><strong>Steps To Reproduce:</strong></p> <pre><code> C:/Users/user/code/blog/&gt;laravel new website C:/Users/user/code/blog/&gt;php artisan make:migration create_lists_table --create=lists C:/Users/user/code/blog/&gt;php artisan migrate </code></pre> <p><strong>Problem</strong></p> <p>It Creates users table and give error but not creating lists table</p> </div>

JDBC Connection [org.apache.commons.dbcp.PoolableConnection@47db5fa5] will not be managed by Spring DEBUG [main] - ==> Preparing: select * from user where id = ?

![图片说明](https://img-ask.csdn.net/upload/201910/11/1570799817_983016.png)<br> JDBC Connection [org.apache.commons.dbcp.PoolableConnection@47db5fa5] will not be managed by Spring<br> DEBUG [main] - ==> Preparing: select * from user where id = ? <br> DEBUG [main] - ==> Parameters: 1(Integer)<br> DEBUG [main] - Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@7d286fb6]<br> DEBUG [main] - Returning JDBC Connection to DataSource<br> spring和mybatis的整合<br> 从数据库拿不到数据<br> ``` MyUser auser = userDao.selectUserById(1); System.out.println("名字" +auser.getname()); System.out.println("============================"); ``` 拿id为i的数据(这个数据存在,),就不会输出<br> 可以向数据库中存入信息,但是不能拿出来

vue 无法向data中的数组中push

``` new Vue({ el: "#adminDiv", data: { admins: [], id: null, aname: null, pwd: null }, created: function () { alert("loadList"); $.get("admin/load").success(function (list) { alert(list.length); for(var i=0;i<list.length;i++){ alert(list[i].aname); this.admins.push(list[i]); } }) }, ``` list里面数据是正确的,但是无法push到data里的数组中,不知道是为什么求教 这里push会报错 ![图片说明](https://img-ask.csdn.net/upload/201905/22/1558489926_454576.png)

Python编程从入门到实践 第18章Django入门 第365页“添加主题”出错,找不出原因,求大神帮忙

电脑系统为64位的win7,python为64位的3.7.4版本,Django为2.2.4版本,学习第365页“添加主题”遇到了麻烦 ,自己摸索了很长时间,网上也搜索了很久还是没解决,求大神帮帮小白。 ![图片说明](https://img-ask.csdn.net/upload/201908/27/1566913286_833364.jpg) 在添加Chess主题时网页和终端里都报错,终端错误截图如下: ![图片说明](https://img-ask.csdn.net/upload/201908/27/1566912120_690258.png) 网页错误最前面的截图如下: ![图片说明](https://img-ask.csdn.net/upload/201908/27/1566912225_331720.png) 网页错误提示很长,下面这张是最后带提示的截图,我按照提示把settings.py文件里的DEBUG = False后,终端就退出了,再次运行python manage.py runserver终端也无法启动。 ![图片说明](https://img-ask.csdn.net/upload/201908/27/1566912555_34630.png) 仔细检查代码也没查出来,models.py,settings.py,admins.py代码如下: ![图片说明](https://img-ask.csdn.net/upload/201908/27/1566913232_687107.png) ![图片说明](https://img-ask.csdn.net/upload/201908/27/1566913242_373496.png) ![图片说明](https://img-ask.csdn.net/upload/201908/27/1566913253_641400.png)

以相同的形式/页面更新和创建的方法

<div class="post-text" itemprop="text"> <p>I have a form to edit the administrators of a post.</p> <p>This form has some radio buttons. Each radio button corresponds to a administrator of a a post. When some radio button (administrator) is clicked the details of the administrator are populated in the form fields. When the "Update" button is clicked the details of the administrator are updated. </p> <p>This is working fine.</p> <p><strong>Doubt:</strong></p> <p>But there is a static radio button, "Create new administrator", that allows to create a new administrator. When this radio button is selected the form fields are reseted so the user can insert values to create a new admin.</p> <p>My doubt is how we can reuse this same form for the udpate, that is already working fine, but also for the creation of a new administrator when the radio button selected is "Create new admin"? Or, what could be a proper approach for this context?</p> <p><strong>form:</strong></p> <pre><code>&lt;form method="post" class="clearfix" action="{{route('admins.update', ['id' =&gt; $post-&gt;id])}}" enctype="multipart/form-data"&gt; {{csrf_field()}} @foreach($administrators $admin) &lt;div class="form-check"&gt; &lt;input class="form-check-input" type="radio" name="radiobutton" id="{{$admin-&gt;id}}" value=""&gt; &lt;label class="form-check-label" for=""&gt; {{$admin-&gt;name}} &lt;/label&gt; &lt;/div&gt; @endforeach &lt;div class="form-check"&gt; &lt;input class="form-check-input" type="radio" name="radiobutton" id="create_administrator" value="option2"&gt; &lt;label class="form-check-label" for="exampleRadios2"&gt; Create new administrator &lt;/label&gt; &lt;/div&gt; &lt;div class="form-group"&gt; &lt;label for="name"&gt;Name&lt;/label&gt; &lt;input type="text" required class="form-control" value="{{ $admin-&gt;name }}" name="name"&gt; &lt;/div&gt; &lt;!-- below I have more form fields like administrator name, email, etc --&gt; &lt;input type="submit" id="adminStoreButton" class="btn btn-primary" value="Create"/&gt; &lt;input type="submit" id="adminUpdateButton" class="btn btn-primary" value="Update"/&gt; &lt;/form&gt; </code></pre> <p><strong>JS: to show the details of the admin based on radio button selection and to hide and show the store/update button</strong></p> <pre><code>var admins = {!! $administrators !!} $("input[name='radiobutton']").click(function() { if($(this).attr("id") == "create_administrator"){ $("#adminUpdateButton").hide(); $("#adminStoreButton").show(); form.attr('action', '{{route('admins.store', ['post_id' =&gt; $post-&gt;id])}}'); } else{ $("#adminUpdateButton").show(); $("#adminStoreButton").hide(); form.attr('action', '{{route('admins.update', ['post_id' =&gt; $post-&gt;id])}}'); } let id = $(this).attr("id"); let data = administrators.find(e =&gt; e.id == id) || { name: "", email: "", ...: "" }; $("input[name='name']").val(data.name); ... }); </code></pre> <p><strong>// update admins routes</strong></p> <pre><code>Route::get('post/edit/{id}/admins', [ 'uses' =&gt; 'AdminController@edit', 'as'=&gt;'admins.edit']); Route::post('post/update/{id}/admins', [ 'uses' =&gt; 'AdminController@update', 'as'=&gt;'admins.update']); </code></pre> <p><strong>Administrator controller update method:</strong></p> <pre><code> public function update(Request $request, $id){ $this-&gt;validate($request, [ 'name' =&gt; 'required|string', ... ]); $adminToUpdate = Administrator::find($request-&gt;radiobutton); $adminToUpdate-&gt;name = $request-&gt;name; ... $adminToUpdate-&gt;save(); return redirect()-&gt;back(); } } </code></pre> <p><strong>Administrator controller edit method:</strong></p> <pre><code>public function edit($id) { $post = Post::find($id); $administrators = Administrator::where('post_id', $id)-&gt;get(); return view('administrators.edit') -&gt;with('post', $post) -&gt;with('administrators', $administrators)); } </code></pre> </div>

rails to_xls插件的使用

<p><br><img src="http://dl.iteye.com/upload/attachment/198890/8780c5d9-b3a3-3d56-bd1c-e7867f59ff5a.png" alt=""></p>   <p>在地址栏输入<br>http://localhost:3000/admins.xls<br>可以获取xls文件,并且是下载形式的!<br><br> @accounts = Account.find(:all, :limit =&gt; 500)<br>    respond_to do |format|<br>      format.html<br>      format.xls { send_data @accounts.to_xls }<br>    end<br>想让其单击"导出文档"链接来提供xls文件下载,所以单独写了个action</p> <pre name="code" class="ruby">def create_xls respond_to do |format| format.xls{send_data @accounts.to_xls} end</pre> <p> 但是导出的就是不xls文件的为后缀了!</p> <p> </p> <p> </p> <p>还有,我这个控制器在app/controller/admin/admin_accounts/crete_xls 我想这不会影响到插件的使用吧!</p> <p>实验成功的是新建的一个test应用,在地址栏用后缀获取是成功的。<br><img src="http://dl.iteye.com/upload/attachment/198882/d10f50bf-331e-3763-b74e-692441313619.png" alt=""></p>

使用MySQL创建一个php变量

<div class="post-text" itemprop="text"> <p>I have a Problem and I don't know how to solve it. I try to make a simple if statement with a php variable. The Variable contains a MySQL SELECT value.</p> <pre><code>$adminarray = $mysqli-&gt;query("SELECT admin FROM user WHERE name LIKE '$username'"); $currentuser = mysqli_fetch_row($adminarray); $adm = $currentuser[0]; echo "&lt;form action='?delete1' method='post' style='visibility:";if ($adm = 1){echo "block";}else{echo "hidden";}echo "'&gt; </code></pre> <p>I try to hide the button for non admins ($adm = 0) but it is not working. The IF Statemant always returns a "true". even if $adm is 0.</p> <p>I know the code isn't that good, but I'm still learning. So if you can give some tips :)</p> <p>Thanks for answering</p> </div>

easy ui datagrid 没有请求url指定的servlet

问题: 直接访问servlet可以得到数据: ![图片说明](https://img-ask.csdn.net/upload/201704/26/1493184117_370983.jpg) 但是通过通过页面访问发现datagrid 根本就不发送请求: ![图片说明](https://img-ask.csdn.net/upload/201704/26/1493184317_140963.jpg) 页面: ``` <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Insert title here</title> <script type="text/javascript" src="../../jslib/jqueryjs/jquery-1.9.1.main"></script> <!-- 2 css资源 --> <link rel="stylesheet" type="text/css" href="../../css/jquerycss/easyui.css"> <!-- 3、图标资源 --> <link rel="stylesheet" type="text/css" href="../../css/jquerycss/icon.css"> <!-- 4、easyui的js包 --> <script type="text/javascript" src="../../jslib/jqueryjs/jquery.easyui.min.js"></script> <!-- 5、本地语言 --> <script type="text/javascript" src="../../jslib/jqueryjs/easyui-lang-zh_CN.js"></script> </head> <body> <script type="text/javascript"> $(function(){ //创建data_grid $("#st").datagrid({ url:'/JsonServlet', //数据来源 //列的定义 columns:[[ {field:'id',title:'用户ID',width:50}, {field:'name',title:'用户姓名',width:50}, {field:'passWord',title:'用户密码',width:50,align:'right'} ]], fitColumns:true,//列自适应宽度,不能和冻结列同时设置为true striped:true,//斑马线效果 idField:'id',//主键列 rownumbers:true,//显示行号 singleSelect:false,//是否单选 pagination:true,//显示分页栏 pageList:[10,20,50,100],//每页行数选择列表 pageSize:10,//出事每页行数 remoteSort:false,//是否服务器端排序,设成false,才能客户端排序 sortName:'sclass'//设置排序列 }); }) </script> <table id="st"></table> </body> </html> ``` JsonServlet: ``` package com.climberclimbing.github.io.servlet; import java.io.IOException; import java.util.ArrayList; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.climberclimbing.github.io.dao.AdminDaoImp; import com.climberclimbing.github.io.model.*; import net.sf.json.JSONArray; public class JsonServlet extends HttpServlet{ private static final long serialVersionUID = 1L; @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { ArrayList <Admin> admins=new ArrayList<Admin>(); AdminDaoImp adminDaoImp = new AdminDaoImp(); admins = adminDaoImp.getAllAdmin(); JSONArray result = JSONArray.fromObject(admins); String JsonResult = "{\"total\":"+admins.size()+","+"\"rows\":"+result.toString()+"}"; System.out.println(JsonResult); resp.getWriter().write(JsonResult); } @Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { // TODO Auto-generated method stub doGet(req, resp); } } ```

CodeIgniter return尝试获取非对象的属性

<div class="post-text" itemprop="text"> <p>I've made an application in <code>CodeIgniter</code> this working in locally and now I want to try in on a hosting: <code>hostinger</code>. If you want see, <a href="http://primodebug.esy.es/Calendario/" rel="nofollow">check</a> this. Now the problem's that when the I perform the installation of the library I get the error on the bottom from the code below:</p> <pre><code>public function get_admin_role_id() { $result = intval($this-&gt;db-&gt;get_where('ea_roles', array('slug' =&gt; DB_SLUG_ADMIN))-&gt;row()-&gt;id); print_r($result); return $result; } </code></pre> <blockquote> <p>A PHP Error was encountered</p> <p>Severity: Notice</p> <p>Message: Trying to get property of non-object</p> <p>Filename: models/admins_model.php</p> <p>Line Number: 372</p> </blockquote> <p>Now this code should be returned the id roles of admin that is setted to default to <code>1</code>. Now the installation is also involved in creating the structure of the tables and logging in phpMyAdmin seems that the database is still empty, perhaps this could be the cause of the problem? Can someone help me understand what's going on?</p> <p><a href="http://pastebin.com/kShtzzsK" rel="nofollow">Complete admin model</a></p> </div>

Laravel App - 仅限管理员路线'/ admin'将始终返回404错误| '/ admins'或其他任何工作

<div class="post-text" itemprop="text"> <p>So if you <a href="https://laracasts.com/discuss/channels/laravel/when-routes-url-is-admin-it-results-in-404" rel="nofollow noreferrer">go here</a> you will see the EXACT SAME ISSUE word for word that i'm having...</p> <p>Basically I have the admin route set like this:</p> <pre><code>Route::get('/admin', function () { return view('admin.app'); }); </code></pre> <p>Simple enough right? It always returns this error here:</p> <blockquote> <p>Not Found</p> <p>The requested URL /admin/ was not found on this server.</p> </blockquote> <p>If i change the route to <code>/admins</code> (plural) or really <strong>anything</strong> else, even <code>/test</code> the route displays properly.</p> <p>I DID have an admin folder inside my public folder, but I have since deleted the admin folder and now the problem is still persisting. I don't really understand why. I'm running on a Laravel/Homestead environment. Basic LEMP stack. Nothing special.</p> <p>Edit: When i type in mysite.dev:8000/admin it directs me automatically to mysite.dev/admin (Notice there is no port) So, now i'm really even more confused. :/</p> <p>Edit 2: Changed the route to <code>admin/dashboard</code> works just fine. Could it be possible that Laravel has defined the <code>/admin</code> route as a 'reserved route' or something (similar to reserved keywords in any programming language) to where it won't ever display anything? Is that even a thing?</p> <pre><code>Route::get('admin/dashboard', function () { return view('admin.app'); }); </code></pre> <p>Any ideas?</p> </div>

Laravel:管理员可以查看/编辑/删除所有内容,但作者只能拥有自己的内容

<div class="post-text" itemprop="text"> <p>My app has two roles: <strong>admin</strong> &amp; <strong>author</strong> (by the way, there are tables: <em>roles</em>, <em>permissions</em>, <em>permission_role</em>, <em>role_user</em>, there are Eloquent models <em>Role.php</em>, <em>Permission.php</em>... in model User.php there is a method called <strong>hasRole</strong> that checks whether the user has some role... and finally, in <strong>AuthServiceProvider.php</strong> there is:</p> <pre><code>public function boot(GateContract $gate) { $this-&gt;registerPolicies($gate); foreach ($this-&gt;getPermissions() as $permission) { $gate-&gt;define($permission-&gt;name, function($user) use ($permission) { return $user-&gt;hasRole($permission-&gt;roles); }); } } protected function getPermissions() { return Permission::with('roles')-&gt;get(); } </code></pre> <p>Anyway, I've created two roles: <strong>admin</strong> &amp; <strong>author</strong>. </p> <ul> <li>Admins should be able to see/edit/delete all articles. Also, admins should be able to create and edit/delete all registered users.</li> <li>Author should be able to see/edit/delete only his own articles. Also, author should be able to edit only his own profile.</li> </ul> <p>I'm not sure which is the best way to create this. Would it be a good idea to create the following permissions:</p> <ul> <li>manage_users</li> <li>edit_profile</li> <li>manage_articles</li> <li>edit_published_articles</li> <li>delete_published_articles</li> </ul> <p>and then <strong>admin</strong> role would have all of these permissions, while <strong>author</strong> would have only: <em>edit_profile</em>, <em>edit_published_articles</em>, <em>delete_published_articles</em>... </p> <p>Then, in <strong>UsersController.php</strong> in each method I would check the permissions:</p> <pre><code>public function index() { if (Auth::user()-&gt;can('edit_profile')) { if (Auth::user()-&gt;can('manage_users')) { $users = User::with('roles')-&gt;get(); return view('backend.users.index', compact('users')); } $users = collect([Auth::user()]); return view('backend.users.index', compact('users')); } return redirect('backend'); } public function create(User $user) { if (Auth::user()-&gt;can('manage_users')) { $roles = Role::lists('label', 'name'); return view('backend.users.form', compact('user', 'roles')); } return redirect('backend'); } public function store(Requests\StoreUserRequest $request) { if (Auth::user()-&gt;can('manage_users')) { $user = new User($request-&gt;only('name', 'email', 'password')); $user-&gt;save(); $roleName = $request-&gt;input('role'); $user-&gt;assignRole($roleName); session()-&gt;flash('status', 'User has been created.'); return redirect(route('backend.users.index')); } return redirect('backend'); } public function edit($id) { if (Auth::user()-&gt;can('edit_profile')) { if (Auth::user()-&gt;can('manage_users')) { $user = User::findOrFail($id); $roles = Role::lists('label', 'name'); foreach ($user-&gt;roles as $role) { $roleName = $role-&gt;name; } return view('backend.users.form', compact('user', 'roles', 'roleName')); } $user = User::findOrFail($id); if ($user-&gt;id == Auth::user()-&gt;id) { $roles = Role::lists('label', 'name'); foreach ($user-&gt;roles as $role) { $roleName = $role-&gt;name; } return view('backend.users.form', compact('user', 'roles', 'roleName')); } } return redirect('backend'); } // ... and so on... </code></pre> <p>BUT, I'm quite sure that this is not the best way. Maybe I do not need to have the permissions at all - instead of checking permissions in controller methods it would be better to ask whether the user has a specific role (<code>if (Auth::user()-&gt;hasRole('admin'))</code>), for example instead of:</p> <pre><code>public function index() { if (Auth::user()-&gt;can('edit_profile')) { if (Auth::user()-&gt;can('manage_users')) { $users = User::with('roles')-&gt;get(); return view('backend.users.index', compact('users')); } $users = collect([Auth::user()]); return view('backend.users.index', compact('users')); } return redirect('backend'); } </code></pre> <p>we would say:</p> <pre><code>public function index() { if (Auth::user()-&gt;hasRole('admin')) { $users = User::with('roles')-&gt;get(); return view('backend.users.index', compact('users')); } $users = collect([Auth::user()]); return view('backend.users.index', compact('users')); } </code></pre> <p>... or maybe this isn't the good way too? How would you do? Is it enough just to check in controller methods, or maybe there should be some Middleware involved? </p> <hr> <p>Since this is a long post, to summarize:</p> <p>I've created two roles: <strong>admin</strong> &amp; <strong>author</strong> and: </p> <ul> <li>Admins should be able to see/edit/delete all articles. Also, admins should be able to create and edit/delete all registered users.</li> <li>Author should be able to see/edit/delete only his own articles. Also, author should be able to edit only his own profile.</li> </ul> <p>How would you do this?</p> </div>

遍历结构并执行数据库查询

<div class="post-text" itemprop="text"> <p>So I'm new to go and I come from a javascript/node background and for practice, I've been rewriting some of my javascript code into go.</p> <p>I have a situation where I have an struct (in node it was my object) and I need to iterate over it and perform two database queries. I have something that works but it seems costly and repetitive.</p> <p><strong>Struct:</strong></p> <pre><code>type SiteUsers struct { Active struct { Moderators []string `json:"moderators"` Admins []string `json:"admins"` Regulars []string `json:"regulars"` } `json:"active"` } </code></pre> <p>Then in the function where I handle an api request that returns JSON binded to this struct I use a for range loop for each role under active. For each one I perform the same first query and then a second one that is specific to each one.</p> <pre><code>v := getSiteUsers(&amp;usrs, website) for _, moderators := range v.Active.Moderators { // Insert into user table // Insert into user table with role of moderator } for _, admins := range v.Active.Admins { // Insert into user table // Insert into user table with role of admin } for _, regulars := range v.Active.Regulars { // Insert into user table // Insert into user table with role of regular } </code></pre> <p>This method will work but it doesn't feel completely right and I would love to get some input from people experienced with go.</p> </div>

根据标签类验证字段

<div class="post-text" itemprop="text"> <p>I'm setting up dynamic form fields that admins can add questions to the form themselves and have us not worry about adding anything.</p> <p>These are fairly simple questions and are going to be validated just in the ajax validation script and amended to the current error message. (no real need for php validation, I'd love to add this but I just can't get the cvalidation working for fields that are added dynamically)</p> <p>The issue I'm having is aiming at the custom class I've put in the label for every field that has the required class applied to it. In this case it's "required label". </p> <p>My guess to just have a blanket look at the label is..</p> <pre><code> 'afterValidate'=&gt;"js:function(form, data, hasError) { if(document.forms['user-form'].required-label.value == '') { $('&lt;li&gt;Field cannot be blank&lt;/li&gt;').appendTo('#user-form_es_'); $('.required-label').css( 'border-color', '#a94442 ' ); $('label[for=requiredField]').css('color','#a94442 '); } else { $('.required-label').css( 'border-color', '#3c763d ' ) ; $('label[for=.required-label]').css('color','#3c763d '); return true; } } </code></pre> <p>But the issue is that the value sits alongside the label, not under it. They are all nested in a form-group class.</p> <p>Any ideas how to target this label class or is there a better way to go about this?</p> <p>Edit. Should have noted, the obvious thing is to add required to the input element. The issue is that there is radio buttons and dropdowns that can be marked as required too. </p> </div>

MySQL 8.0.19安装教程(windows 64位)

话不多说直接开干 目录 1-先去官网下载点击的MySQL的下载​ 2-配置初始化的my.ini文件的文件 3-初始化MySQL 4-安装MySQL服务 + 启动MySQL 服务 5-连接MySQL + 修改密码 先去官网下载点击的MySQL的下载 下载完成后解压 解压完是这个样子 配置初始化的my.ini文件的文件 ...

Python+OpenCV计算机视觉

Python+OpenCV计算机视觉系统全面的介绍。

Vue.js 2.0之全家桶系列视频课程

基于新的Vue.js 2.3版本, 目前新全的Vue.js教学视频,让你少走弯路,直达技术前沿! 1. 包含Vue.js全家桶(vue.js、vue-router、axios、vuex、vue-cli、webpack、ElementUI等) 2. 采用笔记+代码案例的形式讲解,通俗易懂

navicat(内含激活码)

navicat支持mysql的可视化操作,内涵激活码,不用再忍受弹框的痛苦。

HTML期末大作业

这是我自己做的HTML期末大作业,花了很多时间,稍加修改就可以作为自己的作业了,而且也可以作为学习参考

150讲轻松搞定Python网络爬虫

【为什么学爬虫?】 &nbsp; &nbsp; &nbsp; &nbsp;1、爬虫入手容易,但是深入较难,如何写出高效率的爬虫,如何写出灵活性高可扩展的爬虫都是一项技术活。另外在爬虫过程中,经常容易遇到被反爬虫,比如字体反爬、IP识别、验证码等,如何层层攻克难点拿到想要的数据,这门课程,你都能学到! &nbsp; &nbsp; &nbsp; &nbsp;2、如果是作为一个其他行业的开发者,比如app开发,web开发,学习爬虫能让你加强对技术的认知,能够开发出更加安全的软件和网站 【课程设计】 一个完整的爬虫程序,无论大小,总体来说可以分成三个步骤,分别是: 网络请求:模拟浏览器的行为从网上抓取数据。 数据解析:将请求下来的数据进行过滤,提取我们想要的数据。 数据存储:将提取到的数据存储到硬盘或者内存中。比如用mysql数据库或者redis等。 那么本课程也是按照这几个步骤循序渐进的进行讲解,带领学生完整的掌握每个步骤的技术。另外,因为爬虫的多样性,在爬取的过程中可能会发生被反爬、效率低下等。因此我们又增加了两个章节用来提高爬虫程序的灵活性,分别是: 爬虫进阶:包括IP代理,多线程爬虫,图形验证码识别、JS加密解密、动态网页爬虫、字体反爬识别等。 Scrapy和分布式爬虫:Scrapy框架、Scrapy-redis组件、分布式爬虫等。 通过爬虫进阶的知识点我们能应付大量的反爬网站,而Scrapy框架作为一个专业的爬虫框架,使用他可以快速提高我们编写爬虫程序的效率和速度。另外如果一台机器不能满足你的需求,我们可以用分布式爬虫让多台机器帮助你快速爬取数据。 &nbsp; 从基础爬虫到商业化应用爬虫,本套课程满足您的所有需求! 【课程服务】 专属付费社群+每周三讨论会+1v1答疑

三个项目玩转深度学习(附1G源码)

从事大数据与人工智能开发与实践约十年,钱老师亲自见证了大数据行业的发展与人工智能的从冷到热。事实证明,计算机技术的发展,算力突破,海量数据,机器人技术等,开启了第四次工业革命的序章。深度学习图像分类一直是人工智能的经典任务,是智慧零售、安防、无人驾驶等机器视觉应用领域的核心技术之一,掌握图像分类技术是机器视觉学习的重中之重。针对现有线上学习的特点与实际需求,我们开发了人工智能案例实战系列课程。打造:以项目案例实践为驱动的课程学习方式,覆盖了智能零售,智慧交通等常见领域,通过基础学习、项目案例实践、社群答疑,三维立体的方式,打造最好的学习效果。

基于STM32的电子时钟设计

时钟功能 还有闹钟功能,温湿度功能,整点报时功能 你值得拥有

学生成绩管理系统(PHP + MYSQL)

做的是数据库课程设计,使用的php + MySQL,本来是黄金搭配也就没啥说的,推荐使用wamp服务器,里面有详细的使用说明,带有界面的啊!呵呵 不行的话,可以给我留言!

面试了一个 31 岁程序员,让我有所触动,30岁以上的程序员该何去何从?

最近面试了一个31岁8年经验的程序猿,让我有点感慨,大龄程序猿该何去何从。

程序员的兼职技能课

获取讲师答疑方式: 在付费视频第一节(触摸命令_ALL)片头有二维码及加群流程介绍 限时福利 原价99元,今日仅需39元!购课添加小助手(微信号:itxy41)按提示还可领取价值800元的编程大礼包! 讲师介绍: 苏奕嘉&nbsp;前阿里UC项目工程师 脚本开发平台官方认证满级(六级)开发者。 我将如何教会你通过【定制脚本】赚到你人生的第一桶金? 零基础程序定制脚本开发课程,是完全针对零脚本开发经验的小白而设计,课程内容共分为3大阶段: ①前期将带你掌握Q开发语言和界面交互开发能力; ②中期通过实战来制作有具体需求的定制脚本; ③后期将解锁脚本的更高阶玩法,打通任督二脉; ④应用定制脚本合法赚取额外收入的完整经验分享,带你通过程序定制脚本开发这项副业,赚取到你的第一桶金!

实用主义学Python(小白也容易上手的Python实用案例)

原价169,限时立减100元! 系统掌握Python核心语法16点,轻松应对工作中80%以上的Python使用场景! 69元=72讲+源码+社群答疑+讲师社群分享会&nbsp; 【哪些人适合学习这门课程?】 1)大学生,平时只学习了Python理论,并未接触Python实战问题; 2)对Python实用技能掌握薄弱的人,自动化、爬虫、数据分析能让你快速提高工作效率; 3)想学习新技术,如:人工智能、机器学习、深度学习等,这门课程是你的必修课程; 4)想修炼更好的编程内功,优秀的工程师肯定不能只会一门语言,Python语言功能强大、使用高效、简单易学。 【超实用技能】 从零开始 自动生成工作周报 职场升级 豆瓣电影数据爬取 实用案例 奥运冠军数据分析 自动化办公:通过Python自动化分析Excel数据并自动操作Word文档,最终获得一份基于Excel表格的数据分析报告。 豆瓣电影爬虫:通过Python自动爬取豆瓣电影信息并将电影图片保存到本地。 奥运会数据分析实战 简介:通过Python分析120年间奥运会的数据,从不同角度入手分析,从而得出一些有趣的结论。 【超人气老师】 二两 中国人工智能协会高级会员 生成对抗神经网络研究者 《深入浅出生成对抗网络:原理剖析与TensorFlow实现》一书作者 阿里云大学云学院导师 前大型游戏公司后端工程师 【超丰富实用案例】 0)图片背景去除案例 1)自动生成工作周报案例 2)豆瓣电影数据爬取案例 3)奥运会数据分析案例 4)自动处理邮件案例 5)github信息爬取/更新提醒案例 6)B站百大UP信息爬取与分析案例 7)构建自己的论文网站案例

Java8零基础入门视频教程

这门课程基于主流的java8平台,由浅入深的详细讲解了java SE的开发技术,可以使java方向的入门学员,快速扎实的掌握java开发技术!

Python数据挖掘简易入门

&nbsp; &nbsp; &nbsp; &nbsp; 本课程为Python数据挖掘方向的入门课程,课程主要以真实数据为基础,详细介绍数据挖掘入门的流程和使用Python实现pandas与numpy在数据挖掘方向的运用,并深入学习如何运用scikit-learn调用常用的数据挖掘算法解决数据挖掘问题,为进一步深入学习数据挖掘打下扎实的基础。

零基础学C#编程—C#从小白到大咖

本课程从初学者角度出发,提供了C#从入门到成为程序开发高手所需要掌握的各方面知识和技术。 【课程特点】 1 由浅入深,编排合理; 2 视频讲解,精彩详尽; 3 丰富实例,轻松易学; 4 每章总结配有难点解析文档。 15大章节,228课时,1756分钟与你一同进步!

MySQL数据库面试题(2020最新版)

文章目录数据库基础知识为什么要使用数据库什么是SQL?什么是MySQL?数据库三大范式是什么mysql有关权限的表都有哪几个MySQL的binlog有有几种录入格式?分别有什么区别?数据类型mysql有哪些数据类型引擎MySQL存储引擎MyISAM与InnoDB区别MyISAM索引与InnoDB索引的区别?InnoDB引擎的4大特性存储引擎选择索引什么是索引?索引有哪些优缺点?索引使用场景(重点)...

多功能数字钟.zip

利用数字电子计数知识设计并制作的数字电子钟(含multisim仿真),该数字钟具有显示星期、24小时制时间、闹铃、整点报时、时间校准功能

极简JAVA学习营第四期(报名以后加助教微信:eduxy-1)

想学好JAVA必须要报两万的培训班吗? Java大神勿入 如果你: 零基础想学JAVA却不知道从何入手 看了一堆书和视频却还是连JAVA的环境都搭建不起来 囊中羞涩面对两万起的JAVA培训班不忍直视 在职没有每天大块的时间专门学习JAVA 那么恭喜你找到组织了,在这里有: 1. 一群志同道合立志学好JAVA的同学一起学习讨论JAVA 2. 灵活机动的学习时间完成特定学习任务+每日编程实战练习 3. 热心助人的助教和讲师及时帮你解决问题,不按时完成作业小心助教老师的家访哦 上一张图看看前辈的感悟: &nbsp; &nbsp; 大家一定迫不及待想知道什么是极简JAVA学习营了吧,下面就来给大家说道说道: 什么是极简JAVA学习营? 1. 针对Java小白或者初级Java学习者; 2. 利用9天时间,每天1个小时时间; 3.通过 每日作业 / 组队PK / 助教答疑 / 实战编程 / 项目答辩 / 社群讨论 / 趣味知识抢答等方式让学员爱上学习编程 , 最终实现能独立开发一个基于控制台的‘库存管理系统’ 的学习模式 极简JAVA学习营是怎么学习的? &nbsp; 如何报名? 只要购买了极简JAVA一:JAVA入门就算报名成功! &nbsp;本期为第四期极简JAVA学习营,我们来看看往期学员的学习状态: 作业看这里~ &nbsp; 助教的作业报告是不是很专业 不交作业打屁屁 助教答疑是不是很用心 &nbsp; 有奖抢答大家玩的很嗨啊 &nbsp; &nbsp; 项目答辩终于开始啦 &nbsp; 优秀者的获奖感言 &nbsp; 这是答辩项目的效果 &nbsp; &nbsp; 这么细致的服务,这么好的氛围,这样的学习效果,需要多少钱呢? 不要1999,不要199,不要99,只要9.9 是的你没听错,只要9.9以上所有就都属于你了 如果你: 1、&nbsp;想学JAVA没有基础 2、&nbsp;想学JAVA没有整块的时间 3、&nbsp;想学JAVA没有足够的预算 还等什么?赶紧报名吧,抓紧抢位,本期只招300人,错过只有等时间待定的下一期了 &nbsp; 报名请加小助手微信:eduxy-1 &nbsp; &nbsp;

Python可以这样学(第一季:Python内功修炼)

董付国系列教材《Python程序设计基础》、《Python程序设计(第2版)》、《Python可以这样学》配套视频,讲解Python 3.5.x和3.6.x语法、内置对象用法、选择与循环以及函数设计与使用、lambda表达式用法、字符串与正则表达式应用、面向对象编程、文本文件与二进制文件操作、目录操作与系统运维、异常处理结构。

Java基础知识面试题(2020最新版)

文章目录Java概述何为编程什么是Javajdk1.5之后的三大版本JVM、JRE和JDK的关系什么是跨平台性?原理是什么Java语言有哪些特点什么是字节码?采用字节码的最大好处是什么什么是Java程序的主类?应用程序和小程序的主类有何不同?Java应用程序与小程序之间有那些差别?Java和C++的区别Oracle JDK 和 OpenJDK 的对比基础语法数据类型Java有哪些数据类型switc...

机器学习实战系列套餐(必备基础+经典算法+案例实战)

机器学习实战系列套餐以实战为出发点,帮助同学们快速掌握机器学习领域必备经典算法原理并结合Python工具包进行实战应用。建议学习顺序:1.Python必备工具包:掌握实战工具 2.机器学习算法与实战应用:数学原理与应用方法都是必备技能 3.数据挖掘实战:通过真实数据集进行项目实战。按照下列课程顺序学习即可! 课程风格通俗易懂,用最接地气的方式带领大家轻松进军机器学习!提供所有课程代码,PPT与实战数据,有任何问题欢迎随时与我讨论。

Java面试题大全(2020版)

发现网上很多Java面试题都没有答案,所以花了很长时间搜集整理出来了这套Java面试题大全,希望对大家有帮助哈~ 本套Java面试题大全,全的不能再全,哈哈~ 一、Java 基础 1. JDK 和 JRE 有什么区别? JDK:Java Development Kit 的简称,java 开发工具包,提供了 java 的开发环境和运行环境。 JRE:Java Runtime Environ...

程序员垃圾简历长什么样?

已经连续五年参加大厂校招、社招的技术面试工作,简历看的不下于万份 这篇文章会用实例告诉你,什么是差的程序员简历! 疫情快要结束了,各个公司也都开始春招了,作为即将红遍大江南北的新晋UP主,那当然要为小伙伴们做点事(手动狗头)。 就在公众号里公开征简历,义务帮大家看,并一一点评。《启舰:春招在即,义务帮大家看看简历吧》 一石激起千层浪,三天收到两百多封简历。 花光了两个星期的所有空闲时...

深度学习原理+项目实战+算法详解+主流框架(套餐)

深度学习系列课程从深度学习基础知识点开始讲解一步步进入神经网络的世界再到卷积和递归神经网络,详解各大经典网络架构。实战部分选择当下最火爆深度学习框架PyTorch与Tensorflow/Keras,全程实战演示框架核心使用与建模方法。项目实战部分选择计算机视觉与自然语言处理领域经典项目,从零开始详解算法原理,debug模式逐行代码解读。适合准备就业和转行的同学们加入学习! 建议按照下列课程顺序来进行学习 (1)掌握深度学习必备经典网络架构 (2)深度框架实战方法 (3)计算机视觉与自然语言处理项目实战。(按照课程排列顺序即可)

HoloLens2开发入门教程

本课程为HoloLens2开发入门教程,讲解部署开发环境,安装VS2019,Unity版本,Windows SDK,创建Unity项目,讲解如何使用MRTK,编辑器模拟手势交互,打包VS工程并编译部署应用到HoloLens上等。

几率大的Redis面试题(含答案)

本文的面试题如下: Redis 持久化机制 缓存雪崩、缓存穿透、缓存预热、缓存更新、缓存降级等问题 热点数据和冷数据是什么 Memcache与Redis的区别都有哪些? 单线程的redis为什么这么快 redis的数据类型,以及每种数据类型的使用场景,Redis 内部结构 redis的过期策略以及内存淘汰机制【~】 Redis 为什么是单线程的,优点 如何解决redis的并发竞争key问题 Red...

MFC一站式终极全套课程包

该套餐共包含从C小白到C++到MFC的全部课程,整套学下来绝对成为一名C++大牛!!!

【数据结构与算法综合实验】欢乐连连看(C++ & MFC)案例

这是武汉理工大学计算机学院数据结构与算法综合实验课程的第三次项目:欢乐连连看(C++ & MFC)迭代开发代码。运行环境:VS2017。已经实现功能:开始游戏、消子、判断胜负、提示、重排、计时、帮助。

YOLOv3目标检测实战:训练自己的数据集

YOLOv3是一种基于深度学习的端到端实时目标检测方法,以速度快见长。本课程将手把手地教大家使用labelImg标注和使用YOLOv3训练自己的数据集。课程分为三个小项目:足球目标检测(单目标检测)、梅西目标检测(单目标检测)、足球和梅西同时目标检测(两目标检测)。 本课程的YOLOv3使用Darknet,在Ubuntu系统上做项目演示。包括:安装Darknet、给自己的数据集打标签、整理自己的数据集、修改配置文件、训练自己的数据集、测试训练出的网络模型、性能统计(mAP计算和画出PR曲线)和先验框聚类。 Darknet是使用C语言实现的轻型开源深度学习框架,依赖少,可移植性好,值得深入探究。 除本课程《YOLOv3目标检测实战:训练自己的数据集》外,本人推出了有关YOLOv3目标检测的系列课程,请持续关注该系列的其它课程视频,包括: 《YOLOv3目标检测实战:交通标志识别》 《YOLOv3目标检测:原理与源码解析》 《YOLOv3目标检测:网络模型改进方法》 敬请关注并选择学习!

u-boot-2015.07.tar.bz2

uboot-2015-07最新代码,喜欢的朋友请拿去

相关热词 c# 局部 截图 页面 c#实现简单的文件管理器 c# where c# 取文件夹路径 c# 对比 当天 c# fir 滤波器 c# 和站 队列 c# txt 去空格 c#移除其他类事件 c# 自动截屏
立即提问