Guest?
 
Project
SubGit
Priority
Type
State
Assignee
Subsystem
Affected versions
Fix versions
Fixed in build
  • Created by   guest
    16 months ago (17 Feb 2012 23:35)
  • Updated by   Semyon Vadishev
    15 months ago (21 Feb 2012 22:28)
Watchers (3)
0
Issue is visible to:
  The issue is visible to the selected user group only
2 Attachments
You don't have permissions to view 5 more attachments to this issue
attachments_2012_02_18.zip   (2 KB) JnaTest.java   (3 KB)
under Git bash on window XP.
[:CHESSMASTER] /l/workspace/jose-git <62> git push –force origin chessengine
Password for 'http://chiiwen@localhost':
Total 0 (delta 0), reused 0 (delta 0)
remote: bash.exe: warning: could not find /tmp, please create!
remote:
remote: SubGit ERROR REPORT (SubGit version 1.0.0-EAP ('Miai') build #1096):
remote:
remote: You see this message because SubGit (http://subgit.com) is installed in
your repository
remote: and an error that needs to be dealt with has occured in SubGit translati
on engine.
remote:
remote:
remote: TEMPORARY ERROR:
remote:
remote: CURRENT STATE: Both Git and Subversion repository are open for pushes or
commits.
remote: Your commit was not committed, but you may retry it.
remote:
remote: TO RECOVER:
remote: A) Address the problem if possible and then retry commit
remote: OR
remote: B) Run on the server
remote: $ subgit uninstall L:\Repositories2\jose
remote:
remote: IMPORTANT: As soon as SubGit is uninstalled, both Git and Subversi
on repositories
remote: will become open, but no synchronization will take plac
e.
remote:
remote: TO REPORT:
remote: Report an issue at http://issues.tmatesoft.com/
remote: You may find logs on the server at 'L:\Repositories2\jose\subgit\l
ogs'
remote:
remote: THANK YOU!

-------------------on subgit log directory i have

[1329514105.062][pre-receive-hook][10] Initialized memory cache logger.
[1329514105.140][pre-receive-hook][10] SubGit version 1.0.0-EAP ('Miai') build #1096
[1329514105.140][pre-receive-hook][10] Command name: pre-receive.
[1329514105.140][pre-receive-hook][10] Command argument: l:/Repositories2/jose/.git.
[1329514105.140][pre-receive-hook][10] Initialized console logger.
[1329514105.140][pre-receive-hook][10] SubGit version 1.0.0-EAP ('Miai') build #1096
[1329514106.453][pre-receive-hook][10] Initialized file logger, logs directory is: 'L:\Repositories2\jose\subgit\logs'.
[1329514106.453][pre-receive-hook][10] SubGit version 1.0.0-EAP ('Miai') build #1096
[1329514106.500][pre-receive-hook][10] Obtaining file lock on 'L:\Repositories2\jose\subgit\daemon.pid.lock'.
[1329514106.515][pre-receive-hook][10] Obtained file lock on 'L:\Repositories2\jose\subgit\daemon.pid.lock'
[1329514106.515][pre-receive-hook][10] error parsing address daemon info (null, null, null)
java.io.IOException: error parsing address daemon info (null, null, null)
java.io.IOException: error parsing address daemon info (null, null, null)
 at org.tmatesoft.translator.process.m.a(SourceFile:34)
 at org.tmatesoft.translator.process.t.c(SourceFile:110)
 at org.tmatesoft.translator.j.f.h(SourceFile:282)
 at org.tmatesoft.translator.j.f.a(SourceFile:331)
 at org.tmatesoft.translator.j.f.a(SourceFile:264)
 at org.tmatesoft.translator.j.f.i(SourceFile:113)
 at org.tmatesoft.translator.j.f.b(SourceFile:76)
 at org.tmatesoft.translator.SubGitHook.d(SourceFile:81)
 at org.tmatesoft.translator.SubGitHook.a(SourceFile:52)
 at org.tmatesoft.translator.SubGitHook.a(SourceFile:20)
 at org.tmatesoft.translator.process.f.c(SourceFile:106)
 at org.tmatesoft.translator.process.f.b(SourceFile:78)
 at org.tmatesoft.translator.SubGitHook.main(SourceFile:25)
[1329514106.531][pre-receive-hook][10] Pid file 'L:\Repositories2\jose\subgit\daemon.pid' deleted.
[1329514106.546][pre-receive-hook][10] Launching daemon, classpath: l:/Repositories2/jose/subgit/lib/subgit-1.0.0-EAP_1096_fat.jar
java options: [-noverify, -client]
working directory: L:\Repositories2\jose
arguments: –svn L:\Repositories2\jose –limit 1329514111531
[1329514106.578][pre-receive-hook][10] About to release lock: org.tmatesoft.translator.process.a@17182c1
[1329514106.578][pre-receive-hook][10] Trying to release file lock on 'L:\Repositories2\jose\subgit\daemon.pid.lock'.
[1329514106.578][pre-receive-hook][10] Released file lock on 'L:\Repositories2\jose\subgit\daemon.pid.lock'
[1329514106.593][pre-receive-hook][10]
java.lang.NoClassDefFoundError
java.lang.NoClassDefFoundError
 at com.sun.jna.Structure.<clinit>(Structure.java:134)
 at org.tmatesoft.translator.process.win32.a.a(SourceFile:53)
 at org.tmatesoft.translator.j.f.b(SourceFile:317)
 at org.tmatesoft.translator.j.f.a(SourceFile:339)
 at org.tmatesoft.translator.j.f.a(SourceFile:264)
 at org.tmatesoft.translator.j.f.i(SourceFile:113)
 at org.tmatesoft.translator.j.f.b(SourceFile:76)
 at org.tmatesoft.translator.SubGitHook.d(SourceFile:81)
 at org.tmatesoft.translator.SubGitHook.a(SourceFile:52)
 at org.tmatesoft.translator.SubGitHook.a(SourceFile:20)
 at org.tmatesoft.translator.process.f.c(SourceFile:106)
 at org.tmatesoft.translator.process.f.b(SourceFile:78)
 at org.tmatesoft.translator.SubGitHook.main(SourceFile:25)
[1329514106.640][pre-receive-hook][10] Failed to execute pre-receive hook command
org.tmatesoft.translator.i.d:
 at org.tmatesoft.translator.i.d.b(SourceFile:47)
 at org.tmatesoft.translator.i.d.b(SourceFile:47)
 at org.tmatesoft.translator.i.d.a(SourceFile:40)
 at org.tmatesoft.translator.j.f.b(SourceFile:97)
 at org.tmatesoft.translator.SubGitHook.d(SourceFile:81)
 at org.tmatesoft.translator.SubGitHook.a(SourceFile:52)
 at org.tmatesoft.translator.SubGitHook.a(SourceFile:20)
 at org.tmatesoft.translator.process.f.c(SourceFile:106)
 at org.tmatesoft.translator.process.f.b(SourceFile:78)
 at org.tmatesoft.translator.SubGitHook.main(SourceFile:25)
Caused by: java.lang.NoClassDefFoundError
 at com.sun.jna.Structure.<clinit>(Structure.java:134)
 at org.tmatesoft.translator.process.win32.a.a(SourceFile:53)
 at org.tmatesoft.translator.j.f.b(SourceFile:317)
 at org.tmatesoft.translator.j.f.a(SourceFile:339)
 at org.tmatesoft.translator.j.f.a(SourceFile:264)
 at org.tmatesoft.translator.j.f.i(SourceFile:113)
 at org.tmatesoft.translator.j.f.b(SourceFile:76)
 ... 6 more
Comments (29)
 
History
 
Linked Issues (?)
 
Alexander Kitaev
  Alexander Kitaev
18 Feb 2012 02:52
16 months ago
Thank you for reporting this issue! It looks like SubGit pre-recevie hooks fails to start translator background process (which we call "daemon").

It might happen because of the obfuscation process, however we did not encounter this issue during the tests that we performed on Windows XP as well. I will soon prepare an updated build for you with the JNA-related classes non-obfuscated and it would be great if you'll be able to give this build a try.

Thanks!
Chiiwen Liou
  Chiiwen Liou
18 Feb 2012 05:20
16 months ago
I created another simple repo. This time its error message is fewer. Perhaps this provided more information.
The first repo I ran subgit under git bash. This new repo created with subgit under windows command.
L:\workspace\jose-git2>git push
Password for 'http://chiiwen@localhost':
Counting objects: 5, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 289 bytes, done.
Total 3 (delta 2), reused 0 (delta 0)
remote: java.lang.NoClassDefFoundError: org/tmatesoft/translator/SubGitHook
remote: Exception in thread "main" To http://chiiwen@localhost/git/jose
! [remote rejected] chessengine -> chessengine (pre-receive hook declined)
error: failed to push some refs to 'http://chiiwen@localhost/git/jose'
Semyon Vadishev
  Semyon Vadishev
18 Feb 2012 07:41
16 months ago
Hello,

What git distribution do you use? We have automated tests suit with msys-git — http://code.google.com/p/msysgit/ If you use cygwin version of git, certain problems may arise. E.g. switching between standard Windows and Git Bash environments could cause the failure:

1. First time you pushed this way:

/l/workspace/jose-git <62> git push –force origin chessengine


Unix path in your working directory means you were using bash environment. Push succeeded to execute pre-receive hook script. Then the script launched Java process with the following classpath:

l:/Repositories2/jose/subgit/lib/subgit-1.0.0-EAP_1096_fat.jar


It seems this jar file was somehow broken. Since it is generated during install phase we need to look into 'install' log stored in $SVN_REPOS/subgit/logs/ directory. It may be obfuscation issue or the classpath parsing issue. We need to look into $GIT_REPOS/hooks/pre-receive(.cmd) file in order to find what could be wrong with the classpath. Could you please send us this file, too?

