Skip to content

fix(bdev.batch): 배치 마법사가 실행환경에 없는 옛 패키지로 bean 의 class 속성을 생성하는 문제 수정 - #160

Merged
eGovFrameSupport merged 1 commit into
eGovFramework:mainfrom
wantaekchoi:fix/batch-wizard-generates-old-package
Sep 18, 2026
Merged

eGovFrameSupport merged 1 commit into
eGovFramework:mainfrom
wantaekchoi:fix/batch-wizard-generates-old-package

Conversation

@wantaekchoi

Copy link
Copy Markdown
Contributor

수정 사유 Reason for modification

  • 버그수정 Bug fixes
  • 기능개선 Enhancements
  • 기능추가 Adding features
  • 기타 Others

수정된 소스 내용 Modified source

배치 마법사가 생성하는 Job 설정 XML 에 egovframework.brte.… 로 시작하는 bean 의 class 값이 들어갑니다. 실행환경 저장소에는 그 패키지의 java 파일이 하나도 없습니다.

이 저장소에서:

$ git grep -c "egovframework\.brte" origin/main -- "*.java"
origin/main:egovframework.bdev.imp.batch/src/egovframework/bdev/imp/batch/wizards/jobcreation/operation/AppendBatchReaderWriterBeanOperation.java:19
origin/main:egovframework.bdev.imp.batch/src/egovframework/bdev/imp/batch/wizards/jobcreation/operation/CreateBatchJobXMLFileOperation.java:2
origin/main:egovframework.bdev.imp.confmngt/src/egovframework/bdev/imp/confmngt/preferences/readwrite/model/DefaultJobRW.java:1

배치 프로젝트 템플릿이 받는 배치 의존성은 egovframe-rte-bat-core 이고, 그 아티팩트가 담는 패키지는 org.egovframe.rte.bat 입니다. 즉 생성된 프로젝트의 클래스패스에는 새 패키지명만 있고, 이 마법사가 쓴 XML 은 없는 이름을 가리킵니다.

이 저장소에서:

$ unzip -p egovframework.bdev.imp.ide/examples/egovframe-boot-batch-db-commandline.zip pom.xml | grep -A2 "egovframe-rte-bat-core"
			<artifactId>egovframe-rte-bat-core</artifactId>
		</dependency>
		<dependency>

실행환경 저장소(eGovFramework/egovframe-runtime)의 main 에서:

$ git show origin/main:Batch/org.egovframe.rte.bat.core/pom.xml | grep -m1 "<artifactId>egovframe-rte-bat-core</artifactId>"
    <artifactId>egovframe-rte-bat-core</artifactId>
$ git ls-tree -r --name-only origin/main | grep -c "^Batch/org.egovframe.rte.bat.core/src/main/java/org/egovframe/rte/bat/core/"
63

같은 플러그인의 Job Launcher 쪽은 이미 새 패키지명으로 옮겨 두었습니다. 남은 22곳은 그때 함께 옮겨지지 않은 자리입니다.

이 저장소에서:

$ git show origin/main:egovframework.bdev.imp.batch/src/egovframework/bdev/imp/batch/wizards/joblauncher/operation/CreateBatchJobLauncherXMLFileOperation.java | sed -n "188,189p"
		// 표준프레임워크 v4.0 패키지명 적용
		eGovBatchRunnerBean.setAttribute(new Attribute("class", "org.egovframe.rte.bat.core.launch.support.EgovBatchRunner"));

아래는 실행환경 저장소(eGovFramework/egovframe-runtime)의 main 에서 돌린 것입니다.

