Re: Deploy custom web-service (700 Views)
Reply
Advisor
ieroglif
Posts: 32
Registered: ‎11-21-2012
Message 1 of 9 (712 Views)
Accepted Solution

Deploy custom web-service

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.
HP Expert
Etienne_Canaud
Posts: 178
Registered: ‎10-15-2010
Message 2 of 9 (700 Views)

Re: Deploy custom web-service

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.

Advisor
VinaykumarDH
Posts: 12
Registered: ‎01-30-2013
Message 3 of 9 (506 Views)

Re: Deploy custom web-service

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

Honored Contributor
Utkarsh_Mishra
Posts: 713
Registered: ‎07-13-2010
Message 4 of 9 (495 Views)

Re: Deploy custom web-service

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)
Advisor
VinaykumarDH
Posts: 12
Registered: ‎01-30-2013
Message 5 of 9 (465 Views)

Re: Deploy custom web-service

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

Honored Contributor
Utkarsh_Mishra
Posts: 713
Registered: ‎07-13-2010
Message 6 of 9 (457 Views)

Re: Deploy custom web-service

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)
HP Expert
Etienne_Canaud
Posts: 178
Registered: ‎10-15-2010
Message 7 of 9 (439 Views)

Re: Deploy custom web-service

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.

Advisor
VinaykumarDH
Posts: 12
Registered: ‎01-30-2013
Message 8 of 9 (390 Views)

Re: Deploy custom web-service

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
Advisor
VinaykumarDH
Posts: 12
Registered: ‎01-30-2013
Message 9 of 9 (295 Views)

Re: Deploy custom web-service

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

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.