I have a program that executes a command jpub like this
executeCommand("jpub -u "+args[0]+"/"+args[1]+" -package="+args[3]+" -codegen=iso -url="+args[2]+" -plsqlpackage="+resultSetMain.getString(1)+" -dir "+args[4]+" -case=lower -plsqlfile="+resultSetMain.getString(1)+"_wrapper.sql,"+resultSetMain.getString(1)+"_wrapper_drop.sql -s "+resultSetMain.getString(1)+":"+resultSetMain.getString(1)+"_OUT -compile=false -omit_schema_names");
when execCommand is simply a private function that gets a runtime instance and executes the command :
Process pr = rt.exec(command);
I'm using maven to build my project.
when I run my program with eclipse Juno everything is fine, but when I want to migrate to the latest version of eclipse when I run mvn clean install i had this error
Exception in thread "main" java.lang.NoClassDefFoundError: sun/io/CharToByteConverter
I have tried to build a jar converter that contains this class and to add it to my project but this is not working
<repositories>
<repository>
<id>my-local-repo</id>
<url>file://${basedir}/lib</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>ma.me</groupId>
<artifactId>converter</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
How can I solve this problem?
After reading the documentation of the JPublisher I have found a section that speaks about how to specify JVM through which JPublisher is invoked doc.
We can use the -vm=value parameter where the value is the location of JDK6or 7, so you can run the command like this:
executeCommand("jpub -u "+args[0]+"/"+args[1]+" -package="+args[3]+" -codegen=iso -url="+args[2]+" -vm="+args[8]+" -plsqlpackage="+resultSetMain.getString(1)+" -dir "+args[4]+" -case=lower -plsqlfile="+resultSetMain.getString(1)+"_wrapper.sql,"+resultSetMain.getString(1)+"_wrapper_drop.sql -s "+resultSetMain.getString(1)+":"+resultSetMain.getString(1)+"_OUT -compile=false -omit_schema_names");
In our exemple args[8] contains the path of executable java 6 for exemple : D:\Java\jdk6\bin\java
Related
I've been trying to get a hello world project working for a Picocli/GraalVM project. I'm on an M1 Mac running Montery, Java 11, and GraalVM 22.3. I followed he Picocli documentation, but get "unmatched argument" errors when trying to run the native image.
The program works fine by calling:
java -cp "picocli-4.7.0.jar:FocusStackCLI.jar" FSCLI hello
My Java code:
import picocli.CommandLine;
import picocli.CommandLine.Command;
import picocli.CommandLine.Option;
import picocli.CommandLine.Parameters;
#Command(name = "fscli", version = "fscli 1.0", mixinStandardHelpOptions = true)
public class FSCLI implements Runnable{
#Parameters(paramLabel = "directory", description = "Directory containing images to focus stack")
private String directory;
#Override
public void run(){
System.out.println(directory);
}
public static void main(String[] args) {
int exitCode = new CommandLine(new FSCLI()).execute(args);
System.exit(exitCode);
}
}
My pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<artifactId>FocusStackCLI</artifactId>
<version>1.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<!-- annotationProcessorPaths requires maven-compiler-plugin version 3.5 or higher -->
<version>3.8.1</version>
<configuration>
<annotationProcessorPaths>
<path>
<groupId>info.picocli</groupId>
<artifactId>picocli-codegen</artifactId>
<version>4.7.0</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>info.picocli</groupId>
<artifactId>picocli</artifactId>
<version>4.7.0</version>
</dependency>
</dependencies>
<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
</properties>
</project>
Created the native image by calling: Note - It won't let me staticly compile on Mac.
native-image -cp picocli-4.6.3.jar -jar FocusStackCLI.jar
Now when I try to run either of these, with or without arguments,
./FocuStackerCLI hello
./FocuStackerCLI FSCLI hello
I get this error:
Unmatched argument at index 0: 'hello'
Usage: picocli.AutoComplete [-hV] [#<filename>...]
Generates a bash completion script for the specified command class.
[#<filename>...] One or more argument files containing options.
-h, --help Show this help message and exit.
-V, --version Print version information and exit.
Exit Codes:
0 Successful program execution
1 Usage error: user input for the command was incorrect, e.g., the wrong
number of arguments, a bad flag, a bad syntax in a parameter, etc.
2 The specified command script exists (Specify `--force` to overwrite).
3 The specified completion script exists (Specify `--force` to overwrite).
4 An exception occurred while generating the completion script.
System Properties:
Set the following system properties to control the exit code of this program:
* `"picocli.autocomplete.systemExitOnSuccess"`
call `System.exit(0)` when execution completes normally.
* `"picocli.autocomplete.systemExitOnError"`
call `System.exit(ERROR_CODE)` when an error occurs.
If these system properties are not defined or have value "false", this program
completes without terminating the JVM.
Example
-------
java -cp "myapp.jar;picocli-4.6.3.jar" \
picocli.AutoComplete my.pkg.MyClass
Am I not running this right or configuring GraalVM incorrectly?
I suspect you need to make the native image generator know that your FLCL class is the main application class. Without this information the native image generator will search the manifest files in all available jars and find that the picocli.Autocompletion class is a main class in the picocli jar. If your jar doesn’t declare a main class in the manifest file you can specify it on the command line. I forgot what option that was, check the help for the native image generator tool.
As part of my JEE routine i run a JUnit test using Payara embedded and Maven.
But the process is not optimal.
I need to change the port from default 8080 to 8888 for instance.
Also I receive the following error when test is run:
Caused by: javax.naming.NamingException: Lookup failed for 'resource/frontPageDirectory' in SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.namin
I can probably use the following command line flag
-Ddeployment.resource.validation=false
but I don't know how to apply it in my maven file.
My maven file is simply:
<dependency>
<groupId>fish.payara.extras</groupId>
<artifactId>payara-embedded-all</artifactId>
<version>5.192</version>
<scope>test</scope>
</dependency>
So my question is how do I add these parameters to my maven pom file?
Kim
problem: My Java code cannot see BouncyCastle libraries.
situation: I have a component that needs to use BouncyCastle libraries. The other vendor has provided some Java examples on how to use their API and the examples uses BouncyCastle.I have tried using regular Java libraries (java.*) and it's not working. I'm just testing to see if the implementation requires BouncyCastle.
mvn integration with BouncyCastle:
To integrate BouncyCastle into my maven project, I changed core/pom.xml and added these lines
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.10</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk18on</artifactId>
<version>1.71</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk18on</artifactId>
<version>1.71</version>
</dependency>
According to this https://www.bouncycastle.org/latest_releases.html, I need to use jdk18on for Java 8+. I'm on Java11.
observations:
When running an "mvn clean install", mvn fetches the BouncyCastle libraries. (I previously didn't have the bouncycastle folder prior to running the nvm command. Also mvn does not produce any compilation errors)
my-work-desktop-mac in repository/org/bouncycastle
➜ pwd
/Users/myuser/.m2/repository/org/bouncycastle
my-work-desktop-mac in repository/org/bouncycastle
➜ ls -al
0755 - myuser 18 Apr 09:59 bcpkix-jdk18on
0755 - myuser 18 Apr 09:59 bcprov-jdk18on
0755 - myuser 18 Apr 09:59 bcutil-jdk18on
my-work-desktop-mac in repository/org/bouncycastle
➜ find . -iname "*.jar" -type f
./bcprov-jdk18on/1.71/bcprov-jdk18on-1.71.jar
./bcutil-jdk18on/1.71/bcutil-jdk18on-1.71.jar
./bcpkix-jdk18on/1.71/bcpkix-jdk18on-1.71.jar
When I try to debug this code, my execution never stops at the 2nd or 3rd breakpoint after "stepping over" on the 1st breakpoint.
try {
String publicKeyAsString = "my-public-key-here";
PEMParser pemParser = new PEMParser(new StringReader(publicKeyAsString)); //1st breakpoint
String test=""; //2nd breakpoint
} catch (Exception e) {
System.out.println("error in here"); //3rd breakpoint
}
I'm using IntelliJ and IntelliJ often highlights possible issues/problems in my code. Right now, it's highlighting all the import statements I have for "org.bouncycastle" and "PEMParser" line in no2.
If you can see the lib in maven repo locally then issue with IntelliJ, try to clean cache and restart the IntelliJ.
Your question is neither clear nor specific.
BouncyCastle must be working if your code is compiling. The PEMParser class belongs to the org.bouncycastle.openssl package which simply isn't available if BouncyCastle isn't available. So, if BouncyCastle wasn't available, your code wouldn't compile.
Are you having a problem with IntelliJ or with BouncyCastle?
What issues are being reported by IntelliJ?
Have you configured BouncyCastle as a Security provider?
if (Security.getProvider("BC") == null) {
Security.addProvider(new BouncyCastleProvider());
}
However, it sounds more like you are having an issue with IntelliJ but it's simply not clear.
To avoid any problems (for the moment) with IntelliJ, please use the command line with the mvn command.
What do you mean by "it's not working". This is not clear. What error are you receiving? How is it not working?
Since Spring Boot 2.2.0.RELEASE spring-boot-maven-plugin
mvn spring-boot:run -Drun.profiles=prod
create two java process (see https://github.com/spring-projects/spring-boot/issues/17766). In my case:
14811 ? Sl 1:34 /usr/lib/jvm/java-11-oracle/bin/java -classpath /opt/maven/boot/plexus-classworlds-2.5.2.jar -Dclassworlds.conf=/opt/maven/bin/m2.conf -Dmaven.home=/opt/maven -Dlibrary.jansi.path
=/opt/maven/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/opt/javaops org.codehaus.plexus.classworlds.launcher.Launcher spring-boot:run -Drun.profiles=prod
14841 ? Sl 8:01 /usr/lib/jvm/java-11-oracle/bin/java -Xverify:none -XX:TieredStopAtLevel=1 -cp /opt/javaops/target/classes:/opt/maven_repo/com/google/http-client/google-http-client/1.34.0/google-
http-client-1.34.0.jar:/opt/maven_repo/javax/xml/bind/jaxb-api/2.4.0-b180830.0359/jaxb-api-2.4.0-b180830.0359.jar:/opt/maven_repo/org/springframework/spring-beans/5.2.3.RELEASE/spring-beans-5.2.3.RELEASE.ja
r:/opt/maven_repo/org/apache/tomcat/embed/tomcat-embed-core/9.0.30/tomcat-embed-core-9.0.30.jar:/opt/maven_repo/com/sun/xml/fastinfoset/FastInfoset/1.2.15/FastInfoset-1.2.15.jar:/opt/maven_repo/com/google/h
ttp-client/google-http-client-jackson2/1.34.1/google-http-client-jackson2-1.34.1.jar:/opt/maven_repo/jakarta/persistence/jakarta.persistence-api/2.2.3/jakarta.persistence-api-2.2.3.jar:/opt/maven_repo/com/g
oogle/oauth-client/google-oauth-client/1.30.5/google-oauth-client-1.30.5.jar:/opt/maven_repo/com/google/apis/google-api-services-admin-directory/directory_v1-rev20191003-1.30.8/google-api-services-admin-dir
ectory-directory_v1-rev20191003-1.30.8.jar:/opt/maven_repo/com/google/j2objc/j2objc-annotations/1.3/j2objc-annotations-1.3.jar:/opt/maven_repo/org/springframework/spring-expression/5.2.3.RELEASE/spring-expr
ession-5.2.3.RELEASE.jar:/opt/maven_repo/com/sun/activation/jakarta.activation/1.2.1/jakarta.activation-1.2.1.jar:/opt/maven_repo/org/springframework/boot/spring-boot-starter-security/2.2.3.RELEASE/spring-b
oot-starter-security-2.2.3.RELEASE.jar:/opt/maven_repo/org/springframework/boot/spring-boot-starter-web/2.2.3.RELEASE/spring-boot-starter-web-2.2.3.RELEASE.jar:/opt/maven_repo/org/hibernate/common/hibernate
-commons-annotations/5.1.0.Final/hibernate-commons-annotations-5.1.0.Final.jar:/opt/maven_repo/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar:/opt/maven_repo/javax/annotation/javax.annotatio
n-api/1.3.2/javax.annotation-api-1.3.2.jar:/opt/maven_repo/org/glassfish/jaxb/jaxb-runtime/2.4.0-b180830.0438/jaxb-runtime-2.4.0-b180830.0438.jar:/opt/maven_repo/org/projectlombok/lombok/1.18.12/lombok-1.18
.12.jar:/opt/maven_repo/org/springframework/boot/spring-boot-autoconfigure/2.2.3.RELEASE/spring-boot-autoconfigure-2.2.3.RELEASE.jar:/opt/maven_repo/org/springframework/spring-aop/5.2.3.RELEASE/spring-aop-5
.2.3.RELEASE.jar:/opt/maven_repo/org/springframework/spring-web/5.2.3.RELEASE/spring-web-5.2.3.RELEASE.jar:/opt/maven_repo/javax/activation/javax.activation-api/1.2.0/javax.activation-api-1.2.0.jar:/opt/mav
en_repo/io/grpc/grpc-context/1.22.1/grpc-context-1.22.1.jar:/opt/maven_repo/org/jvnet/staxex/stax-ex/1.8/stax-ex-1.8.jar:/opt/maven_repo/org/hibernate/hibernate-core/5.4.10.Final/hibernate-core-5.4.10.Final
.jar:/opt/maven_repo/org/jboss/jandex/2.1.1.Final/jandex-2.1.1.Final.jar:/opt/maven_repo/org/apache/httpcomponents/httpcore/4.4.13/httpcore-4.4.13.jar:/opt/maven_repo/org/springframework/boot/spring-boot/2.
2.3.RELEASE/spring-boot-2.2.3.RELEASE.jar:/opt/maven_repo/org/thymeleaf/extras/thymeleaf-extras-java8time/3.0.4.RELEASE/thymeleaf-extras-java8time-3.0.4.RELEASE.jar:/opt/maven_repo/org/slf4j/jul-to-slf4j/1.
7.30/jul-to-slf4j-1.7.30.jar:/opt/maven_repo/com/zaxxer/HikariCP/3.4.2/HikariCP-3.4.2.jar:/opt/maven_repo/com/sun/istack/istack-commons-runtime/3.0.7/istack-commons-runtime-3.0.7.jar:/opt/maven_repo/org/spr
ingframework/spring-orm/5.2.3.RELEASE/spring-orm-5.2.3.RELEASE.jar:/opt/maven_repo/org/apache/logging/log4j/log4j-api/2.12.1/log4j-api-2.12.1.jar:/opt/maven_repo/org/springframework/security/spring-security
-config/5.2.1.RELEASE/spring-security-config-5.2.1.RELEASE.jar:/opt/maven_repo/ch/qos/logback/logback-core/1.2.3/logback-core-1.2.3.jar:/opt/maven_repo/org/springframework/boot/spring-boot-starter-logging/2
.2.3.RELEASE/spring-boot-starter-logging-2.2.3.RELEASE.jar:/opt/maven_repo/javax/activation/activation/1.1.1/activation-1.1.1.jar:/opt/maven_repo/org/springframework/spring-core/5.2.3.RELEASE/spring-core-5.
2.3.RELEASE.jar:/opt/maven_repo/org/apache/tomcat/embed/tomcat-embed-websocket/9.0.30/tomcat-embed-websocket-9.0.30.jar:/opt/maven_repo/com/fasterxml/jackson/core/jackson-annotations/2.10.2/jackson-annotati
ons-2.10.2.jar:/opt/maven_repo/org/springframework/security/spring-security-core/5.2.1.RELEASE/spring-security-core-5.2.1.RELEASE.jar:/opt/maven_repo/com/fasterxml/jackson/core/jackson-databind/2.10.2/jacks
on-databind-2.10.2.jar:/opt/maven_repo/com/h2database/h2/1.3.176/h2-1.3.176.jar:/opt/maven_repo/jakarta/validation/jakarta.validation-api/2.0.2/jakarta.validation-api-2.0.2.jar:/opt/maven_repo/org/springfra
mework/boot/spring-boot-starter-aop/2.2.3.RELEASE/spring-boot-starter-aop-2.2.3.RELEASE.jar:/opt/maven_repo/com/fasterxml/jackson/module/jackson-module-parameter-names/2.10.2/jackson-module-parameter-names-
2.10.2.jar:/opt/maven_repo/com/fasterxml/classmate/1.5.1/classmate-1.5.1.jar:/opt/maven_repo/org/springframework/spring-context/5.2.3.RELEASE/spring-context-5.2.3.RELEASE.jar:/opt/maven_repo/org/springframe
work/spring-aspects/5.2.3.RELEASE/spring-aspects-5.2.3.RELEASE.jar:/opt/maven_repo/org/springframework/boot/spring-boot-starter-json/2.2.3.RELEASE/spring-boot-starter-json-2.2.3.RELEASE.jar:/opt/maven_repo/
io/opencensus/opencensus-api/0.24.0/opencensus-api-0.24.0.jar:/opt/maven_repo/org/springframework/boot/spring-boot-starter-validation/2.2.3.RELEASE/spring-boot-starter-validation-2.2.3.RELEASE.jar:/opt/mave
n_repo/com/google/guava/listenablefuture/9999.0-empty-to-avoid-conflict-with-guava/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar:/opt/maven_repo/org/checkerframework/checker-compat-qual/2.5
.5/checker-compat-qual-2.5.5.jar:/opt/maven_repo/com/fasterxml/jackson/datatype/jackson-datatype-jsr310/2.10.2/jackson-datatype-jsr310-2.10.2.jar:/opt/maven_repo/org/springframework/security/spring-security
-web/5.2.1.RELEASE/spring-security-web-5.2.1.RELEASE.jar:/opt/maven_repo/antlr/antlr/2.7.7/antlr-2.7.7.jar:/opt/maven_repo/jakarta/annotation/jakarta.annotation-api/1.3.5/jakarta.annotation-api-1.3.5.jar:/o
pt/maven_repo/com/ibm/icu/icu4j/66.1/icu4j-66.1.jar:/opt/maven_repo/org/springframework/boot/spring-boot-starter-cache/2.2.3.RELEASE/spring-boot-starter-cache-2.2.3.RELEASE.jar:/opt/maven_repo/org/springfra
mework/boot/spring-boot-starter-thymeleaf/2.2.3.RELEASE/spring-boot-starter-thymeleaf-2.2.3.RELEASE.jar:/opt/maven_repo/com/google/guava/failureaccess/1.0.1/failureaccess-1.0.1.jar:/opt/maven_repo/org/yaml/
snakeyaml/1.25/snakeyaml-1.25.jar:/opt/maven_repo/net/bytebuddy/byte-buddy/1.10.6/byte-buddy-1.10.6.jar:/opt/maven_repo/jakarta/activation/jakarta.activation-api/1.2.1/jakarta.activation-api-1.2.1.jar:/opt/
maven_repo/org/slf4j/slf4j-api/1.7.30/slf4j-api-1.7.30.jar:/opt/maven_repo/com/fasterxml/jackson/datatype/jackson-datatype-jdk8/2.10.2/jackson-datatype-jdk8-2.10.2.jar:/opt/maven_repo/org/springframework/sp
ring-webmvc/5.2.3.RELEASE/spring-webmvc-5.2.3.RELEASE.jar:/opt/maven_repo/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar:/opt/maven_repo/org/springframework/spring-context-support/5.2.3.RELEASE/spri
ng-context-support-5.2.3.RELEASE.jar:/opt/maven_repo/androidx/annotation/annotation/1.1.0/annotation-1.1.0.jar:/opt/maven_repo/jakarta/transaction/jakarta.transaction-api/1.3.3/jakarta.transaction-api-1.3.3
.jar:/opt/maven_repo/org/springframework/data/spring-data-jpa/2.2.4.RELEASE/spring-data-jpa-2.2.4.RELEASE.jar:/opt/maven_repo/org/apache/commons/commons-lang3/3.9/commons-lang3-3.9.jar:/opt/maven_repo/org/s
pringframework/boot/spring-boot-starter-data-jpa/2.2.3.RELEASE/spring-boot-starter-data-jpa-2.2.3.RELEASE.jar:/opt/maven_repo/org/jboss/logging/jboss-logging/3.4.1.Final/jboss-logging-3.4.1.Final.jar:/opt/m
aven_repo/org/springframework/boot/spring-boot-configuration-processor/2.2.3.RELEASE/spring-boot-configuration-processor-2.2.3.RELEASE.jar:/opt/maven_repo/org/springframework/boot/spring-boot-starter-tomcat
/2.2.3.RELEASE/spring-boot-starter-tomcat-2.2.3.RELEASE.jar:/opt/maven_repo/com/google/errorprone/error_prone_annotations/2.3.4/error_prone_annotations-2.3.4.jar:/opt/maven_repo/org/springframework/spring-t
x/5.2.3.RELEASE/spring-tx-5.2.3.RELEASE.jar:/opt/maven_repo/org/attoparser/attoparser/2.0.5.RELEASE/attoparser-2.0.5.RELEASE.jar:/opt/maven_repo/com/google/api-client/google-api-client/1.30.8/google-api-cli
ent-1.30.8.jar:/opt/maven_repo/org/thymeleaf/thymeleaf-spring5/3.0.11.RELEASE/thymeleaf-spring5-3.0.11.RELEASE.jar:/opt/maven_repo/com/fasterxml/jackson/core/jackson-core/2.10.2/jackson-core-2.10.2.jar:/opt
/maven_repo/org/hibernate/validator/hibernate-validator/6.0.18.Final/hibernate-validator-6.0.18.Final.jar:/opt/maven_repo/org/apache/httpcomponents/httpclient/4.5.10/httpclient-4.5.10.jar:/opt/maven_repo/co
m/google/guava/guava/28.2-android/guava-28.2-android.jar:/opt/maven_repo/org/springframework/data/spring-data-commons/2.2.4.RELEASE/spring-data-commons-2.2.4.RELEASE.jar:/opt/maven_repo/org/unbescape/unbesc
ape/1.1.6.RELEASE/unbescape-1.1.6.RELEASE.jar:/opt/maven_repo/org/springframework/boot/spring-boot-starter-mail/2.2.3.RELEASE/spring-boot-starter-mail-2.2.3.RELEASE.jar:/opt/maven_repo/org/jsoup/jsoup/1.13.
1/jsoup-1.13.1.jar:/opt/maven_repo/org/aspectj/aspectjweaver/1.9.5/aspectjweaver-1.9.5.jar:/opt/maven_repo/org/springframework/spring-jcl/5.2.3.RELEASE/spring-jcl-5.2.3.RELEASE.jar:/opt/maven_repo/org/glass
fish/jaxb/txw2/2.3.2/txw2-2.3.2.jar:/opt/maven_repo/commons-codec/commons-codec/1.13/commons-codec-1.13.jar:/opt/maven_repo/com/sun/mail/jakarta.mail/1.6.4/jakarta.mail-1.6.4.jar:/opt/maven_repo/org/apache/
logging/log4j/log4j-to-slf4j/2.12.1/log4j-to-slf4j-2.12.1.jar:/opt/maven_repo/org/springframework/boot/spring-boot-starter-jdbc/2.2.3.RELEASE/spring-boot-starter-jdbc-2.2.3.RELEASE.jar:/opt/maven_repo/org/t
hymeleaf/thymeleaf/3.0.11.RELEASE/thymeleaf-3.0.11.RELEASE.jar:/opt/maven_repo/org/apache/tomcat/embed/tomcat-embed-el/9.0.30/tomcat-embed-el-9.0.30.jar:/opt/maven_repo/org/springframework/boot/spring-boot-
starter/2.2.3.RELEASE/spring-boot-starter-2.2.3.RELEASE.jar:/opt/maven_repo/org/javassist/javassist/3.24.0-GA/javassist-3.24.0-GA.jar:/opt/maven_repo/io/opencensus/opencensus-contrib-http-util/0.24.0/opence
nsus-contrib-http-util-0.24.0.jar:/opt/maven_repo/org/springframework/spring-jdbc/5.2.3.RELEASE/spring-jdbc-5.2.3.RELEASE.jar:/opt/maven_repo/org/dom4j/dom4j/2.1.1/dom4j-2.1.1.jar ru.javaops.JavaOPsApplicat
ion
It is too verbose and for Windows could cause of "error CreateProcess error=206, The filename or extension is too long" (see Jhipster 5.7 microservice failed to start on windows with error CreateProcess error=206, The filename or extension is too long).
What is the best way to fix it (exclude return to previous version:)?
Apparently, forking is enabled by default since Spring Boot 2.2.
Disable it again might help.
Add -Dspring-boot.run.fork=false to your maven command or configure it in your pom.xml:
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>false</fork>
</configuration>
</plugin>
I want to run my WebDriver test cases on Chrome on remote Ubuntu server. I have installed latest Chrome on that server but I've been getting these errors,when I used this:
System.setProperty("webdriver.chrome.driver","/usr/bin/chromedriver");
driver = new ChromeDriver();
Error1:
The driver is not executable: /usr/bin/chromedriver to correct I made it executable using sudo 777 chromedriver then I got
Error2:
org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: exited abnormally to fix this I updated selenium jar dependencies to 2.40.0 and since then, I've been getting
Error3:
java.lang.NoClassDefFoundError: org/openqa/selenium/HasInputDevices
Query: Now I know that HasInputDevices has been moved to org/openqa/selenium/Interactions/ then why it is still looking in old directory path org/openqa/selenium/HasInputDevices. How to let it find at its actual directory.
1. I have updated dependencies. 2. I have tried to use mvn install so that it download what is written in pom.xmlbut it's looking in old directory.How to resolve this error, I don't want to downgrade selenium APIs, because then Chrome exits unexpectedly.
Had a similar problem, getting ClassCastException where HasInputDevices was incompatible with FirefoxDriver.
Solved by changing the import to another package:
From
import org.openqa.selenium.Mouse;
To
import org.openqa.selenium.interactions.Mouse;
The exact error stack I encountered was:
java.lang.ClassCastException: org.openqa.selenium.firefox.FirefoxDriver cannot be cast to org.openqa.selenium.interactions.HasInputDevices.
I had same problem and way to resolve was next:
remove all unused dependencies from POM.xml
for example if u use only FirefoxDriver and in POM.xml there are anothers one (Chrome, Common, remote) delete them
I found the solution which worked for me. I was using a dependency which had a transitive dependency on selenium-remote-driver version 2.34.0, remove this dependency and it will work.This dependency was:
<dependency>
<groupId>com.github.detro.ghostdriver</groupId>
<artifactId>phantomjsdriver</artifactId>
<version>1.1.0</version>
</dependency>
OR
<dependency>
<groupId>com.github.detro.ghostdriver</groupId>
<artifactId>phantomjsdriver</artifactId>
<version>1.0.4</version>
</dependency>