Computer Science 351: Questions and Answers

Frequently asked questions about lab assignments, homeworks, lectures, or any other topic of CS 351 will be posted here.

If you have a question you'd like answered send email to In your email, please give the following information:

  1. Name of simplest test case that your program fails.
  2. Exact test that fails or errors out. (You can fail a test by giving the wrong answer which assertXXX(...) checks. Or you can fail by crashing with an assertion error or some other exception.)
  3. Exactly what the failure is: which Exception was thrown, or what JUnit says is wrong.
  4. What you think the data structure looks like at the point your code is called. (Tell us whether you have checked your guess in the debugger.)
  5. The snippet of your code (whole method typically) that went wrong. Mark the line where the exception was thrown from, if any.
  6. Explain then either
    1. Why you think your code should do what the test wanted, and why you think it shouldn't crash with that exception, OR
    2. Why you think the test case is doing the wrong thing.
    You are probably wrong in this part, but that's fine. If you weren't wrong, you wouldn't need help!

NB: See Java 8 API.

NB: See how to access your grades.

Homework #14

NB: In test30 and test31, the "</t>" after "italic" should actually be "</i>". Otherwise the test is too easy. Please change it.

Q: How do we use the addCDATA method?

A: See the javadoc associated with Homework #14.

Homework #13

NB: As the homework says, your mergeSortMove/Keep methods shouldn't ever just move data from one plave to another except for a single item at the base of recursion. More generally, these methods shouldn't have any loops. We will take off points if you have loops in these methods.

Q: I've solved most of the homework, but it breaks down on the last efficiency test. There seems to be some corrupted characters. What do I do?

A: We should have set the project properties to be UTF-8, but didn't. Since we didn't set the encoding to anything, it inherits it to your default character encoding. This works fine as long as you use UTF-8 or don't use any special characters. But the dictionary has a few French words at the end (I don't recall why!). The dioctionary is encoded using UTF-8 and so these words are read wrong if you don't use UTF-8. Here's how to set the project's text file encoding to UTF-8:

File > Properties...
Text File Encoding
Inherited from container (XXX)
( )
Other [--Select--]
[ ]
Store the encoding of derived resources separately
If the "XXX" isn't "UTF-8", you need to click the second button and select UTF-8. Then when committing with git, make sure to move the .settings to the staged area.

Homework #12

Q: How do we make a lambda for a comparator or a consumer?

A: Use the following syntax for a comparator:

(l1,l2) -> ...expression...
Where the expression will use the two lists to compute a number that compares the sizes of the two lists.

And the following for a consumer:

(uo) -> ...expression...
where the expression indciates what you want to do with the URL object passed in. Our soluition immediately calls out to a helper method with the URL object as a parameter.

Q: How long does the example (finding duplicate resources from Prof. Boyland's web page) take to run?

A: A couple of minutes.

Q: Are we allowed to add our own fields to BreadthFirstWebCrawler and DuplicateResourceFinder?

A: Yes. Sorry, I should have said so.

NB: The homework says "duplicate resources" means "resources with the same CRC-32 hash". It would better say "resources whose contents are the same, which we approximate by finding resources whose contents have the same CRC-32 hash".

Q: How do we convert a URL to a URI? The obvious methods throws an exception. What do we do if an exception is thrown?

A: Log any exceptions. But only count and only tell the client (who is listening) about successfully loaded URLObjects.

Q: What do you mean by "load" the URL?

A: Creating a URL object will load the resource at the the URL. Don't create the URL object until you've checked that the URL hasn't been loaded already. (The Resource.Table will be useful here.)

Q: What should the Queue contain?

A: URLs. Before they've been processed. (The book suggests processing things before placing them in the queue -- don't do that, it makes the code more complex, and micro-managing. Just place every URL you find in the queue, and process when you get it out of the queue.)

Homework #11

Q: I don't see how to use the resources you gave us to implement CRC-32.

