Ich versuche, einen Rest Web-Service mit Java und ich verwende OpenShift Service zum Testen des Servers.Fehler während der Bereitstellung auf OpenShift
in OpenShift Ich wähle Tomcat 7 (JBoss EWS 2.0) als Webserver.
wenn ich Tring meine Dateien in dem Server zu schieben, in Maven Zeit bauen, geben sie mir diese Fehler:
remote: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project operatorrail: Compilation failure: Compilation failure:
remote: [ERROR] /var/lib/openshift/583387240c1e66c33cXXXXX/app-root/runtime/repo/src/main/java/RestApi/Tools/tools.java:[5,16] error: cannot find symbol
remote: [ERROR] package java.util
remote: [ERROR] /var/lib/openshift/583387240c1e66c33cXXXXX/app-root/runtime/repo/src/main/java/RestApi/Tools/tools.java:[35,25] error: cannot find symbol
remote: [ERROR] -> [Help 1]
remote: [ERROR]
remote: [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
remote: [ERROR] Re-run Maven using the -X switch to enable full debug logging.
remote: [ERROR]
remote: [ERROR] For more information about the errors and possible solutions, please read the following articles:
remote: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
remote: An error occurred executing 'gear postreceive' (exit code: 1)
remote: Error message: CLIENT_ERROR: Failed to execute: 'control build' for /var/lib/openshift/583387240c1e66c33cXXXXXX/jbossews
remote:
remote: For more details about the problem, try running the command again with the '--trace' option.
To ssh://XXXXXX-seyedaliroshan.rhcloud.com/~/git/restoprator.git/
2233024..a2c2911 master -> master
Es scheint, wie die Fehler über meine tools.java Datei sind.
so hier ist mein tools.java Dateicodes:
package RestApi.Tools;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Base64;
/**
* @file tools.java
* @brief this file contains some hasher like MD5.
*
* @author Seyed Ali Roshan
*/
public class tools {
public String md5(String text) throws NoSuchAlgorithmException {
MessageDigest md = MessageDigest.getInstance("MD5");
md.update(text.getBytes());
byte byteData[] = md.digest();
StringBuilder hexString = new StringBuilder();
for (int i=0;i<byteData.length;i++) {
String hex=Integer.toHexString(0xff & byteData[i]);
if(hex.length()==1) hexString.append('0');
hexString.append(hex);
}
return hexString.toString();
}
public String[] conventToUserPass(String text) {
String patternText = "(?i)Basic ";
String hashedString = text.replaceFirst(patternText, "");
byte[] unhased = Base64.getDecoder().decode(text);
String finalText = new String(unhased);
return finalText.split(":");
}
}
Ich frage mich, denn wenn ich Befehl mvn compile
in meinem PC kein Fehler ist und das Projekt kompiliert vollständig (ohne Fehler).
in Fehler gibt es einen Link ->https://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException was ich nicht verstanden habe, welchen Punkt es versucht zu sagen.
Übrigens verwende ich Netbeans als IDE und es erkennt keinen Fehler in meinem Code.
bitte helfen Sie mir.
Möglicherweise verursacht durch * java.util.Base64 * nur Java 8. Versuchen Sie herauszufinden, ob Ihre OpenShift-Instanz diese Sprachstufe unterstützt. – Tome