14 September 2015

Application on a separate custom port - Webspher Application Server 8.5

I've just spotted a question on developerworks forum whether it's possible to run one of the applications on Websphere Application Server on a separate, custom port. There's a way to achieve this and in this post I'm going to show how to do it.

1. First, we need to define a new port for our server. Go to Application servers -> your server -> Ports, anc click New....

Type in non-standard value (eg. 9081) and a custom name (WC_customPort)
Click OK and save the changes, and you will see your newly added port on the list:
But there's a small culprit now - we got the port, but "No associated transport" means that nothing really listens on the requests on this port. That's why we need to define a new transport chain for our port.

2. The new transport chain will essentially be identical to existing default transport chain. To create it we need to  go to Application servers -> Web container -> Web container transport chains:

Click New... and create on from webContainer template:

Click Next, and pick the existing port created in step 1. (as you can see, WAS could have made this for us in this place)

Confirm the data on the last screen and click Finish, save changes and you should have your new transport chain on the list:

We're almost ready: we've got the port and transport associated with it, but we still have no way to map our application to a different port, because we only have one default virtual host defined for standard 9080 port:

3. Let's create a new virtual host then:

Now, go again into custom_host, and go to Mime Aliases screen and define it to be 'any' (*) host, port 9081:

Click OK, save changes. The only thing remaining now is to map the application you want to use on custom port to this new virtual host. Go to Enterprise Applications > Your application > Virtual hosts and map it to custom_host:

All necessary changes have been made, so be sure you save them to server's config and restart the server. And there we go, after server reboot, we have two different applications on two different ports:

In this post I showed how to make J2EE application running on Websphere Application Server 8.5 use custom, non standard port along with other applications running on default web container port. I hope this helps you and if you have any questions, feel free to post it in comments.

Good day, and good luck to you!

11 March 2015

Eclipse (Rational) stuck on cleaning/building workspace forever

..or at least seems so.

Sometimes - usually with complex projects including mutiple sub-projects open in RAD/Eclipse - your IDE gets stuck on Building workspace or even Cleaning projects at various stages (in my case it was 100%) and despite Progress bar showing undergoing work, it would never end. Also, you are unable to close the IDE in a normal manner, only killing the process can end it and after restart, build/clean re-starts automatically up to no avail, to get you stuck again.

There a few things you can do about it:

  1. level: NEAT
    try starting RAD/Eclipse with -clean -clearPersistedState flags. it will cause removal of unused artifacts and rebuild the indexes
  2. level: ROUGH
    go to .metadata/.plugins/org.eclipse.core.resources/.root/.indexes and delete all contents (3 files) and restart your IDE. it will see indexes physically wiped so will rebuild them from the scratch
  3. level: VILLAIN
    go to .metadata\.plugins\org.eclipse.ui.workbench and rename workbench.xml to other name, like workbench.xml.bak . It will remove all existing workspace-lifetime artifacts and will revert you to default perspective after re-launch, but it seems to do wonders in terms of unblocking existing zombie artifacts
Just be careful, always do backups when messing with .metadata files in case IDE throws any nasty errors at you at the next re-start (yeah, it happens)

Good luck!

12 January 2015

Obscured by the cloud - why google hides functions in API docs ???

Just a quickie. I need to make a few Google Sheets scripts for some side projects, and struggle finding some basic low-level tools in Google API docs. For instance, you can't find String object documented....but it's still in there.

So I managed to successfully use function such as


wondered why, and probable answer (not obvious to me) is that they are supported as a part of JavaScript which you can use in Google Script editor. Seems google just went so abstract in what they want developers to use form Google API services and apps that they dropped maintaining documentation for generic stuff like above. It causes some confusion, at least for me (I haven't been following any updates for devs from g's side).

Next time I will just remember.

Anyway, if you want to convert a cell contents which behind the scenes is stored by the sheet as:

Thu Dec 11 2014 01:00:00 GMT+0100 (CET)

to some more human readable form

use toDateString which yields

Mon Jan 12 2015

straight from JS: http://www.w3schools.com/jsref/jsref_todatestring.asp

or put his bit of code:

var month = data[row][col].getMonth() + 1;
var neatDate = data[row][col].getDate() + "/" + month +"/" + data[row][col].getFullYear();

good luck!