Book a Demo

Author Topic: Java API cann't access after installed an addIn.  (Read 5006 times)

wang-bingbing

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Java API cann't access after installed an addIn.
« on: December 17, 2009, 05:36:16 pm »
Hi, everybody.
recently, we made an addIn use VB according to EA's help.
But, unexpected that a tool we made by EA's java API become to cann't accessed.
Through debugging it we found that an Exception thrown by org.sparx.Repository.comConstructor method. So, by now we cann't solved it ourself, anyone have any suggesstions?
Thank you.
« Last Edit: December 17, 2009, 05:36:45 pm by wangbingbing »

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13495
  • Karma: +572/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Java API cann't access after installed an addI
« Reply #1 on: December 17, 2009, 06:39:32 pm »
Wang,

Maybe you could post the part of the code that gets the error.
That could be usefull to find the error.

Geert

wang-bingbing

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Java API cann't access after installed an addI
« Reply #2 on: December 17, 2009, 08:30:30 pm »
Quote
Wang,

Maybe you could post the part of the code that gets the error.
That could be usefull to find the error.

Geert
Ok, i just found this line of my code thrown exception.

   [size=12]this.repository = new Repository();[/size]

 And debug information was
Repository.comConstrutor() line:not available [native method]

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13495
  • Karma: +572/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Java API cann't access after installed an addI
« Reply #3 on: December 17, 2009, 08:50:10 pm »
Wang

If you are writing an add-in you should not create a new Repository object, it will be passed as a parameter in the methods called by EA.

Geert

wang-bingbing

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Java API cann't access after installed an addI
« Reply #4 on: December 18, 2009, 02:17:05 pm »
Quote
Wang

If you are writing an add-in you should not create a new Repository object, it will be passed as a parameter in the methods called by EA.

Geert
hi, Geert.
Maybe you misunderstanded my description, I mean we have made two tools, one is EA' add-in bulit by vb.net, and the other is an external java tool bulit by eaapi.jar.
And the problem is that installed our vb add-in, our java tool cann't accessed the org.sparx.Repository.comConstructor method. Maybe there was a problem with the SSCOM.dll.
« Last Edit: December 18, 2009, 02:18:28 pm by wangbingbing »

Aaron B

  • EA Administrator
  • EA User
  • *****
  • Posts: 941
  • Karma: +18/-0
    • View Profile
Re: Java API cann't access after installed an addI
« Reply #5 on: December 18, 2009, 02:44:15 pm »
Are you referencing the SSJavaCOM.dll and eaapi.jar files provided with your current EA installation?  Problems could occur if you are still using SSJavaCOM from an older installation for example.

What EA version/build are you running?  If possible, make sure you are running the latest build of EA and make sure that the SSJavaCOM.dll provided with this installation is copied into your windows System32 directory.

wang-bingbing

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Java API cann't access after installed an addI
« Reply #6 on: December 18, 2009, 03:00:46 pm »
Quote
Are you referencing the SSJavaCOM.dll and eaapi.jar files provided with your current EA installation?  Problems could occur if you are still using SSJavaCOM from an older installation for example.

What EA version/build are you running?  If possible, make sure you are running the latest build of EA and make sure that the SSJavaCOM.dll provided with this installation is copied into your windows System32 directory.

hi, my current version of EA is 7.5.847 and SSJavaCom.dll have copied into my windows System32 directory.

wang-bingbing

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Java API cann't access after installed an addI
« Reply #7 on: December 21, 2009, 07:07:53 pm »
Now, i have got some error message below:
Exception in thread "AWT-EventQueue-0" java.lang.Exception: Failed to construct object. Error code: 0x80004002
        at org.sparx.Repository.comConstructor(Native Method)
        at org.sparx.Repository.<init>(Repository.java:150)

what does this code [0x80004002] stand for?

« Last Edit: December 21, 2009, 07:08:24 pm by wangbingbing »

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8098
  • Karma: +118/-20
    • View Profile
Re: Java API cann't access after installed an addI
« Reply #8 on: December 22, 2009, 08:12:56 am »
It's coming directly from COM, so I don't know precisely.

But I have seen it in the past when doing an invalid cast.