WebSphere Clear Old EJB Timer Tasks

In some cases old timer task might become orphaned in the EJB timer database, due to application name changes or other circumstances. You’ll see these kind of errors in the logs:
[31-5-16 15:45:46:648 CEST] 00000024 SchedulerDaem W SCHD0103W: The Scheduler WebSphere_EJB_Timer_Service (WebSphere_EJB_Timer_Service) was unable to run task 204 because the application or module is unavailable: my-app#my-ejb-1.0.0-SNAPSHOT.jar#MyEJB.

There is no ability to remove timers from the admin console, but you can use the WAS_HOME/bin/cancelEJBTimers command to remove them. You can view them first using the findEJBTimers command.

Linux (or Unix) Self-Extracting Archive using Makeself

Tried out Makeself out at work today, it works really well. We used it to automatically run database scripts on a database host.

An example:

./makeself.sh --compress ./directory_containing_my_files ./my_archive_filename.run "A description or label for your archive" ./a_script_in_the_archive_run.sh

To run:

./my_archive_filename.run <args_to_pass_to_script>

Unit docker-nnn.scope already exists.

Sometimes when starting a stopped docker container on CoreOS, an error is thrown:

Error response from daemon: Cannot start container sane: [8] System error: Unit docker-166be344aa25c9c1abc17daa2a14bb3d02cf10adc88e3ec795480a60c11a8e78.scope already exists.

It is usually caused by ‘.scope’ files that are not cleaned up by ‘systemd’. To fix the problem run this command, replacing the scope filename with yours:

sudo systemctl stop docker-166be344aa25c9c1abc17daa2a14bb3d02cf10adc88e3ec795480a60c11a8e78.scope

How I Installed CoreOS (Bare Metal)

1. Find an empty bare metal server. I’m using an MSI Windbox.
2. Build a Debian live bootable flash-drive.
3. Boot system in Debian, and login (user/live)
4. Run command:

wget https://raw.githubusercontent.com/coreos/init/master/bin/coreos-install

5. Run command (Note: This will partition the HDD/SSD and install CoreOS, all data will be lost!):

sudo ./coreos-install -d /dev/sda -C stable

6. Create a file called ‘cloud-config.yml’ and the following minimum configuration:

#cloud-config
users:
 - name: core
   passwd: <your_hashed_password>

(Note: Passwd should be hashed, use one of the following tools):

1. mkpasswd --method=SHA-512 --rounds=4096
2. openssl passwd -1

7. Mount coreos filesystem and copy ‘cloud-config.yml’ file:

sudo mount /dev/sda6 /mnt
sudo cp -f cloud-config.yml /mnt/
sudo umount /mnt

8. Reboot!

Websphere Liberty Profile JMX Service URL

The localhost JMX service URL for a liberty profile Websphere instance can be found in the following file once the server is started:

.../wlp/usr/servers/defaultServer/workarea/com.ibm.ws.jmx.local.address

It’ll contain the URL to connect to the JMX server:

service:jmx:rmi://127.0.0.1/stub/rO0ABXNyAC5qYXZheC5tYW5hZ2VtZW50LnJlbW98ZS5ybWkuUk1J... (omitted)

It can be used directly in a JMXServiceURL(); on your java code, but beware the URL will change each time the server is restarted.

How to Open Portable Heap Dump Files in Memory Analyzer Tool

To open IBM portable heap dump files (.phd) in Memory Analyzer Tool (MAT), you need to install the IBM Diagnostic Tool Framework for Java plugin:

  1. Help -> Install New Software
  2. Add site: http://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/runtimes/tools/dtfj/
  3. Install IBM DTFJ plugin.

Now MAT should recognize the PHD files format.