java-11

MojoExecutionException when generate sources cxf-xjc-plugin:3.3.0 java11

十年热恋 提交于 2021-02-08 09:51:15
问题 I try to generate java classes from xsd in a maven project using cxf-xjc-plugin. But when I try to generate the sources, I have an error. I tried to use another version of the plugin: 3.2.3 but it didn't help. <plugin> <groupId>org.apache.cxf</groupId> <artifactId>cxf-xjc-plugin</artifactId> <version>3.3.0</version> <executions> <execution> <id>generate-sources</id> <phase>generate-sources</phase> <goals> <goal>xsdtojava</goal> </goals> <configuration> <xsdOptions> <xsdOption> <xsdDir>$

Run Two Modules in Different Directories in Java 11

落花浮王杯 提交于 2021-02-08 06:52:36
问题 Directories Structure : After compilation if i store two module in two different directories[out, out2]. When I'm try to combine two module out and out2 with : operator in java command. java --upgrade-module-path out:out2 -m myModuleA/myPackA.ClassA when i try this command throw the error. Error occurred during initialization of boot layer java.nio.file.InvalidPathException: Illegal char <:> at index 3: out:out2 Please Suggest me Where is my Mistake.I'm newbie in (Java Modules). 回答1: As per

Enable SSL certificate revocation checking in OpenJDK 11

≯℡__Kan透↙ 提交于 2021-02-08 02:37:51
问题 Is there some quick "declarative" way in Java 11, instead of a tedious manual implementation, to enable checking if a certificate is revoked? I tried to use properties from this answer: Check X509 certificate revocation status in Spring-Security before authenticating with this dummy revoked certificate: https://revoked.badssl.com but the code always accepts the certificate. Am I doing something wrong or these properties are no more actual for Java 11? If so, do we have any alternatives? Below

Error: Hash of java.xml (…) differs to expected hash (…) recorded in java.base

对着背影说爱祢 提交于 2021-02-07 18:42:46
问题 Creating simple javafx 11 "hello world" application. Getting error while creating custom JRE. user@user:~/Desktop/javafx/hellofx$ ./run.sh Error: Hash of java.xml (c043b4c28b897656e2a4d36c92ba2f5d52134bce79643236dd36295e14178be7) differs to expected hash (4e7db7fc941d9f316c4aafe02717b5809ee722be8433d283050365e7fd49331f) recorded in java.base Error Code: $JAVA_HOME/bin/jlink --module-path $PATH_TO_FX_MODS:mods --add-modules hellofx --output hellofx #error OS: ubuntu 19.10 $java --version

Error: Hash of java.xml (…) differs to expected hash (…) recorded in java.base

↘锁芯ラ 提交于 2021-02-07 18:42:35
问题 Creating simple javafx 11 "hello world" application. Getting error while creating custom JRE. user@user:~/Desktop/javafx/hellofx$ ./run.sh Error: Hash of java.xml (c043b4c28b897656e2a4d36c92ba2f5d52134bce79643236dd36295e14178be7) differs to expected hash (4e7db7fc941d9f316c4aafe02717b5809ee722be8433d283050365e7fd49331f) recorded in java.base Error Code: $JAVA_HOME/bin/jlink --module-path $PATH_TO_FX_MODS:mods --add-modules hellofx --output hellofx #error OS: ubuntu 19.10 $java --version

Java 11 HttpClient not sending basic authentication

喜夏-厌秋 提交于 2021-02-07 05:21:13
问题 I wrote the following HttpClient code, and it did not result in an Authorization header being sent to the server: public static void main(String[] args) { var client = HttpClient.newBuilder() .authenticator(new Authenticator() { @Override protected PasswordAuthentication getPasswordAuthentication() { return new PasswordAuthentication("username", "password".toCharArray()); } }) .version(HttpClient.Version.HTTP_1_1) .build(); var request = HttpRequest.newBuilder() .uri("https://service-that

Java 11 : Execution default-compile of goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile failed.: NullPointerException

放肆的年华 提交于 2021-02-04 19:51:29
问题 I am upgrading my project from java 8 to java 11. I'm able to build and deploy it with java11, spring 5 dependencies but when I am adding module-info.java into my project I am getting below error while build : [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project infrastructure: Execution default-compile of goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile failed.: NullPointerException -> [Help 1] org.apache

The type org.objectweb.asm.ClassVisitor cannot be resolved. It is indirectly referenced from required .class files

删除回忆录丶 提交于 2021-01-29 07:18:39
问题 I am using ASM 7.0 in a short Java 11 project, which convert a class file to a text using the following code: final var charset = StandardCharsets.UTF_8; final ByteArrayOutputStream bos = new ByteArrayOutputStream(); try (var pw = new PrintWriter(bos, false, charset)) { final org.objectweb.asm.ClassVisitor traceClassVisitor = new TraceClassVisitor(null, new org.objectweb.asm.util.Textifier(), new PrintWriter(bos)); new ClassReader(stream.getStream()).accept(traceClassVisitor, ClassReader.SKIP

java module system - why do we need to explicitly specify the default modules in -add-modules

独自空忆成欢 提交于 2021-01-29 07:03:05
问题 Recently I was converting a spring boot(2.1.3 version) dummy project into a spring boot muti module project on java 11. To make it work I have to explicitly add --add-modules=java.instrument as run time vm argument. Please find the related so question here Spring boot multi module project with java 11 throws cannot access class org.springframework.cglib.core.ReflectUtils Then I checked the default modules of my installed jdk using —list-modules and I can see that java.instrument in that. I

How to generate JAVA classes from XSD hierarchy without namespace

旧时模样 提交于 2021-01-29 06:05:27
问题 I have a set of XSD files from a client. I need to generate java classes from those. One of the XSDs imports another without namespace. That fails the mvn generate-sources with an error: src-resolve: Cannot resolve the name 'faultstring' to a(n) 'element declaration' component. org.xml.sax.SAXParseException; systemId: file:/src/main/resources/Common/SOAP_Fault_v4_0_0.xsd I am using openjdk 11 with version 3.3.0 of cxf-xjc-plugin to generate classes. Attached is the project. I have tried to