Friday 15 June 2012

java - How do I fix "incompatible JNA native library" when using Putty, Gradle, and the Gradle Git plugin? -



java - How do I fix "incompatible JNA native library" when using Putty, Gradle, and the Gradle Git plugin? -

i have simple build script:

import org.ajoberstar.grgit.grgit apply plugin: 'application' apply plugin: 'org.ajoberstar.release-opinion' task wrapper(type:wrapper) { gradleversion = '2.1' } buildscript { repositories { mavencentral() } dependencies { classpath 'org.ajoberstar:gradle-git:0.11.+' } } release { grgit = grgit.open(project.file('.')) }

i created helloworld style project , initialized git repository. when utilize directory remote origin can run

.\gradlew.bat release

just fine. when utilize ssh target remote origin next output:

16:39:55.355 [debug] [org.gradle.api.internal.tasks.execution.executeactionstaskexecuter] executing actions task ':prepare'. 16:39:55.355 [info] [org.gradle.api.task] fetching changes remote: origin 16:39:55.387 [info] [org.ajoberstar.grgit.auth.transportoputil] next authentication options allowed (though may not available): [ hardcoded, pageant, sshagent, interactive] 16:39:55.402 [info] [org.ajoberstar.grgit.auth.transportoputil] using interactive credentials, if needed 16:39:55.480 [info] [org.ajoberstar.grgit.auth.jschagentproxysessionfactory] ssh-agent not available 16:39:55.511 [info] [org.ajoberstar.grgit.auth.jschagentproxysessionfactory] pageant available 16:39:55.527 [debug] [org.gradle.api.internal.tasks.execution.executeatmostoncetaskexecuter] finished executing task ':prepare' 16:39:55.527 [lifecycle] [class org.gradle.taskexecutionlogger] :prepare failed 16:39:55.543 [info] [org.gradle.execution.taskgraph.abstracttaskplanexecutor] :prepare (thread[main,5,main]) completed. took 0.219 secs. 16:39:55.543 [debug] [org.gradle.execution.taskgraph.abstracttaskplanexecutor] task worker [thread[main,5,main]] finished, busy: 0.219 secs, idle: 0.0 secs 16:39:55.543 [error] [org.gradle.buildexceptionreporter] 16:39:55.543 [error] [org.gradle.buildexceptionreporter] failure: build failed exception. 16:39:55.543 [error] [org.gradle.buildexceptionreporter] 16:39:55.558 [error] [org.gradle.buildexceptionreporter] * went wrong: 16:39:55.558 [error] [org.gradle.buildexceptionreporter] execution failed task ':prepare'. 16:39:55.558 [error] [org.gradle.buildexceptionreporter] > 16:39:55.558 [error] [org.gradle.buildexceptionreporter] 16:39:55.558 [error] [org.gradle.buildexceptionreporter] there incompatible jna native library installed on system. 16:39:55.558 [error] [org.gradle.buildexceptionreporter] resolve issue may 1 of following: 16:39:55.558 [error] [org.gradle.buildexceptionreporter] - remove or uninstall offending library 16:39:55.558 [error] [org.gradle.buildexceptionreporter] - set scheme property jna.nosys=true 16:39:55.558 [error] [org.gradle.buildexceptionreporter] - set jna.boot.library.path include path version of 16:39:55.558 [error] [org.gradle.buildexceptionreporter] jnidispatch library included jna jar file using 16:39:55.558 [error] [org.gradle.buildexceptionreporter] 16:39:55.574 [error] [org.gradle.buildexceptionreporter] 16:39:55.574 [error] [org.gradle.buildexceptionreporter] * try: 16:39:55.574 [error] [org.gradle.buildexceptionreporter] run --stacktrace alternative stack trace. 16:39:55.574 [lifecycle] [org.gradle.buildresultlogger] 16:39:55.574 [lifecycle] [org.gradle.buildresultlogger] build failed

i reran --stacktrace , here partial stack trace error (seems implicate jsch):

caused by: java.lang.error: @ com.sun.jna.native.<clinit>(native.java:142) @ com.jcraft.jsch.agentproxy.connector.pageantconnector$user32.<clinit>(pageantconnector.java:85) @ com.jcraft.jsch.agentproxy.connector.pageantconnector.<init>(pageantconnector.java:61) @ org.ajoberstar.grgit.auth.jschagentproxysessionfactory$_closure2.docall(jschagentproxysessionfactory.groovy:122) @ org.ajoberstar.grgit.auth.jschagentproxysessionfactory$_closure2.docall(jschagentproxysessionfactory.groovy) @ org.ajoberstar.grgit.auth.jschagentproxysessionfactory$_determineconnector_closure5.docall(jschagentproxysessionfactory.groovy:86) @ org.ajoberstar.grgit.auth.jschagentproxysessionfactory.determineconnector(jschagentproxysessionfactory.groovy:85) @ org.ajoberstar.grgit.auth.jschagentproxysessionfactory.getjsch(jschagentproxysessionfactory.groovy:65) @ org.eclipse.jgit.transport.jschconfigsessionfactory.createsession(jschconfigsessionfactory.java:191) @ org.eclipse.jgit.transport.jschconfigsessionfactory.createsession(jschconfigsessionfactory.java:150) @ org.eclipse.jgit.transport.jschconfigsessionfactory.getsession(jschconfigsessionfactory.java:109) @ org.eclipse.jgit.transport.sshtransport.getsession(sshtransport.java:121) @ org.eclipse.jgit.transport.transportgitssh$sshpushconnection.<init>(transportgitssh.java:306) @ org.eclipse.jgit.transport.transportgitssh.openpush(transportgitssh.java:152) @ org.eclipse.jgit.transport.pushprocess.execute(pushprocess.java:154) @ org.eclipse.jgit.transport.transport.push(transport.java:1173) @ org.eclipse.jgit.api.pushcommand.call(pushcommand.java:156) @ org.eclipse.jgit.api.pushcommand.call(pushcommand.java:79) @ java_util_concurrent_callable$call$0.call(unknown source) @ org.ajoberstar.grgit.operation.pushop.call(pushop.groovy:104) @ org.ajoberstar.grgit.operation.pushop.call(pushop.groovy) @ java_util_concurrent_callable$call.call(unknown source) @ java_util_concurrent_callable$call.call(unknown source) @ org.ajoberstar.grgit.util.opsyntaxutil.tryop(opsyntaxutil.groovy:45) @ org.ajoberstar.grgit.grgit.methodmissing(grgit.groovy:190) @ org.ajoberstar.gradle.git.release.grgitreleaseplugin$_addreleasetask_closure4_closure14.docall(grgitreleaseplugin.groovy:134) ... 56 more

any ideas on how working?

i'm using gradle 2.1, gradle-git 0.11.0 (as can see in build script), java 1.7.0_71 64-bit (there other versions of java on system, path set version , java -version outputs 1.7.0_71 64 bit), putty 0.60, , git 1.9.0 msysgit.

some possible reasons are:

there @ to the lowest degree 1 bug in gradle gradle-side jna "leaked" other places, see https://issues.gradle.org/browse/gradle-3288, in rc-versions of gradle 2.4

i had 1 case did pass scheme properties gradle unit test via

test { systemproperties = system.properties }

this leads gradle passing jna-system properties on unit test. solved me following:

test { systemproperties = system.properties systemproperties['jna.boot.library.path'] = null }

java gradle jna jsch

No comments:

Post a Comment