2016-10-18 2 views
0

Websphere Liberty 프로파일 (최신 버전 16)에서 작동하는 일부 레거시 코드를 얻으려고합니다.Websphere에서 클래스 로더 가시성을 얻는 방법 EAR의 jar와 공유 라이브러리 간의 Liberty Profile

이 코드는 내가 문제를 얻고있다

귀가 와서 공유 WLP 도서관 설치 및 응용 프로그램으로 설정 한 도서관의 건축 세트의 형태로 제공됩니다 어디에 몇 가지 코드 라이브러리 중 하나에있는 jar는 EAR 안에있는 클래스를 인스턴스화하려고 시도합니다 (lib 폴더의 jar 파일에 있음).

나는이 스택 트레이스 받고 있어요 :

Caused by: java.lang.ClassNotFoundException: com.isb.holamu.fnegocio.ln.AAL_FNegocioFactory <-- This class (1) is inside a .jar inside the EAR 
     at com.ibm.ws.classloading.internal.AppClassLoader.findClassCommonLibraryClassLoaders(AppClassLoader.java:491) 
     at com.ibm.ws.classloading.internal.AppClassLoader.findClass(AppClassLoader.java:274) 
     at java.lang.ClassLoader.loadClass(Unknown Source) 
     at com.ibm.ws.classloading.internal.AppClassLoader.findOrDelegateLoadClass(AppClassLoader.java:469) 
     at com.ibm.ws.classloading.internal.AppClassLoader.loadClass(AppClassLoader.java:441) 
     at java.lang.ClassLoader.loadClass(Unknown Source) 
     at java.lang.Class.forName0(Native Method) 
     at java.lang.Class.forName(Unknown Source) 
     at com.isb.bs.bl.base.MetaFacadeFactory.createFactoryInstance(MetaFacadeFactory.java:74) <-- This class (2) is in the shared library in WLP. 

을 그리고 이것들은 server.xml의에서 관련 비트입니다 :

<!-- Server shared library --> 

    <library id="architecture" > 
     <fileset dir="${server.config.dir}/lib/jars" includes="*.jar" scanInterval="5s"/> <-- (2) is here 

    </library> 

    <enterpriseApplication autoStart="true" id="sample" location="sample.ear" name="sample"> <-- (1) is here 
     <classloader commonLibraryRef="architecture" delegation="parentFirst"/> 
    </enterpriseApplication> 

공유 라이브러리 클래스 로더에 액세스 할 수있는 EAR 클래스 것처럼 보인다 그리고 그 클래스들과 공유 라이브러리 클래스는 EAR 내부의 것들을 찾을 수 없다.

누구나이 작업을 수행하는 방법에 대한 단서를 제공 할 수 있습니까?

감사합니다.

답변

4

공용 라이브러리는 자신의 클래스 로더를 사용하기 때문에 작동하지 않습니다. 참조하는 응용 프로그램의 클래스 로더가 아닌.

이 작업을 수행하려면 commonLibraryRef를 privateLibraryRef로 변경하십시오. 이렇게하면 앱의 클래스 경로에 효과적으로 라이브러리 콘텐츠가 추가됩니다. 마지막으로 내가 가진 ...이 길에 저를 설정,

<enterpriseApplication id="sample" location="sample.ear" name="sample"> 
    <classloader> 
    <privateLibrary> 
     <fileset dir="${server.config.dir}/lib/jars" includes="*.jar" scanInterval="5s"/> 
    </privateLibrary> 
    </classloader> 
</enterpriseApplication> 
+0

감사 :

--joe

0

마지막으로 나는 다음과 같이 응용 프로그램 태그 안에 라이브러리를 정의하여 작업 있어요 라이브러리를 비공개로 정의하고 응용 프로그램 태그
+0

응용 프로그램이 Spring Boot 응용 프로그램입니까? Liberty 16.0.0.3을 사용하여 구성을 시도한 결과 나에게 적합하지 않습니다. – springbootlearner

관련 문제