Service Virtualization

  • 1.  Library issue # Confilicting with jars available in Lisa lib

    Posted May 23, 2016 09:17 AM
      |   view attached

    Hi All,

    I have created a Custom Java test Step to read the outlook mail using Exchange web service (EWS) API - 2.0.  EWS API  requires httpcore-4.4.1.jar and httpclient-4.4.1.jar files as dependency jars. But these two jars are already bundled with LISA_HOME\lib\shared\ folder with versions 4.3.6.

    I am getting below exceptions when I am triggering the step in ITR;

     

    ============================================================================

    | Exception:

    ============================================================================

    | Step:        Custom Test Step Execution Step

    ----------------------------------------------------------------------------

    | Message:     Exception executing custom Java Step

    ----------------------------------------------------------------------------

    | Trapped Exception: org.apache.http.conn.ssl.SSLConnectionSocketFactory.<init>(Ljavax/net/ssl/SSLContext;Ljavax/net/ssl/HostnameVerifier;)V

    | Trapped Message:   java.lang.NoSuchMethodError: org.apache.http.conn.ssl.SSLConnectionSocketFactory.<init>(Ljavax/net/ssl/SSLContext;Ljavax/net/ssl/HostnameVerifier;)V

    ----------------------------------------------------------------------------

    STACK TRACE

    java.lang.NoSuchMethodError: org.apache.http.conn.ssl.SSLConnectionSocketFactory.<init>(Ljavax/net/ssl/SSLContext;Ljavax/net/ssl/HostnameVerifier;)V

        at microsoft.exchange.webservices.data.core.EwsSSLProtocolSocketFactory.<init>(EwsSSLProtocolSocketFactory.java:102)

        at microsoft.exchange.webservices.data.core.EwsSSLProtocolSocketFactory.build(EwsSSLProtocolSocketFactory.java:132)

        at microsoft.exchange.webservices.data.core.EwsSSLProtocolSocketFactory.build(EwsSSLProtocolSocketFactory.java:117)

        at microsoft.exchange.webservices.data.core.ExchangeServiceBase.createConnectionSocketFactoryRegistry(ExchangeServiceBase.java:244)

        at microsoft.exchange.webservices.data.core.ExchangeServiceBase.initializeHttpClient(ExchangeServiceBase.java:198)

        at microsoft.exchange.webservices.data.core.ExchangeServiceBase.<init>(ExchangeServiceBase.java:174)

        at microsoft.exchange.webservices.data.core.ExchangeService.<init>(ExchangeService.java:3718)

        at com.custom.steps.EmailReader.MailReader.readMail(MailReader.java:41)

        at com.custom.steps.EmailReader.MailReader.executeNodeLogic(MailReader.java:32)

        at com.itko.lisa.test.CustJavaNode.execute(CustJavaNode.java:185)

        at com.itko.lisa.test.TestNode.executeNode(TestNode.java:981)

        at com.itko.lisa.test.TestCase.execute(TestCase.java:1295)

        at com.itko.lisa.test.TestCase.execute(TestCase.java:1210)

        at com.itko.lisa.test.TestCase.executeNextNode(TestCase.java:1195)

        at com.itko.lisa.editor.WalkThruPanel.prepAndExecNode(WalkThruPanel.java:1057)

        at com.itko.lisa.editor.WalkThruPanel.access$900(WalkThruPanel.java:70)

        at com.itko.lisa.editor.WalkThruPanel$10.doCallback(WalkThruPanel.java:964)

        at com.itko.util.swing.panels.ProcessingDialog$2.run(ProcessingDialog.java:194)

        at java.lang.Thread.run(Unknown Source)

    ============================================================================

        at com.itko.lisa.test.CustJavaNode.execute(CustJavaNode.java:210)

        at com.itko.lisa.test.TestNode.executeNode(TestNode.java:981)

        at com.itko.lisa.test.TestCase.execute(TestCase.java:1295)

        at com.itko.lisa.test.TestCase.execute(TestCase.java:1210)

        at com.itko.lisa.test.TestCase.executeNextNode(TestCase.java:1195)

        at com.itko.lisa.editor.WalkThruPanel.prepAndExecNode(WalkThruPanel.java:1057)

        at com.itko.lisa.editor.WalkThruPanel.access$900(WalkThruPanel.java:70)

        at com.itko.lisa.editor.WalkThruPanel$10.doCallback(WalkThruPanel.java:964)

        at com.itko.util.swing.panels.ProcessingDialog$2.run(ProcessingDialog.java:194)

        at java.lang.Thread.run(Unknown Source)

     

    I had tried including supported jar files in system environment variables with name as LISA_PRE_CLASSPATH. and well as in Hot Deploy folder...conflicting with jars here..

     

    Could you please someone me help to resolve this library issue.

    Screen shot attached for your understanding

     

    Thanks in advance



  • 2.  Re: Library issue # Confilicting with jars available in Lisa lib

    Posted May 23, 2016 10:05 AM

    did you look at the workstation or VSE log startup messages to make sure your jars were loaded first?  there is a classpath message for each jar file.

     

    On Windows, if you add it to the environment variable list, but start this thing as a service, those env vars are not used.

    on Linux if you add it to the .profile, but use the service command, those env vars are not used (.profile is not run)

     

     

    here is the beginning for my workstation startup from the command line. the 3 in bold are the ones I need and are set in LISA_PRE_CLASSPATH

    2016-05-22 14:52:05,007Z (09:52) [main] INFO  com.itko.util.LogUtilities  - Classpath: C:\Program Files\CA\DevTest-9.1\.install4j\i4jruntime.jar

    2016-05-22 14:52:05,007Z (09:52) [main] INFO  com.itko.util.LogUtilities     - Classpath: C:\Program Files\CA\DevTest-9.1\hotDeploy\xmlunit-core-2.0.0-alpha-03.jar

    2016-05-22 14:52:05,007Z (09:52) [main] INFO  com.itko.util.LogUtilities     - Classpath: C:\Program Files\CA\DevTest-9.1\hotDeploy\xmlunit-legacy-2.0.0-alpha-03.jar

    2016-05-22 14:52:05,007Z (09:52) [main] INFO  com.itko.util.LogUtilities     - Classpath: C:\Program Files\CA\DevTest-9.1\hotDeploy\xmlunit-matchers-2.0.0-alpha-03.jar

    2016-05-22 14:52:05,007Z (09:52) [main] INFO  com.itko.util.LogUtilities     - Classpath: C:\Program Files\CA\DevTest-9.1\bin\..\lib\core\agent-zip-9.1.0.jar



  • 3.  Re: Library issue # Confilicting with jars available in Lisa lib

    Posted May 24, 2016 01:01 AM

    Hi  sdetweil2,

    Thanks for your quick reply.

    As you mentioned, could you please help to get know where to see the start up logs when DevTest Workstation loads first.

    As posted earlier, I had set PRE_LISA_CLASSPATH in windows environment variables. When this thing is run as a service, Could lisa not able to load the third party jars

     

    Could you please clarify once how to use PRE_LISA_CLASSPATH in windows machine or any document if available is helpful



  • 4.  Re: Library issue # Confilicting with jars available in Lisa lib

    Posted May 24, 2016 08:12 AM

    when u start any of the Lisa components,  they place their logs in the folder lisatmp_?????  where ???? is the product version number..

     

    if you start the component NOT as a service, that folder will be in the users folder  c:\users\******  where ****** is the logon username

    if you start the component as a service, then that folder will be in the product install folder (on windows), or in the /root folder (on linux)



  • 5.  Re: Library issue # Confilicting with jars available in Lisa lib
    Best Answer

    Posted May 24, 2016 08:39 AM

    Thanks  sdetweil2 for your support.

    As you guided, I could able to verify the workstation logs and verified the dependency jars are pre loaded or not.

    Issue is resolved by keeping LISA_PRE_CLASSPATH. Only did the mistake is separated the jar files with comma (,) instead of semicolon (;) while setting the classpath environment variables.

     

    Thanks



  • 6.  Re: Library issue # Confilicting with jars available in Lisa lib

    Posted May 24, 2016 08:48 AM

    thanks for the feedback.. glad you got it solved

     

    yes, classpath needs the proper separator   ; on windows and : everywhere else