Author Topic: Connecting to Interface errors in Java Code Sample  (Read 766 times)

0xCAFEBABE

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Connecting to Interface errors in Java Code Sample
« on: November 04, 2014, 09:31:25 pm »
Hello. I followed the steps in
http://www.sparxsystems.com/enterprise_architect_user_guide/9.2/automation/setup.html
to make C:\Program Files (x86)\Sparx Systems\EA\Code Samples\Java_Sample run in Eclipse; in other words, I put the .dll into system32 and eaapi.jar into the classpath-system-variable; I additionally added eaapi.jar to the built path in eclipse (it was already there from importing project but not loaded until I selected the file again in the built path).

I can start the program, but when selecting a write-permitted, empty (a clean project in EA without anything added into it) .eap-file and one of the "Select Example"-options in the running GUI  program, it gives me the error "Unable to communicate with EA PLease ensure that the .dll is in java.library.path". When I click it a second time it gives me "java.lang.NoClassDefFoundError: Could not initialize class org.sparx.Repository".

What might be the problem?
« Last Edit: November 04, 2014, 09:32:40 pm by 0xCAFEBABE »

0xCAFEBABE

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Connecting to Interface errors in Java Code Sa
« Reply #1 on: November 05, 2014, 01:28:53 am »
Okay, for everyone else having this problem: the problem was that either the SSJavaCOM.dll or eaapi.jar is 32 bit only; meaning you have to run it from 32 bit Eclipse with 32 bit JDK and JRE (you better uninstall the 64 bit one first; changing the built path seems to leave traces of the  64 bit JRE)
« Last Edit: November 05, 2014, 01:30:22 am by 0xCAFEBABE »

qwerty

  • EA Guru
  • *****
  • Posts: 8960
  • Karma: +136/-123
  • I'm no guru at all
    • View Profile
Re: Connecting to Interface errors in Java Code Sa
« Reply #2 on: November 05, 2014, 02:51:30 am »
Now as you say this: Geert has indicated the 64/32 bit issue more than once  ::)

q.