Java - AJNI error

 
Vista:
sin imagen de perfil
Val: 14
Ha disminuido su posición en 70 puestos en Java (en relación al último mes)
Gráfica de Java

AJNI error

Publicado por AFB (10 intervenciones) el 20/04/2020 21:19:10
error-ajNi
java-exception-img-02

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*Que es lo que puede estar fallando?
el código es:
*/
package SourcePkg;
 
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.ie.InternetExplorerDriver;
 
public class IE_CLS {
 
	public static void main(String args[]) throws InterruptedException {
 
		System.setProperty("webdriver.ie.driver", "C:\\Selenium IE driver 64bit\\IEDriverServer.exe");
 
		InternetExplorerDriver driver = new InternetExplorerDriver();
 
		driver.get("http://www.wikipedia.org");
 
	//	driver.manage().maximize();
 
//		System.out.println(driver.getTitle());
 
		WebElement link;
		link = driver.findElement(By.linkText("English"));
		link.click();
		Thread.sleep(5000);
		WebElement searchBox;
		searchBox= driver.findElement(By.id("search input"));
		searchBox.sendKeys("Software");
		searchBox.submit();
		Thread.sleep(5000);
		driver.quit();
	}
}
/* este ejemplo está hecho con Eclipse, la vm de java funciona con Neatbeans y Firefox pero al entrar en la configuracion de Java, por defecto está seteado el Firefox (tildado en el checkbox) y grisado tildado  en Internet explorer*/
/*Espero su respuesta, gracias*/
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
sin imagen de perfil
Val: 14
Ha disminuido su posición en 70 puestos en Java (en relación al último mes)
Gráfica de Java

AJNI error

Publicado por AFB (10 intervenciones) el 21/04/2020 21:14:22
/*Error arrojado luego de verificar que VM de Java funciona correctamete y que el driver de Selenium IDE para IE están instalados y su path en el script es el correcto.*/
--------------------------------------
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
String cannot be resolved to a type
System cannot be resolved
The method get(String) from the type RemoteWebDriver refers to the missing type String
The method linkText(String) from the type By refers to the missing type String
Thread cannot be resolved
The method id(String) from the type By refers to the missing type String
The type java.lang.CharSequence cannot be resolved. It is indirectly referenced from required .class files
The method sendKeys(CharSequence...) from the type WebElement refers to the missing type CharSequence
Thread cannot be resolved
___________________________
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
sin imagen de perfil
Val: 14
Ha disminuido su posición en 70 puestos en Java (en relación al último mes)
Gráfica de Java

AJNI error

Publicado por AFB (10 intervenciones) el 21/04/2020 22:06:12
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/* este es el código depurado pero igual genera errores*/
 
package IE_Brw_pkg;
 
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.ie.InternetExplorerDriver;
//import java.io.IOException;
 
import com.mysql.cj.x.protobuf.MysqlxDatatypes.Scalar.String;
 
public class IE_CLS {
 
 
public static void main(String args[]) try {
	{
	//public static void main(String[] args)  {
	//throws IOException
 
	System.setProperty("webdriver.ie.driver", "C:\\Selenium IE driver 64bit\\IEDriverServer.exe");
 
			InternetExplorerDriver driver = new InternetExplorerDriver();
 
			driver.get("http://www.wikipedia.org");
 
		//	driver.manage().maximize();
		//		System.out.println(driver.getTitle());
 
			WebElement link;
			try {
				link = driver.findElement(By.linkText("English"));
			} catch (Exception e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			link.click();
			Thread.sleep(5000);
			WebElement searchBox;
			searchBox= driver.findElement(By.id("search input"));
			searchBox.sendKeys("Software");
			searchBox.submit();
			Thread.sleep(5000);
			driver.quit();
		}
} catch (InterruptedException e) {
	// TODO Auto-generated catch block
	e.printStackTrace();
}
}
 
/* errores a continuación
Exception in thread "main" java.lang.NoClassDefFoundError: com/google/protobuf/MessageOrBuilder
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(Unknown Source)
	at java.security.SecureClassLoader.defineClass(Unknown Source)
	at java.net.URLClassLoader.defineClass(Unknown Source)
	at java.net.URLClassLoader.access$100(Unknown Source)
	at java.net.URLClassLoader$1.run(Unknown Source)
	at java.net.URLClassLoader$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(Unknown Source)
	at java.security.SecureClassLoader.defineClass(Unknown Source)
	at java.net.URLClassLoader.defineClass(Unknown Source)
	at java.net.URLClassLoader.access$100(Unknown Source)
	at java.net.URLClassLoader$1.run(Unknown Source)
	at java.net.URLClassLoader$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at java.lang.Class.getDeclaredMethods0(Native Method)
	at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
	at java.lang.Class.privateGetMethodRecursive(Unknown Source)
	at java.lang.Class.getMethod0(Unknown Source)
	at java.lang.Class.getMethod(Unknown Source)
	at sun.launcher.LauncherHelper.validateMainClass(Unknown Source)
	at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
Caused by: java.lang.ClassNotFoundException: com.google.protobuf.MessageOrBuilder
	at java.net.URLClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	... 31 more
*/
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar