Established Member.. ieroglif
Established Member..
1945 views

Deploy custom web-service

Jump to solution

Hi all.

 

Does anybody knows how to deploy custom java RESTful web-service at Hp PPM?

I developed and successfully tested it at jBoss AS7..but now I have no idea how to deploy it correctly at PPM. 

 

Any ideas?

Best Regards,
Ieroglif.
0 Likes
1 Solution

Accepted Solutions
Micro Focus Expert
Micro Focus Expert

Re: Deploy custom web-service

Jump to solution

Hi Ieroglif,

 

There is no officially supported way to deploy a custom RESTful service on PPM Server. 

 

If someone really wanted to do that they could copy their REST Application resources classes to WEB-INF/classes and edit <SERVER_HOME>/deploy/itg.war/WEB-INF/conf/wink_ws.app to add their Jax-RS resource class to the list to have it picked up by PPM RESTful Services server (Apache Wink), but that would be a bad idea as this is not supported and everything would be wiped out during every PPM upgrade (even during patch upgrades).

 

You'd rather manage your own server (JBoss AS7 or simpler things such as Grizzly + Jersey) to run your custom RESTful services. Unless for some reason you need them to run in PPM Server, but that likely means that you need to leverage some PPM native code, and there's little chance that what you are doing is encouraged or even supported by HP Support.

 

Kind Regards,

Etienne.

8 Replies
Micro Focus Expert
Micro Focus Expert

Re: Deploy custom web-service

Jump to solution

Hi Ieroglif,

 

There is no officially supported way to deploy a custom RESTful service on PPM Server. 

 

If someone really wanted to do that they could copy their REST Application resources classes to WEB-INF/classes and edit <SERVER_HOME>/deploy/itg.war/WEB-INF/conf/wink_ws.app to add their Jax-RS resource class to the list to have it picked up by PPM RESTful Services server (Apache Wink), but that would be a bad idea as this is not supported and everything would be wiped out during every PPM upgrade (even during patch upgrades).

 

You'd rather manage your own server (JBoss AS7 or simpler things such as Grizzly + Jersey) to run your custom RESTful services. Unless for some reason you need them to run in PPM Server, but that likely means that you need to leverage some PPM native code, and there's little chance that what you are doing is encouraged or even supported by HP Support.

 

Kind Regards,

Etienne.

VinaykumarDH Trusted Contributor.
Trusted Contributor.

Re: Deploy custom web-service

Jump to solution

Hi Etienne,

 

I have a class file loaded in  \\c$\ITG\server\<server>\deploy\itg.war\WEB-INF\classes and edited wink_ws.app file to include that class file but when I call it through the command from workflow it gives me  excel.ReadExcelDemo cannot be cast to com.kintana.core.server.execution.BaseCommand, below is the command ksc_run_java excel.ReadExcelDemo [REQ.REQUEST_ID]

 

Any idea what could be the issue? is there any guideline to deploy custom class files to PPM?

 

Your help is greatly appreciated. Thanks in advance

0 Likes
Established Member.. Utkarsh_Mishra
Established Member..

Re: Deploy custom web-service

Jump to solution

I would rather create a JAR file and put its libraries and JAR file in web-inf/lib folder.

 

Then call this jar file using ksc_local_exec.

 

 

This is perfectly working fine for me. And there is no risk of customizing any HP entitieis.

Cheers..
Utkarsh Mishra

-- Remember to give Kudos to answers! (click the KUDOS star)
VinaykumarDH Trusted Contributor.
Trusted Contributor.

Re: Deploy custom web-service

Jump to solution

Thanks Utkarsh for your reply, I copied the jar files to web-inf/lib folder and tried to run but getting below error, Am i missing something?

 

Class file runs perfectly fine when executed on eclipse.

 

ERROR :CommandRunner for com.kintana.core.server.execution.CLLocalExecCommand Batch ID: 226759:com.kintana.core.executions.commands.localExec:2014/07/22-14:20:11.642 IST: Unexpected exception occurred running ksc_local_exec:
java.io.IOException: Cannot run program "ReadExcelDemo": CreateProcess error=2, The system cannot find the file specified

0 Likes
Established Member.. Utkarsh_Mishra
Established Member..

Re: Deploy custom web-service

Jump to solution

This issue is faced when your are on Windows system.

 

Try this.

 

  1. First Identify the JAVA_HOME path as it will be needed in the command
  2. Location where your jar file is store
  3. Finally make sure that the environment used in the command is working fine i.e check transfer and connection protocal

 

ksc_connect_dest_server DEST_ENV="KINTANA_SERVER"
echo Running..
C:/Java/jdk1.6.0_16/bin/java -jar "C:\itg\webservices\my_project\PPM-CUSTOM.jar"
ksc_exit

 

Cheers..
Utkarsh Mishra

-- Remember to give Kudos to answers! (click the KUDOS star)
Micro Focus Expert
Micro Focus Expert

Re: Deploy custom web-service

Jump to solution

Hi,

 

One quick info about trying to use ksc_run_java: if you want to use this special command, the full class name you pass as a parameter MUST extend the PPM abstract class  com.kintana.core.server.execution.BaseCommand. So yes, the error message is correct 🙂

 

However, ksc_run_java is supposed to be a PPM internal command. Nothing prevents you to create your own class extending BaseCommand, but it will be much easier to create an executable Java class and invoke it with ksc_local_exec or simply with command line java.exe execution like Utkarsh demonstratred.

 

Thanks,

Etienne.

0 Likes
VinaykumarDH Trusted Contributor.
Trusted Contributor.

Re: Deploy custom web-service

Jump to solution
Applogies I was OOO for long duration so could not check and Thanks a lot Utkarsh grt solution it worked for me.

Etienne,
I will try and get back on this
0 Likes
VinaykumarDH Trusted Contributor.
Trusted Contributor.

Re: Deploy custom web-service

Jump to solution

I was even able to call specific class file to run using below

 

ksc_connect_dest_server DEST_ENV="DevEnvTest"
echo Running..
C:/jdk1.6.0_17/bin/java -cp "[AS.BASE_PATH]metricsProject\ReadExcel1Demo.jar" ReadExcel1 [REQ.REQUEST_ID]
ksc_exit

 

I feel there is no need of using ksc_run_java or ksc_local_exec 🙂

 

Thanks Utkarsh, Etienne

 

Regards,

Vinay

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.