Book a Demo

Author Topic: Java don't works  (Read 6576 times)

remo

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Java don't works
« on: February 07, 2009, 02:52:52 am »
Hello,
 I've written javacode, but it doesn't work:

Quote
public static void main(String[] args) {
            Repository r = new org.sparx.Repository();
            if (r.OpenFile("c:\\Example.EAP")==true) {

                 //here is the action
                  r.CloseFile();
            } else {
                  System.out.println("EA-Project not found");
            }
Open the file works, but I can't get anything in there. Anytime I get a nullpointerexception. For example when I use the following things:
                  Collection<org.sparx.Package> c = r.GetModels();
                  org.sparx.Package pack = c.GetAt((short)0);
r.GetModels().GetCount(); is not working, everything is null...I'm completly frustratet.

In VBA it works in a simple Excel-Macro...

alext

  • EA User
  • **
  • Posts: 28
  • Karma: +0/-0
    • View Profile
Re: Java don't works
« Reply #1 on: February 07, 2009, 02:58:06 am »
I have had the same problem...
1) make sure you don't have any EA processes running for you first run.
2) make sure you close the repository correctly

 repository.CloseAddins();
 repository.CloseFile();
 repository.Exit() //fails sometimes
 repository = null;


You can also call GC after this.

remo

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Java don't works
« Reply #2 on: February 07, 2009, 04:02:25 am »
that dont't works.  :( :'(
« Last Edit: February 07, 2009, 04:02:41 am by remo »

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Java don't works
« Reply #3 on: February 09, 2009, 10:28:01 am »
What build of EA are you using?

If you're not using the latest 7.1 (or the 7.5 beta) try upgrading to that build.  I am aware of issues where the Java API didn't work on some builds.

remo

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Java don't works
« Reply #4 on: February 09, 2009, 08:04:27 pm »
I use version 7.1.827

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Java don't works
« Reply #5 on: February 10, 2009, 08:35:46 am »
Then upgrading to the latest build should help.

remo

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Java don't works
« Reply #6 on: February 10, 2009, 08:30:01 pm »
I've tried with 7.1.834  .... no success.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Java don't works
« Reply #7 on: February 11, 2009, 08:24:03 am »
Did you upgrade using the installer of the patch file?

If it was the patch file, did it include the SSJavaCOM.dll file?

What are your SSJavaCOM.dll and eaapi.jar files dated?
« Last Edit: February 11, 2009, 08:24:22 am by simonm »

Lars H

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
    • View Profile
Re: Java don't works
« Reply #8 on: February 12, 2009, 10:37:27 pm »
Have you checked if there are any EA processes still running? If you don't shut down properly, a process will keep running and cause problems for later processes. Kill all EA processes in Windows task manager or restart Windows.

remo

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Java don't works
« Reply #9 on: February 13, 2009, 11:27:21 pm »
@simon: the installation process uninstalled the old version and installed a complete new one. File date ist 05. august 2008.

@lars: no other instance running.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Java don't works
« Reply #10 on: February 16, 2009, 08:27:33 am »
The date of SSJavaCOM.dll should be 13 October 2008.

I've got your support request, I'll send you the 834 files via email.

remo

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Java don't works
« Reply #11 on: February 17, 2009, 01:44:45 am »
thx simon. a restart helps also. :-)