Kafka 를 윈도우에서 실행하기 위한 방법

 

https://www.confluent.io/blog/set-up-and-run-kafka-on-windows-linux-wsl-2/#enable-windows-subsystem

 

Set Up and Run Apache Kafka on Windows

Kafka-on-Windows tutorials are everywhere, but most run Kafka directly on Windows. Here's how to use Kafka on Windows in a Linux environment backed by WSL 2, maximizing performance and stability

www.confluent.io

 

Spring-boot / Spring Cloud Config 구성하는 경ㅜ 

 - yml profile 설정시에 No such label Error

 - NoSuchLabelException

 

org.springframework.cloud.config.server.environment.NoSuchLabelException: No such label: main

 

github에서 default branch를 master가 아닌 main으로 변경되었다.

그러나 여전히 master branch를 설정으로 인식하는 경우에 발생하는 에러이다.

 

Sol)

repository의 default branch 설정 값으로 변경

 

.yml or .properties 파일



spring.cloud.config.server.git.default-label=master #or main

[no main manifest attribute]

[maven]
- 원인은 Main Class 위치를 찾지 못해서 발생하는 것 입니다.
- pom.xml 파일에 플러그인(plugin)을 추가 하고 그 안에 있는 "mainClass" 태그에 "[package name].[class name]" 을 추가하면 됩니다.

<build>
  <plugins>
    <plugin>
      <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
          <configuration>
            <excludes>
              <exclude>
                <groupId>org.projectlombok</groupId>
                <artifactId>lombok</artifactId>
            </exclude>
          </excludes>
        </configuration>
      </plugin>
    </plugins>
</build>



[gradle]

jar {
    manifest {
        attributes 'Main-Class': 'com.package.application.MainClass'
    }
}



[필요한 의존성 모두 추가 - gradle 사용시]

- 프로젝트에 필요한 모든 의존성이 같이 추가된것으로 MANIFEST.MF까지 모두 정상적인 형태로 나온다.

jar {
    enabled = false
}

 

<artifactId>spring-boot-maven-plugin</artifactId>

spring-boot-maven-plugin not found 가 표시되는 경우에 spring-boot 의 version 을 추가한다.

<parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.6.6</version>
        <relativePath/> <!-- lookup parent from repository -->
</parent>

https://spring.io/blog/2022/03/31/spring-framework-rce-early-announcement

 

Spring Framework RCE, Early Announcement

<p><strong>Updates</strong> </p> <ul> <li><strong>[04-01 16:35 BST]</strong> Updated <a href="#am-i-impacted">Am I Impacted</a> with additional notes</li> <li><strong>[04-01 13:05 BST]</strong> Updated <a href="#suggested-workarounds">Suggested Workarounds

spring.io

 

 

Spring Framework RCE, Early Announcement

 

 

MARCH 31, 2022

 

Updates

  • [04-01 16:35 BST] Updated Am I Impacted with additional notes
  • [04-01 13:05 BST] Updated Suggested Workarounds section for Apache Tomcat upgrades and Java 8 downgrades
  • [04-01 12:51 BST] Apache Tomcat releases versions 10.0.20, 9.0.62, and 8.5.78 which close the attack vector on Tomcat’s side, see mitigation alternative
  • [03-31 15:40 BST] Spring Boot 2.6.6 is available
  • [03-31 14:38 BST] Spring Boot 2.5.12 is available
  • [03-31 14:00 BST] CVE-2022-22965 is published
  • [03-31 13:03 BST] Added section “Misconceptions”
  • [03-31 12:34 BST] Added section “Am I Impacted”
  • [03-31 12:11 BST] Fix minor issue in the workaround for adding disallowedFields
  • [03-31 11:59 BST] Spring Framework versions 5.3.18 and 5.2.20, which address the vulnerability, are now available. The release process for Spring Boot is in progress

 

--------------------------------------

KISA 공지

https://www.krcert.or.kr/data/secNoticeView.do?bulletin_writing_sequence=66592&queryString=cGFnZT0xJnNvcnRfY29kZT0mc29ydF9jb2RlX25hbWU9JnNlYXJjaF9zb3J0PXRpdGxlX25hbWUmc2VhcmNoX3dvcmQ9c3ByaW5n

The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path...


임포트해온 프로젝트나 환경이 바뀐 경우, 프로젝트가 위의 에러로 인해 빌드가 되지 않는 경우가 있다.

대부분 톰캣서버의 라이브러리가 프로젝트의 빌드 패스에 추가 되지 않아 생기는 현상이다.


해결:

1. 프로젝트 정보 열기

해당 프로젝트에서 alt+enter or 오른쪽 클릭 -> properties -> Build Path -> Add Library... -> Server Runtime -> (Tomcat) Server 선택

2. Order and Export 에서 해당 library 선택.

+ Recent posts