PC2 FAQ and Troubleshooting Guide
This page lists some of the common problems which users have
reported encountering while trying to set up and use PC2.
It explains some reasons why the problems might occur,
and provides suggestions for trying to eliminate them.
- Question:
How can I run a "Practice Contest" during which contestants
get to login and use the system to see how it works, and then "restart"
a real contest?
- Answer:
The current release of PC^2 (V7.5) does not have such a function
integrated into it (although it is on the list for a near-future
release). However, it is relatively simple to run a practice contest
followed by a real contest. The following steps describe how to
do this.
-
Start a PC^2 Registry, then a Server, then an Admin Client.
-
Configure the "real" contest using the Admin (put in the names
of the real contest problems, etc., as well as create
the Team/Judge/Scoreboard/Admin accounts and so forth
as described in the Admin Guide).
-
Log off the Admin (shut it down).
-
Shutdown all PC^2 programs (i.e. kill the Server and the Registry).
-
Go into the PC^2 installation directory.
-
Copy the db/ and r_db/ directory hierarchies somewhere safe,
outside of the PC^2. This gives you a clean, initialized
copy of the PC^2 contest database, but with no runs in it.
-
Restart the Registry, then the Server, then an Admin Client.
-
In the Admin, delete any "real" contest information which you
do not want contestants to see ahead of time (such as
the problem names) and add the "practice" contest
information. For example, you might have only one
"Problem" in a practice contest, with its own data set.
-
Start Team and Judge Clients as necessary.
-
Run the practice contest.
-
After the practice is over, shutdown all PC^2 programs.
-
Remove (delete) the db/ and r_db directories from the PC^2
installation directory (or rename them or move them
somewhere safe).
-
Copy the original db/ and r_db/ directories from the safe place
where they were saved back into the PC^2 installation directory.
This gives you a cleanly "reset" contest, with all the orginal
configuration items but none of the runs from the practice.
-
Start real contest (Registry, then Server, then Clients).
- Question: What does it mean when the system generates a
"Java security access violation" message ?
- Answer:
The most common reason for this message is that you have not enabled
the necessary security features in Java. To fix this,
update the file "java.policy" under $JAVAHOME/jre/lib/security to include
"grant codebase access privileges" for the PC^2 installation directory and the
files named swing.jar, swingall.jar, and s_mclb.jar in the PC^2 installation
directory.
For example, if you installed PC^2 in a directory named c:\pc2home,
then add the following lines to the java.policy file:
grant codeBase "file:/c:/pc2home" {
permission java.security.AllPermission;
};
grant codeBase "file:/c:/pc2home/swing.jar" {
permission java.security.AllPermission;
};
grant codeBase "file:/c:/pc2home/swingall.jar" {
permission java.security.AllPermission;
};
grant codeBase "file:/c:/pc2home/s_mclb.jar" {
permission java.security.AllPermission;
};
Note that all slashes are "forward", even in a Windows environment.
-
Question: I made the adjustments to the "java.policy" file as
indicated in the FAQ, and I've even gone back over them to check
for stupid little spelling or directory mistakes. But I still get
the "Security Access Violation" message. Is there any other reason
I might be getting this? (p.s. this is in a Microsoft environment)
-
Answer: Yes, there is another possible explanation.
-
Question: OK, wise guys -- what is the explanation for getting
a "Security Access Violation" error even after I have correctly updated
the "java.policy" file?
-
Answer: Glad you asked. One of the things you have to do to
run Java is add the $JavaHome/bin directory (for example,
c:\jdk1.3\bin, if that's where you installed Java) to your PATH.
Under certain conditions in a Microsoft environment, there
is a COPY of the Java VM (the program java.exe) automatically placed in a
Microsoft system directory (for example, it gets copied to
WinNT\System32) during installation of Java. If you have this system
directory in your PATH and it is AHEAD of the $JavaHome entry, then
the operating system will find and execute this copy of Java instead of the
one you installed in $JavaHome.
This copy of java.exe is precisely the
same as the one under the Java installation directory, but IT USES A
DIFFERENT JAVA.POLICY FILE (it apparently looks for a java.policy file
in the "Program Files" directory hierarchy...). Since you probably
didn't modify that java.policy file, you'll get a security access
violation. To fix this, either find and modify the duplicate java.policy
file, or move the $JavaHome entry to the FRONT of your PATH variable.
Amazing but true....
- Question: What does it mean when the system generates the
message "NoClassDefFound" and won't run ?
- Answer:
This is a Java error message meaning that it could not find one of the
"classes" (programs) required to run the system. The missing classes
could either be PC2 modules or Java system modules.
There are a number of possible causes for this error.
Here are some things you can try:
-
Verify that the PC2 system was unzipped "including
subdirectories" and "with case-sensitivity".
PC2 uses many Java "packages", which must be stored
in the proper subdirectories beneath the PC2
installation directory. Make sure the program which was used
to "unzip" the distribution properly created and maintained
the hierarchical directory structure and the "case" of filenames
in the system.
-
Verify that the CLASSPATH environment variable includes the Java/lib
and PC2 installation directories.
-
Question: I would like to be able to change the format of the
Scoreboard -- I want to be able to put the data into a Web Page for
example. Is there a way to get to the Scoreboard data in text form
or something like that?
-
Answer: Yes; something like that. When you run a
PC2 Scoreboard module, it generates a simple ranking display
in its own format. You can't change that.
However, the Scoreboard module ALSO automatically
generates a collection of HTML files showing contest
standings and submission data in several different formats. These
HTML files are updated and placed in the $PC2HOME directory (PC2
installation directory) each time there is a change in the contest
standings state (roughly, each time a submission is judged).
This updating is done automatically, on the fly as the state changes.
There are currently FIVE different HTML files generated:
-
full.html -- a full listing of all (active) teams by name,
ranked by number of problems solved and then by "penalty points"
-
fullnums.html -- same as above, except also includes the
PC2 "Team Number"
-
sumatt.html -- a summary page showing, for each team and
problem, how many submissions the team has made on that problem and
whether or not they have solved the problem
-
sumtime.html -- same as above, except that instead of
simply displaying "Y" or "N" if the team has (or has not) solved the
problem, displays the contest-relative TIME (in minutes) at which the
teams solved the problem (or shows "--" if the problem hasn't been
solved)
-
final.html -- a standings page formatted in the style used
by the ACM International Collegiate Programming Contest World Finals
You can therefore get to the "text data" from the scoreboard by picking it
out of the HTML files, if that's what you want. However, since the
generated files are full valid HTML, you can simply use them as-is.
For example, when we run a contest under PC2 (as if there was
some other way...) we never run more than ONE Scoreboard module for
the entire contest (even if it is a multi-site contest spread over
an entire continent). Once we have one Scoreboard module running,
we build an external "master" HMTL file containing references to the
PC2 directory HTML files (for example, we insert the various
PC2
HTML files into frames in the master page,
along with things like a header frame
showing the contest title and graphics and so forth). We then write
a script (batch file) to copy the master page to some publicly published
location at regular intervals (e.g. once per minute).
We then tell people who want to see the "scoreboard" (for example,
Teams, Judges, Spectators) to simply point their favorite browser to the
"public" location.
The PC2 Scoreboard will update the
PC2 HTML files whenever the standings change; the script
will copy the updated HTML files to the public location at the frequency
we specify.
This approach also makes it easy to "freeze" the (public) scoreboard
at some point near the end of the contest, if that's what is desired:
simply kill the script which is doing the copying (but not the
PC2 Scoreboard module itself). The internal
scoreboard will continue to update, while the public HTML scoreboard
will "freeze" at the last displayed form.
-
Question: If the PC2 Registry and/or Server are shut
down or die for some reason, is it necessary for Clients (Teams, Judges,
etc.) to log back in?
-
Answer:
In the current version of PC2, Yes. Although the state of
the contest (runs submitted, problem names, etc.) is retained between
executions of the Registry and Servers, the state of remote connections
is not retained.
Note also that if the reverse happens -- e.g. a Client gets killed or
shut down improperly without executing a "log out" operation --
the system will think the Client is still
"logged in" and will not allow the Client to reconnect when it starts
back up -- it considers it a "duplicate login". To fix this, simply
use the "Force Logout" function in the Admin to make the system drop
the login connection to the dead Client, then have the Client log back
in normally. The same is true if a Server dies in a multi-site contest;
before the Server can "reconnect" to the system, it must be "forced off"
by the Administrator. (We're working on improving this aspect of the
system...)
- Question: Is there a way to prepare PC2 "Account
Information" (such as Team Names and Passwords) ahead of time and then
load them into the system?
- Answer:
Yes. Although it is not documented in the manual, PC2 versions 7.4
and higher allow you to create account information ahead of time in a
file and then "import" the file into the system. The file is loaded
with the "Import" button on the Administrator.
Imported values overwrite any values that were in the system previously.
The format of the import file is as follows.
File lines starting
with ! or # in the first column are ignored. Each non-comment line has FOUR
fields, separated by a pipe (|). The fields are:
Account_number
Display_name
Active (either "true" or "false")
Password
For example:
1|Number 1|true|pass1
2|Team Number 2||pass33
Note: a blank "active" field is considered false
(so the example above will cause
team 2 to become inactive). True and false are not case sensitive.
- Question: Why is it that when I run PC2 under Windows
95/98, the "Test" button on the Team and the "Execute" button on the Judge
don't work, but instead generate a message in the .log file similar to the
following:
run
Executable.execute(RunData)
java.io.IOException: CreateProcess: "/c start runscr.bat" runscr.bat v7judge.bat sum1.pas sum1 java 1 error=0
at java.lang.Win32Process.create(Native Method)
at java.lang.Win32Process.(Compiled Code)
at java.lang.Runtime.execInternal(Native Method)
at java.lang.Runtime.exec(Compiled Code)
...
Answer:
This is due to a difference in the way NT and Win 95/98 handle parsing
and processing of command line arguments passed from PC2 to
the user-written "script" for executing problems.
Download and install Version 7.5, which fixes this problem.
- Question:
I am running a multi-site contest, and sometimes one or more of the
other sites simply stops communicating. What can cause this?
- Answer:
Assuming you still have network connectivity to the sites, one reason
this can occur is due to an error in older versions of the Java runtime
system. In versions prior to Java 1.2.2 there is a documented error
where the Distributed Garbage Collection routines used by the Remote
Method Invocation (RMI) system can deadlock, causing a PC2
Server to be unable to communicate.
The preferable fix for this is to make sure you are using JDK version
1.2.2 or higher.
An alternative would be to use only a single
PC2 Server (i.e. to run a "single site" contest).
Note that it is possible for a single
PC2 server to handle clients (teams and judges) located at arbitrary
(physically/geographically separated) locations.
In fact in principle you only need ONE
server to run a PC2-based contest over the entire world. The only
reason for supporting multi-server operations is efficiency (proximity between
clients and their server reduces communication time).
-
Question: When running a multi-site contest, I suddenly saw the
PC2 Scoreboard go "blank", showing no data from any site. I
think one of my sites was down, but I know the rest were running. What
causes this?
-
Answer:
This is a problem with multi-site operations which is fixed by Patch 2
for Version 7.5. Please download and install that patch, or a download
a new copy of the system (the patch has been applied to the new posted
version).
- Question: What if my problem is not covered in the above list?
Can you still help me?
- Answer:
Well, we'll be happy to try (please keep in mind that this is
a totally volunteer project on our part). The first thing we ask is that
you make the effort to read the Administrator's Guide and see if you can
find out from there what is going on. The Admin Guide is available on
our web page, and it comes packaged with the system when you download it
(although we admit to having missed the document packaging on at least
one release...). If that doesn't do it....
-
Each of the PC2 modules generates entries in a "log" file.
The log file names correspond to the module -- team.log, judge.log, etc.
Look through the log files and see if there are any obvious error
messages -- this will frequently give you a clue as to what is
happening.
-
If you still can't figure out what is happening, send us an email
message ("pc2@ecs.csus.edu") describing the problem and we'll see
what we can do to help.
Please include a zip file containing a complete copy of your
PC2 installation as an attachment to the email.
To generate such a file, go to the PC2 installation directory
and type the command "java pc2.ZipPC2"; this will create a .zip file of
the system. (If the problem relates to multiple modules on multiple
machines, please send a zip of each module).
pc2@ecs.csus.edu
PC2 Home Page
Rev:
Fri Nov 17 21:05:45 PST 2000