28 August 2014

ADMU3007E: Exception com.ibm.websphere.management.exception.AdminException: ADMU3027E: An instance of the server may already be running

So, I didn't went very far away from WebSphere in this one. Just yesterday one of my colleagues asked me for help while attempting to start nawely installed WAS on newly installed Linux OS.

He was getting standard "specified port busy" message and exceptions in the logs:

[8/27/14 13:17:48:979 CEST] 00000001 AdminTool     A   ADMU3028I: Conflict detected on port 8879.  Likely causes: a) An instance of the server dmgr is already running  b) some other process is using port 8879
[8/27/14 13:17:48:980 CEST] 00000001 AdminTool     A   ADMU3029I: Conflict detected on port 8879 for endpoint SOAP_CONNECTOR_ADDRESS of the server dmgr 
[8/27/14 13:17:48:980 CEST] 00000001 AdminTool     A   ADMU3027E: An instance of the server may already be running: dmgr
[8/27/14 13:17:48:981 CEST] 00000001 WsServerLaunc E   ADMU3002E: Exception attempting to process server dmgr
[8/27/14 13:17:48:981 CEST] 00000001 WsServerLaunc E   ADMU3007E: Exception com.ibm.websphere.management.exception.AdminException: ADMU3027E: An instance of the server may already be running: dmgr
at com.ibm.ws.management.tools.WsServerLauncher.runTool(WsServerLauncher.java:318)
at com.ibm.ws.management.tools.AdminTool.executeUtility(AdminTool.java:269)
at com.ibm.ws.management.tools.WsServerLauncher.main(WsServerLauncher.java:134)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:611)
at com.ibm.ws.bootstrap.WSLauncher.main(WSLauncher.java:277)

Usual (for the case) check of netstat -an | grep 8879 and ps -ef | grep dmgr didn't show any rogue or orphaned processes running in the system, so initially the cause was not apparent. But, I tried to start the server with -trace flag which gives you (sometimes) a lot of additional information on server startup process and.....we found the culprit:

[27.08.14 15:11:36:362 CEST] 00000001 ConnectorHelp >  getOpenConnectorPorts: false Entry
[27.08.14 15:11:36:362 CEST] 00000001 ConnectorHelp 3   testing host: fully_qualified_hostname, port: 8879
[27.08.14 15:11:36:362 CEST] 00000001 ConnectorHelp 3   trying host: fully_qualified_hostname, port: 8879
[27.08.14 15:11:36:366 CEST] 00000001 ConnectorHelp 3   determined host: fully_qualified_hostname, port: 8879  in use
[27.08.14 15:11:36:366 CEST] 00000001 AdminTool     A   ADMU3028I: Wykryto konflikt na porcie 8879.  Możliwe przyczyny: a) Instancja serwera dmgr została już uruchomiona.  b) Port 8879 jest używany przez inny proces.
[27.08.14 15:11:36:366 CEST] 00000001 AdminTool     A   ADMU3029I: Wykryto konflikt na porcie 8879 dla punktu końcowego SOAP_CONNECTOR_ADDRESS serwera dmgr
[27.08.14 15:11:36:367 CEST] 00000001 AdminTool     A   ADMU3027E: Możliwe, że działa już instancja tego serwera: dmgr
[27.08.14 15:11:36:367 CEST] 00000001 WsServerLaunc E   ADMU3002E: Wyjątek podczas próby przetworzenia serwera dmgr
[27.08.14 15:11:36:368 CEST] 00000001 WsServerLaunc E   ADMU3007E: Wyjątek com.ibm.websphere.management.exception.AdminException: ADMU3027E: Możliwe, że działa już instancja tego serwera: dmgr

so, only after using -trace those two key log lines appear, telling you what exactly host your jvm is trying to use to open sockets. Being sure no process occupies port 8879, I checked /etc/hosts and found there only:

127.0.0.1 localhost

entry. So there was no way WAS could resolve port 8879 on fully_qualified_hostname! I simply added:

127.0.0.1 fully_qualified_hostname 

there, saved, and the very next attempt to start the server was successful:

[27.08.14 15:11:36:371 CEST] 00000001 AdminTool     A   ADMU0111E: Program zakończył pracę z błędem: com.ibm.websphere.management.exception.AdminException: ADMU3027E: Możliwe, że działa już instancja tego serwera: dmgr
at com.ibm.ws.management.tools.WsServerLauncher.runTool(WsServerLauncher.java:318)
at com.ibm.ws.management.tools.AdminTool.executeUtility(AdminTool.java:269)
at com.ibm.ws.management.tools.WsServerLauncher.main(WsServerLauncher.java:134)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:611)
at com.ibm.ws.bootstrap.WSLauncher.main(WSLauncher.java:277)

