Re: Problem with updating and checkout under Tomcat 4
Milos Kleint <[email protected]>
| Newsgroups | gmane.comp.java.netbeans.modules.javacvs.devel |
|---|---|
| Message-ID | <[email protected]> |
Dariusz Drezno wrote:
> Hello,
>
>
> LocalPath is set OK, because when I call my method in main() as separate
> program it works...
so, the problem doesn't seem to be in your code, but in some enviroment
settings that the library canot handle?
> When I use it in JSP page - it fails. (I start Tomcat as root - with all
> rights).
> I think if file were not writable, I would get another exception - i.e.
> "permission denied".
> I have no idea ...
me neither :( could you try the following (just to be sure).. replace
the line where the error appears and directly specify the directory
where the temporary file should reside..
File tempFile = File.createTempFile("cvsCRLF", "tmp",
f.getParentFile());
hope that works (*fingers crossed*)
Milos
>
> Regards,
> DD
>
>
> ----- Original Message -----
> From: "Milos Kleint" <[email protected]>
> To: <[email protected]>
> Sent: Thursday, May 09, 2002 8:05 AM
> Subject: Re: [javacvs-dev] Problem with updating and checkout under Tomcat 4
>
>
>
>>according to the stacktrace it seems to be a problem with creating a
>>temp file..
>>
>> File f = new File(path);
>> f.getParentFile().mkdirs();
>> f.createNewFile();
>> File tempFile = File.createTempFile("cvsCRLF", "tmp");
>
> file://NOI18N
>
>>in this code the temp file is created in the default temp directory..
>>maybe you don't have that defined or it's not writable?
>>
>>Milos
>>
>>
>>Jeff Cantin wrote:
>>
>>>NullPointerException. The code block you provided checks whether
>>>something is null, then tries to access it. This will cause an npe.
>>>
>>>Not sure why your code doesn't work in tomcat 4. Since the exception
>>>has something to do with creating a file on unix, you probably have
>>>the 'localPath' on the client set to something funny.
>>>
>>>
>>>--- Dariusz Drezno <[email protected]> wrote:
>>>
>>>
>>>>Hello Jeff,
>>>>I still don't understand something...
>>>>First of all - what is npe??
>>>>If I try get something :) blocked, maybe I should add somewhere
>>>>"connection.close()" function?
>>>>Then, could explain why my application works with old version of
>>>>tomcat, and
>>>>dont work with new version?
>>>>Regards,
>>>>
>>>>DD
>>>>
>>>>
>>>>----- Original Message -----
>>>>From: "Jeff Cantin" <[email protected]>
>>>>To: <[email protected]>
>>>>Sent: Wednesday, May 08, 2002 11:59 AM
>>>>Subject: Re: [javacvs-dev] Problem with updating and checkout under
>>>>Tomcat 4
>>>>
>>>>
>>>>
>>>>
>>>>>I think you're gonna get an npe with that
>>>>
>>>>client.getEventManager()
>>>>
>>>>
>>>>>block. You also might want to write your own cvslistener for web
>>>>>responses instead of using the default system.out one
>>>>>(basiclistener).
>>>>>
>>>>>Jeff
>>>>>
>>>>>--- Dariusz Drezno <[email protected]> wrote:
>>>>>
>>>>>
>>>>>>Hello,
>>>>>>
>>>>>>I use javacvs to create application for cvs web browsing. My
>>>>>
>>>>jsp
>>>>
>>>>
>>>>>>page use
>>>>>>bean in which I have:
>>>>>>
>>>>>> CheckoutCommand cc = new CheckoutCommand();
>>>>>> cc.setModule(p_module);
>>>>>>
>>>>>> if (client.getEventManager() == null) {
>>>>>> client.getEventManager().addCVSListener(new
>>>>>>BasicListener());
>>>>>> }
>>>>>> try {
>>>>>> client.executeCommand(cc, globalOption);
>>>>>> } catch (CommandException ce) {
>>>>>> ce.printStackTrace();
>>>>>> }
>>>>>>
>>>>>>and it works well under Tomcat 3.3 and doesnt work under Tomcat
>>>>>>4.0.3 :-(.
>>>>>>There is the same problem with LogCommand.
>>>>>>I have got an exception:
>>>>>>
>>>>>>java.io.IOException: No such file or directory
>>>>>> at java.io.UnixFileSystem.createFileExclusively(Native
>>>>>>Method)
>>>>>> at java.io.File.checkAndCreate(File.java:1294)
>>>>>> at java.io.File.createTempFile(File.java:1382)
>>>>>> at java.io.File.createTempFile(File.java:1419)
>>>>>> at
>>>>>>
>>>>>
> org.netbeans.lib.cvsclient.file.DefaultFileHandler.writeTextFile(DefaultFile
>
>>>>>>Handler.java:253)
>>>>>> at
>>>>>>
>>>>>
> org.netbeans.lib.cvsclient.response.UpdatedResponse.process(UpdatedResponse.
>
>>>>>>java:146)
>>>>>> at
>>>>>>
>>>>>
>>>>org.netbeans.lib.cvsclient.Client.handleResponse(Client.java:478)
>>>>
>>>>
>>>>>> at
>>>>>>
>>>>>
>>>>org.netbeans.lib.cvsclient.Client.processRequests(Client.java:442)
>>>>
>>>>
>>>>>> at
>>>>>>
>>>>>
> org.netbeans.lib.cvsclient.command.checkout.CheckoutCommand.postExpansionExe
>
>>>>>>cute(CheckoutCommand.java:365)
>>>>>> at
>>>>>>
>>>>>
> org.netbeans.lib.cvsclient.command.checkout.CheckoutCommand.execute(Checkout
>
>>>>>>Command.java:280)
>>>>>> at
>>>>>>
>>>>>
>>>>org.netbeans.lib.cvsclient.Client.executeCommand(Client.java:521)
>>>>
>>>>
>>>>>>Maybe it is question to another mail-group (which?), but I hope
>>>>>>somebody
>>>>>>will be able to help me.
>>>>>>
>>>>>>Best regards,
>>>>>>DD
>>>>>>
>>>>>>
>>>>>>