2. Next time you were using Windows command prompt:

L:\workspace\jose-git2>git push


At this time pre-receive hook script started but it failed to launch Java process since SubGitHook class was missing in the classpath.

So, here we need:
  • $GIT_REPOS/hooks/pre-receive(.cmd) script
  • $SVN_REPOS/conf/subgit.conf file
  • The log files from the $SVN_REPOS/subgit/logs directory.

Thank you in advance.
Chiiwen Liou
  Chiiwen Liou
18 Feb 2012 08:53
16 months ago
Thanks for your help.
I made mistakes when I tested, I should use different repos. I use the same repo for the second test, so I lost the information for the first one. I will try later to create on a different repo
For the second one (Windows command prompt) first. It is strange that subgit directory does not have lib directory (even though I get installation successful last time). I issued the subgit install again. lib directory created.
Here is new result:
L:\workspace\jose-git2>git push
Password for 'http://chiiwen@localhost':
Counting objects: 5, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 289 bytes, done.
Total 3 (delta 2), reused 0 (delta 0)
remote:
remote: SubGit ERROR REPORT (SubGit version 1.0.0-EAP ('Miai') build #1096):
remote:
remote: You see this message because SubGit (http://subgit.com) is installed in your repository
remote: and an error that needs to be dealt with has occured in SubGit translation engine.
remote:
remote:
remote: TEMPORARY ERROR:
remote:
remote: CURRENT STATE: Both Git and Subversion repository are open for pushes or commits.
remote: Your commit was not committed, but you may retry it.
remote:
remote: TO RECOVER:
remote: A) Address the problem if possible and then retry commit
remote: OR
remote: B) Run on the server
remote: $ subgit uninstall L:\Repositories2\jose
remote:
remote: IMPORTANT: As soon as SubGit is uninstalled, both Git and Subversion repositories
remote: will become open, but no synchronization will take place.
remote:
remote: TO REPORT:
remote: Report an issue at http://issues.tmatesoft.com/
remote: You may find logs on the server at 'L:\Repositories2\jose\subgit\logs'
remote:
remote: THANK YOU!
To http://chiiwen@localhost/git/jose
! [remote rejected] chessengine -> chessengine (pre-receive hook declined)
error: failed to push some refs to 'http://chiiwen@localhost/git/jose'


Thanks!
Chiiwen Liou
  Chiiwen Liou
18 Feb 2012 08:57
16 months ago
I forgot to mention that I installed msys-git (Git-1.7.9-preview20120201)
Semyon Vadishev
  Semyon Vadishev
19 Feb 2012 06:24
15 months ago
Thanks for noticing the problem with the tracker email. We'll fix that soon.

Regarding the failure:

1. I noticed you run different versions of JRE:

JAVA_HOME="/C/Program Files/Java/jdk1.5.0_14/jre"

and
JAVA_HOME="/E/Program Files/Git/opt/depot/jdk-1.3/jre"


It's better to use 1.5 (or 1.6) version, i.e. set global variable to "C:\Program Files\Java\jdk1.5.0_14\jre"

2. Seems like JNA library we use for Windows specific stuff causes the problem. I've prepared a new build with better debug log and the latest version of JNA library available today.

Please download this build at http://subgit.com/interim/ and give it a try. In case of failure send us all the same logs.

Thanks.
Semyon Vadishev
  Semyon Vadishev
20 Feb 2012 02:28
15 months ago
Still the same problem. Tomorrow I'm going to prepare a build with much less obfuscation. Also I'm going to reproduce this issue on our machine. Meanwhile you may try to exclude subgit related files from anti-viral scanning including repositories. Or you can turn off the anti-viral scanning for a while and run the same commands.

Try to make the experiment pure — do everything from scratch, i.e. install subgit into stand-alone not translated Subversion repository. You may use 'subgit uninstall –purge $SVN_REPOS' command, it removes all the generated files but keeps Subversion and Git repositories. Move translated Git repository somewhere or change git.<id>.repository path in a new subgit.conf file.

Could you please also provide as much information on your setup as possible:

  • Operating system: Windows XP, hope Service Pack version doesn't play any role here.
  • Git version 1.7.9-preview20120201. Which installer/distribution did you use?
  • What's the version of Subversion?
  • JRE 1.5.0, what 'java -version' prints? Is it 32- or 64-bit?
  • McAffee anti-viral is installed, what is the version?

Thanks!
Semyon Vadishev
  Semyon Vadishev
20 Feb 2012 05:40
15 months ago
And what happens when you push into newly created/translated repository? Did you disable anti-viral scanning during install/git push/svn commit? Does it pass and the changes get translated?

Regarding FileNotFoundException: that happens when no daemon launched at the moment. Daemon process exits after daemon.idleTimeout seconds, 5 seconds by default. So, that's expected for the first push.
Semyon Vadishev
  Semyon Vadishev
20 Feb 2012 05:51
15 months ago
Interesting discussion (a bit out-dated maybe) on Java vs. McAfee — http://www.theserverside.com/news/thread.tss?thread_id=44775
Semyon Vadishev
  Semyon Vadishev
20 Feb 2012 06:26
15 months ago
I found a JVM bug related to stack trace output in case of NoClassDefFoundError — http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4649144

Could you please run the same code under JRE 1.6? I put a link here for your convenience — http://java.com/en/download/manual.jsp#win
Semyon Vadishev
  Semyon Vadishev
20 Feb 2012 18:56
15 months ago
I've prepared a build with no obfuscation for appropriate classes. Please, give it a try — http://subgit.com/interim/subgit-1.0.0-EAP_1110.zip

Thank you!
Semyon Vadishev
  Semyon Vadishev
20 Feb 2012 20:14
15 months ago
If possible, let's try to test JNA in your environment. I've just attached JnaTest.java file and I'd like to ask you to do the following:

1. Put this class into some temporary directory.

2. Compile it with JNA library in classpath:
javac -classpath $SUBGIT_HOME/lib/jna-3.4.0 JnaTest.java
javac -classpath $SUBGIT_HOME/lib/jna-3.2.7 JnaTest.java
javac -classpath $SVN_REPOS/subgit/lib/subgit-1.0.0-EAP_..._fat.jar

3. Run compiled class:
java -classpath .:$SUBGIT_HOME/lib/jna-3.4.0 JnaTest
java -classpath .:$SUBGIT_HOME/lib/jna-3.2.7 JnaTest
java -classpath .:$SVN_REPOS/subgit/lib/subgit-1.0.0-EAP_..._fat.jar JnaTest

It's important to test different jar files, in different combinations with Windows command prompt and git shell environment.

Thank you in advance.
Semyon Vadishev
  Semyon Vadishev
20 Feb 2012 20:43
15 months ago
Another possible explanation is that JNA library unpacks native binaries into temporary directory and then tries to load it dynamically. In case of insufficient permissions that can fail. Make sure the user you use for VisualSVN Server and Apache has enough permissions to do that.
Chiiwen Liou
  Chiiwen Liou