A: Use the Wikipedia article to write the algorithm, use the Javadoc for InputStream to see how to get one byte at a time from the source, and use the MSDN article to get the table contents.

Q: In testC, everything looks fine: there's one resource and the size is set to reflect that. Why should it be wrong?

A: You're not checking everything that you should. Perhaps you forgot the DESIGN line that starts "// where i ...".

Q: In test43, it seems to require that r[13] come first in iteration even though r[3] was added first and r[13] was added to the same chain afterwards.

A: We are assuming that you will use the most-efficient/easiest way to add something to the chain. Where is the easiest place to add something to a linked list? The head or the tail?

NB: In Homework #5, we also worked with endogenous structures. You may recall that when removing something from an endogenous structure, you need to clear up the links in the data. The same is true when clearing the structure.

NB: I see lots of people using "available". The Javadoc for available says:

Note that while some implementations of InputStream will return the total number of bytes in the stream, many will not. It is never correct to use the return value of this method to allocate a buffer intended to hold all data in this stream.
Don't use available. You shouldn't read things into an array first. If you do so, you will lose points on the assignment. Just read one byte at a time as the wikipedia page suggests.

NB: The random tests had problems:

  1. The implementation it checked your code against had a disastrously wrong implementation of rehashing, but this wasn't noticed because
  2. It was very difficult to test rehash errors because the random testing rarely caused rehashing to happen -- it would have too many tables with too few resources between them.
  3. The reference implementation also had a slightly buggy clear that was only apparent if you added several elements to a collection that was cleared after having been rehashed and then iterated over the result.
The last bug was very hard to find -- you could run RandomTest 50 times, and only then find it. These problems have been (mostly) fixed with a new homework11.jar. Please replace the one you have with this new one. "Mostly" means that you might need to run RandomTest two times to find the subtle clear error.

NB: The invariant checks were written BEFORE the _table field was added. So they are deficient:

  1. wellFormed SHOULD be checking that the _table fields have the right values, but doesn't.
  2. The tests should be setting _table for the tests, but don't.
We provide a "patch" that you can install using File > Team > Apply Patch .... After applying this patch, the tests wiull be updated to test the "table" field of resources.

Homework #10

Q: After deleting values I no longer pass test51 and following from TestDictionary.

A: Oops. In step 7, you should ignore results from tests test51-test59 until iterators are working.

Homework #9

NB: The test suite TestBSTSet claims to be an abstract test, that shouldn't be run. This comment is wrong. Sorry. It should be run; it's not abstract.

Q: I get an error when I run RandomTest. It says that RandomTest$1 cannot be found.

A: Oops! Our mistake. Please get updated JAR and drop in the lib folder, replacing the old copy.

Homework #8

Q: In the third of the testC tests, my code returns 11 instead of -1. Can I have a hint what's going on?

A: The tree has 13 nodes in it. I expect that one of the lowly minions is reporting a problem (by returning -1), but the supervisors aren't listening to their minions carefully, and asusme they always are reporting a size, and adding the value returned as if it was a size. Remember in the bureaucracy: EVERYONE is following the same rules: they need to return -1 if there's a problem with their division, OR the size of the division is there are NO problems.

Q: Where is "pre-order" defined?

A: In the textbook: pages 484ff (3rd edition, pages 474ff)

Q: What does it for there to be no bound (lo == null)?

A: It means there is no bound on that side: if lo is null, there is lower bound, the key can be as small (or lexicographically early) as it wants.

Q: How do we get the string of the Name? toString puts a slash atthe front which is tedious to remove.

A: Use the public rep field.

Homework #7.5

NB: SOme people are declaring a fourth field to keep a pointer to the dummy node. Don't do that. Use only the three fields described in the homework and shown in the picture.

Midterm Exam

Q: Please explain the procedure for the mid-term examination.

A: The exam takes place over all four class periods: lecture Tuesday and Thursday plus both parts of the lab:

  1. In Tuesday's lecture time, you will get portions of code from homework solution(s) and answer questions about the code.
  2. In Thursday's lecture, you will get the specification for a method similar to, but different from the homework. You need to write the code that meets the specification (and perhaps other restrictions).
  3. In the first hour of "lab", you will answer questions about concepts/definitions/motivations.
  4. In the second hour of "lab", you will be given some buggy code and told to answer questions about it, related to debugging the code. Your answers will be written on paper, but you are expected to use the debugger available in Eclipse.

Homework #7

Q: How can I tell if I'm showing lib/ correctly?

A: It is a series of pages with little pictures. To see how it is viewed by a commercial PS viewer, open lib/ with any PDF/PostScript viewer (such as Adobe Acrobat, or Apple Preview). (To view the text, you will need to open it with the text editor.)

Q: If the engine is so incomplete and buggy, how many tests should be pass?

A: All of them. As we said, you are not responsible to fix the incompleteness or bugginess of the whole engine. But if the engine were complete and bug-free, you could pass it any PostScript file (a precursor to PDF) and it would be able to show it. You can find millions of PostScript figures on the web; most of them won't work with our interpreter. You only need to handle lib/

Q: How does index get the argument i ? The method index in is only passed the engine.

A: Take a look at how add gets its arguments. Hint: everything is on the stack. Also don't neglect to read the text on top of page 2 of the homework sheet.

Q: Isn't a Stack a LIFO structure? The file says FIFO!

A: Oops, yes. You're quite right. I've pushed a fix. Please "pull" right now before doing any more.

Homework #6

Q: I needed to add something to the Sequence constructor but there's no TODO there.

A: Oops. Yes, our solution does to.

