File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
exist-ant/src/main/java/org/exist/ant
extensions/modules/scheduler/src/main/java/org/exist/xquery/modules/scheduler Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -167,7 +167,7 @@ protected void registerDatabase() throws BuildException
167
167
}
168
168
169
169
final Class <?> clazz = Class .forName ( driver );
170
- final Database database = (Database )clazz .newInstance ();
170
+ final Database database = (Database )clazz .getDeclaredConstructor (). newInstance ();
171
171
database .setProperty ( "create-database" , createDatabase ? "true" : "false" );
172
172
database .setProperty ( "ssl-enable" , ssl ? "true" : "false" );
173
173
Original file line number Diff line number Diff line change 37
37
import org .exist .xquery .XQueryContext ;
38
38
import org .exist .xquery .value .*;
39
39
40
+ import java .lang .reflect .InvocationTargetException ;
40
41
import java .util .Properties ;
41
42
42
43
@@ -312,15 +313,16 @@ else if( isCalledAs( SCHEDULE_JAVA_CRON_JOB ) || isCalledAs( SCHEDULE_JAVA_PERIO
312
313
313
314
//Check if the Class is a UserJob
314
315
Class <?> jobClass = Class .forName ( resource );
315
- job = jobClass .newInstance ();
316
+ job = jobClass .getDeclaredConstructor (). newInstance ();
316
317
317
318
if ( !( job instanceof UserJavaJob ) ) {
318
319
LOG .error ("Cannot Schedule job. Class {} is not an instance of org.exist.scheduler.UserJavaJob" , resource );
319
320
return ( BooleanValue .FALSE );
320
321
}
321
322
( ( UserJavaJob )job ).setName ( jobName );
322
323
}
323
- catch ( ClassNotFoundException | InstantiationException | IllegalAccessException cnfe ) {
324
+ catch (ClassNotFoundException | InstantiationException | IllegalAccessException | NoSuchMethodException |
325
+ InvocationTargetException cnfe ) {
324
326
LOG .error ( cnfe );
325
327
return ( BooleanValue .FALSE );
326
328
}
You can’t perform that action at this time.
0 commit comments