Perforce Public Knowledge Base - P4Java method throws Exception with "Access is denied"
Reset Search



P4Java method throws Exception with "Access is denied"

« Go Back



You are either trying to sync files, login, or disconnect from a Perforce Server.  You receive a exception with the message "(Access is denied)".  Using the OS to examine the given file, it shows that the file is owned by you.

This "Access denied" exception can happen on any file that is read-only but P4Java needs write access.


Caused by: C:\Users\oinker\p4tickets.txt (Access is denied)
	at Method)
	at com.perforce.p4java.server.AuthTicketsHelper.copy(
	at com.perforce.p4java.server.AuthTicketsHelper.saveTicket(
	at com.perforce.p4java.server.AuthTicketsHelper.saveTicket(
	at com.perforce.p4java.impl.mapbased.rpc.RpcServer.saveTicket(

First verify that the user running your P4Java application has the privileges to access the file.   Typically this means the user should be the owner of the file as the user must have the privileges to alter the file's read/write permission.

If the accessing user owns the file, using Java 1.5 is a likely root cause of this problem.

Using Java 1.5 requires additional programming steps.  See "Using P4Java with Java 1.5" for information on using Java 1.5 with P4Java.

If you encounter these errors when using P4Ant or P4Maven, see "Using Java 1.5 with P4Maven and P4Ant" for the changes needed.


ILogCallback Method Invocation

If you have implemented an ILogCallback class, information about this Java 1.5 deficiency will present itself with calls to your ILogCallback class's internalError(), internalException(), and internalWarn() methods at startup:

internalError:  No such method for helper class:


internalWarn:  No such method for helper class:


internalError: No such method for helper class:, boolean)

internalException:, boolean)
Related Links



Was this article helpful?



Please tell us how we can make this article more useful.

Characters Remaining: 255