Comments (8)
How large is the msi file signed? Did you get an exception?
from jsign.
The size of the file is 86 Mb. I signed it with a 32-bit jdk and the signing failed but it worked with a 64-bit jdk.
The ant task didn't print the cause of the error so I had to run the maven test to get the stacktrace.
Stacktrace (32-bit jdk):
java.lang.OutOfMemoryError: unable to create new native thread
at java.lang.Thread.start0(Native Method)
at java.lang.Thread.start(Thread.java:717)
at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:957)
at java.util.concurrent.ThreadPoolExecutor.ensurePrestart(ThreadPoolExecutor.java:1603)
at java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute(ScheduledThreadPoolExecutor.java:334)
at java.util.concurrent.ScheduledThreadPoolExecutor.schedule(ScheduledThreadPoolExecutor.java:533)
at org.apache.maven.surefire.booter.ForkedBooter.launchLastDitchDaemonShutdownThread(ForkedBooter.java:369)
at org.apache.maven.surefire.booter.ForkedBooter.acknowledgedExit(ForkedBooter.java:333)
at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:145)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:418)
Exception in thread "main" java.lang.OutOfMemoryError: unable to create new native thread
at java.lang.Thread.start0(Native Method)
at java.lang.Thread.start(Thread.java:717)
at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:957)
at java.util.concurrent.ThreadPoolExecutor.ensurePrestart(ThreadPoolExecutor.java:1603)
at java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute(ScheduledThreadPoolExecutor.java:334)
at java.util.concurrent.ScheduledThreadPoolExecutor.schedule(ScheduledThreadPoolExecutor.java:533)
at org.apache.maven.surefire.booter.ForkedBooter.launchLastDitchDaemonShutdownThread(ForkedBooter.java:369)
at org.apache.maven.surefire.booter.ForkedBooter.exit(ForkedBooter.java:316)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:425)
from jsign.
The error comes from surefire not being able to create threads to tun the tests. Unless Apache POI, which is used for the msi signing, creates a ton of threads I fail to see what could cause this. Does it happen if you run the test in isolation (using mvn test -Dtest=*NameOfTheTestClass*#nameOfTheTest
) ? What is your OS?
from jsign.
OS: Windows 10
32-bit JDK
Same error.
The ant task shows a default message for every error so I don't know if the cause of the error is the same in both cases ("maven test" and "ant execution").
from jsign.
Could you try closing your IDE and running the test from the command line?
from jsign.
Result of execution from the command line.
mvn -Dtest=MSISignerTest#testSign test
[INFO] Results:
[INFO]
[ERROR] Errors:
[ERROR] MSISignerTest.testSign:57 ยป Runtime java.io.IOException: Map failed
[INFO]
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.595 s
[INFO] Finished at: 2020-03-05T10:55:56+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-test) on project jsign-core: There are test failures.
[ERROR]
[ERROR] Please refer to C:\Users\MY_USER\Documents\GitHub\jsign\jsign-core\target\surefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
[ERROR] Error occurred in starting fork, check output in log
[ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: Error occurred in starting fork, check output in log
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:622)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:282)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:245)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1183)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:1011)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:857)
[ERROR] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:156)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
[ERROR] at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
[ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)
[ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
[ERROR] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
[ERROR] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:957)
[ERROR] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:289)
[ERROR] at org.apache.maven.cli.MavenCli.main(MavenCli.java:193)
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ERROR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR] at java.lang.reflect.Method.invoke(Method.java:498)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347)
[ERROR]
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Content of file "TEST-net.jsign.MSISignerTest"
java.lang.RuntimeException: java.io.IOException: Map failed
at net.jsign.MSISignerTest.testSign(MSISignerTest.java:57)
Caused by: java.io.IOException: Map failed
at net.jsign.MSISignerTest.testSign(MSISignerTest.java:57)
Caused by: java.lang.OutOfMemoryError: Map failed
at net.jsign.MSISignerTest.testSign(MSISignerTest.java:57)
from jsign.
Did you try signing the same file from the command line, without using Maven?
from jsign.
java -jar .\JSign\jsign-3.1.jar --keystore "./Key Stores/mykeyStore.p12" --storepass ####### --storetype ##### --alias ##### test.msi
Result:
Adding Authenticode signature to test.msi
jsign: Couldn't sign test.msi
java.lang.RuntimeException: java.io.IOException: Map failed
at net.jsign.poi.poifs.filesystem.POIFSStream$StreamBlockByteBufferIterator.next(POIFSStream.java:170)
at net.jsign.poi.poifs.filesystem.POIFSStream$StreamBlockByteBufferIterator.next(POIFSStream.java:142)
at net.jsign.msi.MSIFile.computeDigest(MSIFile.java:180)
at net.jsign.msi.MSIFile.createIndirectData(MSIFile.java:199)
at net.jsign.AuthenticodeSigner.createSignedData(AuthenticodeSigner.java:368)
at net.jsign.AuthenticodeSigner.sign(AuthenticodeSigner.java:339)
at net.jsign.SignerHelper.sign(SignerHelper.java:424)
at net.jsign.JsignCLI.execute(JsignCLI.java:111)
at net.jsign.JsignCLI.main(JsignCLI.java:40)
Caused by: java.io.IOException: Map failed
at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:938)
at net.jsign.poi.poifs.nio.FileBackedDataSource.read(FileBackedDataSource.java:95)
at net.jsign.poi.poifs.filesystem.POIFSFileSystem.getBlockAt(POIFSFileSystem.java:427)
at net.jsign.poi.poifs.filesystem.POIFSStream$StreamBlockByteBufferIterator.next(POIFSStream.java:166)
... 8 more
Caused by: java.lang.OutOfMemoryError: Map failed
at sun.nio.ch.FileChannelImpl.map0(Native Method)
at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:935)
... 11 more
Try `java -jar jsign.jar --help' for more information.
from jsign.
Related Issues (20)
- Contradictory error message if no storepass is provided HOT 2
- Signature verification failed, the private key doesn't match the certificate HOT 8
- Doubt about Google HSM changes
- Support for Office files HOT 1
- Unsupported File ".exe" HOT 10
- Support for Oracle OCI Vault HOT 19
- BattlEye validation issue due to missing intermediate certificates HOT 16
- AzureKeyVault JCA provider requires list aliases permission - Unable to retrieve Azure Key Vault certificate aliases HOT 10
- Unable to retrieve the certificate chain from Azure Trusted Signing (socket write error) HOT 24
- jarsigner error: java.lang.RuntimeException: java.security.KeyStoreException: Unable to retrieve Azure Key Vault certificate aliases HOT 1
- Certificate chain not found with jarsigner and Azure Key Vault HOT 26
- Error with a Yubikey FIPS in PIV mode: The parameters in the data field are incorrect HOT 6
- apksigner & jsign with AWS? HOT 8
- Support AWS KMS Key Aliases HOT 3
- Access Denied for jsign when using from Github Action Role HOT 7
- sign more than one file with API (YUBIKEY) HOT 22
- Signing exe with Yubikey on MacOS HOT 5
- Invalid code signing after successful operation HOT 3
- error after 30 minutes : "SCARD_E_NO_SERVICE" HOT 8
- Nuget.org: Signed packages must only have an author signature. Other signature types are not supported. HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jsign.