Service Virtualization

  • 1.  The method createTestMARInfo(String, String, String) from the type ModelArchiveInfo is not visible

    Posted Nov 05, 2018 12:08 AM

    Hi Team ,

     

    I am facing issues while migrating one customized jar from Lisa 6 to Devtest 10.3 .

     

    1.I have open the customized java step code in eclipse and imported the latest jar files but I am facing below error.

    The method createTestMARInfo(String, String, String) from the type ModelArchiveInfo is not visible.

    2. PFB snippet ,I have included all jar files.

     

     

    3.Opened lisa-core-10.3.0.jar --in eclipse ,I couldn't find com.itko.lisa.model.mar function.



  • 2.  Re: The method createTestMARInfo(String, String, String) from the type ModelArchiveInfo is not visible

    Broadcom Employee
    Posted Nov 05, 2018 02:20 AM

    I am unclear on your 3rd point “3.Opened lisa-core-10.3.0.jar --in eclipse ,I couldn't find com.itko.lisa.model.mar function.”

     

    The class is there just fine?

     

     

     

    However, the method createTestMARInfo(String, String, String) of class ModelArchiveInfo is a static method which is not explicitly declared public so it defaults to private: so, it’s understandable you will get this kind of error.

     

    When you open up lisa-core jar of LISA v6 in Eclipse do you see that method as public? (I can’t validate as I don’t have a v6 lisa-core anymore). You would need to see the green circle icon, not the blue triangle icon.

     

     

     

     

    Cheers,

    Danny



  • 3.  Re: The method createTestMARInfo(String, String, String) from the type ModelArchiveInfo is not visible

    Posted Nov 07, 2018 09:17 PM

    Thanks Danny for your prompt response .

    adding more details for 3rd point , usually in Lisa.core.10.3.0.jar, should have two functions .

    1.com.itko.lisa.model.mar

    2.com.itko.lisa.model.mar.ui

     

     

    However, the method createTestMARInfo(String, String, String) of class ModelArchiveInfo is a static method which is not explicitly declared public so it defaults to private: so, it’s understandable you will get this kind of error ---------------That's why I thought of changing from private to public ,but when I imported jar file into eclipse ,I couldn't find ,the com.itko.lisa.model.mar .Please advise my next possible step.

     

    When you open up lisa-core jar of LISA v6 in Eclipse do you see that method as public? (I can’t validate as I don’t have a v6 lisa-core anymore). You would need to see the green circle icon, not the blue triangle icon.--Not Sure .



  • 4.  Re: The method createTestMARInfo(String, String, String) from the type ModelArchiveInfo is not visible

    Broadcom Employee
    Posted Nov 08, 2018 01:40 AM

    Hi,

     

    This seems like an eclipse issue on your side. All of the things you expect to see I am seeing on my side. I am seeing the packages “com.itko.lisa.model.mar” and “com.itko.lisa.model.mar.ui” with their content.

     

    However, most likely we are doing something else inside Eclipse. What exactly are your actions when you “imported jar file into eclipse”?

     

    Cheers,

    Danny



  • 5.  Re: The method createTestMARInfo(String, String, String) from the type ModelArchiveInfo is not visible

    Posted Nov 08, 2018 06:34 PM

    Hi Danny,

     

    1.Could you please advise which version of eclipse you are referring ?

    2.I am working on eclipse oxygen0.2 (December 2017).

    3. What exactly are your actions when you “imported jar file into eclipse”?-- I have code which refers to

    createTestMARInfo(String,String,String) function ,but as mentioned I am facing error as

    The method createTestMARInfo(String, String, String) from the type ModelArchiveInfo is not visible.

     

    Thanks in advance,

    Madhuri .

     



  • 6.  Re: The method createTestMARInfo(String, String, String) from the type ModelArchiveInfo is not visible

    Posted Nov 09, 2018 11:48 AM

    Hi Madhuri,

     

    Just wandering if it has something to do with JRE dependency . Can you try once configuring your build path with JRE 8 ?



  • 7.  Re: The method createTestMARInfo(String, String, String) from the type ModelArchiveInfo is not visible

    Posted Nov 11, 2018 06:34 AM

    Hi Rahul,

     

    I have already configured the build path with JRE 8 and tried in eclipse 10 also but the issue still persist.

    Could you please help me to resolve because  we are getting close to delivery date.

     

    TIA,

    Madhuri.



  • 8.  Re: The method createTestMARInfo(String, String, String) from the type ModelArchiveInfo is not visible

    Broadcom Employee
    Posted Nov 12, 2018 04:25 AM

    Hi Madhuri,

     

    This has somehow focused on Eclipse as you tried to import the lisa core jar and it did work as expected, etc... However, your core issue is that a lisa core jar method you use in some custom code is not declared public and hence you cannot use it as you did in lisa v6. You basically want to patch the official lisa core jar.

     

    If you patch lisa-core-10.3.0.jar within an installed DevTest folder that renders this installation unsupported. If in the future you report an issue to CA Support you would have to prove that your issue occurs when using the official lisa-core-10.3.0.jar and it is not caused by your patch.

     

    There is a way around this as you are using this library within some custom code, so you can always store the patched lisa-core-10.3.0.jar outside the DevTest installation folder and use the classpath to use your patched version whenever you run your custom code.

     

    Now to the core of your problem, I have personally never used Eclipse to patch some java library, I guess I still do it the old way before we even had Eclipse.

     

    To change “simple” things in a compiled class fuke it is easiest to use a Java Bytecode Editor, go to Sourceforge, and download reJava. You will get a zip file e.g. rej_v0.7_bin.zip, extract rej.jar out of it and double-click it to start the GUI interface.

     

    The procedure you can follow is, start a Command Window:

     

    cd \temp

    mkdir patch

    cd patch

    copy \jdk1.8.0_102

    set PATH=%PATH%;%JAVA_HOME%\bin

    jar xvf lisa-core-10.3.0-patched20181112.jar

     

    Start reJ,

    open the file C:\temp\patch\com\itko\lisa\model\mar\ModelArchiveInfo.class,

    browse down to the method you want to patch,

    double-click the line, in the Method Editor, check “public”,

    click OK.,

    then click Save at the top

    then close reJ

     

     

    In the command window, update the jar file with the patched class:

     

    jar uvf lisa-core-10.3.0-patched20181112.jar com\itko\lisa\model\mar\ModelArchiveInfo.class

     

     

    You can see now that the method createTestMARInfor(String, String, String) is public

     

     

     

    Hope this helps,

     

    Cheers,

    Danny