tag:blogger.com,1999:blog-34020393.post7383201680868462969..comments2024-03-27T10:59:38.307-07:00Comments on Jim's PeopleSoft Journal: Dynamic Java in PeopleCodeJim Marionhttp://www.blogger.com/profile/12995110203807924786noreply@blogger.comBlogger34125tag:blogger.com,1999:blog-34020393.post-36740000443875385872023-10-26T18:47:44.952-07:002023-10-26T18:47:44.952-07:00@Parth, great question! A JWT is a three-part toke...@Parth, great question! A JWT is a three-part token that uses a modified base64 encoding. The final part contains a signature that we are supposed to verify. Common encryption for the signature uses passphrases (HMAC SHA 256) or certificates. In its simplest form, without signature verification, you would do something like this:<br /><br />Local Array of String &parts = Split (&jwt, ".");<br /><br />Each part would then contain the modified base64. You then decode the part and JSON Parse it using the JsonParser.<br /><br />I have this all documented in our Integration Tools courses, but don't have the algorithm published outside yet.Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-47851352154112375082023-10-14T07:46:52.609-07:002023-10-14T07:46:52.609-07:00Hi Jim,
We have a requirement where PeopleSoft ha...Hi Jim,<br /><br />We have a requirement where PeopleSoft has to parse JWT token in Sign-on PeopleCode.<br />Kindly shed some light on this matter. How to achieve it through Peoplecode.Parthhttps://www.blogger.com/profile/06816391034598026031noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-16481276475285422192021-03-19T14:32:28.040-07:002021-03-19T14:32:28.040-07:00Hi Tom,
The JavaDoc says there should already be ...Hi Tom,<br /><br />The JavaDoc says there should already be a protocol handler for https, so I believe the answer is Yes: https://docs.oracle.com/javase/7/docs/api/java/net/URL.html. Here is a Java example that accesses a site through SSL: https://mkyong.com/java/java-https-client-httpsurlconnection-example/.Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-25802154791036548742021-03-18T12:05:36.216-07:002021-03-18T12:05:36.216-07:00Hi Jim.
I am trying to access a zip file via a RE...Hi Jim.<br /><br />I am trying to access a zip file via a REST API going out to a third party. Attempting to replicate your Custom HTTP Connections example. But I am getting an SSL error. The url I'm attempting to access is a HTTPS. Any suggestions? Should your example work for an https url too?<br /><br />Thanks!<br />TomAnonymoushttps://www.blogger.com/profile/11468825640660750176noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-88903229979444736932020-02-08T06:48:46.815-08:002020-02-08T06:48:46.815-08:00@Viswanatha, PeopleSoft follows standard Operating...@Viswanatha, PeopleSoft follows standard Operating System path loading procedures. Operating systems vary, but the search path usually involves the same folder where the executable loaded, the path environment variable, etc.Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-16526905591543287482020-02-03T07:52:07.434-08:002020-02-03T07:52:07.434-08:00Hi Jim
I would like to call function within DLL f...Hi Jim<br /><br />I would like to call function within DLL from peoplecode, in that case where should we place the DLL?<br /><br />Thanks<br />VisViswanatha Reddyhttps://www.blogger.com/profile/10559983699943054082noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-33875479792470561172020-01-05T17:16:06.924-08:002020-01-05T17:16:06.924-08:00@Unknown, great comment! The JavaScript in this bl...@Unknown, great comment! The JavaScript in this blog MUST be run in the context of the app server JVM. It CANNOT be run from a browser console. It would be awesome if it were that easy! But then that might be considered a security vulnerability.Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-65002190842049546452020-01-02T11:24:53.722-08:002020-01-02T11:24:53.722-08:00Being new to the PeopleSoft and PeopleCode environ...Being new to the PeopleSoft and PeopleCode environment (started 3 months ago) I'm quickly learning the ins and outs of these tools. I've recently found myself wanting to use the tricks described in this post. Namely calling JS from with PeopleCode and then being able to call PC functions from JS. <br /><br />Currently I'm just trying to call SQLExec via JS like so:<br /><br />var SQLExec = Packages.PeopleSoft.PeopleCode.Func.SQLExec;<br />SQLExec("update tableName set column1 = current_timestamp WHERE column2 = :1", ['9923']);<br /><br />I'm getting an Uncaught ReferenceError in the browser console, Packages is not defined. <br /> <br />We are on an old set of tools (8.49) which might be the only part of the problem. <br /><br />Thanks for any input. Anonymoushttps://www.blogger.com/profile/11172199739925246797noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-90114907416409846492018-04-25T14:58:44.065-07:002018-04-25T14:58:44.065-07:00That works if the Java is utility in nature and yo...That works if the Java is utility in nature and you don't need to process a response. In some respects it may be easier for a developer to manage because you have complete control over the class path.Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-1752038250097754682018-04-25T12:47:27.956-07:002018-04-25T12:47:27.956-07:00Thanks Jim, I used Exec command with AE to call JA...Thanks Jim, I used Exec command with AE to call JAR file. Working as required.Duraihttps://www.blogger.com/profile/17637027875436928481noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-64632114607517734742018-04-25T08:14:46.469-07:002018-04-25T08:14:46.469-07:00@Durai,
Step 1: deploy Java to the app server'...@Durai,<br /><br />Step 1: deploy Java to the app server's classpath. This should be something like $PS_HOME/appserv/classes. You can also modify the classpath in psappsrv.cfg.<br /><br />Step 2: Restart the app server. PeopleSoft loads Java with the first Java request, and then doesn't unload the JVM until restarting the app server. Jars in that folder are concatenated into the classpath by startup scripts.<br /><br />Step 3: Run PeopleCode to test.<br /><br />You can also test locally in an App Engine run through App Designer. The great benefit with this approach is you don't have to restart the app server until you have tested and are ready to deploy.Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-77564606977856008352018-04-25T06:31:25.303-07:002018-04-25T06:31:25.303-07:00@Jim- Do we need to include package path in the Ja...@Jim- Do we need to include package path in the Java program? I'm keep on getting <br />Java Exception: java.lang.NoClassDefFoundError<br />Any input or reference within PeopleCode. Thank you.Duraihttps://www.blogger.com/profile/17637027875436928481noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-8501406926880932672018-04-24T00:05:05.846-07:002018-04-24T00:05:05.846-07:00@Durai, it depends on your PeopleTools release. Th...@Durai, it depends on your PeopleTools release. The easiest way to find out is to find the JRE that is used with the app server and run java -version.Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-25879553334643041442018-04-23T18:58:45.144-07:002018-04-23T18:58:45.144-07:00@Jim- Getting the following error while referring ...@Jim- Getting the following error while referring the JAR file. What version do we need to look for?<br /><br />Java Exception: java.lang.UnsupportedClassVersionError: CopyExcelData : Unsupported major.minor vers ion 52.0: finding class CopyExcelData (2,725) <br /><br />Thank youDuraihttps://www.blogger.com/profile/17637027875436928481noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-61586121158464221152018-04-23T07:16:46.135-07:002018-04-23T07:16:46.135-07:00@Durai, only if you plan to use it in both. If it ...@Durai, only if you plan to use it in both. If it will only be used for online PeopleCode (iScripts, FieldChange, etc), then just put it in the app server. Likewise, if it is just used in AppEngine, then put it in the process scheduler.Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-39158622854516076862018-04-23T07:11:20.597-07:002018-04-23T07:11:20.597-07:00Thanks Jim. Do we need to place the JAR file on bo...Thanks Jim. Do we need to place the JAR file on both App & process scheduler class path?Duraihttps://www.blogger.com/profile/17637027875436928481noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-30204077476864258232018-04-20T14:22:02.655-07:002018-04-20T14:22:02.655-07:00@Durai, Java is case sensitive, so it would be jav...@Durai, Java is case sensitive, so it would be java.lang.Class.<br /><br />Regarding jars, just make sure they are in the app or process scheduler class path.Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-10568801745407648002018-04-20T13:20:01.885-07:002018-04-20T13:20:01.885-07:00Hi Jim,
How do we invoke JAR file from PeopleC...Hi Jim,<br /><br /> How do we invoke JAR file from PeopleCode? I gave the following code and getting class not found error.<br />Local JavaObject &jExcel = GetJavaClass("java.lang.class");<br /><br />&ret = &jExcel.ExcelCopyData("/intfc/HCMDEVD/Job_Profiles_Test.xlsx", "data", 1);<br /><br />I'm getting Java Exception: java.lang.NoClassDefFoundError<br />ANy inputs?<br /><br />Thanks<br />DuraiDuraihttps://www.blogger.com/profile/17637027875436928481noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-27783741852800217272018-04-20T13:19:20.505-07:002018-04-20T13:19:20.505-07:00Hi Jim,
How do we invoke JAR file from PeopleC...Hi Jim,<br /><br /> How do we invoke JAR file from PeopleCode? I gave the following code and getting class not found error.<br />Local JavaObject &jExcel = GetJavaClass("java.lang.class");<br /><br />&ret = &jExcel.ExcelCopyData("/intfc/HCMDEVD/Job_Profiles_Test.xlsx", "data", 1);<br /><br />I'm getting Java Exception: java.lang.NoClassDefFoundError<br />ANy inputs?<br /><br />Thanks<br />DuraiDuraihttps://www.blogger.com/profile/17637027875436928481noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-65569742374127066472018-01-16T21:15:28.393-08:002018-01-16T21:15:28.393-08:00@Ram the easiest way today is to use the PeopleCod...@Ram the easiest way today is to use the PeopleCode API for Excel. If that isn't an option, then you can pass bind values or other parameters to the ScriptEngineManager as variables. You can see an example in this blog post: https://jjmpsj.blogspot.com/2015/09/javascript-on-app-server-scripting.html.Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-90394293503812859932018-01-16T16:40:01.190-08:002018-01-16T16:40:01.190-08:00Hi Jim,
I am very happy to send this post, i have...Hi Jim,<br /><br />I am very happy to send this post, i have one quick question. my requirement was user's while click on one hiperlink/pushbutton one excel sheet should be downloaded based online line data. so how to write the code and if incase if i create Java script how to pass my bind values.<br /><br />Please let me know if you have any idea about that it's very helpful for me.<br /><br /><br />Thanks,<br />Ram Y.Anonymoushttps://www.blogger.com/profile/06061934588262916263noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-3333203697055403642017-04-26T08:34:20.346-07:002017-04-26T08:34:20.346-07:00This comment has been removed by the author.Anonymoushttps://www.blogger.com/profile/05839850671701712426noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-54245343054062437152016-09-21T22:34:59.821-07:002016-09-21T22:34:59.821-07:00@Steve, I don't think query uses POI. PS/nVisi...@Steve, I don't think query uses POI. PS/nVision uses POI. Besides that, no I'm sorry, I don't have recommendations. You might try posting the tuning and confguration question on the OTN PeopleSoft discussion forum.Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-13241754814692920632016-09-21T14:01:54.596-07:002016-09-21T14:01:54.596-07:00Jim,
We just recently upgraded to PT 8.54 and are...Jim,<br /><br />We just recently upgraded to PT 8.54 and are having some issues with the Apache POI libraries that are used for psquery. We have a very large client with over 350K employees and our HR users need to run queries with all employees in the result. When running to excel we are running into GC overhead limit reach errors and have to restart our PSQRYSRV processes to reset the heap. Any thoughts on how best to tune appserver memory for these new libraries with larger results?<br /><br />ThanksAnonymoushttps://www.blogger.com/profile/14708223314564650269noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-84311708010934044692016-08-24T10:05:36.863-07:002016-08-24T10:05:36.863-07:00Yes, absolutely! App Packages are available throug...Yes, absolutely! App Packages are available through a Java interface and are documented in the Java section of PeopleBooks. FUNCLIBs are not available directly, but through App Class wrappers.Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.com