Sending commands to JReport Server from Java
After JReport Server has been started as a standalone server, you can send commands to the server to either shut it down or pop up the user interactive interface for administration. All of these can be done through the class jet.server.CommandSender. The full command is as follows:
JAVA -classpath <classpath> -Djava.compiler=NONE [-Dreporthome=<install_root>] jet.server.CommandSender [-s:server -p:port] -w:password [-?]|admin|shutdown|gc|(local:on|off)
- -?
Prints brief help message.
- -Djava.compiler=NONE
This is without JIT. This is not a required option. However, if you encounter problems running the server and you think that they relate to the Java VM, you can try turning off the JIT compiler and running again.
- -Dreporthome
This is where JReport Server is installed. It is the destination location you specified when you installed it. It is required only if you do not execute the command from the local host on which JReport Server is running.
- -Dpoperror=true
This property is used to control whether to pop up a message to show error information. The default value is false which indicates that the error message will not be displayed.
- -Classpath
The classpath must include the following packages originally in your <install_root>\lib
:
JRESServlets.jar;
JREntServer.jar.
- -s:server
Host name on which JReport Server is running.
- -p:port
The port JReport Server used for administration. The default value is 8889.
- -w:password
Password of the admin user. Example: -w:admin.
- admin
A command sent to the server asking to pop up the user interactive interface for administering JReport Server.
- shutdown
A command sent to the server asking it to shut down.
- local:on
A command sent to the server asking to only allow the administration commands sent by the local machine.
- local:off
A command sent to the server asking to accept administration commands from anywhere.
- gc
A command sent to the server asking the JVM to schedule the Java Garbage Collector.
Note: Some of the common options will be used in the later chapters. In addition, JReport has automatically generated the batch file CmdSender.bat for you so that you do not have to write a complicated command line.