cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community email notifications are disrupted. While we are working to resolve, please check on your favorite boards regularly to keep up with your conversations and new topics.

Jasper Studio Connection to WC12

Iblackie
9-Granite

Jasper Studio Connection to WC12

I have been trying to connect Jasper Studio to WC 12 to add more parameters to the OOTB Change_Notice_Summary_Report.  Documentation is not getting me to full solution.

I can get the datasetxxxx.jar from WC and place it in the Plugins folder along with the log4j-api.jar.
I can open the report and do a simple edit and send it back to WC to run the updated report and I see the simple edit.  I cannot , however, see any of my custom attributes inside of the Jasper studio when I add a table or field,
Each time I preview the report it fails with errors that say:
net.sf.jasperreports.engine.JRException: net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression for source text: new net.sf.jasperreports.engine.data.JRXmlDataSource($P{WINDCHILL_URL}+"?proc=com_ptc_windchill_enterprise_report_ReportTask%23ChangeNoticeSummaryHeader&contextOid="+$P{contextOid}+"&isDraft=" + $P{isDraft} +"&uid="+$P{USERNAME}+"&locale="+$P{LOCALE},"/dataset/data/row")
at com.jaspersoft.studio.editor.preview.view.control.ReportController.fillReport(ReportController.java:553)
at com.jaspersoft.studio.editor.preview.view.control.ReportController$1.run(ReportController.java:446)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression for source text: new net.sf.jasperreports.engine.data.JRXmlDataSource($P{WINDCHILL_URL}+"?proc=com_ptc_windchill_enterprise_report_ReportTask%23ChangeNoticeSummaryHeader&contextOid="+$P{contextOid}+"&isDraft=" + $P{isDraft} +"&uid="+$P{USERNAME}+"&locale="+$P{LOCALE},"/dataset/data/row")
at net.sf.jasperreports.engine.fill.JREvaluator.handleEvaluationException(JREvaluator.java:294)
at net.sf.jasperreports.engine.fill.JREvaluator.evaluate(JREvaluator.java:328)
at net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:673)
at net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:641)
at net.sf.jasperreports.engine.fill.JRFillElement.evaluateExpression(JRFillElement.java:1247)
at net.sf.jasperreports.engine.fill.JRFillSubreport.evaluateSubreport(JRFillSubreport.java:529)
at net.sf.jasperreports.components.table.fill.FillTableSubreport.evaluateSubreport(FillTableSubreport.java:112)
at net.sf.jasperreports.components.table.fill.FillTable.evaluate(FillTable.java:136)
at net.sf.jasperreports.engine.fill.JRFillComponentElement.evaluate(JRFillComponentElement.java:110)
at net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluate(JRFillElementContainer.java:383)
at net.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:548)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:2614)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:837)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:276)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:119)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:631)
at net.sf.jasperreports.engine.fill.BaseFillHandle$ReportFill.run(BaseFillHandle.java:135)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: net.sf.jasperreports.engine.JRRuntimeException: net.sf.jasperreports.engine.JRException: Error opening input stream from URL: https://PLMTEST/Windchill/servlet/ReportServlet?proc=com_ptc_windchill_enterprise_report_ReportTask%23ChangeNoticeSummaryHeader&contextOid=/&isDraft=no&uid=Administrator&locale=en_US.
at net.sf.jasperreports.repo.DefaultRepositoryService.getInputStream(DefaultRepositoryService.java:139)
at net.sf.jasperreports.repo.InputStreamPersistenceService.load(InputStreamPersistenceService.java:51)
at net.sf.jasperreports.repo.DefaultRepositoryService.getResource(DefaultRepositoryService.java:196)
at net.sf.jasperreports.repo.RepositoryUtil.findInputStream(RepositoryUtil.java:195)
at net.sf.jasperreports.repo.RepositoryUtil.getInputStreamFromLocation(RepositoryUtil.java:172)
at net.sf.jasperreports.engine.data.JRXmlDataSource.<init>(JRXmlDataSource.java:333)
at net.sf.jasperreports.engine.data.JRXmlDataSource.<init>(JRXmlDataSource.java:321)
at net.sf.jasperreports.engine.data.JRXmlDataSource.<init>(JRXmlDataSource.java:350)
at net.sf.jasperreports.engine.data.JRXmlDataSource.<init>(JRXmlDataSource.java:345)
at Change32Notice32Summary32Report_1690830610647_270468.evaluate(Change32Notice32Summary32Report_1690830610647_270468:91)
at net.sf.jasperreports.engine.fill.JREvaluator.evaluate(JREvaluator.java:313)
... 16 more
Caused by: net.sf.jasperreports.engine.JRException: Error opening input stream from URL: https://PLMTEST/Windchill/servlet/ReportServlet?proc=com_ptc_windchill_enterprise_report_ReportTask%23ChangeNoticeSummaryHeader&contextOid=/&isDraft=no&uid=Administrator&locale=en_US.
at net.sf.jasperreports.engine.util.JRLoader.getInputStream(JRLoader.java:291)
at net.sf.jasperreports.repo.DefaultRepositoryService.getInputStream(DefaultRepositoryService.java:122)
... 26 more
Caused by: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at java.base/sun.security.ssl.Alert.createSSLException(Unknown Source)
at java.base/sun.security.ssl.TransportContext.fatal(Unknown Source)
at java.base/sun.security.ssl.TransportContext.fatal(Unknown Source)
at java.base/sun.security.ssl.TransportContext.fatal(Unknown Source)
at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.checkServerCerts(Unknown Source)
at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.onCertificate(Unknown Source)
at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.consume(Unknown Source)
at java.base/sun.security.ssl.SSLHandshake.consume(Unknown Source)
at java.base/sun.security.ssl.HandshakeContext.dispatch(Unknown Source)
at java.base/sun.security.ssl.HandshakeContext.dispatch(Unknown Source)
at java.base/sun.security.ssl.TransportContext.dispatch(Unknown Source)
at java.base/sun.security.ssl.SSLTransport.decode(Unknown Source)
at java.base/sun.security.ssl.SSLSocketImpl.decode(Unknown Source)
at java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(Unknown Source)
at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at java.base/sun.net.www.protocol.https.HttpsClient.afterConnect(Unknown Source)
at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Unknown Source)
at java.base/java.net.URL.openStream(Unknown Source)
at net.sf.jasperreports.engine.util.JRLoader.getInputStream(JRLoader.java:287)
... 27 more
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at java.base/sun.security.validator.PKIXValidator.doBuild(Unknown Source)
at java.base/sun.security.validator.PKIXValidator.engineValidate(Unknown Source)
at java.base/sun.security.validator.Validator.validate(Unknown Source)
at java.base/sun.security.ssl.X509TrustManagerImpl.validate(Unknown Source)
at java.base/sun.security.ssl.X509TrustManagerImpl.checkTrusted(Unknown Source)
at java.base/sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown Source)
... 46 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at java.base/sun.security.provider.certpath.SunCertPathBuilder.build(Unknown Source)
at java.base/sun.security.provider.certpath.SunCertPathBuilder.engineBuild(Unknown Source)
at java.base/java.security.cert.CertPathBuilder.build(Unknown Source)
... 52 more

 

