일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
- LOG4J
- nginx
- intellijIDEA
- docker
- gradle
- jetbrains
- nodejs
- Spring
- react
- NCP
- useEffect
- Git
- JavaScript
- wildfly
- maven
- database
- VSCode
- tibero
- Kubernetes
- Java
- springboot
- MySQL
- Windows
- IntelliJ
- mybatis
- JPA
- dbeaver
- log4j2
- BPMN
- gson
- Today
- Total
목록분류 전체보기 (238)
두 손끝의 창조자
어떤 클래스가 JpaRepository를 참조하기 위해서 @Autowired나 생성자, 속성으로 할 수 있다. Namespace로 빈을 선언할 때 생성자로 참조하기 위해서 JpaRepository를 넣어주면 참조하기 못하는 현상을 발견했다. 이걸 그냥 Autowired로 바꾸면 잘 되는데.... 아무래도 생성자 방식으로 했을 때 JpaRepository가 아직 Bean으로 만들어지지 않은 상황에서 생성자가 실행되어서 그렇지 싶다. 이걸 어떻게 극복을 하는지 모르겠다. 해결 Autowired로 인해서 잘 초기화된 것이 아니었다. 그냥 null로 바인드 되어서 잘 된 것처럼 보일 뿐... 이것만 봐도 그냥 Autowired를 쓰는 것보다는 생성자로 명시적으로 받는 것이 오류를 미리 발견할 수 있다. 참조하지..
linux lsof -i :1099 windows netstat ano|find "1099"
http .authorizeRequests() .accessDecisionManager(applicationContext.getBean("accessDecisionManager", AccessDecisionManager.class)) http .authorizeRequests() .accessDecisionManager(accessDecisionManager()) 어느 방법이 효율적일까? accessDecisionManager()으로 호출해도 새로운 객체가 생성되지는 않는다. 왜일까?
시스템이 초기화되면서 AccessDecisionManager에 등록된 Voter가 Configuration에서 설정한 속성을 지원하는지 검사하도록 되어있다. 같은 코드임에도 불구하고 XML로 정의하면 정상동작하고, Java Config로 정의하면 실패했다. @Override public boolean supports(ConfigAttribute attribute) { return attributes.contains(attribute.getAttribute()); } XML로 정의할 때 use-expressions="false" 로 넣어주면 attribute.getAttribute()로 access 에 넣었던 값, 또는 표현식을 가져올 수 있었는데 Java Configuration에서는 null 이 리턴되..
HttpSecurity는 네임 스페이스 구성에있는 Spring Security의 XML 요소와 유사합니다. 특정 http 요청에 대해 웹 기반 보안을 구성 할 수 있습니다. 기본적으로 모든 요청에 적용되지만 requestMatcher (RequestMatcher) 또는 기타 유사한 메소드를 사용하여 제한 할 수 있습니다. @Configuration @EnableWebSecurity public class FormLoginSecurityConfig extends WebSecurityConfigurerAdapter { @Override protected void configure(HttpSecurity http) throws Exception { http.authorizeRequests().antMatche..
org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration은 WebSecurity를 사용하여 Spring Security에 대한 웹 기반 보안을 수행하고 Spring Security Filter Chain이라고 부르는 FilterChainProxy를 만든다. 그런 다음 필요한 Bean을 내 보냅니다. WebSecurityConfigurerAdapter를 확장하여 구성으로 노출하거나 WebSecurityConfigurer를 구현하고이를 구성으로 노출하여 WebSecurity를 사용자 정의 할 수 있습니다. EnableWebSecurity를 사용할 때이 구성을 가져옵니다. springSecurityFilte..
이 Appender에 환경변수값을 바인딩할 수 있는 표현식 ${sys:key} 에서 환경변수에 그 값이 없으면 기본값으로 가지도록 하고자 할 때는 local 에 를 추가하면 된다. 표현식 내에서 직접 넣고 싶으면 ${sys:fileHourName:-하고싶은값} 형태로 선언하면 된다. 프로퍼티 내에 표현식이 있을 때도 마찬가지로 하면 된다. INFO ${sys:systemLogLevel} http://logging.apache.org/log4j/2.x/manual/configuration.html#PropertySubstitution
에 entry-point-ref를 설정하지 않으면 ExceptionTranslationFilter를 만들 때 설정되지 않았다고 예외가 발생한다. entry-point-ref 는 인증 실패 등 요청한 자원에 접근을 할 수 없을 때 어떻게 그다음을 진행할지 결정하는 빈을 등록하는 속성이다. 예를 들어 접근 권한이 필요한 자원을 요청했을 때 로그인 페이지로 리다이렉션 된다던지, API를 호출했을 때 JSON으로 응답 결과를 보낸다던지 하는 것이다. 스프링 시큐리티에서 필터를 만들때 entry-point-ref 속성이 없는 경우, 하위 요소 중에 http-basic, form-login, openid-login 요소가 있는지 확인하고 없으면 예외를 발생시킨다. 즉, entry-point-ref 를 지정하던지 로..
HttpClient 전송중에 커넥션에 끊기면 자동적으로 재송신 시도를 한다. 필요에 따라 재전송하면 안되는 경우에 하는 조치이다. HttpClientBuilder.create().disableAutomaticRetries().build();
hibernate 프로퍼티 설정 hibernate.show_sql = false hibernate.format_sql = true hibernate.user_sql_comments = true log4j2 설정 스프링부트에서는 spring.jpa.properties.hibernate.format_sql=true spring.jpa.properties.hibernate.show_sql=false logging.level.org.hibernate.SQL=debug logging.level.org.hibernate.type=trace
org.springframework.context.support.AbstractApplicationContext Class 확인 @Override public void refresh() throws BeansException, IllegalStateException { synchronized (this.startupShutdownMonitor) { // Prepare this context for refreshing. prepareRefresh(); // Tell the subclass to refresh the internal bean factory. ConfigurableListableBeanFactory beanFactory = obtainFreshBeanFactory(); // Prepare th..
Task는 프로세스 흐름 상에서 더 이상 상세 레벨로 내려갈 수 없는 가장 작은 단위이다. 일반적으로 사람이나 애플리케이션이 실제로 행동하는 것을 표현하는 단위이기도 하다. Taks의 Maker Task는 Loop, Multi-Instance, Compensation 3가지 타입 마커를 넣어서 더 상세하게 표현 할 수 있다. Task의 Type Service Task 서비스에 일종이고 웹 서비스나 자동화된 애플리케이션일 수 있다. Send Task Message를 외부 참여자에게 보내기 위한 Task 이다. 메시지를 전송하면 해당 Task는 종료된다. Receive Task 외부 참여자가 보내는 Message를 수신하기 위해 기다리는 Task이다. 메시지를 수신하면 Taks는 종료된다. User Task..
HttpSecurityBeanDefinitionParser https://stackoverflow.com/questions/10140515/spring-security-where-can-i-find-the-list-of-all-security-filters-registered-w
요청이 설정한 것과 매치가 되면 로그인을 시도함
들어온 요청에 대해서 인증에 실패하거나 권한이 없으면 수행되는 AuthenticationEntryPoint를 커스터 마이징 했을 때 CORS는 어떻게 되는건지 확인해봤다. Spring Security 설정에 모든 /api/ 요청에 대해 거절하도록 했다. 그러면 /api/의 모든 요청은 거절되고 restAuthenticationEntryPoint 에 정의된 절차대로 수행한다. public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException authException) throws IOException, ServletException { String noAuthMessage = "{\n" +..
소스코드로 볼 때(compile time)와 실행할 때(run time)의 의존관계가 서로 달라서 그럴 수도 있다. 현재 의존관계에서 중복되거나 버전이 안 맞거나 하는 것을 찾아볼 필요가 있다. setReadOnly not defined in JpaTransactionObject in JpaTransactionManager · Issue #24422 · spring-projects/spring-framework In spring-orm-8.2.3.RELEASE the problem described in Ticket # 23943 is still present. At line 405 txObject.setReadOnly(definition.isReadOnly()); txObject is of type J..
테스트 돌리는데 예외 발생 java.lang.IllegalStateException: Failed to load ApplicationContext Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'resourceHandlerMapping' defined in class path resource [org/springframework/web/servlet/config/annotation/DelegatingWebMvcConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.spr..
ES6(ECMA2015)에서 처음 소개된 import, export, const 같은 기능들은 ES6을 지원하지 않는 브라우저에서는 실행되지 않는다. ES6 문법으로 만들어진 소스 코드를 ES5 등 다른 형태로 변환을 시켜주는 트랜스 파일러 중에 한 아이가 Babel이다. import, export는 require, module.exports로 변환이 되는데 이 둘은 또 브라우저가 해석하지 못한다. 그래서 모듈을 가져오는 것들을 한 파일로 만들어서 require 같은 키워드를 사용하지 않아도 되도록 한 파일로 묶어줄 필요가 있다. 그럴 때 쓰는 것이 번들러라고 하고 번들러 중에는 webpack, rollup 등이 있다. ES6에서 ES5로 전환할 수 없는 기능은 변환하지 않고 그대로 놔두는데 이게 구형 ..
Formatter를 Prettier 사용하고 있다는 전제하에 settings.json 파일 열기 VS Code에서 cmd + shift + p 를 눌러서 커맨드 창을 연뒤 open settings(json)를 선택해서 settings.json 파일을 연다. 설정추가 아래 설정을 추가한다. "vetur.format.defaultFormatterOptions": { "prettier": { "singleQuote": true } } 세미콜론 자동 추가도 끄자 "vetur.format.defaultFormatterOptions": { "prettier": { "singleQuote": true, "semi": false } }