우리 시스템에는 런타임시 알 수없는 클래스를 인스턴스화 할 수있는 플러그인 메커니즘이 있습니다.클래스 검색, 리플렉션, jars 및 jnlp
클래스 패스에 디렉토리 또는 jar가 있으면 시스템은 포함 된 클래스를 탐색 할 수 있으며 클래스가 특정 인터페이스를 구현하면 인스턴스화하여 플러그인으로 사용할 수 있습니다.
모든 것이 항아리로 포장되어 잘 작동합니다. 그러나 웹 스타트 응용 프로그램으로 번들을 만들려고 할 때이 메커니즘이 중단 된 것 같습니다.
더 구체적으로는 더 이상 작동하지 않는 클래스의 발견처럼 보인다 :
public static Collection<String> getAllClassFiles()
{
Collection<String> all_files = new ArrayList<String>();
String pathSep = System.getProperty("path.separator");
String classpath = System.getProperty("java.class.path");
for (String path : classpath.split(pathSep))
{
File filepath = new File(path);
if (filepath.isDirectory())
{
all_files.addAll(dirContent(filepath));
}
else if (path.endsWith(".jar"))
{
JarFile jar;
try {
jar = new JarFile(filepath);
}
catch (IOException e) {
Log.warning("WARNING: " + filepath + " could not be opened!");
continue;
}
for (Enumeration<JarEntry> entries = jar.entries(); entries
.hasMoreElements();)
{
JarEntry entry = entries.nextElement();
if (entry.getName().endsWith(".class"))
all_files.add(entry.getName());
}
}
else if (path.endsWith(".class")) {
all_files.add(path);
}
else {
Log.warning("Warning: corrupt classpath entry: " + path);
}
}
return all_files;
}
을 그래서 ...이에도 불구하고 더 이상하지 Webstart를 직접 항아리를 사용하여 시스템을 호출 할 때 작동합니다 ...하지만 모든 항아리에는 서명되어 포함되어 있습니다.
webstart에서 계속 작동시키는 방법을 알려주세요.
당신을 어떤 오류를주고있다 ...이 열망로드 각각의 주위에 모든 클래스보다 빠르게 어쨌든, 당신의 classpath 항아리에 따라? –
오류 없음 ... 빈 목록을 반환하는 것 – dagnelies
... 분명히 classpath가 java webstart를 사용하여 사라지기 때문입니다. 단지 다음과 같습니다 : java.class.path = /usr/lib/jvm/java-6-sun-1.6.0.06/jre/lib/deploy.jar 그리고 시스템/배치 등록 정보를 덤프하면 아무 것도 볼 수 없습니다. "내"클래스 경로의 흔적도 원래 항아리의 정보도 ... 그래서 가능한 클래스 목록을 어떻게 수집 할 수 있습니까? – dagnelies