Skip to Content
Author's profile photo Gov TOTAWAR

Deploying Custom Jar Files : E-Sourcing

When building CLM application or integrating with third party application there is always requirement to add custom jar files. I have been involved/assisted on couple of CLM projects and found issue deploying custom jar files using standard custom jar file deployment tool provided in CLM Installation and configuration guide.  The jar file added had “Zero” size .

In this blog I would like to present couple of other options that can be used to deploy Custom Jar files.

1. CLM Installation and configuration Guide (Standard process to deploy custom jar files is available in attached link).

https://websmp102.sap-ag.de/~form/handler?_APP=00200682500000002672&_EVENT=DISPLAY&_SCENARIO=01100035870000000122&_HIER_KEY=501100035870000015092&_HIER_KEY=601100035870000179414&_HIER_KEY=601100035870000233634&_HIER_KEY=601100035870000240411&_HIER_KEY=701100035871000569661&

……………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………..

2. Adding custom jar files to esourcing ear file manually using WinRaR or WinZip

  1. Copy the sourcing ear file to local Directory/folder on your system

esoserver.ear (CLM newer Version) or fcsourcing.ear (CLM older Version)


   b.    Modify the extension from .ear to .zip, and unzip the zip file or use WinRAR

The unzipped folder should look like one in the screen shot

/wp-content/uploads/2013/08/1_260004.png

/wp-content/uploads/2013/08/2_260005.png

     c.     Unzipped fcsourcing.war, the unzipped fcsourcing file should look like one in the screen shots

/wp-content/uploads/2013/08/3_260012.png

Delete the fcsourcing.war file after unzip.

     d.     Go to esoserver\fcsourcing\WEB-INF\lib (new CLM version) or fcsourcing\ fcsourcing \WEB-INF\lib  (old CLM Version) folder

Add custom jar files required for your project.

/wp-content/uploads/2013/08/4_260013.png

     e.    Go back to fcssourcing folder (war file folder) and select all files as shown below in the screen shot

/wp-content/uploads/2013/08/6_260016.png

     f.     Select add archive.

/wp-content/uploads/2013/08/7_260017.png

/wp-content/uploads/2013/08/8_260018.png

     g.     After archive step , the folder should look like one in the screen shot

               /wp-content/uploads/2013/08/9_260019.png

     h.     Rename fcssourcing.zip to fcssourcing.war.

Copy fcssourcing.war file and paste it in “esoserver” folder, the esoserver folder should look like one in the screen shot.

          /wp-content/uploads/2013/08/10_260020.png

     i.       Delete fcssourcing folder

               /wp-content/uploads/2013/08/11_260021.png

                              /wp-content/uploads/2013/08/12_260022.png

         j.     Select all files in esoserver folder and create archive

/wp-content/uploads/2013/08/13_260023.png

Rename esoserver.zip to esoserver.ear

     K. Now esoserver.ear is ready for deployment with custom jar files. Undeploy existing ear file and deploy new ear file with custom jars when following “Manually Adding Custom Jar files Option”.

……………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………..

3.  Adding Custom Jar files using ANT Script :

I have written an ANT script (attached) that can be used to add custom jar file.

  1. Download Java, install and set Java Home

     http://docs.oracle.com/cd/E19182-01/820-7851/inst_cli_jdk_javahome_t/index.html

    

  b.    Download ANT and set ANT Home

     http://ant.apache.org/manual/install.html

  c.  Create two folders with below names

    1. custom_jar_files
    2. esourcing_ear_file

  d.    Download and copy attached build file

          Your folder and file structure should look similar to below screen shot

             /wp-content/uploads/2013/08/14_260036.png

  e.    Copy esoserver.ear to “esourcing_ear_file” folder

          /wp-content/uploads/2013/08/15_260037.png

  f.     Copy all the custom jar files you require to “custom_jar_files” folder

          /wp-content/uploads/2013/08/16_260038.png

  g.    Open command prompt and go to directory with build file

          /wp-content/uploads/2013/08/17_260042.png

  h.    Execute ant command

     /wp-content/uploads/2013/08/18_260043.png

  i.     new ear file generated should be found in “esourcing_ear_file” with custom jar file

  j.    undeploy existing ear file and deploy new ear file with custom jars    

……………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………..

*Note : if you are working with older version of esourcing, please edit the build file with older ear file name


/wp-content/uploads/2013/08/19_260045.png


