How do I move from FileSystemProvider to RCSFileProvider?#

Simple: Just change the corresponding line in jspwiki.properties. Do not attempt to do anything else; JSPWiki will handle the rest. Do NOT attempt to check in the files by hand, you're likely to screw up the installation :-).

Just make sure that you have the RCS binaries in your path. If you're running Windows, then you might want to check JSPWikiOnWindows for some configuration information.

My pages are not being committed to the RCS repository?#

Check that you haven't accidentally locked a file under some other user. RCS assumes that you lock a file when you want to use it, and won't allow anyone else to modify that file.

Usually, it's just enough to say

su jspwiki "rcs -M -l Main.txt"
assuming that you're running Tomcat as user 'jspwiki'. This breaks any previous lock and forces a new lock by jspwiki.

Locks occurs most often when you modify the repository by hand. Be very careful when modifying the repository by hand.

Another way to get conflicting RCS locks is to run your JSP container (presumably, or at least often, Tomcat) with different user accounts. For example: if your container usually starts as root (we hope not, a special account is better=), but you decide to add a new webapp and restart the container with your own account, the locking user will change. If you now edit files, and the container later restarts with the regular user id, you will get the same kind of file lock issue as described above.

Trust me, I know what I'm talking about. ;) --ebu

Added mail suppression to example. Usefull incantation (executed by the server user in the directory containing the files)

find . -name '*txt' -exec rcs -M -l {} \;
-- LachlanODonnell

UID and EUID#

RCS determines who the user is for purposes of record keeping from the LOGNAME environment variable or the real UID rather than the effective UID (EUID) as stored in the USER environment variable. This has some consequences for containers started by root which have 'su'-ed to a specialized user.

If su isn't done with parameter '-' only the EUID is changed to that one of the specialized user. If rcs commits some file, they search for a lock made by 'root' not by the container user.

To solve this problem you must use 'su -'. With the "-" flag, a full login is simulated. In this way, the UID is changed to be that of container user as well as the EUID.

If you change that on existing RCS repositories the super user must unlock the files 'rcs -u Main.txt' and the container user must lock it with 'rcs -l Main.txt'. The files must be locked because JSPWiki uses strict locking.

Why are some pages not visible in the RecentChanges?#

See above. This is also due to RCS locks failing.

Why are my RCS keywords being expanded?#

Because this is RCS :-).

There are basically three ways to get rid of this:

1. Use VersioningFileProvider, which does not change the data in any way

2. Set the following lines in the jspwiki.properties file.

jspwiki.rcsFileProvider.checkoutCommand = co -kk -l %s
jspwiki.rcsFileProvider.checkoutVersionCommand = co -kk -p -r1.%v %s

However, in this case the $~Log$ keyword still gets expanded.

3. Use '' inside the keyword.

My search is slow even though I have enable cache!#

This can be a problem with 2.0.45 and above. The problem is that getting the file info with RCSFileProvider is very expensive, and thus testing for external changes often causes the cache to be flushed too often.

If you are sure nobody is going to change the repository externally, put the following in your jspwiki.properties file:

jspwiki.cachingProvider.cacheCheckInterval = 1000000

This makes JSPWiki check for changes every million milliseconds, that is, roughly every 20 minutes only. You can push the value higher, if you want to.

RCSFileProvider isn't working on OS X Panther!#

OS X Panther apparently has a bug with regard to setuid and seteuid. The way Tomcat/Jboss is installed on OS X Server by the X Code cd, the java vm is uid 0, euid 79. ci gets stuck with the uid, while the other rcs commands all use the euid. If you compile rcs, ./configure notices weird behiviour for setuid and seteuid.

RCSFileProvider intermittantly working#

Error Message
    RCS checkin failed
Exception
    com.ecyrd.jspwiki.providers.ProviderException
Place where detected
    com.ecyrd.jspwiki.providers.RCSFileProvider.putPageText(), line 393
OS:Linux Fedora Core 4
JSPWiki:2.4.15-beta
RCS:5.7
Tomcat:5.5
Copy of JSPWiki Log Entry(info)
Current Workaround:Restart Tomcat and RCS functions again. Don't know why this helps.
Any hints would be super. --Stone Brooks

This was happening to me also on MacOSX 10.6.7.

It seemed to fix itself after I installed Developer Tools (XCode) and had rcs tools installed. Strange but true!

