getting NoSuchMethod error while executing the code.

Asked by Shivam on 2019-03-27

downloaded sikulixapi.jar 1.1.4 and build path confiured in eclipse. Please find the code.

Screen scr = new Screen();
   Pattern apps = new Pattern("C:\\Users\\xyz\\Desktop\\Screenshot\\AppsHomePage.PNG");
   scr.click(apps);
Getting below Error :

Exception in thread "main" java.lang.NoSuchMethodError: com.sun.jna.platform.win32.Psapi$MODULEINFO.createFieldsOrder([Ljava/lang/String;)Ljava/util/List;
 at com.sun.jna.platform.win32.Psapi$MODULEINFO.<clinit>(Psapi.java:269)
 at java.lang.Class.forName0(Native Method)
 at java.lang.Class.forName(Unknown Source)
 at com.sun.proxy.$Proxy4.<clinit>(Unknown Source)
 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
 at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
 at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
 at java.lang.reflect.Constructor.newInstance(Unknown Source)
 at java.lang.reflect.Proxy.newProxyInstance(Unknown Source)
 at com.sun.jna.Native.loadLibrary(Native.java:371)
 at com.sun.jna.platform.win32.Psapi.<clinit>(Psapi.java:47)
 at org.sikuli.natives.WinUtil.<clinit>(WinUtil.java:40)
 at org.sikuli.script.RunTime.addToWindowsSystemPath(RunTime.java:1024)
 at org.sikuli.script.RunTime.libsExport(RunTime.java:967)
 at org.sikuli.script.RunTime.libsLoad(RunTime.java:792)
 at org.sikuli.script.RunTime.loadLibrary(RunTime.java:996)
 at org.sikuli.script.Finder2.<clinit>(Finder2.java:35)
 at org.sikuli.script.Pattern.<init>(Pattern.java:123)
 at com.cisco.solutions.quicksilver.em7.scripts.SilkuliCitrixCode.main(SilkuliCitrixCode.java:61)

Question information

Language:
English Edit question
Status:
Answered
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Last query:
2019-03-27
Last reply:
2019-04-01
RaiMan (raimund-hocke) said : #1

does not look like a standard Windows environment.

Shivam (shivaver) said : #2

I have windows 64. and i have included JNA-5.2.0 jar.
but still the error is same.

Can you please elaborate what i can do for the standard windows environment.

Shivam (shivaver) said : #3

Now i just changed the jar to sikulixsetup-1.1.3, i am getting below error.
Shall i assume i progressed?
I am automating Citrix which is not happening through selenium xpath's, so thought of using sikuli.

Starting ChromeDriver 2.36.540470 (e522d04694c7ebea4ba8821272dbef4f9b818c91) on port 55508
Only local connections are allowed.
log4j:WARN No appenders could be found for logger (org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager).
log4j:WARN Please initialize the log4j system properly.
*** classpath dump
  0: /C:/Users/shivaver/workspace/EM7TestFW/bin/
  1: /C:/Users/shivaver/workspace/EM7TestFW/lib/activation-1.1.jar
  2: /C:/Users/shivaver/workspace/EM7TestFW/lib/adapter-api.jar
  3: /C:/Users/shivaver/workspace/EM7TestFW/lib/base64coder.jar
  4: /C:/Users/shivaver/workspace/EM7TestFW/lib/gson-2.3.1.jar
  5: /C:/Users/shivaver/workspace/EM7TestFW/lib/hamcrest-core-1.1.jar
  6: /C:/Users/shivaver/workspace/EM7TestFW/lib/javax.mail_1.4.jar
  7: /C:/Users/shivaver/workspace/EM7TestFW/lib/jersey-client-1.11.jar
  8: /C:/Users/shivaver/workspace/EM7TestFW/lib/jersey-core-1.11.jar
  9: /C:/Users/shivaver/workspace/EM7TestFW/lib/jersey-json-1.11.jar
 10: /C:/Users/shivaver/workspace/EM7TestFW/lib/jersey-multipart-1.8.jar
 11: /C:/Users/shivaver/workspace/EM7TestFW/lib/json-20070829.jar
 12: /C:/Users/shivaver/workspace/EM7TestFW/lib/junit-4.1.jar
 13: /C:/Users/shivaver/workspace/EM7TestFW/lib/log4j-1.2.15.jar
 14: /C:/Users/shivaver/workspace/EM7TestFW/lib/ojdbc14.jar
 15: /C:/Users/shivaver/workspace/EM7TestFW/lib/opencsv-1.7.jar
 16: /C:/Users/shivaver/workspace/EM7TestFW/lib/xstream-1.4.2.jar
 17: /C:/Users/shivaver/workspace/EM7TestFW/lib/dom4j-1.6.1.jar
 18: /C:/Users/shivaver/workspace/EM7TestFW/lib/oss-core-api.jar
 19: /C:/Users/shivaver/workspace/EM7TestFW/lib/oss-adapter-util.jar
 20: /C:/Users/shivaver/workspace/EM7TestFW/lib/oss-l3-billing-adapter.jar
 21: /C:/Users/shivaver/workspace/EM7TestFW/lib/poi-3.10.1.jar
 22: /C:/Users/shivaver/workspace/EM7TestFW/lib/poi-ooxml-3.5-FINAL.jar
 23: /C:/Users/shivaver/workspace/EM7TestFW/lib/selenium-server-standalone-2.41.0.jar
 24: /C:/Users/shivaver/workspace/EM7TestFW/lib/testng.jar
 25: /C:/Users/shivaver/workspace/EM7TestFW/lib/xmlpull-1.1.3.1.jar
 26: /C:/Users/shivaver/workspace/EM7TestFW/lib/xpp3_min-1.1.4c.jar
 27: /C:/Users/shivaver/workspace/EM7TestFW/lib/classes12.jar
 28: /C:/Users/shivaver/workspace/EM7TestFW/lib/snmp4j-2.0.3.jar
 29: /C:/Users/shivaver/workspace/EM7TestFW/lib/syslog4j-0.9.46.jar
 30: /C:/Users/shivaver/workspace/EM7TestFW/lib/jackson-all-1.9.0.jar
 31: /C:/Users/shivaver/workspace/EM7TestFW/lib/extentreports-java-2.40.2.jar
 32: /C:/Users/shivaver/workspace/EM7TestFW/lib/extentreports-java-2.41.1.jar
 33: /C:/Users/shivaver/workspace/EM7TestFW/lib/freemarker-2.3.23.jar
 34: /C:/Users/shivaver/workspace/EM7TestFW/lib/jackson-core-asl-1.9.13.jar
 35: /C:/Users/shivaver/workspace/EM7TestFW/lib/jackson-mapper-asl-1.0.0.jar
 36: /C:/Users/shivaver/workspace/EM7TestFW/lib/jsch-0.1.53.jar
 37: /C:/Users/shivaver/workspace/EM7TestFW/lib/jsoup-1.8.3.jar
 38: /C:/Users/shivaver/workspace/EM7TestFW/lib/MonteScreenRecorder.jar
 39: /C:/Users/shivaver/workspace/EM7TestFW/lib/poi-3.10.1-20140818.jar
 40: /C:/Users/shivaver/workspace/EM7TestFW/lib/poi-ooxml-3.10.1-20140818.jar
 41: /C:/Users/shivaver/workspace/EM7TestFW/lib/poi-ooxml-schemas-3.10.1-20140818.jar
 42: /C:/Users/shivaver/workspace/EM7TestFW/lib/selenium-server-standalone-2.47.1.jar
 43: /C:/Users/shivaver/workspace/EM7TestFW/lib/sqlite-jdbc-3.8.11.1.jar
 44: /C:/Users/shivaver/workspace/EM7TestFW/lib/syslog4j-0.9.51.jar
 45: /C:/Users/shivaver/workspace/EM7TestFW/lib/testng-6.9.9.jar
 46: /C:/Users/shivaver/workspace/EM7TestFW/lib/xml-apis-1.4.01.jar
 47: /C:/Users/shivaver/workspace/EM7TestFW/lib/xmlbeans-2.6.0.jar
 48: /C:/Users/shivaver/workspace/SplunkAutomation/lib/jxl.jar
 49: /C:/Users/shivaver/workspace/SplunkAutomation/lib/pdfbox-1.8.2.jar
 50: /C:/Users/shivaver/Downloads/jna-5.2.0.jar
 51: /C:/Users/shivaver/Downloads/sikulixsetup-1.1.3.jar
*** classpath dump end
[error] RunTimeINIT: *** terminating: libs to export not found on above classpath: /sikulixlibs/windows/libs64

RaiMan (raimund-hocke) said : #4

--- 51: /C:/Users/shivaver/Downloads/sikulixsetup-1.1.3.jar

with 1.1.3 you have to run a setup, to get a valid sikulixapi.jar, that has to be on classpath.

IMHO though, you should try to get 1.1.4 running (without jna on your own classpath, it is bundled as version 4.5.2 and works on Win 10 64).

Can you help with this problem?

Provide an answer of your own, or ask Shivam for more information if necessary.

To post a message you must log in.