Вопрос

I am trying to use SVNKit to get a Log of the SVN Entries in Coldfusion. I downloaded the latest SVNKit jar files and threw them in the lib folder under WEB-INF/lib.

Here is my code that should return an Array Of Log Entries but this code is returning a Null Pointer exception in Coldfusion 9.0.2.

SVNURL = createObject('java','org.tmatesoft.svn.core.SVNURL').parseURIEncoded(svnurl);
drf = createObject("java","org.tmatesoft.svn.core.internal.io.dav.DAVRepositoryFactory");
drf.setup();

rf = drf.create(SVNURL);
SVNWCUtil = createObject("java","org.tmatesoft.svn.core.wc.SVNWCUtil");
authManager = SVNWCUtil.createDefaultAuthenticationManager(user,pass);

rf.setAuthenticationManager(authManager);

log = rf.log(JavaCast("String[]",[]),JavaCast("null",""),JavaCast("long",10),JavaCast("long",15),true,true);

rf.closeSession();

When running this code, I receive the following Error.

The system has attempted to use an undefined value, which usually indicates a programming error, either in your code or some system code. Null Pointers are another name for undefined values.

Which points to this line..

log = rf.log(JavaCast("String[]",[]),JavaCast("null",""),JavaCast("long",10),JavaCast("long",15),true,true);

I moved this same code over to Railo, and everything is running fine. I just cannot see why ACF is choking on the log() method.

I was using the Printing Out Repository History example on the SVNKit Wiki to start me off.

Any suggestions on getting it to work in Adobe Coldfusion would be greatly appreciated. I did not test on CF10.

Это было полезно?

Решение

I wasn't using the JavaCast("boolean",true) for the last two arguments in the log() function. After that, everything worked fine.

Got to remember to check and use JavaCast()!

log = rf.log(JavaCast("String[]",[]),JavaCast("null",""),JavaCast("long",10),JavaCast("long",15),JavaCast("boolean",true),JavaCast("boolean",true));
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top