Showing posts with label 8.5. Show all posts
Showing posts with label 8.5. 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!

21 January 2014

DSRA0302E: XAException. Error code: XAER_RMERR (-3). Exception:

It's been published in several places, I guess but for the sake of simplicity:

Websphere 8.5, Oracle 11.2, datasource and transactions. You start your WAS server and see this in the logs:

[20.01.14 13:36:43:670 CET] 0000004f WSRdbXaResour E   DSRA0304E:  Wystapil wyjatek XAException. Tresc i szczególy wyjatku XAException: The cause is               : null.
[20.01.14 13:36:43:671 CET] 0000004f WSRdbXaResour E   DSRA0302E:  Wystapil wyjatek XAException.  Kod bledu: XAER_RMERR (-3).  Wyjatek: <null>
[20.01.14 13:36:43:671 CET] 0000004f XARminst      E   WTRN0037W: Usluga transakcji napotkala blad w operacji xa_recover. Zasób: com.ibm.ws.rsadapter.spi.WSRdbXaResourceImpl@c6a9f4fb. Kod bledu: XAER_RMERR. Dane sledzenia stosu wyjatku: javax.transaction.xa.XAException
at oracle.jdbc.xa.OracleXAResource.recover(OracleXAResource.java:709)
at com.ibm.ws.rsadapter.spi.WSRdbXaResourceImpl.recover(WSRdbXaResourceImpl.java:1116)
at com.ibm.ws.Transaction.JTA.XARminst.recover(XARminst.java:141)
at com.ibm.ws.Transaction.JTA.XARecoveryData.recover(XARecoveryData.java:716)
at com.ibm.tx.jta.impl.PartnerLogTable.recover(PartnerLogTable.java:431)
at com.ibm.tx.jta.impl.RecoveryManager.resync(RecoveryManager.java:1534)
at com.ibm.tx.jta.impl.RecoveryManager.performResync(RecoveryManager.java:2267)
at com.ibm.ws.tx.jta.RecoveryManager.performResync(RecoveryManager.java:117)
at com.ibm.tx.jta.impl.RecoveryManager.run(RecoveryManager.java:2220)
at java.lang.Thread.run(Thread.java:772)

the key is:

javax.transaction.xa.XAException
at oracle.jdbc.xa.OracleXAResource.recover(OracleXAResource.java:709)

as there are some pending, unrecoverable transaction in the transaction log. there are two ways to deal with it:
- start your server, nevermind your business applications not working, go to console, Application servers > server1 > Transaction service, then to Runtime tab and there you can see some options to manually manage pending troublesome transactions:


- or alternate: stop server, go to <profileroot>/tranlog/(respective path)/tranlog & partnerlog, delete tranlog and partnerlog files. start server.

Now, the way no. 2 is advisable for development systems, where any data loss is irrelevant. For production, proceed with care and try way no.1 first. Should it fail, go hardcore and delete tranlog.
Good luck.

02 October 2013

WAS 8.5 Trace missing - SLF4J: Class path contains multiple SLF4J bindings

It's been quite long since I posted here. Yet I have one new tip for you today:

The problem was that WebSphere 8.5 server did not recognize components to trace after application deployment, and after finally appearing in the traceable components tree did not log all expected output to trace log. As a result we wasn't able to troubleshoot the installation, not to mention that some of the log output was required by defined use cases of the designed solution.


After some search, asking here and there, a colleague of mine (thanks, Agnieszka!) noticed the following entries in the SystemOut.log file of the server when the troublesome application was deployed:


10/2/13 13:42:10:331 CEST] 00000042 SystemErr     R   SLF4J: Class path contains multiple SLF4J bindings.
[10/2/13 13:42:10:331 CEST] 00000042 SystemErr     R   SLF4J: Found binding in [bundleresource://243.fwk-1319487885:1/org/slf4j/impl/StaticLoggerBinder.class]
[10/2/13 13:42:10:331 CEST] 00000042 SystemErr     R   SLF4J: Found binding in [wsjar:file:/opt/ibm/WebSphere/AppServer/profiles/AppSrv01/installedApps/localhostNode01Cell/xxxxx/lib/slf4j-jdk14-1.6.6.jar!/org/slf4j/impl/StaticLoggerBinder.class]
[10/2/13 13:42:10:332 CEST] 00000042 SystemErr     R   SLF4J: Found binding in [wsjar:file:/opt/ibm/WebSphere/AppServer/profiles/AppSrv01/installedApps/localhostNode01Cell/xxxxx/lib/slf4j-log4j12-1.7.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
[10/2/13 13:42:10:332 CEST] 00000042 SystemErr     R   SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
[10/2/13 13:42:10:357 CEST] 00000042 SystemErr     R   SLF4J: Actual binding is of type [org.slf4j.impl.JDK14LoggerFactory]

and apparently this was causing the server to make wrong class pickup the logging (and hence missing output as that class missed appropriate configuration).

I came up with the idea of removing one of the conflicting classes from ear with console option "Remove file" and selecting whole jar (lib/slf4j-log4j12-1.7.2.jar). After application restart logging started to work as expected!


Good luck!


Env: WebSphere 8.5.0.2 ND, Linux rhel 6 64bit, application build with Maven (some predefined class includes defined).

05 March 2013

WAS 8.5 profile creation sample response file

I looked over the net for sample response files for profile creation in WAS 8.5, but I found none. Well, I didn't expect much of a revolution in comparison to V7 or V8, but still, better be safe than sorry :) 


So I ended up converting possible listed manageprofiles flags into response file entries, in a traditional manner. The result was as follows and you can safely use it as a starting point for your profile management automation.



#profile name and capabilities
profileName=P01Dev
profilePath=/opt/IBM/WebSphere/AppServer85/profiles/P01Dev
templatePath=/opt/IBM/WebSphere/AppServer85/profileTemplates/default
#location and names
hostName=chronos.warszawa.pl.ibm.com
nodeName=P01DevNode
cellName=P01DevCell
serverName=P01DevS01
#starting port
startingPort=4000
#certificates
personalCertDN=cn=P01DevS01\\,ou=Root=Certificate\\,ou=P01DevNode\\,ou=P01DevCell\\,o=IBM\\,c=PL
signingCertDN=cn=P01DevRoot\\,ou=Root=Certificate\\,ou=P01DevNode\\,ou=P01DevCell\\,o=IBM\\,c=PL
#standard WAS keystore/truststore password
keyStorePassword=WebAS
#admin security
enableAdminSecurity=true
adminUserName=devadmin
adminPassword=<yourpassword>

good luck, and leave a comment if you made some use of this content. and don't forget to like this page on facebook :)