$ git ls-tree -r --name-only origin/main | grep -c "/brte/"
0
$ git ls-tree -r --name-only origin/main | sed "s|.*/java/||;s|/|.|g;s|\.java$||" | grep -E "^org\.egovframe\.rte\.bat\.core\.(item|job|listener)\." | grep -E "EgovDefaultLineMapper$|EgovObjectMapper$|EgovFixedLengthTokenizer$|EgovDelimitedLineTokenizer$|EgovFieldExtractor$|EgovFixedLengthLineAggregator$|EgovMethodMapItemPreparedStatementSetter$|EgovOutputFileListener$|EgovDecider$|EgovJdbcBatchItemWriter$" | sort
org.egovframe.rte.bat.core.item.database.EgovJdbcBatchItemWriter
org.egovframe.rte.bat.core.item.database.support.EgovMethodMapItemPreparedStatementSetter
org.egovframe.rte.bat.core.item.file.mapping.EgovDefaultLineMapper
org.egovframe.rte.bat.core.item.file.mapping.EgovObjectMapper
org.egovframe.rte.bat.core.item.file.transform.EgovDelimitedLineTokenizer
org.egovframe.rte.bat.core.item.file.transform.EgovFieldExtractor
org.egovframe.rte.bat.core.item.file.transform.EgovFixedLengthLineAggregator
org.egovframe.rte.bat.core.item.file.transform.EgovFixedLengthTokenizer
org.egovframe.rte.bat.core.job.flow.EgovDecider
org.egovframe.rte.bat.core.listener.EgovOutputFileListener

세 파일에서 22곳을 옮겼습니다. 접두어만 egovframework.brte. 에서 org.egovframe.rte.bat. 으로 바뀌고 나머지 경로와 클래스 이름은 그대로입니다. 이렇게 나온 이름 열 개는 각각 실행환경 저장소에 실재합니다. 위 두 번째 명령이 그 열 개를 찍습니다.

AS-IS

beanLineMapper.setAttribute("class", "egovframework.brte.core.item.file.mapping.EgovDefaultLineMapper");

TO-BE

beanLineMapper.setAttribute("class", "org.egovframe.rte.bat.core.item.file.mapping.EgovDefaultLineMapper");

영향 범위

세 파일 모두 생성기가 XML 로 내보내는 클래스 이름 문자열만 바뀝니다. 마법사의 화면·입력·분기는 건드리지 않았고, egovframework.brte. 접두어를 쓰는 곳은 저장소에 더 남지 않았습니다.

@wantaekchoi
wantaekchoi force-pushed the fix/batch-wizard-generates-old-package branch from 236e39a to a64e085 Compare September 10, 2026 10:57
@eGovFrameSupport
eGovFrameSupport merged commit 8249f47 into eGovFramework:main Sep 18, 2026
1 check passed
@wantaekchoi
wantaekchoi deleted the fix/batch-wizard-generates-old-package branch September 18, 2026 09:22
swanpark8538 added a commit that referenced this pull request Sep 18, 2026
배치 Job 생성 마법사가 Job XML 에 기록하는 실행환경 클래스명이 문자열 리터럴로 21곳에 흩어져
있어, 실행환경의 패키지가 바뀔 때 일부만 고쳐지고 나머지가 누락되기 쉬웠다(#160 의 원인).
클래스명을 DefaultJobRW 의 상수로 모으고, 패키지 접두어는 EGOV_BAT_CORE_PACKAGE 하나에서
만들도록 한다. 생성되는 XML 의 값은 바뀌지 않는다.

- DefaultJobRW: EGOV_BAT_CORE_PACKAGE 와 실행환경 클래스 상수 9개 추가,
  EGOV_JDBC_BATCH_ITEM_WRITER_CLASS 도 같은 접두어에서 만들도록 변경
- AppendBatchReaderWriterBeanOperation: 리터럴 19곳을 상수 참조로 교체
- CreateBatchJobXMLFileOperation: EgovOutputFileListener, EgovDecider 2곳을 상수 참조로 교체

Refs: #160
@swanpark8538

Copy link
Copy Markdown
Collaborator

기여해 주셔서 감사합니다. 옮기신 클래스명 10개가 egovframe-runtime 의 main 에 모두 실재하는 것과, 저장소와 배치 예제 zip 에 egovframework.brte 참조가 더 남아 있지 않은 것을 확인한 뒤 squash 머지했습니다.

검토하면서 클래스명 리터럴을 상수로 모았습니다(22692b0).
같은 리터럴이 21곳에 흩어져 있던 구조가 이번 누락의 원인이었다고 판단하여, 후속 커밋에서 DefaultJobRW 의 상수로 통합했습니다. 패키지 접두어는 EGOV_BAT_CORE_PACKAGE 하나에서 만들어지며, 생성되는 XML 의 값은 바뀌지 않습니다.

전자정부 표준프레임워크에 기여해 주셔서 감사합니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants