Ant genkey task doesn't support the "saname" attribute - ant

Any idea how to add the san info in gen key tag in ant 1.9?
I am trying like below, but its not working
<genkey alias="tomcat" validity="3652" keystore="${keystore}"
storepass="security" keypass="security" keyalg="RSA" sigalg="SHA256withRSA" keysize="2048"
dname="CN=XX, OU=XX, O=XX, L=XX, ST=XX, C=X"
*saname="SAN=IP:10.100.0.1,IP:192.168.0.1,DNS:myserver.mydomain.com,DNS:otherserver.otherdomain.com,EMAIL:name#mydomain.com,EMAIL:othename#otherdomain.com"*/>
The error is:
genkey doesn't support the "saname" attribute
I am using jdk-8_261 with Ant 1.9.

This is an issue with Ant versions 1.9.0-1.9.13, fixed in 1.9.14.
Ant downloads are here.

Related

Java Apache POI ImageHeaderPNG missing

I am using latest dependency of Apache POI 4.1.2 in my java application together with Tika.
I realized that the class ImageHeaderPNG is missing with the following calls tack:
java.lang.NoClassDefFoundError: org/apache/poi/sl/image/ImageHeaderPNG
at org.apache.poi.hwpf.usermodel.Picture.fillImageContent(Picture.java:172)
at org.apache.poi.hwpf.usermodel.Picture.getContent(Picture.java:279)
Inside Tika:
org.apache.tika.parser.microsoft.WordExtractor.handlePictureCharacterRun(WordExtractor.java:560
at org.apache.tika.parser.microsoft.WordExtractor.handleParagraph(WordExtractor.java:365)
at org.apache.tika.parser.microsoft.WordExtractor.handleHeaderFooter(WordExtractor.java:257)
at org.apache.tika.parser.microsoft.WordExtractor.parse(WordExtractor.java:180)
at org.apache.tika.parser.microsoft.OfficeParser.parse(OfficeParser.java:175)
at org.apache.tika.parser.microsoft.OfficeParser.parse(OfficeParser.java:131)
at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:280)
at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:280)
at org.apache.tika.parser.AutoDetectParser.parse(AutoDetectParser.java:143)
at org.apache.tika.Tika.parseToString(Tika.java:527)
at org.apache.tika.Tika.parseToString(Tika.java:602)
Any idea, hints where this class was moved to?
According to the online documentation it should be available:
https://poi.apache.org/apidocs/dev/org/apache/poi/sl/image/package-frame.html
https://poi.apache.org/apidocs/dev/org/apache/poi/sl/image/ImageHeaderPNG.html

MockWebServer: java.lang.NoSuchMethodError

Trying MockWebServer for the first time on a Groovy/Spring project that uses Spock for unit testing.
I added MockWebServer dependencies as directed (I had to add the second line myself to avoid errors, but it's not documented:
testImplementation("com.squareup.okhttp3:mockwebserver:4.0.0")
testImplementation("org.jetbrains.kotlin:kotlin-stdlib:1.3.40")
I have a basic Spock test that looks like this:
def 'server'() {
setup:
MockWebServer server = new MockWebServer()
expect:
server
}
But it fails with this output:
java.lang.NoSuchMethodError: okhttp3.internal.Util.immutableListOf([Ljava/lang/Object;)Ljava/util/List;
at okhttp3.mockwebserver.MockWebServer.<init>(MockWebServer.kt:176)
Is there another dependency I'm missing? Does MockWebServer not play well with Groovy and Spock?
For what it's worth, using version 3.1.4 seems to work:
testImplementation("com.squareup.okhttp3:mockwebserver:3.14.2")
(I'm a first time user of MockWebServer)
Thank you!
Try adding this:
testImplementation("com.squareup.okhttp3:mockwebserver:4.0.0")
testImplementation("com.squareup.okhttp3:okhttp:4.0.0")
With MockWebServer your OkHttp dependency must be the same version.
I got the same problem, I found the solution in version, just change the version to "3.7.0" and it's work fine.
there is some discussion about version changing to "3.4.1" but this version got the problem (Cannot inherit from final class) that discussed at this issue :
https://github.com/andrzejchm/RESTMock/issues/56
so the safest version is "3.7.0" :D
just notice that both versions should be the same..
change your to dependencies to below:
//mock retrofit
testImplementation("com.squareup.okhttp3:mockwebserver:3.7.0")
testImplementation("com.squareup.okhttp3:okhttp:3.7.0")
//if your source code is java
testImplementation("org.jetbrains.kotlin:kotlin-stdlib:1.3.40")

Xamarin.Android binding generation giving "Type X was not found" errors for classes new in JDK 1.8

I'm trying to get Xamarin.Android to generate bindings for a library supplied as an AAR. JAR2XML is giving me a lot of "can't find type" errors, so I thought I'd try class-parse, but in addition to some library references I'm trying to track down, I'm getting a couple of these:
1> Error while processing '[Method] java.time.temporal.Temporal adjustInto(java.time.temporal.Temporal temporal, long newValue)' in '[Class] java.time.temporal.ChronoField': Type 'java.time.temporal.Temporal' was not found. (TaskId:69)
1> Error while processing '[Method] java.time.temporal.Temporal addTo(java.time.temporal.Temporal temporal, long amount)' in '[Class] java.time.temporal.ChronoUnit': Type 'java.time.temporal.Temporal' was not found. (TaskId:69)
Now, java.time.temporal.Temporal is a new type in JDK 1.8, so I'm wondering if maybe that's part of my problem here (ie. maybe the types that can't load are using other new-in-1.8 types). Running bin\javac -version in the path specified in Options-Xamarin-Android Settings says I'm using "1.8.0_172". My project is targeting "Android 8.1 (Oreo)" - ie. api level 27. Is there some other option I need to set to make sure I'm using 1.8?

weird import issues - Jung2

I've been trying to get Jung 2.1.1 to work successfully but whatever breaking changes were made are just not making sense.
After importing the 2.1.1 jars, I get the error:
The constructor VisualizationViewer(Network, LayoutAlgorithm, Dimension) is undefined
for the line:
VisualizationViewer vv = new
VisualizationViewer(g, layoutAlgorithm, new Dimension(900, 900));
where
Network g = NetworkBuilder.undirected().build(); // and other load steps
There are other imports that aren't working, like
import edu.uci.ics.jung.visualization.decorators.PickableNodePaintFunction;
import edu.uci.ics.jung.visualization.layout.LayoutAlgorithmTransition;
Edit: It appears the classes in the Jung 2.1.1 JAR still use the old definitions, for example
VisualizationViewer(Layout<V,E>,Dimension)
and not
VisualizationViewer(Network<N,E>,Dimension,Dimension)
This question was answered in https://github.com/jrtom/jung/issues/201
The short version is that you should not be cloning the HEAD version on the JUNG website; that's the 3.0 version in development, which is not yet ready for release, and is incompatible with 2.1.1. Use the 2.1.1 version explicitly for both the jars and the samples.

Rejecting re-init on previously failed class error when loading a Class with dalvikvm

I am trying to use Terminal IDE on Lollipop 5.1.1. Using a Samsung E7 device, a mod version of Terminal IDE is provided by someone on XDA
here:
http://forum.xda-developers.com/showthread.php?t=1340852&page=7
I tried to use javac script in that mod but it gave an unsatisfied link error, saying that:
$ javac
java.lang.UnsatisfiedLinkError: org.apache.harmony.security.fortress.Services
at org.apache.harmony.security.fortress.Engine.getServices(Engine.java:158)
at org.apache.harmony.security.fortress.Engine.getInstance(Engine.java:137)
at java.security.cert.CertificateFactory.getInstance(CertificateFactory.java:90)
at
org.apache.harmony.security.utils.JarUtils.verifySignature(JarUtils.java:83)
at java.util.jar.JarVerifier.verifyCertificate(JarVerifier.java:294)
at java.util.jar.JarVerifier.readCertificates(JarVerifier.java:268)
at java.util.jar.JarFile.getInputStream(JarFile.java:380)
at libcore.net.url.JarURLConnectionImpl.getInputStream(JarURLConnectionImpl.java:222)
at java.net.URL.openStream(URL.java:470)
at java.lang.ClassLoader.getResourceAsStream(ClassLoader.java:444)
at java.util.ResourceBundle.handleGetBundle(ResourceBundle.java:515)
at java.util.ResourceBundle.handleGetBundle(ResourceBundle.java:542)
at java.util.ResourceBundle.handleGetBundle(ResourceBundle.java:542)
at java.util.ResourceBundle.getBundle(ResourceBundle.java:228)
at java.util.ResourceBundle.getBundle(ResourceBundle.java:139)
at com.sun.tools.javac.main.JavaCompiler.version(JavaCompiler.java:112)
at com.sun.tools.javac.main.JavaCompiler.version(JavaCompiler.java:97)
at com.sun.tools.javac.main.Main.bugMessage(Main.java:434)
at com.sun.tools.javac.main.Main.compile(Main.java:421)
at com.sun.tools.javac.main.Main.compile(Main.java:308)
at com.sun.tools.javac.main.Main.compile(Main.java:299)
at com.sun.tools.javac.Main.compile(Main.java:82)
at com.spartacusrex.spartacuside.external.javac.main(javac.java:13)
$
It is strange that there is a UnsatisfiedLinkError , because it doesn't say that VM cannot find xyz.so library or cannot find xyz method.
I tried using logcat command right after using Terminal IDE's javac script on Device, the odd thing I found from there is :
I/art ( 6558) : rejecting re-init on previously-failed class java.lang.Class<org.apache.harmony.security.fortress.Services>
I couldn't understand why this happened,
The javac script uses android's dalvikvm command to load
com.spartacusrex.spartacuside.external.javac
class. People have faced this rejecting re-init issue on sdk version 20+ but it's not clear to me why this info message uccurs and how to solve it.
I copied /system/lib/libjavacrypto.so to Terminal IDE's ~/system/lib folder and now javac and dx tools are working.
It seems like Google messed up with things in /system/lib which resulted in errors.
Answering so someone else might find it useful.

Resources