20 Feb 2012 23:24
15 months ago
I followed the command line to test JnaTest.java. It failed.
I also put JnaTest.java in my eclipse and run, it also failed. There is not much to debug. :-(
I also test JnaTest.java on my other laptop that does not McAfee, still failed. I will try JNA examples later.
Here is the log

[1329772662.312][pre-receive-hook][10] Initialized memory cache logger.
[1329772662.343][pre-receive-hook][10] SubGit version 1.0.0-EAP ('Miai') build #1110
[1329772662.343][pre-receive-hook][10] Command name: pre-receive.
[1329772662.343][pre-receive-hook][10] Command argument: l:/Repositories2/jchess/.git.
[1329772662.343][pre-receive-hook][10] Initialized console logger.
[1329772662.343][pre-receive-hook][10] SubGit version 1.0.0-EAP ('Miai') build #1110
[1329772669.015][pre-receive-hook][10] Initialized file logger, logs directory is: 'L:\Repositories2\jchess\subgit\logs'.
[1329772669.015][pre-receive-hook][10] SubGit version 1.0.0-EAP ('Miai') build #1110
[1329772669.078][pre-receive-hook][10] Obtaining file lock on 'L:\Repositories2\jchess\subgit\daemon.pid.lock'.
[1329772669.093][pre-receive-hook][10] Obtained file lock on 'L:\Repositories2\jchess\subgit\daemon.pid.lock'
[1329772669.109][pre-receive-hook][10] L:\Repositories2\jchess\subgit\daemon.pid (???????????)
java.io.FileNotFoundException: L:\Repositories2\jchess\subgit\daemon.pid (???????????)
java.io.FileNotFoundException: L:\Repositories2\jchess\subgit\daemon.pid (???????????)
 at java.io.FileInputStream.open(Native Method)
 at java.io.FileInputStream.<init>(FileInputStream.java:120)
 at java.io.FileReader.<init>(FileReader.java:55)
 at org.tmatesoft.translator.process.TsPidFile.openFileForReading(SourceFile:156)
 at org.tmatesoft.translator.process.TsPidFile.readDaemonInfo(SourceFile:109)
 at org.tmatesoft.translator.hook.TsHook.readDaemonInfo(SourceFile:282)
 at org.tmatesoft.translator.hook.TsHook.openConnection(SourceFile:331)
 at org.tmatesoft.translator.hook.TsHook.sendPacket(SourceFile:264)
 at org.tmatesoft.translator.hook.TsHook.doExecute(SourceFile:113)
 at org.tmatesoft.translator.hook.TsHook.execute(SourceFile:76)
 at org.tmatesoft.translator.SubGitHook.executeCommand(SourceFile:81)
 at org.tmatesoft.translator.SubGitHook.run(SourceFile:52)
 at org.tmatesoft.translator.SubGitHook.run(SourceFile:20)
 at org.tmatesoft.translator.process.TsAbstractProcess.execute(SourceFile:106)
 at org.tmatesoft.translator.process.TsAbstractProcess.run(SourceFile:78)
 at org.tmatesoft.translator.SubGitHook.main(SourceFile:25)
[1329772669.125][pre-receive-hook][10] Pid file 'L:\Repositories2\jchess\subgit\daemon.pid' deleted.
[1329772669.125][pre-receive-hook][10] Launching daemon, classpath: l:/Repositories2/jchess/subgit/lib/subgit-1.0.0-EAP_1110_fat.jar
java options: [-noverify, -client]
working directory: L:\Repositories2\jchess
arguments: –svn L:\Repositories2\jchess –limit 1329772674125
[1329772669.125][pre-receive-hook][10] About to release lock: org.tmatesoft.translator.process.TsFileLock@1cfb549
[1329772669.140][pre-receive-hook][10] Trying to release file lock on 'L:\Repositories2\jchess\subgit\daemon.pid.lock'.
[1329772669.140][pre-receive-hook][10] Released file lock on 'L:\Repositories2\jchess\subgit\daemon.pid.lock'
[1329772669.140][pre-receive-hook][10] Could not initialize class com.sun.jna.Native
java.lang.NoClassDefFoundError: Could not initialize class com.sun.jna.Native
java.lang.NoClassDefFoundError: Could not initialize class com.sun.jna.Native
 at com.sun.jna.Structure.<clinit>(Structure.java:134)
 at org.tmatesoft.translator.process.win32.TsPlatformWin32.forkDetachedJVMProcess(SourceFile:53)
 at org.tmatesoft.translator.hook.TsHook.launchDaemon(SourceFile:317)
 at org.tmatesoft.translator.hook.TsHook.openConnection(SourceFile:339)
 at org.tmatesoft.translator.hook.TsHook.sendPacket(SourceFile:264)
 at org.tmatesoft.translator.hook.TsHook.doExecute(SourceFile:113)
 at org.tmatesoft.translator.hook.TsHook.execute(SourceFile:76)
 at org.tmatesoft.translator.SubGitHook.executeCommand(SourceFile:81)
 at org.tmatesoft.translator.SubGitHook.run(SourceFile:52)
 at org.tmatesoft.translator.SubGitHook.run(SourceFile:20)
 at org.tmatesoft.translator.process.TsAbstractProcess.execute(SourceFile:106)
 at org.tmatesoft.translator.process.TsAbstractProcess.run(SourceFile:78)
 at org.tmatesoft.translator.SubGitHook.main(SourceFile:25)
[1329772669.187][pre-receive-hook][10] Failed to execute pre-receive hook command
org.tmatesoft.translator.util.TsException: Could not initialize class com.sun.jna.Native
org.tmatesoft.translator.util.TsException: Could not initialize class com.sun.jna.Native
 at org.tmatesoft.translator.util.TsException.wrap(SourceFile:47)
 at org.tmatesoft.translator.util.TsException.wrap(SourceFile:40)
 at org.tmatesoft.translator.hook.TsHook.execute(SourceFile:97)
 at org.tmatesoft.translator.SubGitHook.executeCommand(SourceFile:81)
 at org.tmatesoft.translator.SubGitHook.run(SourceFile:52)
 at org.tmatesoft.translator.SubGitHook.run(SourceFile:20)
 at org.tmatesoft.translator.process.TsAbstractProcess.execute(SourceFile:106)
 at org.tmatesoft.translator.process.TsAbstractProcess.run(SourceFile:78)
 at org.tmatesoft.translator.SubGitHook.main(SourceFile:25)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.sun.jna.Native
 at com.sun.jna.Structure.<clinit>(Structure.java:134)
 at org.tmatesoft.translator.process.win32.TsPlatformWin32.forkDetachedJVMProcess(SourceFile:53)
 at org.tmatesoft.translator.hook.TsHook.launchDaemon(SourceFile:317)
 at org.tmatesoft.translator.hook.TsHook.openConnection(SourceFile:339)
 at org.tmatesoft.translator.hook.TsHook.sendPacket(SourceFile:264)
 at org.tmatesoft.translator.hook.TsHook.doExecute(SourceFile:113)
 at org.tmatesoft.translator.hook.TsHook.execute(SourceFile:76)
 ... 6 more
Semyon Vadishev
  Semyon Vadishev
20 Feb 2012 23:50
15 months ago
This test may fail because it tries to launch "dir" utility which might be wrong on Windows (e.g. it's not in the PATH variable).

Do you get the same error message when running the test?
java.lang.NoClassDefFoundError: Could not initialize class com.sun.jna.Native
java.lang.NoClassDefFoundError: Could not initialize class com.sun.jna.Native
 at com.sun.jna.Structure.<clinit>(Structure.java:134)

I think here's what happens in your case: JNA tries to generate DLL file in the temporary directory and fails since this directory belongs to other user. At least I found something similar on the internet.

I will try to copy-paste the code from JNA loading routines to get more descriptive error message. Then we run the same code inside our hook in order to reproduce under the same conditions.
Chiiwen Liou
  Chiiwen Liou
21 Feb 2012 01:12
15 months ago
I have admin priv, and dir is in the PATH variable.
Now we have more interesting cases.


C:\>java -classpath .;e:\subgit\lib\jna-3.4.0.jar JnaTest
Test failed

L:\>java -classpath .;e:\subgit\lib\jna-3.4.0.jar JnaTest
Exception in thread "main" java.lang.NoClassDefFoundError: IKernel32
 at JnaTest.<clinit>(JnaTest.java:20)
 at JnaTest.<clinit>(JnaTest.java:20)
Caused by: java.lang.ClassNotFoundException: IKernel32
 at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
 at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
 ... 1 more
Could not find the main class: JnaTest. Program will exit.
---
This happened because I copied JnaTest.class from c:/ to L:/
if I javac the same source on L: and java ....
I get the same result
Test failed.
--


on eclipse, it only show "Test failed"

I have seen some programs only work on C: drive. You might need D: if you want to test on your windows
Semyon Vadishev
  Semyon Vadishev
21 Feb 2012 01:25
15 months ago
Ok, here is the build with debug logging enabled when JNA binaries get extracted — http://subgit.com/interim/subgit-1.0.0-EAP_1111.zip

Install it as usually and try to push. Debug data will be in pre-receive hook log file.
Semyon Vadishev
  Semyon Vadishev
21 Feb 2012 01:27
15 months ago
Thanks for the hint, do you have different hard drives mapped to corresponding logical drives C:, E: and L:? Or should I use some utility to create a logical drive from directory?
Chiiwen Liou
  Chiiwen Liou
21 Feb 2012 06:52
15 months ago
I partitioned my HD when I got HD. I can reproduce on my laptop which only has one drive.
------------Result
[1329799603.890][pre-receive-hook][10] Initialized memory cache logger.
[1329799603.906][pre-receive-hook][10] SubGit version 1.0.0-EAP ('Miai') build #1111
[1329799603.906][pre-receive-hook][10] Command name: pre-receive.
[1329799603.906][pre-receive-hook][10] Command argument: l:/Repositories2/jchess/.git.
[1329799603.906][pre-receive-hook][10] Initialized console logger.
[1329799603.906][pre-receive-hook][10] SubGit version 1.0.0-EAP ('Miai') build #1111
[1329799611.125][pre-receive-hook][10] Initialized file logger, logs directory is: 'L:\Repositories2\jchess\subgit\logs'.
[1329799611.125][pre-receive-hook][10] SubGit version 1.0.0-EAP ('Miai') build #1111
[1329799611.140][pre-receive-hook][10] no jnidispatch in java.library.path
java.lang.UnsatisfiedLinkError: no jnidispatch in java.library.path
java.lang.UnsatisfiedLinkError: no jnidispatch in java.library.path
 at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1738)
 at java.lang.Runtime.loadLibrary0(Runtime.java:823)
 at java.lang.System.loadLibrary(System.java:1028)
 at org.tmatesoft.translator.hook.TsHook.loadNativeLibrary(SourceFile:167)
 at org.tmatesoft.translator.hook.TsHook.loadJnaNative(SourceFile:112)
 at org.tmatesoft.translator.hook.TsHook.execute(SourceFile:84)
 at org.tmatesoft.translator.SubGitHook.executeCommand(SourceFile:81)
 at org.tmatesoft.translator.SubGitHook.run(SourceFile:52)
 at org.tmatesoft.translator.SubGitHook.run(SourceFile:20)
 at org.tmatesoft.translator.process.TsAbstractProcess.execute(SourceFile:106)
 at org.tmatesoft.translator.process.TsAbstractProcess.run(SourceFile:78)
 at org.tmatesoft.translator.SubGitHook.main(SourceFile:25)
[1329799611.140][pre-receive-hook][10] Resource name: /com/sun/jna/win32-x86/jnidispatch.dll
[1329799611.140][pre-receive-hook][10] Resource url: jar:file:/L:/Repositories2/jchess/subgit/lib/subgit-1.0.0-EAP_1111_fat.jar!/com/sun/jna/win32-x86/jnidispatch.dll
[1329799611.156][pre-receive-hook][10] ?????
java.io.IOException: ?????
java.io.IOException: ?????
 at java.io.WinNTFileSystem.createFileExclusively(Native Method)
 at java.io.File.checkAndCreate(File.java:1704)
 at java.io.File.createTempFile(File.java:1792)
 at java.io.File.createTempFile(File.java:1828)
 at org.tmatesoft.translator.hook.TsHook.loadNativeLibraryFromJar(SourceFile:222)
 at org.tmatesoft.translator.hook.TsHook.loadNativeLibrary(SourceFile:171)
 at org.tmatesoft.translator.hook.TsHook.loadJnaNative(SourceFile:112)
 at org.tmatesoft.translator.hook.TsHook.execute(SourceFile:84)
 at org.tmatesoft.translator.SubGitHook.executeCommand(SourceFile:81)
 at org.tmatesoft.translator.SubGitHook.run(SourceFile:52)
 at org.tmatesoft.translator.SubGitHook.run(SourceFile:20)
 at org.tmatesoft.translator.process.TsAbstractProcess.execute(SourceFile:106)
 at org.tmatesoft.translator.process.TsAbstractProcess.run(SourceFile:78)
 at org.tmatesoft.translator.SubGitHook.main(SourceFile:25)
[1329799611.156][pre-receive-hook][10] Failed to create temporary file for jnidispatch library: java.io.IOException: ?????
java.lang.Error: Failed to create temporary file for jnidispatch library: java.io.IOException: ?????
java.lang.Error: Failed to create temporary file for jnidispatch library: java.io.IOException: ?????
 at org.tmatesoft.translator.hook.TsHook.loadNativeLibraryFromJar(SourceFile:242)
 at org.tmatesoft.translator.hook.TsHook.loadNativeLibrary(SourceFile:171)
 at org.tmatesoft.translator.hook.TsHook.loadJnaNative(SourceFile:112)
 at org.tmatesoft.translator.hook.TsHook.execute(SourceFile:84)
 at org.tmatesoft.translator.SubGitHook.executeCommand(SourceFile:81)
 at org.tmatesoft.translator.SubGitHook.run(SourceFile:52)
 at org.tmatesoft.translator.SubGitHook.run(SourceFile:20)
 at org.tmatesoft.translator.process.TsAbstractProcess.execute(SourceFile:106)
 at org.tmatesoft.translator.process.TsAbstractProcess.run(SourceFile:78)
 at org.tmatesoft.translator.SubGitHook.main(SourceFile:25)
[1329799611.156][pre-receive-hook][10] Native library path: null
[1329799611.187][pre-receive-hook][10] Obtaining file lock on 'L:\Repositories2\jchess\subgit\daemon.pid.lock'.
[1329799611.187][pre-receive-hook][10] Obtained file lock on 'L:\Repositories2\jchess\subgit\daemon.pid.lock'
[1329799611.187][pre-receive-hook][10] L:\Repositories2\jchess\subgit\daemon.pid (???????????)
java.io.FileNotFoundException: L:\Repositories2\jchess\subgit\daemon.pid (???????????)
java.io.FileNotFoundException: L:\Repositories2\jchess\subgit\daemon.pid (???????????)
 at java.io.FileInputStream.open(Native Method)
 at java.io.FileInputStream.<init>(FileInputStream.java:120)
 at java.io.FileReader.<init>(FileReader.java:55)
 at org.tmatesoft.translator.process.TsPidFile.openFileForReading(SourceFile:156)
 at org.tmatesoft.translator.process.TsPidFile.readDaemonInfo(SourceFile:109)
 at org.tmatesoft.translator.hook.TsHook.readDaemonInfo(SourceFile:487)
 at org.tmatesoft.translator.hook.TsHook.openConnection(SourceFile:536)
 at org.tmatesoft.translator.hook.TsHook.sendPacket(SourceFile:469)
 at org.tmatesoft.translator.hook.TsHook.doExecute(SourceFile:318)
 at org.tmatesoft.translator.hook.TsHook.execute(SourceFile:85)
 at org.tmatesoft.translator.SubGitHook.executeCommand(SourceFile:81)
 at org.tmatesoft.translator.SubGitHook.run(SourceFile:52)
 at org.tmatesoft.translator.SubGitHook.run(SourceFile:20)
 at org.tmatesoft.translator.process.TsAbstractProcess.execute(SourceFile:106)
 at org.tmatesoft.translator.process.TsAbstractProcess.run(SourceFile:78)
 at org.tmatesoft.translator.SubGitHook.main(SourceFile:25)
[1329799611.203][pre-receive-hook][10] Pid file 'L:\Repositories2\jchess\subgit\daemon.pid' deleted.
[1329799611.203][pre-receive-hook][10] Launching daemon, classpath: l:/Repositories2/jchess/subgit/lib/subgit-1.0.0-EAP_1111_fat.jar
java options: [-noverify, -client]
working directory: L:\Repositories2\jchess
arguments: –svn L:\Repositories2\jchess –limit 1329799616203
[1329799611.234][pre-receive-hook][10] About to release lock: org.tmatesoft.translator.process.TsFileLock@f9f9d8
[1329799611.234][pre-receive-hook][10] Trying to release file lock on 'L:\Repositories2\jchess\subgit\daemon.pid.lock'.
[1329799611.234][pre-receive-hook][10] Released file lock on 'L:\Repositories2\jchess\subgit\daemon.pid.lock'
[1329799611.234][pre-receive-hook][10] Could not initialize class com.sun.jna.Native
java.lang.NoClassDefFoundError: Could not initialize class com.sun.jna.Native
java.lang.NoClassDefFoundError: Could not initialize class com.sun.jna.Native
 at com.sun.jna.Structure.<clinit>(Structure.java:134)
 at org.tmatesoft.translator.process.win32.TsPlatformWin32.forkDetachedJVMProcess(SourceFile:53)
 at org.tmatesoft.translator.hook.TsHook.launchDaemon(SourceFile:522)
 at org.tmatesoft.translator.hook.TsHook.openConnection(SourceFile:544)
 at org.tmatesoft.translator.hook.TsHook.sendPacket(SourceFile:469)
 at org.tmatesoft.translator.hook.TsHook.doExecute(SourceFile:318)
 at org.tmatesoft.translator.hook.TsHook.execute(SourceFile:85)
 at org.tmatesoft.translator.SubGitHook.executeCommand(SourceFile:81)
 at org.tmatesoft.translator.SubGitHook.run(SourceFile:52)
 at org.tmatesoft.translator.SubGitHook.run(SourceFile:20)
 at org.tmatesoft.translator.process.TsAbstractProcess.execute(SourceFile:106)
 at org.tmatesoft.translator.process.TsAbstractProcess.run(SourceFile:78)
 at org.tmatesoft.translator.SubGitHook.main(SourceFile:25)
[1329799611.296][pre-receive-hook][10] Failed to execute pre-receive hook command
org.tmatesoft.translator.util.TsException: Could not initialize class com.sun.jna.Native
org.tmatesoft.translator.util.TsException: Could not initialize class com.sun.jna.Native
 at org.tmatesoft.translator.util.TsException.wrap(SourceFile:47)
 at org.tmatesoft.translator.util.TsException.wrap(SourceFile:40)
 at org.tmatesoft.translator.hook.TsHook.execute(SourceFile:106)
 at org.tmatesoft.translator.SubGitHook.executeCommand(SourceFile:81)
 at org.tmatesoft.translator.SubGitHook.run(SourceFile:52)
 at org.tmatesoft.translator.SubGitHook.run(SourceFile:20)
 at org.tmatesoft.translator.process.TsAbstractProcess.execute(SourceFile:106)
 at org.tmatesoft.translator.process.TsAbstractProcess.run(SourceFile:78)
 at org.tmatesoft.translator.SubGitHook.main(SourceFile:25)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.sun.jna.Native
 at com.sun.jna.Structure.<clinit>(Structure.java:134)
 at org.tmatesoft.translator.process.win32.TsPlatformWin32.forkDetachedJVMProcess(SourceFile:53)
 at org.tmatesoft.translator.hook.TsHook.launchDaemon(SourceFile:522)
 at org.tmatesoft.translator.hook.TsHook.openConnection(SourceFile:544)
 at org.tmatesoft.translator.hook.TsHook.sendPacket(SourceFile:469)
 at org.tmatesoft.translator.hook.TsHook.doExecute(SourceFile:318)
 at org.tmatesoft.translator.hook.TsHook.execute(SourceFile:85)
 ... 6 more
Semyon Vadishev
  Semyon Vadishev
21 Feb 2012 18:16
15 months ago
Ok, now we have the cause of the failure — hook process fails to create temporary file. Seems like unsufficient permissions issue.

I've googled a bit and found a couple of solutions:

0. http://comments.gmane.org/gmane.comp.java.sonar.general/10462
We had the same problem with our NT Service.
Don't start your service with the Local System but associate the specified
user with which you have installed Sonar.

I don't know if this is the only solution, you should probably be able to
fix the problem by changing the rights to your sonar installation directory
but the above solution worked for us.


1. https://mxforum.mendix.com/questions/1541/
the error occurs in a 2.4 application running as a Windows 2008 service under Local System. Somehow, the filesystem permissions are not sufficient. We solved the problem by running it under a named user with sufficient filesystem rights. Any idea what rights Local System is missing?


2. https://issues.jenkins-ci.org/browse/JENKINS-8425
The stack trace indicates that Jenkins may not be able to create a temporary file on the slave.
Have you checked that there is a temp directory and the Jenkins slave is able to write to it?


3. http://docs.oracle.com/javase/6/docs/api/java/io/File.html#createTempFile(java.lang.String, java.lang.String, java.io.File)
I put here a piece of javadoc for File.createTempFile:
If the directory argument is null then the system-dependent default temporary-file directory will be used. The default temporary-file directory is specified by the system property java.io.tmpdir. On UNIX systems the default value of this property is typically "/tmp" or "/var/tmp"; on Microsoft Windows systems it is typically "C:\\WINNT\\TEMP". A different value may be given to this system property when the Java virtual machine is invoked, but programmatic changes to this property are not guaranteed to have any effect upon the temporary directory used by this method.


We can try to use another temporary directory for hooks (though it's stated that it may not work). To do that please add the following lines into subgit.conf file, create corresponding directory and reinstall subgit:

[hooks]
javaOptions = -Djava.io.tmpdir=C:/tmp

From our side I'll put a special check to make sure that java.io.tmpdir is writable directory to get meaningful error message in case of similar problems.
Chiiwen Liou
  Chiiwen Liou
21 Feb 2012 20:42
15 months ago
e-mail reply still not work.

I add your suggested hooks to subgit.conf.
I checked VisualSVN server log, and found out following information. This error is interesting because I can git clone and git push successfully without subgit.

user chiiwen: authentication failure for "/git/jchess/info/refs": Password Mismatch
[client 127.0.0.1]

I do not know whether it is related to I use http instead https. I have to modified Authentication to Other settings.
I reinstalled subgit. Here is the log.
-------------------------- install log
[1329848771.031][client-install][10] Initialized memory cache logger.
[1329848771.046][client-install][10] SubGit version 1.0.0-EAP ('Miai') build #1111
[1329848771.046][client-install][10] Command name: install.
[1329848771.046][client-install][10] Command argument: L:\Repositories2\jchess.
[1329848771.062][client-install][10] Initialized console logger.
[1329848771.062][client-install][10] SubGit version 1.0.0-EAP ('Miai') build #1111
[1329848771.218][client-install][10] Initialized file logger, logs directory is: 'null'.
[1329848771.218][client-install][10] SubGit version 1.0.0-EAP ('Miai') build #1111
[1329848772.718][client-install][10] L:\Repositories2\jchess\subgit\daemon.pid (The system cannot find the file specified)
java.io.FileNotFoundException: L:\Repositories2\jchess\subgit\daemon.pid (The system cannot find the file specified)
java.io.FileNotFoundException: L:\Repositories2\jchess\subgit\daemon.pid (The system cannot find the file specified)
 at java.io.FileInputStream.open(Native Method)
 at java.io.FileInputStream.<init>(FileInputStream.java:120)
 at java.io.FileReader.<init>(FileReader.java:55)
 at org.tmatesoft.translator.process.TsPidFile.openFileForReading(SourceFile:156)
 at org.tmatesoft.translator.process.TsPidFile.readDaemonInfo(SourceFile:109)
 at org.tmatesoft.translator.client.TsClientRepositoryCommand.lockPidFile(SourceFile:43)
 at org.tmatesoft.translator.client.TsClientRepositoryCommand.lockPidFile(SourceFile:35)
 at org.tmatesoft.translator.client.TsRepositoryInstall.execute(SourceFile:99)
 at org.tmatesoft.translator.client.TsInstall.executeForPath(SourceFile:81)
 at org.tmatesoft.translator.client.TsInstall.doExecute(SourceFile:47)
 at org.tmatesoft.translator.client.TsClientCommand.execute(SourceFile:21)
 at org.tmatesoft.translator.SubGit.executeCommand(SourceFile:111)
 at org.tmatesoft.translator.SubGit.run(SourceFile:72)
 at org.tmatesoft.translator.SubGit.run(SourceFile:31)
 at org.tmatesoft.translator.process.TsAbstractProcess.execute(SourceFile:106)
 at org.tmatesoft.translator.process.TsAbstractProcess.run(SourceFile:78)
 at org.tmatesoft.translator.SubGit.main(SourceFile:36)
[1329848772.718][client-install][10] Pid file 'L:\Repositories2\jchess\subgit\daemon.pid' deleted.
[1329848772.734][client-install][10] Trying to obtain file lock on 'L:\Repositories2\jchess\subgit\daemon.pid.lock'.
[1329848772.734][client-install][10] Obtained by #tryToObtain file lock on 'L:\Repositories2\jchess\subgit\daemon.pid.lock'
[1329848778.921][client-install][10] Translating Subversion revisions to Git commits...
[1329848778.937][client-install][10] Subversion revisions: 2.
[1329848779.703][client-install][10] Translating 'L:\Repositories2\jchess'.
[1329848779.703][client-install][10] Sync started.
[1329848779.703][client-install][10] Sync started for git location 'default'
[1329848780.156][client-install][10] Checking remote 'file:///L:/Repositories2/jchess'.
[1329848780.515][client-install][10] Revisions are 2/2 (last fetched/last).
[1329848780.531][client-install][10] Everything is up-to-date.
[1329848780.531][client-install][10] Sync complete for git location default.
[1329848780.531][client-install][10] Sync complete.
[1329848780.781][client-install][10] SubGit hooks installed.
[1329848780.796][client-install][10] Trying to release file lock on 'L:\Repositories2\jchess\subgit\daemon.pid.lock'.
[1329848780.796][client-install][10] Released file lock on 'L:\Repositories2\jchess\subgit\daemon.pid.lock'

Now I got 2 logs after git push
--------------------------------daemon.0
[1329848868.546][daemon][10] Initialized memory cache logger.
[1329848868.562][daemon][10] SubGit version 1.0.0-EAP ('Miai') build #1111
[1329848868.562][daemon][10] Command name: null.
[1329848868.562][daemon][10] Command argument: –svn.
[1329848868.562][daemon][10] Command argument: L:\Repositories2\jchess.
[1329848868.562][daemon][10] Command argument: –limit.
[1329848868.562][daemon][10] Command argument: 1329848873000.
[1329848868.812][daemon][10] Initialized console logger.
[1329848868.812][daemon][10] SubGit version 1.0.0-EAP ('Miai') build #1111
[1329848868.843][daemon][10] Initialized file logger, logs directory is: 'L:\Repositories2\jchess\subgit\logs'.
[1329848868.843][daemon][10] SubGit version 1.0.0-EAP ('Miai') build #1111
[1329848868.843][daemon][10] System properties:
java.runtime.name : Java(TM) SE Runtime Environment
sun.boot.library.path : c:\Progra~1\Java\jdk1.6.0_31\jre\bin
java.vm.version : 20.6-b01
java.vm.vendor : Sun Microsystems Inc.
java.vendor.url : http://java.sun.com/
path.separator : ;
java.vm.name : Java HotSpot(TM) Client VM
file.encoding.pkg : sun.io
sun.java.launcher : SUN_STANDARD
user.country : US
sun.os.patch.level : Service Pack 3
java.vm.specification.name : Java Virtual Machine Specification
user.dir : L:\Repositories2\jchess
java.runtime.version : 1.6.0_31-b05
java.awt.graphicsenv : sun.awt.Win32GraphicsEnvironment
java.endorsed.dirs : c:\Progra~1\Java\jdk1.6.0_31\jre\lib\endorsed
os.arch : x86
java.io.tmpdir : C:\WINDOWS\
line.separator :

java.vm.specification.vendor : Sun Microsystems Inc.
user.variant :
os.name : Windows XP
sun.jnu.encoding : Cp1252
java.library.path : c:\Progra~1\Java\jdk1.6.0_31\jre\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;E:\Program Files\Git\libexec\git-core;E:\Program Files\Git\libexec\git-core;E:\Program Files\Git\libexec\git-core;E:\Program Files\Git\libexec\git-core;E:\Program Files\Git\libexec\git-core;E:\Program Files\Git\libexec\git-core;c:\Progra~1\Java\jdk1.6.0_31\bin;c:\Perl\site\bin;c:\Perl\bin;c:\Program Files\CMake 2.4\bin;c:\Program Files\PHP\;c:\Perl\bin\;c:\WINDOWS\system32;c:\WINDOWS;c:\WINDOWS\System32\Wbem;c:\SFU\common\;e:\PROGRA~1\MySQL\MYSQLS~1.0\bin;c:\SFU\Perl\bin\;c:\Program Files\GnuWin32\bin;c:\Program Files\Hummingbird\Connectivity\11.00\Accessories\;.;c:\Program Files\Microsoft SQL Server\80\Tools\BINN;d:\Program Files\VisualSVN Server\bin;d:\Program Files\Perforce;d:\Program Files\Graphviz 2.21\bin;d:\Program Files\svk;c:\WINDOWS\system32\WindowsPowerShell\v1.0;d:\Program Files\Microsoft SQL Server\100\Tools\Binn\;d:\Program Files\Microsoft SQL Server\100\DTS\Binn\;d:\Program Files\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;c:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\;c:\OptimizeIt\OptimizeIt31\lib;d:\Program Files\Executive Software\Diskeeper\;c:\Program Files\Common Files\DivX Shared\;c:\Program Files\Smart Projects\IsoBuster;c:\Program Files\TortoiseGit\bin;E:\Program Files\Git\cmd;E:\Program Files\Git\bin;d:\Program Files\TortoiseSVN\bin;i:\apache-maven-3.0.4\bin;.
java.specification.name : Java Platform API Specification
java.class.version : 50.0
sun.management.compiler : HotSpot Client Compiler
os.version : 5.1
user.home : C:\Documents and Settings\NetworkService
user.timezone :
java.awt.printerjob : sun.awt.windows.WPrinterJob
file.encoding : Cp1252
java.specification.version : 1.6
java.class.path : l:/Repositories2/jchess/subgit/lib/subgit-1.0.0-EAP_1111_fat.jar;
user.name : NETWORK SERVICE
java.vm.specification.version : 1.0
sun.java.command : org.tmatesoft.translator.SubGitDaemon –svn L:\Repositories2\jchess –limit 1329848873000
java.home : c:\Progra~1\Java\jdk1.6.0_31\jre
sun.arch.data.model : 32
user.language : en
java.specification.vendor : Sun Microsystems Inc.
awt.toolkit : sun.awt.windows.WToolkit
java.vm.info : mixed mode, sharing
java.version : 1.6.0_31
java.ext.dirs : c:\Progra~1\Java\jdk1.6.0_31\jre\lib\ext;C:\WINDOWS\Sun\Java\lib\ext
sun.boot.class.path : c:\Progra~1\Java\jdk1.6.0_31\jre\lib\resources.jar;c:\Progra~1\Java\jdk1.6.0_31\jre\lib\rt.jar;c:\Progra~1\Java\jdk1.6.0_31\jre\lib\sunrsasign.jar;c:\Progra~1\Java\jdk1.6.0_31\jre\lib\jsse.jar;c:\Progra~1\Java\jdk1.6.0_31\jre\lib\jce.jar;c:\Progra~1\Java\jdk1.6.0_31\jre\lib\charsets.jar;c:\Progra~1\Java\jdk1.6.0_31\jre\lib\modules\jdk.boot.jar;c:\Progra~1\Java\jdk1.6.0_31\jre\classes
java.vendor : Sun Microsystems Inc.
file.separator : \
java.vendor.url.bug : http://java.sun.com/cgi-bin/bugreport.cgi
sun.io.unicode.encoding : UnicodeLittle
sun.cpu.endian : little
sun.desktop : windows
sun.cpu.isalist : pentium_pro+mmx pentium_pro pentium+mmx pentium i486 i386 i86

[1329848868.843][daemon][10] Launching daemon.
[1329848868.906][daemon][10] Server socket instance created.
[1329848869.671][daemon][10] List of network interfaces obtained.
[1329848869.671][daemon][10] Network interface: name:lo (MS TCP Loopback interface)
[1329848869.671][daemon][10] Processing address: /127.0.0.1
[1329848869.671][daemon][10] Processing address: /0:0:0:0:0:0:0:1
[1329848869.671][daemon][10] Processing address: /fe80:0:0:0:0:0:0:1%1
[1329848869.671][daemon][10] Network interface: name:eth0 (3Com 3C918 Integrated Fast Ethernet Controller (3C905B-TX Compatible) - McAfee NDIS Intermediate Filter Miniport)
[1329848869.671][daemon][10] Processing address: /192.168.0.18
[1329848869.671][daemon][10] Processing address: /fe80:0:0:0:2c0:4fff:fea0:b712%4
[1329848869.671][daemon][10] Network interface: name:tun0 (Teredo Tunneling Pseudo-Interface)
[1329848869.671][daemon][10] Processing address: /2001:0:4137:9e76:8000:f503:b4ff:4c7e
[1329848869.671][daemon][10] Processing address: /fe80:0:0:0:0:ffff:ffff:fffd%5
[1329848869.671][daemon][10] Network interface: name:tun1 (6to4 Pseudo-Interface)
[1329848869.671][daemon][10] Network interface: name:tun2 (Automatic Tunneling Pseudo-Interface)
[1329848869.671][daemon][10] Processing address: /fe80:0:0:0:0:5efe:c0a8:12%2
[1329848869.687][daemon][10] Local loopback address found: /127.0.0.1.
[1329848869.687][daemon][10] Trying to use a free port for address '127.0.0.1'.
[1329848869.703][daemon][10] Daemon socket opened for port: 4084.
[1329848869.781][daemon][10] Daemon process pid obtained: 5624.
[1329848869.812][daemon][10] Daemon (pid=5624; port=4084; address=127:0:0:1) at (L:\Repositories2\jchess\subgit).
[1329848875.046][daemon][11] 'pid=5624; port=4084; address=127:0:0:1' was written into temporary file 'L:\Repositories2\jchess\subgit\subgit.6427358808843237460.pid'
[1329848875.203][daemon][11] Cannot write pid file to 'L:\Repositories2\jchess\subgit\daemon.pid', exiting.
org.tmatesoft.translator.util.TsException: Time limit to write pid file 'L:\Repositories2\jchess\subgit\daemon.pid' exceeded; current time: 1329848875187, time limit: 1329848873000
org.tmatesoft.translator.util.TsException: Time limit to write pid file 'L:\Repositories2\jchess\subgit\daemon.pid' exceeded; current time: 1329848875187, time limit: 1329848873000
 at org.tmatesoft.translator.util.TsException.create(SourceFile:17)
 at org.tmatesoft.translator.process.TsPidFile.writePidAndPort(SourceFile:99)
 at org.tmatesoft.translator.daemon.TsDaemon.doRun(SourceFile:136)
 at org.tmatesoft.translator.daemon.TsDaemon.run(SourceFile:128)
 at java.lang.Thread.run(Thread.java:662)
-------------------and pre-receive-hook.0
[1329848860.046][pre-receive-hook][10] Initialized memory cache logger.
[1329848860.062][pre-receive-hook][10] SubGit version 1.0.0-EAP ('Miai') build #1111
[1329848860.062][pre-receive-hook][10] Command name: pre-receive.
[1329848860.062][pre-receive-hook][10] Command argument: l:/Repositories2/jchess/.git.
[1329848860.078][pre-receive-hook][10] Initialized console logger.
[1329848860.078][pre-receive-hook][10] SubGit version 1.0.0-EAP ('Miai') build #1111
[1329848867.031][pre-receive-hook][10] Initialized file logger, logs directory is: 'L:\Repositories2\jchess\subgit\logs'.
[1329848867.031][pre-receive-hook][10] SubGit version 1.0.0-EAP ('Miai') build #1111
[1329848867.046][pre-receive-hook][10] no jnidispatch in java.library.path
java.lang.UnsatisfiedLinkError: no jnidispatch in java.library.path
java.lang.UnsatisfiedLinkError: no jnidispatch in java.library.path
 at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1738)
 at java.lang.Runtime.loadLibrary0(Runtime.java:823)
 at java.lang.System.loadLibrary(System.java:1028)
 at org.tmatesoft.translator.hook.TsHook.loadNativeLibrary(SourceFile:167)
 at org.tmatesoft.translator.hook.TsHook.loadJnaNative(SourceFile:112)
 at org.tmatesoft.translator.hook.TsHook.execute(SourceFile:84)
 at org.tmatesoft.translator.SubGitHook.executeCommand(SourceFile:81)
 at org.tmatesoft.translator.SubGitHook.run(SourceFile:52)
 at org.tmatesoft.translator.SubGitHook.run(SourceFile:20)
 at org.tmatesoft.translator.process.TsAbstractProcess.execute(SourceFile:106)
 at org.tmatesoft.translator.process.TsAbstractProcess.run(SourceFile:78)
 at org.tmatesoft.translator.SubGitHook.main(SourceFile:25)
[1329848867.515][pre-receive-hook][10] Resource name: /com/sun/jna/win32-x86/jnidispatch.dll
[1329848867.515][pre-receive-hook][10] Resource url: jar:file:/L:/Repositories2/jchess/subgit/lib/subgit-1.0.0-EAP_1111_fat.jar!/com/sun/jna/win32-x86/jnidispatch.dll
[1329848867.859][pre-receive-hook][10] Native library path: C:\tmp\jna7111216171838878764.dll
[1329848867.984][pre-receive-hook][10] Obtaining file lock on 'L:\Repositories2\jchess\subgit\daemon.pid.lock'.
[1329848868.000][pre-receive-hook][10] Obtained file lock on 'L:\Repositories2\jchess\subgit\daemon.pid.lock'
[1329848868.000][pre-receive-hook][10] L:\Repositories2\jchess\subgit\daemon.pid (???????????)
java.io.FileNotFoundException: L:\Repositories2\jchess\subgit\daemon.pid (???????????)
java.io.FileNotFoundException: L:\Repositories2\jchess\subgit\daemon.pid (???????????)
 at java.io.FileInputStream.open(Native Method)
 at java.io.FileInputStream.<init>(FileInputStream.java:120)
 at java.io.FileReader.<init>(FileReader.java:55)
 at org.tmatesoft.translator.process.TsPidFile.openFileForReading(SourceFile:156)
 at org.tmatesoft.translator.process.TsPidFile.readDaemonInfo(SourceFile:109)
 at org.tmatesoft.translator.hook.TsHook.readDaemonInfo(SourceFile:487)
 at org.tmatesoft.translator.hook.TsHook.openConnection(SourceFile:536)
 at org.tmatesoft.translator.hook.TsHook.sendPacket(SourceFile:469)
 at org.tmatesoft.translator.hook.TsHook.doExecute(SourceFile:318)
 at org.tmatesoft.translator.hook.TsHook.execute(SourceFile:85)
 at org.tmatesoft.translator.SubGitHook.executeCommand(SourceFile:81)
 at org.tmatesoft.translator.SubGitHook.run(SourceFile:52)
 at org.tmatesoft.translator.SubGitHook.run(SourceFile:20)
 at org.tmatesoft.translator.process.TsAbstractProcess.execute(SourceFile:106)
 at org.tmatesoft.translator.process.TsAbstractProcess.run(SourceFile:78)
 at org.tmatesoft.translator.SubGitHook.main(SourceFile:25)
[1329848868.000][pre-receive-hook][10] Pid file 'L:\Repositories2\jchess\subgit\daemon.pid' deleted.
[1329848868.000][pre-receive-hook][10] Launching daemon, classpath: l:/Repositories2/jchess/subgit/lib/subgit-1.0.0-EAP_1111_fat.jar
java options: [-noverify, -client]
working directory: L:\Repositories2\jchess
arguments: –svn L:\Repositories2\jchess –limit 1329848873000
[1329848874.500][pre-receive-hook][10] About to release lock: org.tmatesoft.translator.process.TsFileLock@1d2068d
[1329848874.500][pre-receive-hook][10] Trying to release file lock on 'L:\Repositories2\jchess\subgit\daemon.pid.lock'.
[1329848874.500][pre-receive-hook][10] Released file lock on 'L:\Repositories2\jchess\subgit\daemon.pid.lock'
[1329848874.500][pre-receive-hook][10] Timeout while waiting for pid file 'L:\Repositories2\jchess\subgit\daemon.pid'.
org.tmatesoft.translator.util.TsException: Timeout while waiting for pid file 'L:\Repositories2\jchess\subgit\daemon.pid'.
org.tmatesoft.translator.util.TsException: Timeout while waiting for pid file 'L:\Repositories2\jchess\subgit\daemon.pid'.
 at org.tmatesoft.translator.util.TsException.create(SourceFile:17)
 at org.tmatesoft.translator.process.TsPidFile.readWhenExists(SourceFile:63)
 at org.tmatesoft.translator.hook.TsHook.launchDaemon(SourceFile:527)
 at org.tmatesoft.translator.hook.TsHook.openConnection(SourceFile:544)
 at org.tmatesoft.translator.hook.TsHook.sendPacket(SourceFile:469)
 at org.tmatesoft.translator.hook.TsHook.doExecute(SourceFile:318)
 at org.tmatesoft.translator.hook.TsHook.execute(SourceFile:85)
 at org.tmatesoft.translator.SubGitHook.executeCommand(SourceFile:81)
 at org.tmatesoft.translator.SubGitHook.run(SourceFile:52)
 at org.tmatesoft.translator.SubGitHook.run(SourceFile:20)
 at org.tmatesoft.translator.process.TsAbstractProcess.execute(SourceFile:106)
 at org.tmatesoft.translator.process.TsAbstractProcess.run(SourceFile:78)
 at org.tmatesoft.translator.SubGitHook.main(SourceFile:25)
[1329848874.828][pre-receive-hook][10] Failed to execute pre-receive hook command
org.tmatesoft.translator.util.TsException: Timeout while waiting for pid file 'L:\Repositories2\jchess\subgit\daemon.pid'.
org.tmatesoft.translator.util.TsException: Timeout while waiting for pid file 'L:\Repositories2\jchess\subgit\daemon.pid'.
 at org.tmatesoft.translator.util.TsException.create(SourceFile:17)
 at org.tmatesoft.translator.process.TsPidFile.readWhenExists(SourceFile:63)
 at org.tmatesoft.translator.hook.TsHook.launchDaemon(SourceFile:527)
 at org.tmatesoft.translator.hook.TsHook.openConnection(SourceFile:544)
 at org.tmatesoft.translator.hook.TsHook.sendPacket(SourceFile:469)
 at org.tmatesoft.translator.hook.TsHook.doExecute(SourceFile:318)
 at org.tmatesoft.translator.hook.TsHook.execute(SourceFile:85)
 at org.tmatesoft.translator.SubGitHook.executeCommand(SourceFile:81)
 at org.tmatesoft.translator.SubGitHook.run(SourceFile:52)
 at org.tmatesoft.translator.SubGitHook.run(SourceFile:20)
 at org.tmatesoft.translator.process.TsAbstractProcess.execute(SourceFile:106)
 at org.tmatesoft.translator.process.TsAbstractProcess.run(SourceFile:78)
 at org.tmatesoft.translator.SubGitHook.main(SourceFile:25)

Semyon Vadishev
  Semyon Vadishev
21 Feb 2012 21:37
15 months ago
Hello,

1. Email replies.

Sorry, we have to upgrade our tracker installation in order to make e-mail replies work. We decided to postpone a bit with the upgrade, hope it doesn't make things too inconvenient for you.

2. Authentication problems
I add your suggested hooks to subgit.conf.
I checked VisualSVN server log, and found out following information. This error is interesting because I can git clone and git push successfully without subgit.
user chiiwen: authentication failure for "/git/jchess/info/refs": Password Mismatch
[client 127.0.0.1]
I do not know whether it is related to I use http instead https. I have to modified Authentication to Other settings.
I reinstalled subgit. Here is the log.


That's weird. Apache checks credentials and access control list before it runs SubGit hooks. So, you should notice the same problem before you install subgit. Maybe subgit accidentally removed some caches from repository, so you have to enter them once again.

I've created a separate issue for this particular problem. You may subscribe to it at http://issues.tmatesoft.com/issue/SGT-425.

After all it seems authentications passed because SubGit hooks actually got executed.

3. JNA problems.
I add your suggested hooks to subgit.conf.
Now I got 2 logs after git push


Great! We have resolved JNA-related problem. Now it's clear why we had problems with temporary directory:

java.io.tmpdir : C:\WINDOWS\


I think this directory has very strict permissions in Windows XP.

4. Daemon launch takes too much time.

So, you got timeout waiting for pid file error. That means SubGit daemon takes to long to launch. I've checked the timestamps in the debug data you've provided and here's what strange:

[1329848869.687][daemon][10] Trying to use a free port for address '127.0.0.1'.
[1329848869.703][daemon][10] Daemon socket opened for port: 4084.
[1329848869.781][daemon][10] Daemon process pid obtained: 5624.
[1329848869.812][daemon][10] Daemon (pid=5624; port=4084; address=127:0:0:1) at (L:\Repositories2\jchess\subgit).
[1329848875.046][daemon][11] 'pid=5624; port=4084; address=127:0:0:1' was written into temporary file 'L:\Repositories2\jchess\subgit\subgit.6427358808843237460.pid'


It took 5 seconds just to write into file. In that case SubGit hook doesn't wait until the daemon is launched and exits with error. But from the other side this problem must be temporary, i.e. sometimes push must succeed.

If that doesn't hold for you, please run the following command and check whether daemon actually launches:

java -classpath L:\Repositories2\jchess\subgit\lib\subgit-1.0.0-EAP_1111_fat.jar org.tmatesoft.translator.SubGitDaemon –svn L:\Repositories2\jchess –limit 2329848873000

After it launches you can push commits at least once.
Chiiwen Liou
  Chiiwen Liou
21 Feb 2012 21:58
15 months ago
Command does not work.

L:\workspace\jchess-git>java -classpath L:\Repositories2\jchess\subgit\lib\subgi
t-1.0.0-EAP_1111_fat.jar org.tmatesoft.translator.SubGitDaemon -svn L:\Repositor
ies2\jchess -limit 2329848873000
error: Failed to parse command line ûsvn L:\Repositories2\jchess ûlimit 23298488
73000
error: Missing option: –svn

I did setup [hooks]
-----------subgit.config
[hooks]
    javaOptions = -Djava.io.tmpdir=C:/tmp
[core]
    shared = false
    logs = subgit/logs
    errorReport = subgit/error
    authorsFile = conf/authors.txt
[git "default"]
    translationRoot = /
    repository = .git
    pathEncoding = MS950
    trunk = trunk:refs/heads/master
    branches = branches/*:refs/heads/*
    shelves = shelves/*:refs/shelves/*
    tags = tags/*:refs/tags/*
[daemon]
    pidFile = subgit/daemon.pid
    idleTimeout = 0
    classpath = subgit/lib

Semyon Vadishev
  Semyon Vadishev
21 Feb 2012 22:06
15 months ago
If you don't mind, I'm going to close this issue and start to use two its derivatives:


Regarding missing -svn option, it is due to comments formatting in our tracker. The right command would be:

java -classpath L:\Repositories2\jchess\subgit\lib\subgit-1.0.0-EAP_1111_fat.jar org.tmatesoft.translator.SubGitDaemon --svn L:\Repositories2\jchess --limit 2329848873000
Chiiwen Liou
  Chiiwen Liou
21 Feb 2012 22:08
15 months ago
I got better results after change c:/tmp to c:\tmp.
This time only pre-receive-hook.0

[1329854734.421][pre-receive-hook][10] Initialized memory cache logger.
[1329854734.453][pre-receive-hook][10] SubGit version 1.0.0-EAP ('Miai') build #1111
[1329854734.453][pre-receive-hook][10] Command name: pre-receive.
[1329854734.453][pre-receive-hook][10] Command argument: l:/Repositories2/jchess/.git.
[1329854734.453][pre-receive-hook][10] Initialized console logger.
[1329854734.453][pre-receive-hook][10] SubGit version 1.0.0-EAP ('Miai') build #1111
[1329854740.625][pre-receive-hook][10] Initialized file logger, logs directory is: 'L:\Repositories2\jchess\subgit\logs'.
[1329854740.625][pre-receive-hook][10] SubGit version 1.0.0-EAP ('Miai') build #1111
[1329854740.640][pre-receive-hook][10] no jnidispatch in java.library.path
java.lang.UnsatisfiedLinkError: no jnidispatch in java.library.path
java.lang.UnsatisfiedLinkError: no jnidispatch in java.library.path
 at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1738)
 at java.lang.Runtime.loadLibrary0(Runtime.java:823)
 at java.lang.System.loadLibrary(System.java:1028)
 at org.tmatesoft.translator.hook.TsHook.loadNativeLibrary(SourceFile:167)
 at org.tmatesoft.translator.hook.TsHook.loadJnaNative(SourceFile:112)
 at org.tmatesoft.translator.hook.TsHook.execute(SourceFile:84)
 at org.tmatesoft.translator.SubGitHook.executeCommand(SourceFile:81)
 at org.tmatesoft.translator.SubGitHook.run(SourceFile:52)
 at org.tmatesoft.translator.SubGitHook.run(SourceFile:20)
 at org.tmatesoft.translator.process.TsAbstractProcess.execute(SourceFile:106)
 at org.tmatesoft.translator.process.TsAbstractProcess.run(SourceFile:78)
 at org.tmatesoft.translator.SubGitHook.main(SourceFile:25)
[1329854740.640][pre-receive-hook][10] Resource name: /com/sun/jna/win32-x86/jnidispatch.dll
[1329854740.640][pre-receive-hook][10] Resource url: jar:file:/L:/Repositories2/jchess/subgit/lib/subgit-1.0.0-EAP_1111_fat.jar!/com/sun/jna/win32-x86/jnidispatch.dll
[1329854740.640][pre-receive-hook][10] ?????
java.io.IOException: ?????
java.io.IOException: ?????
 at java.io.WinNTFileSystem.createFileExclusively(Native Method)
 at java.io.File.checkAndCreate(File.java:1704)
 at java.io.File.createTempFile(File.java:1792)
 at java.io.File.createTempFile(File.java:1828)
 at org.tmatesoft.translator.hook.TsHook.loadNativeLibraryFromJar(SourceFile:222)
 at org.tmatesoft.translator.hook.TsHook.loadNativeLibrary(SourceFile:171)
 at org.tmatesoft.translator.hook.TsHook.loadJnaNative(SourceFile:112)
 at org.tmatesoft.translator.hook.TsHook.execute(SourceFile:84)
 at org.tmatesoft.translator.SubGitHook.executeCommand(SourceFile:81)
 at org.tmatesoft.translator.SubGitHook.run(SourceFile:52)
 at org.tmatesoft.translator.SubGitHook.run(SourceFile:20)
 at org.tmatesoft.translator.process.TsAbstractProcess.execute(SourceFile:106)
 at org.tmatesoft.translator.process.TsAbstractProcess.run(SourceFile:78)
 at org.tmatesoft.translator.SubGitHook.main(SourceFile:25)
[1329854740.640][pre-receive-hook][10] Failed to create temporary file for jnidispatch library: java.io.IOException: ?????
java.lang.Error: Failed to create temporary file for jnidispatch library: java.io.IOException: ?????
java.lang.Error: Failed to create temporary file for jnidispatch library: java.io.IOException: ?????
 at org.tmatesoft.translator.hook.TsHook.loadNativeLibraryFromJar(SourceFile:242)
 at org.tmatesoft.translator.hook.TsHook.loadNativeLibrary(SourceFile:171)
 at org.tmatesoft.translator.hook.TsHook.loadJnaNative(SourceFile:112)
 at org.tmatesoft.translator.hook.TsHook.execute(SourceFile:84)
 at org.tmatesoft.translator.SubGitHook.executeCommand(SourceFile:81)
 at org.tmatesoft.translator.SubGitHook.run(SourceFile:52)
 at org.tmatesoft.translator.SubGitHook.run(SourceFile:20)
 at org.tmatesoft.translator.process.TsAbstractProcess.execute(SourceFile:106)
 at org.tmatesoft.translator.process.TsAbstractProcess.run(SourceFile:78)
 at org.tmatesoft.translator.SubGitHook.main(SourceFile:25)
[1329854740.656][pre-receive-hook][10] Native library path: null
[1329854740.687][pre-receive-hook][10] Obtaining file lock on 'L:\Repositories2\jchess\subgit\daemon.pid.lock'.
[1329854740.687][pre-receive-hook][10] Obtained file lock on 'L:\Repositories2\jchess\subgit\daemon.pid.lock'
[1329854740.687][pre-receive-hook][10] L:\Repositories2\jchess\subgit\daemon.pid (???????????)
java.io.FileNotFoundException: L:\Repositories2\jchess\subgit\daemon.pid (???????????)
java.io.FileNotFoundException: L:\Repositories2\jchess\subgit\daemon.pid (???????????)
 at java.io.FileInputStream.open(Native Method)
 at java.io.FileInputStream.<init>(FileInputStream.java:120)
 at java.io.FileReader.<init>(FileReader.java:55)
 at org.tmatesoft.translator.process.TsPidFile.openFileForReading(SourceFile:156)
 at org.tmatesoft.translator.process.TsPidFile.readDaemonInfo(SourceFile:109)
 at org.tmatesoft.translator.hook.TsHook.readDaemonInfo(SourceFile:487)
 at org.tmatesoft.translator.hook.TsHook.openConnection(SourceFile:536)
 at org.tmatesoft.translator.hook.TsHook.sendPacket(SourceFile:469)
 at org.tmatesoft.translator.hook.TsHook.doExecute(SourceFile:318)
 at org.tmatesoft.translator.hook.TsHook.execute(SourceFile:85)
 at org.tmatesoft.translator.SubGitHook.executeCommand(SourceFile:81)
 at org.tmatesoft.translator.SubGitHook.run(SourceFile:52)
 at org.tmatesoft.translator.SubGitHook.run(SourceFile:20)
 at org.tmatesoft.translator.process.TsAbstractProcess.execute(SourceFile:106)
 at org.tmatesoft.translator.process.TsAbstractProcess.run(SourceFile:78)
 at org.tmatesoft.translator.SubGitHook.main(SourceFile:25)
[1329854740.703][pre-receive-hook][10] Pid file 'L:\Repositories2\jchess\subgit\daemon.pid' deleted.
[1329854740.703][pre-receive-hook][10] Launching daemon, classpath: l:/Repositories2/jchess/subgit/lib/subgit-1.0.0-EAP_1111_fat.jar
java options: [-noverify, -client]
working directory: L:\Repositories2\jchess
arguments: –svn L:\Repositories2\jchess –limit 1329854745703
[1329854740.765][pre-receive-hook][10] About to release lock: org.tmatesoft.translator.process.TsFileLock@16cd7d5
[1329854740.765][pre-receive-hook][10] Trying to release file lock on 'L:\Repositories2\jchess\subgit\daemon.pid.lock'.
[1329854740.765][pre-receive-hook][10] Released file lock on 'L:\Repositories2\jchess\subgit\daemon.pid.lock'
[1329854740.765][pre-receive-hook][10] Could not initialize class com.sun.jna.Native
java.lang.NoClassDefFoundError: Could not initialize class com.sun.jna.Native
java.lang.NoClassDefFoundError: Could not initialize class com.sun.jna.Native
 at com.sun.jna.Structure.<clinit>(Structure.java:134)
 at org.tmatesoft.translator.process.win32.TsPlatformWin32.forkDetachedJVMProcess(SourceFile:53)
 at org.tmatesoft.translator.hook.TsHook.launchDaemon(SourceFile:522)
 at org.tmatesoft.translator.hook.TsHook.openConnection(SourceFile:544)
 at org.tmatesoft.translator.hook.TsHook.sendPacket(SourceFile:469)
 at org.tmatesoft.translator.hook.TsHook.doExecute(SourceFile:318)
 at org.tmatesoft.translator.hook.TsHook.execute(SourceFile:85)
 at org.tmatesoft.translator.SubGitHook.executeCommand(SourceFile:81)
 at org.tmatesoft.translator.SubGitHook.run(SourceFile:52)
 at org.tmatesoft.translator.SubGitHook.run(SourceFile:20)
 at org.tmatesoft.translator.process.TsAbstractProcess.execute(SourceFile:106)
 at org.tmatesoft.translator.process.TsAbstractProcess.run(SourceFile:78)
 at org.tmatesoft.translator.SubGitHook.main(SourceFile:25)
[1329854740.843][pre-receive-hook][10] Failed to execute pre-receive hook command
org.tmatesoft.translator.util.TsException: Could not initialize class com.sun.jna.Native
org.tmatesoft.translator.util.TsException: Could not initialize class com.sun.jna.Native
 at org.tmatesoft.translator.util.TsException.wrap(SourceFile:47)
 at org.tmatesoft.translator.util.TsException.wrap(SourceFile:40)
 at org.tmatesoft.translator.hook.TsHook.execute(SourceFile:106)
 at org.tmatesoft.translator.SubGitHook.executeCommand(SourceFile:81)
 at org.tmatesoft.translator.SubGitHook.run(SourceFile:52)
 at org.tmatesoft.translator.SubGitHook.run(SourceFile:20)
 at org.tmatesoft.translator.process.TsAbstractProcess.execute(SourceFile:106)
 at org.tmatesoft.translator.process.TsAbstractProcess.run(SourceFile:78)
 at org.tmatesoft.translator.SubGitHook.main(SourceFile:25)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.sun.jna.Native
 at com.sun.jna.Structure.<clinit>(Structure.java:134)
 at org.tmatesoft.translator.process.win32.TsPlatformWin32.forkDetachedJVMProcess(SourceFile:53)
 at org.tmatesoft.translator.hook.TsHook.launchDaemon(SourceFile:522)
 at org.tmatesoft.translator.hook.TsHook.openConnection(SourceFile:544)
 at org.tmatesoft.translator.hook.TsHook.sendPacket(SourceFile:469)
 at org.tmatesoft.translator.hook.TsHook.doExecute(SourceFile:318)
 at org.tmatesoft.translator.hook.TsHook.execute(SourceFile:85)
 ... 6 more
Semyon Vadishev
  Semyon Vadishev
21 Feb 2012 22:12
15 months ago
I got better results after change c:/tmp to c:\tmp.


The problem with c:\tmp is that '\' char is an escape char in our config file format (which is the same as git config format).

When you use c:\tmp, JVM fails to find this directory, so it fallbacks to default java.io.tmpdir and thus we get the same behavior when we cannot create temporary file.
Chiiwen Liou
  Chiiwen Liou
21 Feb 2012 22:17
15 months ago
2 – still same issue
L:\workspace\jchess-git>java -classpath L:\Repositories2\jchess\subgit\lib\subgit-1.0.0-EAP_1111_fat.jar org.tmatesoft.translator.SubGitDaemon –svn L:\Reposito
ries2\jchess –limit 2329848873000
error: Failed to parse command line û-svn L:\Repositories2\jchess –limit 232984
8873000
error: Missing option: –svn
Semyon Vadishev
  Semyon Vadishev
21 Feb 2012 22:21
15 months ago
It is formatting issue again, please put two dashes before svn and limit parameters, i.e. - - but with no whitespace between.
Semyon Vadishev
  Semyon Vadishev
21 Feb 2012 22:28
15 months ago
I'm closing the issue.

Explanation for further references:

When SubGit hook launched by Apache server, it runs on behalf of the user with limited permissions. SubGit fails to create a temporary file by calling java.io.File#createTempFile.

  • To resolve that, make sure that user has enough permissions to create a file in the temporary directory.
  • If that doesn't help put the following lines into $SVN_REPOS/conf/subgit.conf config file:

[hooks]
javaOptions = -Djava.io.tmpdir=C:/tmp/
[daemon]
javaHooks = -Djava.io.tmpdir=C:/tmp/

C:/tmp/ directory must be writable for corresponding user.
Related Changes
Resolved Date
15 months ago (21 Feb 2012 22:28)
State
SubmittedFixed
Apply Command

Command Preview: