[Logo] JCVSForum - Community Support For JCVS Users and Developers
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Checkout problem with jCVS 5.3.2  XML
Forum Index » JCVS Developers
Author Message


Joined: 29/07/2004 09:06:53
Messages: 8

Apologies for using the older version. I can't use version 5.4.1 because
I'm stuck with JDK 1.3.

I'm trying to do a checkout in java (not javascript) using the com.ice.cvsc

I adapted the code in the gjt-co.js javascript. However, when I ran it,
I got a null pointer exception on this line (3524):

"String rootDirStr = this.projectDef.getRootDirectorySpec();"

in the CVSProject writeAdminAndDescend method.

Looks like the CVSProjectDef is never set in the CVSProject class.

When I went back to my code and created a CVSProject (I had to guess
at the parameters), and set it using CVSProject.setProjectDef, everything
works fine. This step was missing from the javascript, so I suspect that
the javascript would not work (don't know what js does with null
pointer exceptions). The files get checked out, and the CVS
subdirectories get created, but no admin files are created.

Just thought you might want to know.

Just curious: why do you have to set the same parameters over and
over? All of the fields in CVSProjectDef were already set in CVSProject
and/or CVSClient. Couldn't the code read the required information
from other classes, or perhaps store all of this in another class that
can be used by CVSProject and CVSClient? It would save *a lot* of
code. Maybe this is fixed in the newer version?

Also, what is the meaning of the "noMode" parameter for CVSProjectDef?
It isn't documented.

Also, it would be nice if there were a class that can parse the CVSROOT
environment variable. I have code if you're interested, but it is fairly
specific, since I only care about pserver connections at the moment.


Joined: 05/06/2004 18:09:23
Messages: 367
Location: Bangkok

First, let me cover the release. You can probably use the 5.4.2 release if you
just comment out the j2ssh code in CVSClient. I would like to come up with a
way to make it compatible with 1.3, suggestions are welcome.

The NullPointerException that you are seeing is the result of the CVSProject's
project definition not being set, as you indicated. The JavaScript is from
before that coding change, and the only reason it does not fail is that it does
not attempt to write the admin files. This NPE is also the reason that your
admin files are never written.

The reason that the CVSProjectDef seems redundant is that you are in checkout
mode. When you open an existing project, CVSProjectDef is preset for you and you
do nothing. It was also vital for supporting jCVS Servlet and now jCVSWeb. If
you can see any true redundancy, I would be happy to weed it out. If you are
checking out, you need to construct the project definition and set it to allow
for the checkout to complete, as you found out with the NPE.

The "noModeRoot" ( I assume that it what you meant by "noMode") flag is
commented in the code. The cvs "root directory spec" has ":server:" and
":pserver:" prefixes, but it also has "nothing". In order to preserve this
setting when I rewrite the spec, I need to set this flag internally. You should
never care about this flag, unless you are opening projects saved by the command
line client.

This message was edited 1 time. Last update was at 29/07/2004 12:46:42

[Email] [WWW]
Forum Index » JCVS Developers
Go to:   
Powered by JForum 2.1.9 © JForum Team