2013-06-14 3 views
1

발견하지, 난 내가 예외 아래에 무엇입니까 플러그인을 실행하려고하면, "database.properties"라는 새 파일을 추가 : 여기이클립스 플러그인 파일 내 플러그인 프로젝트에서 예외

java.io.FileNotFoundException: database.properties (The system cannot find the file specified) 
at java.io.FileInputStream.open(Native Method) 
at java.io.FileInputStream.<init>(Unknown Source) 
at java.io.FileInputStream.<init>(Unknown Source) 

가 내 프로젝트 구조 :

또한

enter image description here

내가 빌드 속성에서 해당 파일을 포함 한 스크린 샷은 여기에 표시됩니다 :

enter image description here

이클립스를 다시 시작하여 청소를 시도했지만 여전히 시스템에서 파일을 찾을 수 없습니다. 누구든지 나를 도울 수 있습니까? 내가 여기서 뭘 놓치고 있니? 당신의 build.properties에

Bundle bundle = Platform.getBundle("your_plugn_id"); 
InputStream is = bundle.getEntry("database.properties").openStream(); 

그리고 includeit :

+0

http://www.dreamincode.net/forums/topic/245777- databaseproperties/ – lifetimes

+0

@Zenith, 언급하는 것을 잊어 버렸지 만, 그 클래스를 독립형 Java 응용 프로그램으로 실행하면 파일을 찾을 수 있습니다. 그러나 플러그인으로 실행하려고 할 때만 예외가 발생합니다. –

+1

플러그인으로 실행할 때 전체 경로가 무엇인지 확인할 수 있습니다. –

답변

2

당신은 같은 파일에 액세스 할

bin.includes = META-INF/,\ 
      OSGI-INF/,\ 
      database.properties/,\ 
      .,\ 
      plugin.xml 
+0

와우, 대단한 !! 그것은 작동합니다. –

+0

감사합니다 scawf !! 참고 문헌 – Campa

관련 문제