Assigned Tags

      11 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Isaac Ariza Cruz
      Isaac Ariza Cruz

      Thanks Gov for this great post. Really appreciated.

      I have a quick question: when you say "K. Now esoserver.ear is ready for deployment with custom jar files. Undeploy existing ear file and deploy new ear file with custom jars when following "Manually Adding Custom Jar files Option"."

      - Could you please let me know how can we to undeploy ear file and deploy a new ear file following "Manually Adding Custom Jar files Option"?

      Thanks a lot and best regards,

      Isaac

      Author's profile photo Gov TOTAWAR
      Gov TOTAWAR
      Blog Post Author

      Hi Issac,

      Please you below command

      To undeploy the SAP Sourcing
      SCA file, enter the following command:

      UNDEPLOY
      name=E-Sourcing-Server vendor=sap.com on_undeploy_error=stop

      Author's profile photo Isaac Ariza Cruz
      Isaac Ariza Cruz

      Hi Gov,

      Thanks for the replay!.

      Let me share with you the actions done:

      1. Custom JAR created with one class that send a testing mail.

      2. Process 2 (on your post) has been followed (so WAR file and EAR file has been created including custom JAR.

      3. Now, executable file "Configurable.exe" of path <SAP Sourcing home directory>\bin is executed.

      4. On the wizard displayed, options "Include Custom JAR Files" and "Update WAR,EAR and SCA Files" are selected.

      5. Rest of wizard is followed, introducing the path of the J00 folder and selecting the custom JAR file as "Custom JAR file 1"

      6. Configuration is completed successfully.

      After these actions, I've tried to call this call through an toolbar script but following error is raised:

      "Source file: inline evaluation of: "import custom.test.mails; SendMails mails; mails = new SendMails(); mails...\'\': Typed variable declaration: Class: SendMails not found in namespace"

      Therefore, I guess that I've done something wrong or there are some steps pending to be done.

       

      Could you please answer to the following questions:

      - Before to start these actions, should I stop the E-Sourcing server through NWA or is it done automatically using the wizard listed above?

      - Following the procedure no. 2, I've created the new EAR and WAR files including the custom JAR. However, I've not used them in any step of the process. How should I use them?

      Your help will be really appreciated.

       

      Thanks and best regards,

      Isaac

      Author's profile photo Isaac Ariza Cruz
      Isaac Ariza Cruz

      Hi Gov,

      Did you have the chance to check the question raised in my last reply? In that case, could you please support me on those questions?

      Thanks again and best regards,

      Isaac

      Author's profile photo Gov TOTAWAR
      Gov TOTAWAR
      Blog Post Author

      Hi Isaac,

      I had similar issue when using the Wizard, the reason I have written this Blog .

      Please follow the steps in option 2, this resolved my issue.

      Adding custom jar files to esourcing ear file manually using WinRaR or WinZip.

      Thank You

      Regards

      Gov


      Author's profile photo Isaac Ariza Cruz
      Isaac Ariza Cruz

      Hi Gov,

      Thanks a lot for your reply.

      I've followed the steps in option 2. However, after EAR file has been created, I'm lost regarding how to deploy this new EAR file into the Sourcing environment. Let me explain you my issues:

      • According to my understanding: after EAR file has been created using the steps provided into your blog, I should undeploy previous EAR file from esourcing environment. For that purpose, following statement needs to be used:
        • UNDEPLOY name=E-Sourcing-Server vendor=sap.com on_undeploy_error=stop


      • Now, I should deploy new EAR file into the ESO environment. This is the point: how should I do that? I've read that I could do it using JSPM. So I guess I should follow next actions:
        1. Create SCA file from new EAR file created.
        2. Move this new SCA file to following paht: <Drive>\usr\sap\trans\EPS\in
        3. Execute JSPM and deploy new SCA file.

      Is this procedure correct?

      Thanks again for your great post and support.

      Best regards,

      Isaac

      Author's profile photo Gov TOTAWAR
      Gov TOTAWAR
      Blog Post Author

      Hi

      You're on the right track or you can use NWDS to deploy it.

      Attached note provides different options, the note is related to deploying XPI Inspector ear file, the steps or process is similar to what you require

      Thank You

      Regards

      Gov

      https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/sno/ui_entry/entry.htm?param=69765F6D6F64653D3030312669765F7361706E6F7465735F6E756D6265723D3135313438393826\

      Author's profile photo Former Member
      Former Member

      Great post Gov. Your post was really helpful and in understanding the process of deploying custom jar file.

      One question slightly different from this post. Have you managed to create a web service and consume it from via scripting in CLM 9.0 ?

      We have a requirement where we might need a web service deployment.

      Thanks,

      Arijeet

      Author's profile photo Gov TOTAWAR
      Gov TOTAWAR
      Blog Post Author

      Hi Arijeet,

      Yes, You need to generate webservice client jar file from the WSDL and import it by following the process mentioned in the blog (custom jar file).

      Please let me know if you need additional info.

      Thank You

      Regards

      Gov

      Author's profile photo Former Member
      Former Member

      Could you please guide me how to generate Webservices and use it in SAP Sourcing/CLM? Please explain with an Example.

      Thanks,

      Mahesh.D

      Author's profile photo Gov TOTAWAR
      Gov TOTAWAR
      Blog Post Author

      Hi Mahesh,

      You can find the info in below blog.

      http://scn.sap.com/community/sourcing/blog/2013/11/24/consuming-a-webservice--esourcing

      Thank You

      Regards

      Gov