Problems with Rational Publishing Engine Java API
Hello,
I need to generate documents from Work Items in an automation. The automation will be triggered from the CCM sever. Therefore I would like to use the Rational Publishing Engine Java API.
The example application com.ibm.rational.rpe.examples works for local document generation, but not for DGAAS Service and not for Document Builder (rpeng).
The error running SampleDocgen with DGAAS Service is:
[Sample] 08:32:11 - Docspec is C:\path\to\TestReport.dsx
[Sample] 08:32:11 - Running document specification: file:/C:/path/to/TestReport.dsx
[Sample] 08:32:11 - RPE Engine version: 6.0.6
[Sample] 08:32:11 - Java version: 1.8.0_161
[Sample] 08:32:11 - Java vendor: IBM Corporation
[Sample] 08:32:11 - Java arch: amd64
[Sample] 08:32:11 - type: DOCSPEC
[Sample] 08:32:11 - Remote URL: https://<server>/dgaas
[Sample] 08:32:11 - Remote USER: oblinges
[Sample] 08:32:11 - RPENG Base URL:
[Sample] 08:32:11 - Remote document generation
[RPE] 08:32:12 - Error while getting the secret.
org.apache.http.client.ClientProtocolException
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:186)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:55)
at com.ibm.rational.rpe.api.docgen.job.RemoteJobUtils.performFormAuthHttpAndGet(RemoteJobUtils.java:320)
at com.ibm.rational.rpe.api.docgen.job.DGaaSRemoteJob.<init>(DGaaSRemoteJob.java:72)
at com.ibm.rational.rpe.api.docgen.RemoteJobFactory.getRemoteJobHandler(RemoteJobFactory.java:31)
at com.ibm.rational.rpe.api.docgen.RemoteDocumentGenerator.<init>(RemoteDocumentGenerator.java:94)
at com.ibm.rational.rpe.examples.docgen.SampleDocgen.run(SampleDocgen.java:122)
at com.ibm.rational.rpe.examples.docgen.SampleDocgen.main(SampleDocgen.java:379)
Caused by: org.apache.http.ProtocolException: Target host is not specified
at org.apache.http.impl.conn.DefaultRoutePlanner.determineRoute(DefaultRoutePlanner.java:70)
at org.apache.http.impl.client.InternalHttpClient.determineRoute(InternalHttpClient.java:124)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:183)
... 8 more
[Sample] 08:32:12 -
[Sample] 08:32:12 - Loading docspec ...
[Sample] 08:32:16 - Preparing docspec ...
Exception in thread "RRDG_Thread-7-REMOTE_DOCGEN" java.lang.NoClassDefFoundError: com.google.gson.Gson
at com.ibm.rational.rpe.api.docgen.job.DGaaSRemoteJob.getJobAttribute(DGaaSRemoteJob.java:198)
at com.ibm.rational.rpe.api.docgen.job.DGaaSRemoteJob.createJob(DGaaSRemoteJob.java:119)
at com.ibm.rational.rpe.api.docgen.RemoteDocumentGenerator$Runner.run(RemoteDocumentGenerator.java:194)
at java.lang.Thread.run(Thread.java:811)
Caused by: java.lang.ClassNotFoundException: com.google.gson.Gson
at java.net.URLClassLoader.findClass(URLClassLoader.java:609)
at java.lang.ClassLoader.loadClassHelper(ClassLoader.java:924)
at java.lang.ClassLoader.loadClass(ClassLoader.java:869)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:332)
at java.lang.ClassLoader.loadClass(ClassLoader.java:852)
... 4 more
Exception in thread "main" java.lang.IllegalStateException: failure 'Remote document generation failed for report URL file:/C:/path/to/TestReport.dsx'
at com.ibm.icu.impl.Assert.fail(Assert.java:15)
at com.ibm.rational.rpe.examples.docgen.SampleDocgen.run(SampleDocgen.java:221)
at com.ibm.rational.rpe.examples.docgen.SampleDocgen.main(SampleDocgen.java:379)
com.google.gson_2.2.4.v20170102_1506.jar is in the Classpath.
Has anybody managed to generate documents via DGAAS?
I want to avoid installing RPE on the server.
The client's environment is:
- CLM Version 6.0.6 iFix20b
- Jazz Authorization Server
Thanks,
Stefan
|
Accepted answer
It indeed turned out to be a Defect: Ralph Schoon selected this answer as the correct answer
|
2 other answers
I managed to fix the NoClassDefFoundError for com.google.gson.Gson. I extracted com.google.gson_2.2.4.v20170102_1506.jar and saw that it contains a lib directory with a gson-2.2.4.jar. file. Putting this jar in the Classpath solved the NoClassDefFoundError . According to the logfile the document was generated now. But there is an issue storing it to the database leading to a SQLServerException. Seems that I need to get in contact with support ...
[Sample] 09:33:33 - Running document specification: file:/C:/path/to/TestReport.dsx
[Sample] 09:33:33 - RPE Engine version: 6.0.6
[Sample] 09:33:33 - Java version: 1.8.0_161
[Sample] 09:33:33 - Java vendor: IBM Corporation
[Sample] 09:33:33 - Java arch: amd64
[Sample] 09:33:33 - type: DOCSPEC
[Sample] 09:33:33 - Remote URL: https://<server>/dgaas
[Sample] 09:33:33 - Remote USER: oblinges
[Sample] 09:33:33 - RPENG Base URL:
[Sample] 09:33:33 - Remote document generation
[RPE] 09:33:34 - Error while getting the secret.
org.apache.http.client.ClientProtocolException
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:186)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:55)
at com.ibm.rational.rpe.api.docgen.job.RemoteJobUtils.performFormAuthHttpAndGet(RemoteJobUtils.java:320)
at com.ibm.rational.rpe.api.docgen.job.DGaaSRemoteJob.<init>(DGaaSRemoteJob.java:72)
at com.ibm.rational.rpe.api.docgen.RemoteJobFactory.getRemoteJobHandler(RemoteJobFactory.java:31)
at com.ibm.rational.rpe.api.docgen.RemoteDocumentGenerator.<init>(RemoteDocumentGenerator.java:94)
at com.ibm.rational.rpe.examples.docgen.SampleDocgen.run(SampleDocgen.java:122)
at com.ibm.rational.rpe.examples.docgen.SampleDocgen.main(SampleDocgen.java:379)
Caused by: org.apache.http.ProtocolException: Target host is not specified
at org.apache.http.impl.conn.DefaultRoutePlanner.determineRoute(DefaultRoutePlanner.java:70)
at org.apache.http.impl.client.InternalHttpClient.determineRoute(InternalHttpClient.java:124)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:183)
... 8 more
[Sample] 09:33:34 -
[Sample] 09:33:34 - Loading docspec ...
[Sample] 09:33:38 - Preparing docspec ...
[Sample] 09:33:39 - Remote job is https://<server>/dgaas/data/jobs/DGAAS_d45c63d3-d57b-45d3-94ab-7b7bf5e8e3d5
[Sample] 09:33:40 - Die DGaaS-Lizenz wurde für 0e7cd2f0-c3fc-420f-b7a2-8f980aadf555 erfolgreich ausgecheckt.
[Sample] 09:33:40 - Ausführung wird gestartet...
[Sample] 09:33:41 - Datenquelle WorkItem mit URL https://<server>/ccm/rpt/repository/workitem/workItem/id/49058?fields=workitem/workItem/(creationDate%7Cdescription%7Cid%7Csummary%7CallExtensions/(displayName%7CdisplayValue)%7CapprovalDescriptors/(cumulativeStateName%7Cname%7Capprovals/approver/(name))%7CauditableLinks/(name)%7Ccategory/(name)%7Ccreator/(name)%7CdueDate%7Cowner/(name)%7Cstate/(name)%7Ctype/(name))
[Sample] 09:33:41 - Datenquelle WorkItem mit URL C:\Windows\TEMP\RPE\temp\url_4cdae5f8-ce19-4ac7-b784-167e520962fe.tmp
[Sample] 09:33:41 - 400 Eingabeelemente wurden verarbeitet.
[Sample] 09:33:41 - 200 Eingabeelemente wurden verarbeitet.
[Sample] 09:33:41 - Gesamtzahl verarbeiteter Eingabeelemente: 409
[Sample] 09:33:41 - 1211 Veröffentlichungsbefehle verarbeitet. 0 Veröffentlichungsbefehle stehen noch zur Verarbeitung an.
[Sample] 09:33:41 - Datenanforderungszeit insgesamt: 0,25 Sekunden
[Sample] 09:33:41 - Dokumentgenerierung wird abgeschlossen. Ausgabedateien werden geschrieben...
[Sample] 09:33:41 - Das Ergebnis konnte nicht in den Speicherservice hochgeladen werden. Fehler: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near the keyword 'FILE'.
Error Code: 156
Call: INSERT INTO JOBRESULTDAO (ID, FILE, NAME, SECRET, TYPE, JOB_ID) VALUES (?, ?, ?, ?, ?, ?)
bind => [6 parameters bound]
Query: InsertObjectQuery(com.ibm.rpe.web.service.docgen.storage.dbstorage.dao.JobResultDAO@4ce5d6c5)
[Sample] 09:33:41 - Die DGaaS-Lizenz wurde erfolgreich eingecheckt.
[Sample] 09:33:41 - Das Ergebnis konnte nicht in den Speicherservice hochgeladen werden. Fehler: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near the keyword 'FILE'.
Error Code: 156
Call: INSERT INTO JOBRESULTDAO (ID, FILE, NAME, SECRET, TYPE, JOB_ID) VALUES (?, ?, ?, ?, ?, ?)
bind => [6 parameters bound]
Query: InsertObjectQuery(com.ibm.rpe.web.service.docgen.storage.dbstorage.dao.JobResultDAO@866823e4)
[Sample] 09:33:41 - Generieren des Dokuments wurde in 1 Sekunden abgeschlossen.
[Sample] 09:33:42 - Remote job finished with finished.
[Sample] 09:33:42 - The download link for log is https://<server>/dgaas/data/jobs/DGAAS_d45c63d3-d57b-45d3-94ab-7b7bf5e8e3d5.
[Sample] 09:33:42 - Engine execution finished succesfully. The results are:
[Sample] 09:33:42 - log: https://<server>/dgaas/data/jobs/DGAAS_d45c63d3-d57b-45d3-94ab-7b7bf5e8e3d5
[RPE] 09:33:43 - CRRPE3617I Data request time for artifact - https://<server>/dgaas/data/jobs/DGAAS_d45c63d3-d57b-45d3-94ab-7b7bf5e8e3d5 : 0.201 seconds
[Sample] 09:33:43 - log local copy: C:\Users\oblinges\AppData\Local\Temp\10\RPE\temp\url_b5644895-00a7-476e-9eda-ad5af58d961a.log
[Sample] 09:33:43 - All done
|
Ralph Schoon (63.6k●3●36●46)
| answered Jul 22 '21, 3:57 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Stefan, I think there is no hope trying to reach this host:
[Sample] 09:33:33 - Remote URL: https://<server>/dgaas
Comments
Stefan Oblinger
commented Jul 22 '21, 4:02 a.m.
Sure, Ralph. I replaced for this post the actual server name with a "<server>" placeholder and some paths with "/path/to".
Thanks anyway,
Stefan
Ralph Schoon
commented Jul 22 '21, 4:06 a.m.
| edited Jul 22 '21, 4:07 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Sorry Stefan, I did not understand it that way. Makes sense if you wanted to obfuscate the host name. Please contact support.
|
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.