Topic
  • 7 replies
  • Latest Post - ‏2013-10-08T20:15:22Z by MQ0Y_Amal_Khalil
MQ0Y_Amal_Khalil
MQ0Y_Amal_Khalil
5 Posts

Pinned topic RulesComposer & Simulink/Stateflow models

‏2013-10-02T23:54:34Z |

Hi,

I'm working with Rhapsody Developer 8.0 and I use the RulesComposer add-on to extract some information from the model.

I noticed that RulesComposer can open Simulink models. However when I created a ruleset for a sample Simulink model and tried to run it I got the following error messages:

com.sodius.mdw.core.CoreException: java.lang.UnsatisfiedLinkError: rhapsody (Not found in java.library.path)
    at com.sodius.rhapsody.internal.runner.RhapsodyRunner.run(RhapsodyRunner.java:74)
    at com.sodius.rhapsody.licensing.ApiConnection.run(ApiConnection.java:113)
    at com.sodius.rhapsody.licensing.ApiConnection.getApplication(ApiConnection.java:37)
    at com.sodius.rhapsody.licensing.ApiConnection.<init>(ApiConnection.java:22)
    at com.sodius.rhapsody.licensing.RulesComposerApplicationProvider.<init>(RulesComposerApplicationProvider.java:28)
    at java.lang.J9VMInternals.newInstanceImpl(Native Method)
    at java.lang.Class.newInstance(Class.java:1375)
    at com.sodius.mdw.internal.core.security.ApplicationFactory.createApplicationProvider(ApplicationFactory.java:184)
    at com.sodius.mdw.internal.core.security.ApplicationFactory.createFromClassLoader(ApplicationFactory.java:167)
    at com.sodius.mdw.internal.core.security.ApplicationFactory.create(ApplicationFactory.java:132)
    at com.sodius.mdw.internal.core.security.LicenseManagerFactory.create(LicenseManagerFactory.java:35)
    at com.sodius.mdw.internal.core.MDWorkbenchImpl.initialize(MDWorkbenchImpl.java:41)
    at com.sodius.mdw.internal.core.MDWorkbenchImpl.<init>(MDWorkbenchImpl.java:31)
    at com.sodius.mdw.core.MDWorkbenchFactory.create(MDWorkbenchFactory.java:39)
    at com.sodius.mdw.internal.core.eval.launch.LaunchRunnerImpl.main(LaunchRunnerImpl.java:58)
    at com.sodius.mdw.core.eval.launch.LaunchRunner.main(LaunchRunner.java:106)
Caused by: java.lang.UnsatisfiedLinkError: rhapsody (Not found in java.library.path)
    at java.lang.ClassLoader.loadLibraryWithPath(ClassLoader.java:1165)
    at java.lang.ClassLoader.loadLibraryWithClassLoader(ClassLoader.java:1129)
    at java.lang.System.loadLibrary(System.java:491)
    at com.telelogic.rhapsody.core.RhapsodyAppServer.<clinit>(Unknown Source)
    at java.lang.J9VMInternals.initializeImpl(Native Method)
    at java.lang.J9VMInternals.initialize(J9VMInternals.java:233)
    at com.sodius.rhapsody.licensing.ApiConnection$1.run(ApiConnection.java:41)
    at com.sodius.rhapsody.internal.runner.RhapsodyRunner$RhapsodyThread.run(RhapsodyRunner.java:96)
[progress] Evaluation failed!

The content of My template file is as follows:

