External JAR Import "no classifier issue"

Hi@all,

 

I am trying to access an external Java API (IBM Rational Rhapsody Java API) in my generator. For this, I created a new Solution (named RhapsodyApi) which imports the *.jar-File and provides the stubs.

I can access the stubs from my generator, so far I am fine. If I try to use methods from the API which contains e.g. a "String"  parameter, it is stated as "no classifier". I found out, that in the RhapsodyApi solution, complex data types like "String" are marked as "Unresolved Reference". I tried to add "java.lang@java_stub" to the "core@java_stub" model but after reopening the options for "core@java_stub", the Dependencies-Tab is again empty.

How can I fix this Reference issue?

I am using JetBrains MPS 3.3.2.

Thanks a lot....

0
6 comments

I think that adding a dependency on JDK in the containing solution would solve you issue.

Vaclav

 

0
Avatar
Permanently deleted user

If I add "JDK" as Dependency in the RhapsodyApi solution, nothing changes. The references are still unresolved.

As interesting annotation: If I use the "Analyze Model Dependencies" function, "String" is mentioned to be used in the model two times (also shown on the screenshot below: the first "String" is noted as unresolved, the second is correct). Indeed, "String" is used all over the parts, so a great number of usages would be expected. 

0

Florian, can you please show exact configuration of RhapsodyApi solution? (Common, Dependencies, and Java tabs)

0
Avatar
Permanently deleted user

Any solutions so far on that topic? I'm stuck with the same problem but using com.microsoft.z3.jar on MPS 3.4.1. Besides String it misses other types like Object, Map, etc. as well. The solution depends on JDK as suggested.

The tooltip on the red marked Type "Object" claims "Unresolved reference"

Thx
Kai







0

Kai, have you tried to add the library to the Java -> Libraries (at the bottom)  list?

Here's what works for me:






0
Avatar
Permanently deleted user

Hi Vladimir,

that did the trick. After a restart of the IDE everything was fine.

Thx a lot!

Regards

Kai

0

Please sign in to leave a comment.