[27.08.14 15:11:36:372 CEST] 00000001 AdminTool     3   Returning from auxiliary method issueMessage with return code: 111
[27.08.14 15:11:36:372 CEST] 00000001 AdminTool     A   ADMU0211I: Szczegóły dotyczące błędu można znaleźć w pliku: /opt/IBM/WebSphere/AppServer/profiles/Dmgr01/logs/dmgr/startServer.log
[27.08.14 15:11:36:372 CEST] 00000001 AdminTool     3   Returning from auxiliary method issueMessage with return code: 211
[27.08.14 15:11:36:373 CEST] 00000001 AdminTool     3   Returning from executeUtility method with return code: -1
************ Start Display Current Environment ************
Host Operating System is Linux, version 3.10.0-123.el7.x86_64
Java version = 1.6.0, Java Compiler = j9jit26, Java VM name = IBM J9 VM
was.install.root = /opt/IBM/WebSphere/AppServer
user.install.root = /opt/IBM/WebSphere/AppServer/profiles/Dmgr01
Java Home = /opt/IBM/WebSphere/AppServer/java/jre
ws.ext.dirs = /opt/IBM/WebSphere/AppServer/java/lib:/opt/IBM/WebSphere/AppServer/classes:/opt/IBM/WebSphere/AppServer/lib:/opt/IBM/WebSphere/AppServer/installedChannels:/opt/IBM/WebSphere/AppServer/lib/ext:/opt/IBM/WebSphere/AppServer/web/help:/opt/IBM/WebSphere/AppServer/deploytool/itp/plugins/com.ibm.etools.ejbdeploy/runtime
Classpath = /opt/IBM/WebSphere/AppServer/profiles/Dmgr01/properties:/opt/IBM/WebSphere/AppServer/properties:/opt/IBM/WebSphere/AppServer/lib/startup.jar:/opt/IBM/WebSphere/AppServer/lib/bootstrap.jar:/opt/IBM/WebSphere/AppServer/java/lib/tools.jar:/opt/IBM/WebSphere/AppServer/lib/lmproxy.jar:/opt/IBM/WebSphere/AppServer/lib/urlprotocols.jar
Java Library path = /opt/IBM/WebSphere/AppServer/java/jre/lib/amd64/compressedrefs:/opt/IBM/WebSphere/AppServer/java/jre/lib/amd64:/opt/IBM/WebSphere/AppServer/lib/native/linux/x86_64/:/opt/IBM/WebSphere/AppServer/bin::/usr/lib
Orb Version = IBM Java ORB build orb626-20130112.01
Current trace specification = *=info
************* End Display Current Environment *************
[27.08.14 15:14:17:349 CEST] 00000001 ManagerAdmin  I   TRAS0017I: Początkowy stan śledzenia: *=info.
[27.08.14 15:14:17:402 CEST] 00000001 AdminTool     A   ADMU0128I: Uruchamianie narzędzia w oparciu o profil Dmgr01
[27.08.14 15:14:17:406 CEST] 00000001 AdminTool     A   ADMU3100I: Odczyt konfiguracji serwera: dmgr
[27.08.14 15:14:17:416 CEST] 00000001 ImplFactory   W   WSVR0072W: Niezadeklarowane przesłonięcie interfejsu com.ibm.websphere.cluster.topography.DescriptionManager implementacją com.ibm.ws.cluster.propagation.bulletinboard.BBDescriptionManager jest ignorowane
[27.08.14 15:14:17:563 CEST] 00000001 ModelMgr      I   WSVR0801I: Inicjowanie wszystkich modeli konfiguracji serwera
[27.08.14 15:14:19:761 CEST] 00000001 WorkSpaceMana A   WKSP0500I: Funkcja sprawdzania spójności konfiguracji obszaru roboczego: wyłączone.
[27.08.14 15:14:19:914 CEST] 00000001 AdminTool     A   ADMU3200I: Serwer został uruchomiony. Oczekiwanie na status inicjowania.
[27.08.14 15:14:41:275 CEST] 00000001 AdminTool     A   ADMU3000I: Serwer dmgr został otwarty dla e-biznesu. Identyfikator procesu to 29871


Hope this helps! Good luck!

30 June 2014

JavaScript [1] - Limiting text input to numbers only

As I have changed my professional direction a little bit, I'm finding new interesting topics to blog about. Namely, I've been moved to J2EE development project, vast mix of pure Java, Chordiant, ILOG, WAS and Oracle. Hence, I'm now focusing on code issues more than WebSphere&Security integration issues.

For the sake of continuity I'm not going to change blog name - I'm anyway "somewhere around" the original topic, and probably I will be back to it someday.

So, here's my first JavaScript hint - if you need to limit text input in your HTML form to numbers (decimals, with decimal point) only, you can do it like this:


  1. put together a nice piece of javascript validating what is being input:

  2. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
    <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
    <script>
    $('#in').bind('input propertychange', function() {
        var text = $(this).val();
        var t2 = text.replace(/[\\A-Za-z!"£$%^&\-\)\(*+_={};:'@#~,Š\/<>\" "\?|`¬\]\[]/g,'');
        $(this).val(t2);
                                // line below is purely for presentation purposes - set value of paragraph named "result" to the valid input value
        $('#Result').text(t2); 
       
    });
    </script>
  3. test it out in a piece of complete HTML page to see how it works. important thing is you need to put the <script> part AFTER you put your input field into the document - otherwise the script won't be "bound" to the input:
<html>

<body>
<p>try the input</p>
<input type="text" id="in"><br>
<label id="Result"></label>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<script>

$('#in').bind('input propertychange', function() {
    var text = $(this).val();
    var t2 = text.replace(/[\\A-Za-z!"£$%^&\-\)\(*+_={};:'@#~,Š\/<>\" "\?|`¬\]\[]/g,'');
    $(this).val(t2);
$('#Result').text(t2);
 
});
</script>

</body>
</html>

Good luck! hope you will find this useful!

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.