[gme-users] How to invoke a Java BonComponent

Gürkan Özhan gurkanozhan at gmail.com
Fri Feb 19 10:52:10 CST 2010


Hi Kevin,
   I've tried a similar code to TestMgaLayer1 as below:

...
		Apartment.enter(true);

		// create and open mga project
		MgaProject project = MgaProject.createInstance();
		project.open("MGA=C:\\Gurkan\\PhD\\ModelTrans\\Multi2BinaryFAM\\Model\\FAM_BinaryInstMsc_4SIMMono.mga");
		project.beginTransaction(null);
		JBuilder jBuilder = new JBuilder(project, this);

		JBuilderObject focus =
(JBuilderObject)jBuilder.getRootFolder().getRootModels().get(0);
		Collection selected = null;
		int param = 0;
		invokeEx(jBuilder, focus, selected, param);

		project.commitTransaction();
...

Note that, the this parameter to JBuilder constructor is this class,
which is a BONComponent

 However, I get a runtime error if I execute that code (starting from
new JBuilder(project, this); statement):

Exception in thread "main" org.isis.jaut.ComException: No such
interface supported
(0x80004002)
	at org.isis.jaut.Dispatch.changeInterface(Native Method)
	at org.isis.gme.mga.MgaAtom.<init>(Unknown Source)
	at org.isis.gme.bon.JBuilderFolder.<init>(Unknown Source)
	at org.isis.gme.bon.JBuilderFolder.<init>(Unknown Source)
	at org.isis.gme.bon.JBuilder.<init>(Unknown Source)
	at org.isis.gme.bon.LSCCodeGen.startCodeGen(LSCCodeGen.java:2485)
	at org.isis.gme.bon.LSCCodeGen.main(LSCCodeGen.java:2499)

Apparently, the iID of the new interface in the format of
"{XXXXXXXX-XXXX-XX...}" is not recognized. What is this string anyway?
Every Dispatch object has that.
   Best regards,

Gurkan


On 2/17/10, Kevin Smyth <ksmyth at isis.vanderbilt.edu> wrote:
> Hi Gurkan,
>
> gme.jar contains these relevant classes:
> org.isis.gme.mga.TestMgaLayer1
> org.isis.gme.bon.JBuilder
>
> I'd construct a main() similar to TestMgaLayer1#createProjectTest with a new
> JBuilder(project, interpreter) then interpreter#InvokeEx.
>
> Note gme.jar includes the source.
>
> If you must debug the java inside gme.exe, I'd download the GME source and
> modify JavaCompRunner to enable remote debugging (ie another JavaVMOption)
>
> HTH,
> Kevin
>
>
> -----Original Message-----
> From: gme-users-bounces at list.isis.vanderbilt.edu
> [mailto:gme-users-bounces at list.isis.vanderbilt.edu] On Behalf Of Gürkan
> Özhan
> Sent: Tuesday, February 16, 2010 4:10 PM
> To: gme-users
> Subject: [gme-users] How to invoke a Java BonComponent
>
> Hello All,
>
>   My previous mails have gone unanswered, so I will try to be as
> prompt as possible. Here is my question: Can anybody post a code
> snippet of how to invoke a Java BonCompnent? This component is
> supposed to open an existing .mga model file and starting from its
> RootFolder, it will traverse the whole model structure and do some
> computations.
>
>   Many thanks in advance.
>
> Gurkan Ozhan
> _______________________________________________
> gme-users mailing list
> gme-users at list.isis.vanderbilt.edu
> http://list.isis.vanderbilt.edu/mailman/listinfo/gme-users
>
> _______________________________________________
> gme-users mailing list
> gme-users at list.isis.vanderbilt.edu
> http://list.isis.vanderbilt.edu/mailman/listinfo/gme-users
>
>
>


More information about the gme-users mailing list