I could be facing more than one Issue here, local PTC partners are not well versed in Jasper Reports so I am reaching out to the community. if anyone has a few minutes it would be appreciated.

Ian

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi Shussaini,
Your reply was helpful, I asked my sys admin to look closely at the certificates and he did find a missing intermediate certificate on the HTTP server side as well as in the java trust store.  It helped with some of the errors, the remaining errors were pointing to the WINDCHILL_URL, USERNAME and ContextOID. These Jasper Parameters need to be configured specifically to your system and since the PTC Documentation does not clarify much of this, I will do my best to describe the steps so future users don't waste precious time trying to figure this out. Windchill 12.0.2.1 & Jasper Studio 6.20.5 Community edition.

On the Input Parameters GUI in your Jasper Report, follow these guidelines.

  1. For the WINDCHILL_URL it must be the FQDN of your server + the path to the ReportServlet, in my case it is https:
    https://plm.yourcompany.com/Windchill/servlet/ReportServlet
    Article - CS366437 - When authoring Jasper Report using Report Task, what should be the value of WINDCHILL_URL parameter in Windchill 12 (ptc.com)

  2. For the USERNAME it must be the same as the one entered in the auth.properties file, this is the same credentials used for CAD-workers if they are used.  Simply type the username in the Jasper Parameter field and the auth.properties will do the rest. eg. orgadmin.
  3. ContextOID: This is the specific OID of the object you expect to preview in your report. My object is a change notice (change order) with a number ECO22-0400 so when you are on the details page you will find its OID lurking in the URL. 
    eg. https://plm.yourcompany.com/Windchill/app/#ptc1/tcomp/infoPage?oid=VR%3Awt.change2.WTChangeOrder2%3A12454440&u8=1 
    Keep the text in red after the OID= and also keep the URL formatted special characters %3A shown twice in this example. Paste it in the ContextOID field of the Jasper Input Parameter GUI.
  4. If you have a LOCALE it is most commonly English US, so the value of that is en_US (I believe it is case sensitive)
  5. If you have isDraft among your input parameters, I put YES, I think you can put NO, just don't leave it empty (Null).

