Author: digitaleagle

PeopleCode: Unzipping

I come upon a requirement to unzip a file in a platform independent way.  Jim Marion got me most of the way, but his code didn’t write it to file.  Here’s my adjustment to make a function that wrote it to file:

Function unzip(&inputZipFile, &targetDir)
  Local JavaObject &zipFileInputStream = CreateJavaObject("java.io.FileInputStream", &inputZipFile);
  Local JavaObject &zipInputStream = CreateJavaObject("java.util.zip.ZipInputStream", &zipFileInputStream);
  Local JavaObject &zipEntry = &zipInputStream.getNextEntry();
  Local JavaObject &buf = CreateJavaArray("byte[]", 1024);
  Local number &byteCount;

  While &zipEntry <> Null

    If (&zipEntry.isDirectory()) Then
      REM ** do nothing;
    Else
      Local JavaObject &outFile = CreateJavaObject("java.io.File", &targetDir | &zipEntry.getName());
      &outFile.getParentFile().mkdirs();
      Local JavaObject &out = CreateJavaObject("java.io.FileOutputStream", &outFile);
      &byteCount = &zipInputStream.read(&buf);

      While &byteCount > 0
        &out.write(&buf, 0, &byteCount);
        &byteCount = &zipInputStream.read(&buf);
      End-While;

      &zipInputStream.closeEntry();
    End-If;

    &zipEntry = &zipInputStream.getNextEntry();
  End-While;

  &zipInputStream.close();
  &zipFileInputStream.close();
End-Function;

unzip("/tmp/myzipfile.zip", "/tmp/out");

Resources

Book Review: Governance, Risk, and Compliance Handbook for Oracle Applications

 Just recently, I had the opportunity to review this book: Governance, Risk, and Compliance Handbook for Oracle Applications.

The book was very interesting and covered a broad range of information regarding governance, risk, and compliance.  It was very good at giving a high level picture that could span across a broad organization.

Multiple applications were mentioned.  Hyperion, Oracle Applications, and of course Oracle GRC were mentioned with screenshots.  The book didn’t dive into specific step by step detail, but it did give some screenshots and just enough detail to accomplish the best practices.

All in all, I felt that this was a good book to paint the big picture and help implement best practices in the area of GRC.

If you’re interested, please check it out here at Packt.

Troubleshooting PeopleTools Version Mismatch

I got the following error message after installing the PeopleTools 8.52.10 patch:

PeopleTools release (8.52.10) for web server/ Application Designer ‘lxdevweb02.pugetsound.edu’ is not the same as Application Server PeopleTools release (8.52.02). Access denied.

CHECK APPSERVER LOGS. THE SITE BOOTED WITH INTERNAL DEFAULT SETTINGS, BECAUSE OF: bea.jolt.ApplicationException: TPESVCFAIL – application level service failure

To fix the problem, I just reconfigured the Application Server.

I found that I needed to change something to make it think that it needs to load the configuration.  So, I changed the WSL option.  After loading the configuration, I changed it back and loaded it a second time.

After booting the Application Server again, everything worked fine.  The instructions didn’t say anything about reconfiguring the Application Server, but I found that I had to do it.  I don’t know if this has anything to do with it, but I did change my PS_HOME environment variable as part of the patch installation.  The tools version  (patch number included) is in the path for my PS_HOME.

Now, on a side note, if you get just this message:

CHECK APPSERVER LOGS. THE SITE BOOTED WITH INTERNAL DEFAULT SETTINGS, BECAUSE OF: bea.jolt.ApplicationException: TPESVCFAIL – application level service failure

The problem is probably that the web server cannot talk to the application server.  Here are a few things to check:

  • Is the application server started?  Use psadmin to check the application server status.
  • Is the firewall blocking connections?  Use “sudo service iptables stop” to turn off the firewall.  If that fixes the problem, configure iptables to allow the JSL port.
  • Are the application server and web server using the same port?  Check the psappsrv.cfg file to see what the JSL port is (or use psadmin).  Check the <ps cfg home>/webserv/<domain name>/applications/peoplesoft/PORTAL.war/WEB-INF/psftdocs/<site name>/configuration.properties file for the psserver port (or use psadmin)
  • Is the app server hostname configured to localhost?  On the application server, ping the server name.  If it comes back with 127.0.0.1, you have a problem.  If your configuration is supposed to be listening on the hostname, it will be listening on localhost.  Either change /etc/hosts or put the actual IP address in the app server configuration file.
  • Is the host name on the web server the actual hostname on the app server?  It’s pretty easy to accidentally just put the web server host name as the application server.

