Eclipse 및 Tomcat - 클래스 로딩 (Eclipse & Tomcat - Class loading)


문제 설명

Eclipse 및 Tomcat ‑ 클래스 로딩 (Eclipse & Tomcat ‑ Class loading)

최근에 Tomcat을 사용하여 Java 클라이언트 프로젝트를 Java 서버 프로젝트로 마이그레이션했는데 프로젝트 라이브러리 종속성이 손상될 수 있습니다.

일반적으로 Eclipse 메뉴 옵션을 통해 라이브러리를 Java 빌드 경로에 포함합니다. 프로젝트 \lib 폴더에 라이브러리를 저장합니다.

Tomcat 서버 빌드를 통해 이 작업을 수행하면 라이브러리 개체에 오류가 발생합니다. 다음을 통해 라이브러리를 별도로 로드해야 할 수도 있음을 이해합니다.

Class.forName(classString);

그러나 이렇게 하면 NoClassDefFoundError 예외가 발생합니다. 그래서 나는 의존성을 잘못로드하고 있다고 생각합니다. 하지만 Eclipse & Tomcat?

또한 "서버에서 실행"을 사용하고 있음을 언급해야 합니다.


참조 솔루션

방법 1:

Apart from the whole eclipse aspect: As you mention tomcat and a server project: You probably have a web application. Web applications, when deployed, include all the jar‑files that are contained in WEB‑INF/lib at runtime.

When everything works at compile time, eclipse is happy with the setup. When you get the NoClassDevFoundError at runtime (in tomcat), you most likely need to give tomcat a hint where to find the jar files. And that will be WEB‑INF/lib

(by glendOlaf Kock)

참조 문서

  1. Eclipse & Tomcat ‑ Class loading (CC BY‑SA 2.5/3.0/4.0)

#eclipse-luna #tomcat7 #eclipse #java #tomcat






관련 질문

안드로이드에서 버튼 클릭시 커스텀 카메라 실행 (custom camera launch on button click in android)

Eclipse에서 'Hello world' Android 앱을 실행할 때 일부 오류 발생 (Facing some errors on running 'Hello world' android app from Eclipse)

Eclipse Luna scala IDE의 SQLContext.class에 대한 잘못된 기호 참조 (bad symbolic reference on SQLContext.class in Eclipse Luna scala IDE)

user.home 디렉토리에 쓰지 못하도록 Eclipse 위치를 어떻게 수정합니까? (How modify Eclipse locations to prevent write to user.home directory?)

Eclipse Luna에서 Mylyn 제거 (Uninstall Mylyn from Eclipse Luna)

Eclipse Luna는 탭 클릭 시 편집기를 분할합니다. 비활성화하는 방법? (Eclipse Luna splits editor on tab click. How to disable?)

Eclipse Luna에서 J2Objc 변환기가 파일을 생성하지 않음 (J2Objc Translator not generating files in Eclipse Luna)

Eclipse는 자동으로 종료 코드 127을 종료합니다. (Eclipse exits automatically exit code 127)

Eclipse Luna에서 그룹 시작 (Launch Groups in Eclipse Luna)

Java EE 개발자용 Eclipse를 시작할 때 R6034 오류가 발생함 (Getting R6034 error when starting Eclipse for Java EE Developers)

Eclipse 및 Tomcat - 클래스 로딩 (Eclipse & Tomcat - Class loading)

Eclipse에 E4 Orion CSS 환경 설정 편집기를 설치하는 방법은 무엇입니까? (How to get E4 Orion CSS Preference editor installed on Eclipse?)







코멘트