Ich benutze Apache Velocity, um HTML-Seiten zu erstellen, aber ich bekomme eine Ausnahme beim Initialisieren.Apache Velocity.init() wirft eine Ausnahme
Properties p = new Properties();
String path = EmpowERPlugin.getPluginDir()+IEIFileConstants.VELOCITY_PATH;
p.setProperty("resource.loader","file");
p.setProperty("file.resource.loader.path", path);
//p.setProperty ("runtime.log.logsystem.class","org.apache.velocity.runtime.log.NullLogSystem");
p.setProperty("class.resource.loader.class", "org.apache.velocity.runtime.resource.loader.FileResourceLoader");
try{
Velocity.init(p);
}catch(VelocityException e){
e.printStackTrace();
}catch(Exception e1){
e1.printStackTrace()
}finally{
//some code
}
während Velocity.init Ausführung() direkt die Steuerung an das geht schließlich statt catch-Block, also bin ich nicht in der Lage zu erraten, welche Art von Ausnahme ist
Willkommen bei SO. Bitte schauen Sie nach [wie man fragt] (http://stackoverflow.com/help/how-to-ask). Bitte zeigen Sie uns einen Code – JimHawkins
Ein 'finally' Block wird in * jedem * Fall ausgeführt. Hört sich an, als gäbe es überhaupt keine Ausnahme! –
Was wäre die Ausgabe von 'try {Velocity.init (p); System.out.println ("ok"); } catch (Ausnahme e) {System.out.println ("Ausnahme:" + e); } '? –