Book a Demo

Author Topic: Problem accessing model via Java  (Read 3719 times)

SwissSteve

  • EA User
  • **
  • Posts: 42
  • Karma: +0/-0
    • View Profile
Problem accessing model via Java
« on: May 21, 2008, 06:44:12 pm »
I have written a simple app to export my EA Model to HTML and it works fine when running under .NET.    Unfortunatly my customer requires this simple code in Java so I recompiled it in Java but it
does not work.

The call to OpenFile returns true but the call to GetProjectInterface()
returns NULL.  

I tried to follow the instructions on using the lib i.e. I placed the SSJavaCOM.dll in the Windows, system32 directory and then added the eeapi jar to the Eclipse project.

Any suggestions would be apprecated.

Code: [Select]
repository = new org.sparx.Repository();
boolean status = repository.OpenFile(<eap file location>);

project = repository.GetProjectInterface();
project.RunHTMLReport("", "c:\\test", "PNG", "default", "htm");

SwissSteve

  • EA User
  • **
  • Posts: 42
  • Karma: +0/-0
    • View Profile
Re: Problem accessing model via Java
« Reply #1 on: May 21, 2008, 07:17:20 pm »
I wondered if I should first register the DLL so tried with

regsvr32 SSHavaCOM.dll

But go the error entry point DLLRegisterService not found.

 Anyone out the using Java to access EA?

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Problem accessing model via Java
« Reply #2 on: May 21, 2008, 08:31:27 pm »
Perhaps you should be using Regasm instead.

I'm not sure, so check the help files.
No, you can't have it!

SwissSteve

  • EA User
  • **
  • Posts: 42
  • Karma: +0/-0
    • View Profile
Re: Problem accessing model via Java
« Reply #3 on: May 21, 2008, 10:20:36 pm »
I did already try this opion but it complains that it is not a valid .NET assembly.

Is there a more complete help page on using Java with EA?

TIA

SwissSteve

  • EA User
  • **
  • Posts: 42
  • Karma: +0/-0
    • View Profile
Re: Problem accessing model via Java
« Reply #4 on: May 21, 2008, 10:33:30 pm »
I wonder if we have the same issue as is posted here

http://www.sparxsystems.com/cgi-bin/yabb/YaBB.cgi?num=1207116302/2#2

We are also using version 828. Will upgrade version and post the results.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Problem accessing model via Java
« Reply #5 on: May 22, 2008, 08:39:16 am »
If you are using build 828 then that will be causing the NULL result.  Upgrading to 829 should fix the problem.

SwissSteve

  • EA User
  • **
  • Posts: 42
  • Karma: +0/-0
    • View Profile
Re: Problem accessing model via Java
« Reply #6 on: May 22, 2008, 08:56:35 pm »
Downloaded the 829 files and all works fine, thanks to all for the advice