Showing posts with label deployment environment. Show all posts
Showing posts with label deployment environment. Show all posts

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!

24 April 2012

Generation of deployment environment fails - Reason: CWLDB9014E and Reason: CWWBZ0058E

First of all, this is the task I failed numerous times on, until finally I managed to get past, getting the desired result at the same time. This is because I found some sort of workaround before, but the results were more or less doubtful. Well, this workaround is a bit messy as well, but at least you can benefit from creation of Deployment environment with the wizard, instead of putting DE parts together step by step (and probably missing some parts, which later cause you some, or a lot of, pain).

So, we're talking WPS 6.2.0.0 (a bit obsolete) and 7.0.0.4, deployed vs. DB2 database hosted on z/OS (which probably is the most troublesome circumstance, as you cannot create any objects automatically like in LUW edition). What we try to do is to generate Deployment environment (in any topology - single, distributed or "golden"), while defining databases on z/OS DB2. What we get is failure in this particular part:, where instead of:



you keep getting:

CWLDB9014E: The configuration of component WBI_BPCEventCollector failed.

To make it short, before, I could not find the reason. But recently, I think I found it by looking into FFDC error report, and saw there errors related to failing connection to DERBY database. I wondered why it tries to use Derby when I explicitly requested all databases to be hosted on z/OS, but I will never know (perhaps some buggy ant script, or other config xml issue). Nevertheless, what we need to do is to:

  1. create "dummy" Derby database, just for sake of generation of DE:
    • go to /opt/ibm/WebSphere/AppServer/derby/bin/networkServer
    • run ./ij.sh
    • issue command: connect 'jdbc:derby:/opt/ibm/WebSphere/AppServer/profiles/PPD2UZLB01DMgr/databases/event/PD2UZL.Support/DerbyEventDB/BPD2CEDB;create=true';
    your database has been created and is ready to use, but first:
  2.  add custom user to connect to Derby server
    • edit /opt/ibm/WebSphere/AppServer/derby/derby.properties by adding line
      derby.user."yourUser"=yourpwd
  3. start Derby network server (/opt/ibm/WebSphere/AppServer/derby/bin/networkServer/startNetworkServer.sh)
    Note: default TCP/IP port for derby is 1527
  4. now, get back to DE generation wizard and run it again, but now type in Derby database for your EventDB - server is localhost:1527, user is "yourUser" and password "yourpwd"
  5. finish generation and you should get to successful end of operation
  6. assuming you have already created all necessary database in your target DB (either DB2 on z/OS or other supplier), you now need to redefine jdbc datasource for EventDB to point to the datastore of your choice.
You may of course run into numerous problems before getting your DE working 100% fine but above instruction should at least get you through DE generation wizard.

Good luck, leave a comment or vote in the poll please!