NB: You will need an "if" in addAll if you choose the "move to later" design for removeCurrent. (But you will find other methods easier, so there's no need to change designs!)

Q: I don't understand test15 and test16. In both cases, we remove the only element, and so we don't have any elements any more. We're back to the initial state, without any nodes. But atEnd() is supposed to be false. But when we first create the sequence, atEnd() is supposed to be true (See test02).

A: First, I hope you understand why atEnd() shouldn't be true after any element is removed (even that last one). If you don't, please read the *IMPORTANT* part of the Homework #4 handout (we haven't changed the ADT since then other than to make it generic). Second, assuming you understand why we need to have this behavior, but are just puzzled how it can be implemented, please read the design of Homework #6 again, especially about the "fourth" field. If we remove the only element, we are not back at the initial state!

Q: What does this mean?

3. The prev links must link in the opposite direction.

A: The next links link the nodes into a cycle, beginning and ending with the dummy. The prev links should do the same except in the opposite direction.

Q: What does this mean?

[_dummy's] data should be itself cast unsafely.

A: Sorry -- trying to write succinctly. In full: When you check the dummy node, the "data" field should point back to itself (the dummy node itself). The "cast unsafely" is talking about what you need to do to assign the data field to be a pointer to the dummy node. You will need to use an unchecked cast.

Q: The Javadoc on removeCurrent says that the current element is now the next one. Is that right?

A: No. It's not. Sorry for the oversight. It should be the same as for Homework #4:

 * Remove the current element from this sequence.
 * @param - none
 * @precondition
 *   isCurrent() returns true.
 * @postcondition
 *   The current element has been removed from this sequence. and now
 *   there is no current element.  The sequence will not be
 *   at the end, even if the current element had been at the end.
 * @exception IllegalStateException
 *   Indicates that there is no current element, so 
 *   removeCurrent may not be called. 

Homework #5

Q: I'm having problems writing sortForward. Can you suggest how I start?

A: Look at page two of the homework, especially the case for inserting Triangle D.

  1. What is the test that shows that this triangle (write code using t) cannot stay where it is? (Unlike Triangle C in the previous case). You should write real code that uses t. Don't assume you have a C pointer. And don't assume you know what the key's value for D (or any other triangle is). Remember you're writing real code that potentially can go into your homework.
  2. Next write code that removes Triangle D from where it is. Again write real code that uses t. It should start =;
    It's OK if your code only works if the triangle is in the position Triangle D is in the list. You can generalize later.
  3. The insertion sort will next look at previous triangles and figure where to insert Triangle D after. Suppose pre is such a Triangle. Give the check that shows that Triangle D (remember, using variable t) goes after this triangle (named pre).
  4. Then write the code to insert Triangle D (called t) after this previous triangle (called pre).
This basic process should be done for all methods that you can't just do easily; start with an example that do what needs to be done for it. Write real code, and then try to generalize it.

NB: We have created an exhaustive test case for sorting lists of length up to six. Please put in the default package of homework5.

Q: The removeFirst() method header says that it ``throws'' an illegal state exception. Does that mean that our code doesn't need to check and throw the exception?

A:The throws in the method header is a warning/documentation for the user. It means "this method may throw this exception." It's like a sign "beware of dog". But if you don't actually have a dog, the sign isn't going to make up for this omission! In the same way, the throws line doesn't actually throw an exception itself. (It wouldn't know when to do so!)

NB: For the homework, we're doing insertion sort, not bubble sort. Don't swap the triangle with earlier ones in sortForward! Instead, if it needs to move, then remove it from the list and insert it into the list of previous triangles.

Q: I'm trying to do the first TODO in which says:

// add any new polygons to "line" from "input" which the scan line has reached
// (Use getMinY to see if the triangle starts at this y or before.)
But the input list only lets me get at the "first" triangle. How can I get to all the ones that may be reached.

A: Use the fact that the triangles are sorted by ``min Y'' already and so if the first triangle is not reached yet, none of the ones after it are reached. But if the first one is is reached, there may be others that are reached too. So you can remove and transfer triangles until the first one isn't reached yet.

Q: How can I figure out what this Group is that the triangle needs to point to? I don't know what to compare _group to.

A: The _wellFormed method is a method in the Group. In any (non-static) method, there's a simple Java way that many of you having been using to refer to the object itself. Hint: How did they tell you in CS 251 to write constructors to assign the fields of the object? Don't agonize over it; it's very simple. If you can't think of it, then ignore checking condition 5 for now, and do the rest of the assignment. Next time you write a constructor, try to remember how one refers to the object being constructed.

Q: I don't see what's wrong with testP (and testW below). All the triangles in the group have the same group pointer.

A: It's not enough that the triangles agree on a group, their group pointers should all point to the group that they are in. In testP, the group pointers are all null. This is wrong since only triangles not in a group should have null group pointers. testW has a triangle illegally in two groups, but the group pointer can only point to one of them; the other group should notice that the group pointer is wrong.

NB: There needs to be another invariant test: Please add this at the end (after testV):

public void testW() {
	Group other = new Group(self._key);
	self._first = self._last = t2;
	other._first = other._last = t2;
	t2._group = other;
	assertFalse("invariant 5 (e) not checked",self._wellFormed());

Homework #4

Q: In testcont1, we have an empty sequence where atEnd() is true, and then we add a sequence with two particles in it to the sequence, which is no longer empty any more. My code is getting an invariant error because _atEnd is not allowed to be true because the list isn't empty any more.

A: Yes, _atEnd must remain true after the call to addAll(s2). You will need to adjust other fields to enable this to be the case without running afoul of the invariant. Remember what "at end" means!

NB: Please add the following test to to check that your size() method is efficient:

	public void testSize() {
		for (int i=0; i != MAX_LENGTH; ++i) {
			assertEquals(i, s.size());
			if ((i%2) == 1) {
			} else {

Q: The comment for atEnd says there are three situations where the method returns true, but only two are given. What's going on?

A: The "three" is wrong. It should be "two". The "three" was left over from Homework #2 when atEnd had a slightly different semantics. Read the homework sheet to see how it changed.

Homework #3

Q: When the iterator's version doesn't match that of the collection, why do your tests expect that the data structure invariant (wellFormed) should return true?

A: Because if the versions don't match, then the iterator is stale because of mis-use by the client. It's not the responsibility of the ADT implementation (ParticleCollection) if something is wrong. That's why it should ignore everything and return true.

Q: We get hints that the iterator's index should start at -1 but that value is illegal. What's going on?

A: The hints are not correct for this semester. -1 is indeed not legal for this assignment. As I said in lecture today, next() is implemented by doing an advance() followed by getCurrent(), and if you read further down this page, you will see (in the Homework #2 section) that advance() does not always increment the index.

Homework #2


Q: How do I know when to throw an OutOfMemoryError ?

A: See the NB at the end of the @note in the javadoc for the whole class. This applies throughout for all memory errors.

Q: My code fails the invariant test test6, but the console shows lots of error message about failed tests.

A: You'll find it easier if you run test6 by itself so that you don't get the messages from other tests.

Random Test

Q: The console only shows part of the test. How do I get the full thing?

A: In the "Run Configuration" under the "Common" tab, choose a file (perhaps src/ for the standard output.

Q: After running the RandomTest, I received an output which I copied in a new class. The last line of the test is

but Eclipse says that edu.uwm.cs351.Particle@506e1b77 can not be resolved to a variable.

A: Thanks! This was an error in our random test generator. It's been fixed now, but to get the fix, you need to replace lib/homework2.jar with this updated version.

At End

Q: in test26, my code is crashing with an invariant problem at the end of advance(). It's because _isCurrent is not allowed to be true when we're after all the elements.

A: Your invariant checker is working correctly. See the next questions.

Q: When we are at the end, is there a current?

A: See next question: if you're at the end, you are after all the elements!

Q: Does atEnd refer to be on the last element or being after the last one?

A: After the last one.

Removing elements

Q: If we remove an item, is it replaced with null, or is it removed from the data structure?

A: remove does a remove, not a replace.

Q: In test26 after we remove current, there's still an item there, so why is isCurrent supposed to be false?

A: There is no current because it has been removed, to get to the next element you have to call advance().

Q: ... But if we advane() that will move the indes on to 1 and then there aren't any elements any more!

A: advance() doesn't always increment the current index. In general, just because an ADT method says something like "advance", it doesn't mean we are incrementing an index. Logically it means we go to the next element. But if the current element was just removed then it's not necessary to increment the index to get to the next element!

Lab #1

Q: I get an error about LockedTestCase. It can't import it!

A: Oops. Our error. But it's easy to fix: Right click on locked-tests.jar in lib/ and then choose "Add to Build Path".

General Questions

Q: How do I run RandomTest? (Relevant if the homework indicates there is a RandomTest.)

A: The easiest way to run RandomTest (for homeworks that include it) would be to right-click the included lib/homeworkX.jar file in Eclipse's package explorer, and select "Run as" -> "Java Application". If RandomTest is included in the homework, you should see it under "Matching Items". Run it. It will run several million tests before giving up. If it completes the whole number, this shows that your implementation of the methods tested are likely to be correct. If it stops and outputs a particular test case, this means your code has failed one of its randomly-generated tests, and you can debug based on its output. Feel free to copy the output into a JUnit test so you can use the debugger to step through it.

Q: I don't know how to implement hash code. What should I do?

A: The hash code should combine integers derived from the fields that are compared for equals. An integer field is usable as is. A double can be converted into an integer for hash code purposes using a method in class Double. When you combine values, the tutorials frequently use "31" to spread the values apart from each other. You may want to use a larger spread. Here's one example tutorial on hash code .

Q: Can we add our own helper methods?

A: In principle yes, but if you do the homework "properly" you shouldn't need to add helper methods, unless we mention them. But if (for example), you don't know the "this(...)" syntax for calling one constructor from another, then a helper method can avoid the need to duplicate code (good to avoid).

Lecture Example

Q: Do we have access to the examples shown in lectures? Where do we find them?

A: You can use eclipse to import the lecture examples using repository path

Replace n at the end with the corresponding week number.

Homework Solution

Q: The handout says to check the solution to previous homework for examples. Where do we find them?

A: You can use eclipse to import the solution using repository path

Replace n at the end with the corresponding homework number and note that there is no .git at the end. When you try to import the homework solutions using default settings, you may encounter an error that says files already exist. To fix this, there are two things you need to do:
  1. At start up, choose a different workspace
  2. On import dialog, on the step where you can choose the local destination of git repo, type in a different name at the end of the path e.g homework2_solution.
Alternatively, you can ssh into (see instructions), change directory to the above path.

Accessing AFS through andrew

Q: You said our grades are on AFS and so is the quiz solution. How do we access files in $CLASSHOME/...?

A: You should ssh into (see instructions). Then you can change directory to the place of interest, e.g. your grade directory or the solution file and look at a file using more.

NB: While on andrew, you can check the status of a homework git, what you have pushed or not:

git --git-dir=/afs/ log

Eclipse Problems

Q: I accidently deleted a file. How can I restore it?

A: There are two ways: one is easier but can only restore an entire directory, the other is more complicated but can restore a single file.

First way, in "Package Explorer", right click on the folder where the deleted file belongs to, and select "Replace With" -> "HEAD Revision". Then click "OK". This will replace ALL files in the directory with the ones in last commit. So if you changed any other file in that directory, make sure commit the change on that file before using this approach.

Second way, select "Git Repository Exploring" from "Window" -> "Open Perspective" in menu bar. Then, look "Git Staging" tab in a sub-window. If you didn't do a commit (you shouldn't!) after having accidently deleted the file, you should see your deleted file in "Stage Changes". Right click the file and choose "Replace with HEAD Revision", the file should be restored.

Q: When I try to "push" I get an error: rejected: non fast-forward.

A: That message means you need to "pull" first before "push".

NB: See instructions to merge if you have any problems with push..

Q: It says I can't run my programs because of a major/minor version error.

A: The problem was that the project was compiled on a machine with a higher version of Java (e.g. 7) than the current setup can handle (often Java 6). Clean the project and try again. ("Project > Clean ..." and then just clean the current project -- the one that doesn't work. No need to clean everything).

NB: A similar problem can happen if you use a non-default JRE in the project. Then nothing works, and you have a nasty red exclamation point on the entire project. You will need to go to Project Properties and choose the Java Build Path and then select the Libraries tab. The JRE library selected is marked as bad, delete and then "Add Library > JRE System Library > Workspace default JRE". Then it will clean automatically and rebuild.

AFS and Kerberos Installation

NB: It is no longer necessary to install OpenAFS on your home computer for CompSci 351

NB: In the instructions that follow, if you are on the campus network, you can use AD.UWM.EDU as the Kerberos realm (cell is still instead of CS.UWM.EDU and then use your University password.

Installation on Windows (64 bit)

  1. Go to
  2. Select the section Kerberos for Windows (MIT or Heimdal)
  3. Select Heimdal Kerberos, which takes you to a webpage at "Secure Endpoints"
  4. Select the latest Heimdal Kerberos (1.5.1 or later) for 64 bit. Run/Install this. (Typical install is fine)
  5. Next, on the same "Secure Endpoints" page, find a link to Network Identity Manager v2 (available separately) and click there.
  6. That brings you to a new page, scroll down to the download section and get the 64 bit regular download (not the SDK download). Run/Install this. (Typical install is fine)
  7. Now assuming you downloaded Heimdahl (not MIT) KfW, on your windows machine, bring up the following file in NotePad running as Administrator:
    Add a line after the line [libdefaults]. This new line should say
        allow_weak_crypto = true
    Then "Save" the file. If it doesn't let you save, then you probably didn't run NotePad as an Administrator. Quit NotePad and try again, this time running NotePad as an Administrator. (Apparently it's possible to run a program as administrator by using Control-Shift-Enter from the Search box under Start. Another possibility is to right-click the notepad application and choose "run as administrator".)
  8. Finally verify that this is working by doing the following in a Command Prompt window:
    kinit yourid@CS.UWM.EDU
    Type your CS kerberos password. If on campus, you can use AD.UWM.EDU instead with your panther password. If this succeeds, then continue. Otherwise, tell us the error.
  9. Finally, you can install OpenAFS itself. Go back to the Windows download page for OpenAFS and download the latest 1.7.X distribution. When you run it:
    1. Choose "Typical Install"
    2. On the "Configure AFS Client" Page: Choose "" as the default Cell (NOT And DISABLE "Integrated Logon". Other things should be enabled.
  10. The computer will need to restart. Let it restart and then log in again.
  11. Make sure the network is running (open a browser window).
  12. Start "Network Identity Manager". You might have to look for it.
  13. It will say you don't have credentials. Click to obtain new credentials.
  14. The dialog window will list your Windows logon and ATHENA.MIT.EDU. Change it to your Panther ID (not your student ID!) and CS.UWM.EDU (or, if on campus, AD.UWM.EDU).
  15. If the network is running, it should ask for your password. This is your kerberos password. (or if using AD.UWM.EDU, your panther password).
  16. If it works, you end up with a green credential. A delay of 30 seconds is OK.
  17. If there is a long delay (a minute or more) or a brief error message and THEN the green credential thing comes up, AFS is not working. Perhaps you specified the wrong cell ( ?). You will need to check the AFS information about your credential. Look at the Advanced view and see if you see something obviously wrong.
  18. Now you can use Eclipse. On Windows, remember to use backslashes. and START with two of them: \\afs\\users\classes\cs351\...
If you have problems, please indicate how far you got through these steps. Also, give the output of the following three commands (run in a Command Prompt window):
  1. net view \\afs
  2. kinit yourpantherid@CS.UWM.EDU
  3. aklog -d -c

NB: If you install Openafs 1.6.X on a Windows machine, don't expect us to be able to help you if it doesn't work. OpenAFS 1.7.X is recommended for all Windows installations.

Installation on MacOSX

  1. Download the software from
  2. Install the DMG that you have downloaded. ("Click icon to install") "This package will run a program .." (Continue)
  3. On the Client Cell Configuration, select Optionally cs can be the alias, but you won't need an alias.
  4. Install on the main hard disk. It will ask for your local password to get permission to install.
  5. Then if using Lion or later (e.g., Mountain Lion), open a terminal and use vim (see VIM documentation) to edit /etc/krb5.conf. At the prompt ~ $, type the following
    sudo vi /etc/krb5.conf
    This will ask for the local password, and then bring up the file. Make sure that you have at least the lines:
    allow_weak_crypto = true
    default_realm = CS.UWM.EDU
  6. Now you have finished the installation.

    In order to use OpenAFS to access your class files, you will need to get kerberos credentials and use them to get AFS tokens.

    kinit yourpantherid@CS.UWM.EDU
    Kerberos credentials (and the associated AFS tokens) expire after a time (typically 10 hours, sometimes 25 hours -- it can be set in your krb5.conf file).

Installation on Linux

If asked the following questions, here are some recommended answers:
AFS cell?
size of AFS cache?
1000000 (that is, one gigabyte)
run AFS now?
encrypt AFS traffic?
dynamically generate contents of /afs?
You should ensure that /var/openafs/cache has at least as much space free as you promise in your cache response. Best is that the cache is its own partition. The file system should be ext2, ext3 or ext4. Once you have installed it, continue with the instructions for MacOSX.

Troubleshooting an AFS/kerberos installation

Some OpenAFS errors are easy to fix. Use aklog -d in a command prompt / terminal window to determine the problem.

Error 56 (Authentication server unavailable)
This means you are trying to use the AFS client service to get tickets. This doesn't work. You have to use Network Identity Manager (Windows) and/or aklog (any).
No credentials cache file found
You haven't got Kerberos tickets with Network Identity Manager yet. First get tickets and then if the Advanced view doesn't show AFS tokens, then run aklog again.
enryption type des-cbc-crc disabled
You need to edit krb5.conf to allow weak cryptography as described above.
KDC has no support for encryption type
You need to edit krb5.conf to allow weak cryptography as described above.
error -1765328234
You need to edit krb5.conf to allow weak cryptography as described above.
missing XXX.dll
This means you installed MIT kerberos for windows 32 bit but are on a 64 bit machine. You should have gotten the 64 bit version from Secure Endpoints. Look carefully for the 64 bit link on the OpenAFS installation page. Uninstall the old NIM and re-install the correct one.
clock skew
This means your system clock is more than 5 minutes off the AFS server. You should make sure you have the right time zone (US Central) and then reset your system clock to agree with an external source, e.g. your cell phone.
Couldn't get AFS tickets
If you get an error message about, this means you accepted the default cell as instead of changing it to I don't know how to change it after installation (you could uninstall and reinstall and this time make sure to set the default cell), but you can also run aklog with a cell option:
aklog -d -c
The Network Identity Manager also has a way to get tickets from cells other than the default cell. It's in a hidden dialog. Go to the Options>AFS page, and then select your panther ID (half way up the page) and then select the AFS tab, and then add as a cell to use in the bottom dialog.
ktc 7
If you had OpenAFS working, and it stops working, and this is the error, it can be fixed by rebooting. Otherwise, this is a hard error to fix. This error no longer happens with the OpenAFS 1.7.X IFS client.
RPC server is unavailable
If this error happens when you try to navigate to \\afs\ this means your computer is not letting you access the AFS server. You probably have an overactive firewall.
client not found in kerberos database
You are using the wrong realm. You should use CS.UWM.EDU or AD.UWM.EDU, not a lowercase name or MIT.EDU etc.

NB: On Linux or MacOSX, the command line is used to authenticate to AFS. On Miller, I wrote a script called klog. You can make yourself a similar script. The only two things you MUST have are

kinit PantherID@CS.UWM.EDU
aklog -c

Q: On my Windows Vista PC, I can get a kerberos ticket, but don't get permission to access CS 351 files.

A: You need an AFS token. The network identity manager defaults to, but you need to change that (File>AFS>Preferences) to Then add '' as a cell to automatically get tickets for. Once you have a kerberos ticket, it will get your AFS tokens for you.

Q: How do I get to the CS 351 from my windows PC?

A: Use the ANC path: \\afs\\users\classes\cs351\...

Q: On my MAC/Linux computer, when I try to kinit, it says

client not found in the kerberos database.
A: This means the default realm is not CS.UWM.EDU, and so you have to specify it on the command line, or make it the default realm.

Q: If I get past the error I just mentioned, I get a new error:

Cannot get any kdc for realm CS.UWM.EDU
A: This means that your computer is prevented from accessing the KDC. This can happen if you are off the network, or have a paranoid firewall, or are using UWM's "Public" WiFi system.

Q: What should krb5.conf have in it?

A: Actually you don't need to have much of anything, unless you are using Heimdahl in which case you must "allow weak crypto" but the following is a reasonable contents:

allow_weak_crypto = true
default_realm = CS.UWM.EDU

  kdc =
  kdc =
  master_kdc =
  admin_server =

Q: On my Mac, I got the kerberos tickets; now how do I get AFS access.

A: Use "aklog" from a terminal window, or use one of the Third Party tools mentioned on the OpenAFS download page for MacOSX.

CS 351 FAQ / John Tang Boyland