[#package myPackage]
[#template public myTemplate(myStateFlowModel : simulink.StateFlowModel)]
[#file]${myStateFlowModel.machine.name}.txt[/#file]
generated text
[/#template]

The content of my ruleset file is as follows:

package myPackage;
public ruleset myRuleset(in model : simulink) {
    public rule main() {
        foreach (myStateFlowModel : simulink.StateFlowModel in model.getInstances("StateFlowModel")) {
            $myTemplate(myStateFlowModel);
        }
    }
}

Any suggestions of what is the problem?

Thanks

  • AE91_SHINJI_KANAI
    AE91_SHINJI_KANAI
    147 Posts

    Re: RulesComposer & Simulink/Stateflow models

    ‏2013-10-07T08:01:21Z  

    Hello,

    Do you see "rhapsody.jar" and com.sodius.mdw.matamodel.simulink_<version>.jar listed in Plug-in Dependencies folder? I suspect the cause is that these libraries are not referenced properly. The following steps (or adding equivalent changes) might help to resolve the issue:

    1. File > New > Other
    2. Choose RulesComposer Project
    3. Fill up and press "Next"
    4. Make sure "Rhapsody 8.0" and "Simulink" are selected.
    5. Complete project creation.
    6. Copy existing *.mqr and *tgt to the new project.
    7. Run

    Please let me know if UnsatisfiedLinkError exception persists. Some screenshot might help.

    Best Regard,

    --Shinji
     

  • MQ0Y_Amal_Khalil
    MQ0Y_Amal_Khalil
    5 Posts

    Re: RulesComposer & Simulink/Stateflow models

    ‏2013-10-07T12:23:08Z  

    Hello,

    Do you see "rhapsody.jar" and com.sodius.mdw.matamodel.simulink_<version>.jar listed in Plug-in Dependencies folder? I suspect the cause is that these libraries are not referenced properly. The following steps (or adding equivalent changes) might help to resolve the issue:

    1. File > New > Other
    2. Choose RulesComposer Project
    3. Fill up and press "Next"
    4. Make sure "Rhapsody 8.0" and "Simulink" are selected.
    5. Complete project creation.
    6. Copy existing *.mqr and *tgt to the new project.
    7. Run

    Please let me know if UnsatisfiedLinkError exception persists. Some screenshot might help.

    Best Regard,

    --Shinji
     

    Thanks Shinji,

    I checked my plug-in dependencies folder and I found the two required libraries.

    Please check the attached snapshot of my workspace, showing the content of my plug-ins list and the error messages I mentioned before.

    Please advise.

    Amal

    Attachments

  • GertW
    GertW
    5 Posts

    Re: RulesComposer & Simulink/Stateflow models

    ‏2013-10-07T13:02:00Z  

    use Sun/Oracle Java instead of IBM Java. I had similar issues with importing Statemate models.

    Set the JDKDIR variable in one of the batch file in Rhapsody\8.0.4\Sodius\RulesComposer\bin and execute it to modify rhapsody.ini.

    Gert

  • MQ0Y_Amal_Khalil
    MQ0Y_Amal_Khalil
    5 Posts

    Re: RulesComposer & Simulink/Stateflow models

    ‏2013-10-07T15:41:48Z  
    • GertW
    • ‏2013-10-07T13:02:00Z

    use Sun/Oracle Java instead of IBM Java. I had similar issues with importing Statemate models.

    Set the JDKDIR variable in one of the batch file in Rhapsody\8.0.4\Sodius\RulesComposer\bin and execute it to modify rhapsody.ini.

    Gert

    Thanks Gert,

    Would you please specify which file I should access to update the JDKDIR variable?

    Please find the attached list of the content of my Rhapsody\8.0.4\Sodius\RulesComposer\bin directory.

    I notice that there is a file named "rc4stm_ini_update" which I think it is related to Statemate models (I guess).

    Unfortunately I don't see a similar file for Simulink/Stateflow models. I'm not sure if there should be a one or not!

    Any suggestion?

    Amal

    Attachments

  • AE91_SHINJI_KANAI
    AE91_SHINJI_KANAI
    147 Posts

    Re: RulesComposer & Simulink/Stateflow models

    ‏2013-10-08T01:36:39Z  

    Thanks Shinji,

    I checked my plug-in dependencies folder and I found the two required libraries.

    Please check the attached snapshot of my workspace, showing the content of my plug-ins list and the error messages I mentioned before.

    Please advise.

    Amal

    Hi Amal,

    As you can see in the attached image, com.sodius.mdw.metamodel.rhapsody is missing in your configuration. I can easily reproduce your problem by taking it out of dependencies in my project. Did you follow my steps? Are you experiencing the same problem with another project JavaGeneration? If you type in the word "rhapsody" somewhere in *.tgt file, you should see errors (e.g. the metamodel Rhapsody 8.0 is not part of the plugin dependencies), don't you?

    Best Regard,

    --Shinji

  • GertW
    GertW
    5 Posts

    Re: RulesComposer & Simulink/Stateflow models

    ‏2013-10-08T08:14:34Z  

    Thanks Gert,

    Would you please specify which file I should access to update the JDKDIR variable?

    Please find the attached list of the content of my Rhapsody\8.0.4\Sodius\RulesComposer\bin directory.

    I notice that there is a file named "rc4stm_ini_update" which I think it is related to Statemate models (I guess).

    Unfortunately I don't see a similar file for Simulink/Stateflow models. I'm not sure if there should be a one or not!

    Any suggestion?

    Amal

    Hi Amal,

    I do not know exactly which batch file to use. For Rules Composer I think it is rhp_ini_update_rc.bat. You can also manually edit the rhapsody.ini file.

    Search for Rules Composer Plugin:

    name7=RulesComposer
    MenuStringResourceID7=
    command7=C:\IBM\Rhapsody\8.0.4\Sodius\RulesComposer\eclipse\RulesComposer.exe
    arguments7=-vm "C:\IBM\Rhapsody\8.0.4\jre\bin\javaw.exe"
    initialDir7=

    Edit the arguments line to point to Oracle Java, e.g.:

    arguments7=-vm "C:\Program Files\Java\jre1.6.0_30\bin\javaw.exe"

    When launching RulesComposer you see which Java version/edition is called.

    Gert
     

  • MQ0Y_Amal_Khalil
    MQ0Y_Amal_Khalil
    5 Posts

    Re: RulesComposer & Simulink/Stateflow models

    ‏2013-10-08T20:15:22Z  

    Hi Amal,

    As you can see in the attached image, com.sodius.mdw.metamodel.rhapsody is missing in your configuration. I can easily reproduce your problem by taking it out of dependencies in my project. Did you follow my steps? Are you experiencing the same problem with another project JavaGeneration? If you type in the word "rhapsody" somewhere in *.tgt file, you should see errors (e.g. the metamodel Rhapsody 8.0 is not part of the plugin dependencies), don't you?

    Best Regard,

    --Shinji

    Yes, you are right. I added the missing plugin and it works.

    Thank you very much Shinji.

    Amal