idea SpringBoot项目下 创建 application.yml 显示文件文本的原因和解决方案

版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/qq_40667143/article/details/86427759

最近在玩SpringBoot项目时,创建 application.yml 时显示文本文件(以前从未遇到到,很坑。。) 如下图:

解决方案如下:

file==>settings==>file Types 找到 Text 

这样就完美解决了!!!

展开阅读全文

springboot目下,提示shiro与aop冲突

07-05

我用的是springboot微框架。权限管控用的shiro,现在要使用aop,总是报以下错误:nError creating bean with name 'shiroFilterFactoryBean' defined in class path resource [com/zcy/salesPlatform/shiro/ShiroConfig.class]: BeanPostProcessor before instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration': Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: Pointcut is not well-formed: expecting 'identifier' at character position 0n* com.zcy.salesPlatform.action.sell.order.*.*(..)nn我的aop类:nnn```n package com.zcy.salesPlatform.aop;nnimport org.aspectj.lang.ProceedingJoinPoint;nimport org.aspectj.lang.annotation.Around;nimport org.aspectj.lang.annotation.Aspect;nimport org.aspectj.lang.annotation.Before;nimport org.aspectj.lang.annotation.Pointcut;nimport org.springframework.stereotype.Component;nn@Aspectn@Componentnpublic class LoggerAop n n @Pointcut("* com.zcy.salesPlatform.action.sell.order.*.*(..)")n public void loggerAspect()n n @Before("loggerAspect()")n public void before() n System.out.println("切面before执行了");n n n /*@After("loggerAspect()")n public void after() n System.out.println("切面after执行了");n nn @AfterReturning("loggerAspect()")n public void afterReturning() n System.out.println("切面afterReturning执行了");n n n @AfterThrowing("loggerAspect()")n public void afterThrowing() n System.out.println("切面afterThrowing执行了");n */nn /*@Around("loggerAspect()")n public Object around(ProceedingJoinPoint thisJoinPoint)n Object obj = null;n System.err.println ("切面around before执行了");n try n thisJoinPoint.proceed();n catch (Throwable e) n e.printStackTrace ();n n System.err.println ("切面around after执行了");n return obj;n */nnn```n我的shiro。config类:nnn```n package com.zcy.salesPlatform.shiro;nnimport java.util.LinkedHashMap;nimport java.util.Map;nnimport org.apache.shiro.spring.LifecycleBeanPostProcessor;nimport org.apache.shiro.spring.web.ShiroFilterFactoryBean;nimport org.apache.shiro.web.mgt.DefaultWebSecurityManager;nimport org.springframework.context.annotation.Bean;nimport org.springframework.context.annotation.Configuration;nn/**n * spring boot 集成shiro的配置 http://blog.csdn.net/catoop/article/details/50520958n * n * @author luanhaibinn */nn@Configurationnpublic class ShiroConfig nn private static Map filterChainDefinitionMap = new LinkedHashMap();nn @Bean(name = "shiroFilterFactoryBean")n public ShiroFilterFactoryBean shiroFilterFactoryBean() n ShiroFilterFactoryBean shiroFilterFactoryBean = new ShiroFilterFactoryBean();n shiroFilterFactoryBean.setSecurityManager(securityManager());n shiroFilterFactoryBean.setLoginUrl("/user/login");n shiroFilterFactoryBean.setSuccessUrl("/menu/menuIndex");n// n filterChainDefinitionMap.put("/menu/**", "authc");n// filterChainDefinitionMap.put("/personcenter/**", "authc");n filterChainDefinitionMap.put("/**", "anon");n// n shiroFilterFactoryBean.setFilterChainDefinitionMap(filterChainDefinitionMap);n return shiroFilterFactoryBean;n nn @Bean(name = "securityManager")n public DefaultWebSecurityManager securityManager() n DefaultWebSecurityManager defaultWebSecurityManager = new DefaultWebSecurityManager();n defaultWebSecurityManager.setRealm(shiroRealm());n n return defaultWebSecurityManager;n nn @Bean(name = "shiroRealm")n public ShiroRealm shiroRealm() n return new ShiroRealm();n nn @Bean(name = "lifecycleBeanPostProcessor")n public LifecycleBeanPostProcessor lifecycleBeanPostProcessor() n// AbstractNativeSessionManager a=new AbstractNativeSessionManager();n return new LifecycleBeanPostProcessor();n n n nnnn```n请教各位老师各位大神,怎么破?nnn 问答

没有更多推荐了,返回首页