[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 
Messages posted by: avaval
Forum Index » Profile for avaval » Messages posted by avaval
Author Message
Hi

I am using jCVS-5.2.2

When I try to checkout project, I am getting following exception

java.lang.NullPointerException
at com.ice.cvsc.CVSProject.processResponseItem(CVSProject.java:1995)
at com.ice.cvsc.CVSProject.handleResponseItem(CVSProject.java:1610)
at com.ice.cvsc.CVSClient.processResponseItem(CVSClient.java:1669)
at com.ice.cvsc.CVSClient.readAndParseResponse(CVSClient.java:1821)
at com.ice.cvsc.CVSClient.processCVSRequest(CVSClient.java:1539)
at com.ice.cvsc.CVSClient.processCVSRequest(CVSClient.java:1052)
at com.ecredit.cvs.jcvs.JCVSTest.testCheckout(JCVSTest.java:423)
at com.ecredit.cvs.jcvs.JCVSTest.main(JCVSTest.java:453)


Looking at previous posting, I noticed that there has been change in APIs.
API cvsProject.setProjectDef( cvsProjectDef ); is no more available. Any help
is appreciated

Is there any other API that need to be called before trying to execute
checkout command ?

Code looks as follows

localRootDirectory = new File( localDirectory );
request = new CVSRequest();

arguments = new CVSArgumentVector();




//create client
client = new CVSClient( hostname, CVS_PORT);
log( "Client created");

project = new CVSProject( client );
log( "Project created");

project.setUserName( CVS_USER );
project.setTempDirectory( TEMP_DIR );
project.setRepository( repository );
project.setRootDirectory( rootDirectory );
project.setLocalRootDirectory( localRootDirectory.getPath() );

project.setPServer( true );
project.setConnectionPort( CVS_PORT );
project.setConnectionMethod( CVSRequest.METHOD_INETD );

project.setServerCommand("(not applicable)");

project.setAllowsGzipFileMode( false );

scrambled = CVSScramble.scramblePassword ( new String( CVS_PWD ), 'A' );
project.setPassword( scrambled );
log( "password " + scrambled );

project.establishRootEntry( CVS_REPOSITORY );
log( "root entry set to " + CVS_REPOSITORY );

project.openProject(localRootDirectory );
log( "Opened project at local directory " + localRootDirectory.getPath() );

request.setPServer( true );
request.setUserName( CVS_USER);
request.setPassword( project.getPassword());

request.setConnectionMethod( CVSRequest.METHOD_INETD );
log( "Connection method set to " + CVSRequest.METHOD_INETD );

request.setServerCommand( project.getServerCommand());
request.setRshProcess( project.getRshProcess());

request.setPort( cvsPort );
log( "Port set to " + cvsPort);


request.setHostName( hostname );
log( "host set to " + hostname );


request.setRepository( CVS_MODULE );
log( "request repository set to " + repository );

request.setLocalDirectory( localRootDirectory.getPath() );
log( "request local directory set to " + localRootDirectory.getPath() );

request.setRootDirectory( rootDirectory );
log( "request root directory set to " + rootDirectory );

request.setRootRepository( rootDirectory );
log( "request root Repository set to " + rootDirectory );

request.setSetVariables( project.getSetVariables());
log( "request setSetVariables set to " + project.getSetVariables() );

request.setCommand("co");
//request.setCommand("checkout");


request.sendModule = false;

request.sendArguments = true;

request.sendEntries = false;
request.handleUpdated = true;
request.allowOverWrites = true;
request.queueResponse = false;
request.responseHandler = project;
request.includeNotifies = false;

request.handleEntries = true;


request.traceRequest = true;
request.traceResponse = true;
request.traceTCPData = true;
request.traceProcessing = true;
log( "request trace set to true" );

//request.displayReponse = true;

request.allowGzipFileMode = project.allowsGzipFileMode();
//request.setGzipStreamLevel( project.getGzipStreamLevel());

request.setEntries(cvsEntries );

//append module name to list of arguments
arguments.appendArgument( repository );

request.appendArguments(arguments);
log( "request arguments set " + arguments.toString());

log( "Request is " + request.toString());


response = client.processCVSRequest( request );
log( "Executed command " + arguments.toString());
log( "Response " + response.getDisplayResults());

project.processCVSResponse(request, response);
log( "Processed cvs response " );

log( "Response " + response.getDisplayResults());


Regards
Anupam
Hi

I am trying to checkout module from cvs. Here is my code.

I am getting error response as
Response cvs [server aborted]: must specify at least one module or directory

I am specifying module name. Let me know what am I missing


CVSProject project = null;

String userName = CVS_USER;
String passWord = CVS_PWD;
String hostname = CVS_HOSTNAME;
String repository = CVS_MODULE;
String rootDirectory = CVS_REPOSITORY;
String localDirectory = CVS_LOCAL_DIR;

int cvsPort = CVS_PORT;
File localRootDirectory = null;

CVSUtilities utils = null;
CVSClient client = null;
CVSRequest request = null;
CVSResponse response = null;

String scrambled = null;

CVSProjectDef projectDef = null;
CVSEntryVector cvsEntries = new CVSEntryVector();
CVSArgumentVector arguments = null;;


try
{
localRootDirectory = new File( localDirectory );
request = new CVSRequest();

arguments = new CVSArgumentVector();

//append module name to list of arguments
arguments.appendArgument( repository );

//create client
client = new CVSClient( hostname, CVS_PORT);
log( "Client created");

project = new CVSProject( client );
log( "Project created");

project.setUserName( CVS_USER );
project.setTempDirectory( TEMP_DIR );
project.setRepository( repository );
project.setRootDirectory( rootDirectory );
project.setLocalRootDirectory( localDirectory );
project.setPServer( true );
project.setConnectionPort( CVS_PORT );

project.setServerCommand("(not applicable)");

project.setAllowsGzipFileMode( false );

scrambled = CVSScramble.scramblePassword ( new String( CVS_PWD ), 'A' );

project.setPassword( scrambled );
log( "password " + scrambled );

project.establishRootEntry( CVS_REPOSITORY );
log( "root entry set to " + CVS_REPOSITORY );

request.setPServer( true );
request.setUserName( CVS_USER);
request.setPassword( project.getPassword());

request.setConnectionMethod( CVSRequest.METHOD_INETD );
log( "Connection method set to " + CVSRequest.METHOD_INETD );

request.setServerCommand( project.getServerCommand());
//request.setRshProcess("");

request.setCommand("co");

request.setPort( cvsPort );
log( "Port set to " + cvsPort);


request.setHostName( hostname );
log( "host set to " + hostname );

request.setRepository( CVS_MODULE );
log( "request repository set to " + repository );

request.setRootDirectory( rootDirectory );
log( "request root directory set to " + rootDirectory );

request.setRootRepository( rootDirectory );
log( "request root Repository set to " + rootDirectory );

request.setLocalDirectory( localRootDirectory.getPath() );
log( "request local directory set to " + localRootDirectory.getPath() );

//request.setSetVariables();

request.responseHandler = project;

request.traceRequest = true;
request.traceResponse = true;
request.traceTCPData = true;
request.traceProcessing = true;
log( "request trace set to true" );

request.displayReponse = true;

//request.allowGzipFileMode = project.allowsGzipFileMode();
//request.setGzipStreamLevel( project.getGzipStreamLevel());

request.setEntries(cvsEntries );
request.appendArguments(arguments);

log( "request arguments set " + arguments.toString());


log( "Request is " + request.toString());

response = new CVSResponse();
client.processCVSRequest( request, response);
log( "Executed command " + arguments.toString());
log( "Response " + response.getDisplayResults());

project.processCVSResponse(request, response);
log( "Processed cvs response " );

log( "Response " + response.getDisplayResults());
log( "Response error code " + response.getErrorCode());
log( "Response error text " + response.getErrorText());

log( "Valid request " + request.validRequests);

}
catch ( Throwable eTH )
{
eTH.printStackTrace();
}
finally
{

}
 
Forum Index » Profile for avaval » Messages posted by avaval
Go to:   
Powered by JForum 2.1.9 © JForum Team