I hope those thoughts help more than just me.

Jethro List: Disable Restart

For my first item on the Jethro List, I want to suggest changing the default on the “Disable Restart” option for an Application Engine program.  I think it should be checked by default.

Just to introduce the Jethro List: these posts are a list of good influences on the PeopleSoft world that I would like to make.  Hopefully, they are good suggestions that I would love to get noticed and implemented.  We’ll see if it goes anywhere.

So, what about the Disable Restart option?

The default right now as of PeopleTools 8.52 is that the Disable Restart is unchecked.

The problem is that the first time your new program abends or crashes, you have extra work to do.  You have to either restart the same process instance or delete the AERUNCONTROL row.  You can see the PeopleTools Tip — App Engine Restart If you get … post for more info on fixing the problem.

Why should it default to checked?  Because you have to design a program to be restartable before the user should be able to restart it.  Here are some of the changes that you need to make:

  • Control the Commits: The program will restart at the last commit.  So, you need to pay attention to where you have the program commit.  I believe that when left alone, it will only commit at the end.
  • Set the Do Select types: The default Select/Fetch will fail if the program crashes in the middle of the selection.  You need to choose either Restartable or Reselect.
  • Track the Progress: The program needs to save which row it is processing so that it can restart at the same place.  You either need to add a processed flag to each row, or save the last row processed where you can process only rows greater.

So, that’s why I wish I could change this default option.

Packt Celebrates Their 1000th Title

You may want to sign up on Packt’s website!

From what I understand, Packt is publishing their 1000th book on September 30th.  To celebrate, they will be giving out two free surprises.  I don’t know what the surprises are, but they have been good to me so far.

Here’s the official text:

To celebrate this event with our readers, we’d be gifting them with not one but two assured surprises which would be revealed to them by the 30th of September, 2012. Anyone who is already registered or signs up for a free Packt account before 30th September 2012 is guaranteed a surprise gift.

So, head on over to their website:  http://www.packtpub.com/

Troubleshooting Oracle Database Install

I have been trying to install the Oracle Database on Windows 8, and I keep getting this error message:

If you can’t see the image, here’s what it says:

File not found  c:\oracle\dbhome_1\owb\external\oc4j_applications\WFMLRSVCApp.ear

Then, the installer hangs at setting a value in the registry.

The specific message is “updating registery key ‘HKEY_LOCAL_MAHINE/SOFTWARE/ORACLE/KEY_OraDb11g_home1′”.  It stops between 72% and 73%.

I read some where that this is probably caused by bad installation media.  So, the first thing to check is whether the zip files that I downloaded were valid.  I found that Oracle has a Patch Metadata link that points to an XML file containing an md5sum for the files:

I used md5sum to verify that the files that I downloaded where complete:

Here’s a script that you can use if you downloaded the exact same files that I did:


echo "976634087BDC54C72E8DD187049D35C6 p10404530_112030_WINNT_1of6.zip" | md5sum -c
echo "F20265A371F737C43713E1E7F3440C2C p10404530_112030_WINNT_2of6.zip" | md5sum -c
pecho "8CC4F1132D1DD4FA36B4A13CFC24B9E6 p10404530_112030_WINNT_3of6.zip" | md5sum -c
echo "B84E2E894DAC29B96B7FF57C77A6E1C3 p10404530_112030_WINNT_4of6.zip" | md5sum -c
echo "710B7EC98AD69E51F02B5E73A9825771 p10404530_112030_WINNT_5of6.zip" | md5sum -c
echo "86D0422263F9F9464EE2E0222D10B3B4 p10404530_112030_WINNT_6of6.zip" | md5sum -c

Everything checkout okay, so I proceeded to the next step.  I read in one of the comments on the download, that someone had to unzip each file individually into it’s own directory, and then combine them all.

So, I extract each zip file into it’s own directory…

Once, they were extracted individual, I copied the contents of each directory up one level:

This leaves a complete installation directory:

And, I can launch the installer from the database directory within that:

I still ran into this error.  Perhaps it is because I didn’t delete the directory where I had tried and failed before.

I hit continue several times, and finally, it finished!

Before completing my PeopleSoft installation on this image, I ended up migrating to a new laptop, and I decided to start over with the new laptop.  On my second attempt, I extracted each zip file to it’s own folder.  On that install, I receive no errors.

Resources