Special note for item #1 on the list.  My tests are done from my PC where I am a trusted admin of our PLM(s), in order for you to be able to connect to the Windchill server, Windchill must first TRUST your PC using its IP address (or FQDN). to do this you have to add your IP to the wt.auth.trustedHosts property.

    <Property name="wt.auth.trustedHosts" overridable="true"
        targetFile="codebase/wt.properties"
        value="<Your CAD Worker FQDN><Your PCs IP>"/>  (separating the values with a comma worked for me)
https://www.ptc.com/en/support/article/CS182327?source=search (
information of property wt.auth.trustedHosts)

https://www.ptc.com/en/support/article/CS94147?source=search (How to use xconfmanager to change the Windchill property files in Windchill)

Jasper Input Parameters GUI with previewJasper Input Parameters GUI with preview

 

Enjoy Reporting
Ian Blackie

View solution in original post

4 REPLIES 4

Your Windchill is using a SSL certificate. Make sure all the public certificates are added to the <jdk>\jre\lib\security\cacerts. This will also require Windchill to be restarted. Also make sure the parameter value should be specified as http(s)://<Windchill_DNS_Host_Name>/Windchill/servlet/ReportServletThis is same as the property value wt.server.codebase.

 

regards
~Syed

Hi Shussaini,
Your reply was helpful, I asked my sys admin to look closely at the certificates and he did find a missing intermediate certificate on the HTTP server side as well as in the java trust store.  It helped with some of the errors, the remaining errors were pointing to the WINDCHILL_URL, USERNAME and ContextOID. These Jasper Parameters need to be configured specifically to your system and since the PTC Documentation does not clarify much of this, I will do my best to describe the steps so future users don't waste precious time trying to figure this out. Windchill 12.0.2.1 & Jasper Studio 6.20.5 Community edition.

On the Input Parameters GUI in your Jasper Report, follow these guidelines.

  1. For the WINDCHILL_URL it must be the FQDN of your server + the path to the ReportServlet, in my case it is https:
    https://plm.yourcompany.com/Windchill/servlet/ReportServlet
    Article - CS366437 - When authoring Jasper Report using Report Task, what should be the value of WINDCHILL_URL parameter in Windchill 12 (ptc.com)

  2. For the USERNAME it must be the same as the one entered in the auth.properties file, this is the same credentials used for CAD-workers if they are used.  Simply type the username in the Jasper Parameter field and the auth.properties will do the rest. eg. orgadmin.
  3. ContextOID: This is the specific OID of the object you expect to preview in your report. My object is a change notice (change order) with a number ECO22-0400 so when you are on the details page you will find its OID lurking in the URL. 
    eg. https://plm.yourcompany.com/Windchill/app/#ptc1/tcomp/infoPage?oid=VR%3Awt.change2.WTChangeOrder2%3A12454440&u8=1 
    Keep the text in red after the OID= and also keep the URL formatted special characters %3A shown twice in this example. Paste it in the ContextOID field of the Jasper Input Parameter GUI.
  4. If you have a LOCALE it is most commonly English US, so the value of that is en_US (I believe it is case sensitive)
  5. If you have isDraft among your input parameters, I put YES, I think you can put NO, just don't leave it empty (Null).

Special note for item #1 on the list.  My tests are done from my PC where I am a trusted admin of our PLM(s), in order for you to be able to connect to the Windchill server, Windchill must first TRUST your PC using its IP address (or FQDN). to do this you have to add your IP to the wt.auth.trustedHosts property.

    <Property name="wt.auth.trustedHosts" overridable="true"
        targetFile="codebase/wt.properties"
        value="<Your CAD Worker FQDN><Your PCs IP>"/>  (separating the values with a comma worked for me)
https://www.ptc.com/en/support/article/CS182327?source=search (
information of property wt.auth.trustedHosts)

https://www.ptc.com/en/support/article/CS94147?source=search (How to use xconfmanager to change the Windchill property files in Windchill)

Jasper Input Parameters GUI with previewJasper Input Parameters GUI with preview

 

Enjoy Reporting
Ian Blackie

I am happy my response was helpful. FYI, we are going to soon have a basic training on reporting. Tentatively to be released in October. Refer the Windchill training catalog.

 

regards

~Syed

Looking forward to the new training material.
I would like to edit a section of my thread, if you use a VPN your IP address will likely change so use the FQDN of your PC instead of the IP.
To get that info, copy this into a command prompt on your PC: echo %computername%.%userdnsdomain%

  <Property name="wt.auth.trustedHosts" overridable="true"
        targetFile="codebase/wt.properties"
        value="<Your CAD Worker FQDN>,<Your PC's FQDN>"/>  

Thank you,
Ian

Top Tags