There is another issue I was getting with RCS and JSPWiki. I solved it as discussed at http://moomoomoose.blogspot.com/2009/07/jspwiki-rcsfileprovider-exception.html.

Brooke Smith


Here's a patch that sets LOGNAME environment varaible to "fakeuser" when executing RCS. This way RCS will always use the same user when locking and checking in. This patch requires Java 5. In java 1.4 you can't access the environment this way.

This seems to be the same solution that TWiki used when dealing with RCS: http://twiki.org/cgi-bin/view/Codev.RcsNonStrictLocking


### Eclipse Workspace Patch 1.0
#P JSPWiki
Index: src/com/ecyrd/jspwiki/providers/RCSFileProvider.java
===================================================================
RCS file: /p/cvs/JSPWiki/src/com/ecyrd/jspwiki/providers/RCSFileProvider.java,v
retrieving revision 1.26
diff -u -r1.26 RCSFileProvider.java
--- src/com/ecyrd/jspwiki/providers/RCSFileProvider.java	21 Aug 2006 22:38:21 -0000	1.26
+++ src/com/ecyrd/jspwiki/providers/RCSFileProvider.java	18 Oct 2006 17:53:57 -0000
@@ -24,11 +24,7 @@
 import java.io.InputStreamReader;
 import java.io.InputStream;
 import java.io.IOException;
-import java.util.Properties;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Date;
-import java.util.Iterator;
+import java.util.*;
 import java.text.SimpleDateFormat;
 import java.text.ParseException;
 import org.apache.log4j.Logger;
@@ -130,7 +126,7 @@
 
             cmd = TextUtil.replaceString( cmd, "%s", mangleName(page)+FILE_EXT );
 
-            Process process = Runtime.getRuntime().exec( cmd, null, new File(getPageDirectory()) );
+            Process process = exec( cmd);
 
             // FIXME: Should this use encoding as well?
             stdout = new BufferedReader( new InputStreamReader(process.getInputStream() ) );
@@ -267,7 +263,8 @@
 
             log.debug("Command = '"+cmd+"'");
 
-            process = Runtime.getRuntime().exec( cmd, null, new File(getPageDirectory()) );
+            process = exec(cmd);
+            
             stdout = process.getInputStream();
             result = FileUtil.readContents( stdout, m_encoding );
 
@@ -351,6 +348,22 @@
         return result;
     }
 
+    private Process exec(String cmd) throws IOException
+    {
+        Process process;
+        StringTokenizer st = new StringTokenizer(cmd);
+        String[] cmdarray = new String[st.countTokens()];
+        for (int i = 0; st.hasMoreTokens(); i++)
+            cmdarray[i] = st.nextToken();
+        
+        ProcessBuilder pb = new ProcessBuilder(cmdarray);
+        Map env = pb.environment();
+        env.put("LOGNAME", "fakeuser");
+        pb.directory(new File(getPageDirectory()));
+        process = pb.start();
+        return process;
+    }
+
     /**
      *  Puts the page into RCS and makes sure there is a fresh copy in
      *  the directory as well.
@@ -380,7 +393,7 @@
             cmd = TextUtil.replaceString( cmd, "%c", TextUtil.urlEncodeUTF8(changenote) );
             log.debug("Command = '"+cmd+"'");
 
-            process = Runtime.getRuntime().exec( cmd, null, new File(getPageDirectory()) );
+            process = exec(cmd);
 
             process.waitFor();
 
@@ -459,7 +472,7 @@
                                                  "%s",
                                                  mangleName(page)+FILE_EXT );
             
-            Process process = Runtime.getRuntime().exec( cmd, null, new File(getPageDirectory()) );
+            Process process = exec(cmd);
 
             // FIXME: Should this use encoding as well?
             stdout = new BufferedReader( new InputStreamReader(process.getInputStream()) );
@@ -592,7 +605,7 @@
         
         try
         {
-            process = Runtime.getRuntime().exec( cmd, null, new File(getPageDirectory()) );
+            process = exec(cmd);
 
             // 
             // 'rcs' command outputs to stderr methinks.

Add new attachment

Only authorized users are allowed to upload new attachments.

List of attachments

Kind Attachment Name Size Version Date Modified Author Change note
txt
JSPWikiErrorLog4RCSCheckInErro... 3.1 kB 1 01-Aug-2006 16:45 71.114.108.49
« This page (revision-24) was last changed on 11-May-2011 15:26 by 27.33.65.14