18 October 2017

WLS JMS Configuration

Essential steps to configure a JMS environment


CORE_WLS_Domain --> Services --> Persistent Stores -->

New:

Name: FileStore-Mensajeria1
Target: Managed Server 1 (WLS01)
Directory: jmsMensajeria_1
(Activate Changes)

Name: FileStore-Mensajeria2
Target: Managed Server 2 (WLSS02)
Directory: jmsMensajeria_2
(Activate Changes)


CORE_WLS_Domain --> Services --> Messaging --> JMS Servers

New:

Name: JMSServer-Mensajeria_1
Persistent Store: FileStore-Mensajeria1
Target: WLS01 (migratable)
(finish)

Name: JMSServer-Mensajeria_2
Persistent Store: FileStore-Mensajeria2
Target: WLS02 (migratable)
(finish)

(Activate Changes)


CORE_WLS_Domain --> Services --> Messaging --> JMS Modules

Name: JMSModule_Mensajeria
Target: wls_core_cluster
(next/finish)
(Activate Changes)


entrar a JMS Module creado: (crear subdeployment)
CORE_WLS_Domain --> Services --> Messaging --> JMS Modules --> JMSModule_Mensajeria --> Subdeployments

New:

name: MensajeriaSubdeployment
Target: JMSServer-Mensajeria_1, JMSServer-Mensajeria_2
(Activate Changes)


CORE_WLS_Domain --> Services --> Messaging --> JMS Modules --> JMSModule_Mensajeria

New:

Connection Factory (next)

Name: ConnectionFactory-Mensajeria
JNDI Name: jms/ConnectionFactory-Mensajeria (next)
(finish)
(Activate Changes)

New:

Distributed Queue (next)

Name: DistributedQueue-Mensajeria
JNDI Name: jms/journal-standar (next)
Advanced Targeting: MensajeriaSubdeployment

JMS Servers: JMSServer-Mensajeria_1, JMSServer-Mensajeria_2
(finish)
(Activate Changes)



12 October 2017

Opatch WLS 12c

Backup Oracle Home:
It is highly recommended that you back up the Oracle home before any patch operation. You can back up the Oracle home using your preferred method. You can use any method such as zip, cp -r, tar, and cpio to compress the Oracle home.

Opatch path:
/Users/German/Oracle/Middleware/Oracle_Home/OPatch

List patches:
./opatch lsinventory
./opatch lsinventory -detail

Check if it's feasible:
./opatch apply /Users/German/tmp/patches/23639929 -report

Apply patch:
./opatch apply /Users/German/tmp/patches/23639929

Rollback patch
./opatch rollback -id 23639929

More info:
https://docs.oracle.com/middleware/1213/core/OPATC/toc.htm

11 October 2017

Too many open files


The following problem may occurr in WLS:

Caused By: java.net.SocketException: Too many open files
  at java.net.Socket.createImpl(Socket.java:447)
  at java.net.Socket.connect(Socket.java:577)
  at oracle.net.nt.TcpNTAdapter.connect(TcpNTAdapter.java:161)
  at oracle.net.nt.ConnOption.connect(ConnOption.java:159)
  at oracle.net.nt.ConnStrategy.execute(ConnStrategy.java:428)
  at oracle.net.resolver.AddrResolution.resolveAndExecute(AddrResolution.java:506)
  at oracle.net.ns.NSProtocol.establishConnection(NSProtocol.java:595)
  at oracle.net.ns.NSProtocol.connect(NSProtocol.java:230)

This is a common issue when  File Descriptors are not enough for the OS processes.

Checcking the most open FD appear WLS Managed Servers and they are almost on the limit:

4076 376 /u04/Middleware/WLS12c/jdk/bin/java-server-Xms1024m-Xmx2048m-XX:PermSize=256m-XX:MaxPermSize=512m-Dweblogic.Name=WLS02

4063 32526 /u04/Middleware/WLS12c/jdk/bin/java-server-Xms1024m-Xmx2048m-XX:PermSize=256m-XX:MaxPermSize=512m-Dweblogic.Name=WLS01

Checking with lsof we see a lot of open jar files from war files, because we have several war files deployed.

Check:

$ ulimit -n
4096

Therefore the solution is to set a bigger soft&hard limit.

04 October 2017

How to know OHS version

$ ./httpd.worker -v
./httpd.worker: error while loading shared libraries: libexpat.so.0: cannot open shared object file: No such file or directory

$ ps -fea | grep httpd

$ export ORACLE_HOME=/u04/Middleware/P_OHS12c/product

$ export LD_LIBRARY_PATH=/u04/Middleware/P_OHS12c/product/lib

$ cd /u04/Middleware/P_OHS12c/product/wlserver/../ohs/bin/

$ ./httpd.worker -v
Server version: Oracle-HTTP-Server/2.2.22 (Unix)
Server built:   Sep  3 2015 01:14:57
Server label:   APACHE_12.1.3.0.0_LINUX.X64_RELEASE



25 August 2017

Sed cheat sheet

Sometimes we need to clean-up a file (ie: log prod file)

sed -i.bak '/<ConnectionEnv.cleanup, jconn=oracle.jdbc.driver.T4CConnection/d' ./infile



21 August 2017

Inputless WLS Credentials

Awkwardly WLS develoment version does not show credentials input when booting.
Of course, the solution is to create security/boot.properties.
however if I don't press [enter] then it waits forever :S

Probably there is a patch for this, but dev version

<Aug 11, 2017 11:30:18 AM CLT> <Info> <Security> <BEA-090906> <Changing the default Random Number Generator in RSA CryptoJ from ECDRBG128 to FIPS186PRNG. To disable this change, specify -Dweblogic.security.allowCryptoJDefaultPRNG=true.>
<Aug 11, 2017 11:30:18 AM CLT> <Info> <WebLogicServer> <BEA-000377> <Starting WebLogic Server with Java HotSpot(TM) 64-Bit Server VM Version 24.80-b11 from Oracle Corporation.>
<Aug 11, 2017 11:30:19 AM CLT> <Info> <Security> <BEA-090065> <Getting boot identity from user.>
---->
<Aug 10, 2017 6:01:49 PM CLT> <Info> <Management> <BEA-141298> <Could not register with the Administration Server: java.rmi.RemoteException: [Deployer:149150]An IOException occurred while reading the input. : with response code '401' : with response message 'Unauthorized'>
<Aug 10, 2017 6:01:49 PM CLT> <Info> <Management> <BEA-141107> <Version: WebLogic Server 12.1.3.0.0  Tue Aug 11 09:00:41 UTC 2015 1697938 >
<Aug 10, 2017 6:01:52 PM CLT> <Error> <Configuration Management> <BEA-150021> <The Administration Server failed to authenticate the identity of the user  starting the Managed Server. The reason for the error is .>
<Aug 10, 2017 6:01:52 PM CLT> <Alert> <Management> <BEA-141151> <The Administration Server could not be reached at http://127.0.0.1:7001.>
<Aug 10, 2017 6:01:52 PM CLT> <Info> <Configuration Management> <BEA-150018> <This server is being started in Managed Server independence mode in the absence of the Administration Server.>
<Aug 10, 2017 6:01:52 PM CLT> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING.>
<Aug 10, 2017 6:01:52 PM CLT> <Info> <WorkManager> <BEA-002900> <Initializing self-tuning thread pool.>
<Aug 10, 2017 6:01:52 PM CLT> <Info> <WorkManager> <BEA-002942> <CMM memory level becomes 0. Setting standby thread pool size to 256.>

11 July 2017

Software Architect Skills/Responsabilities

There are several list of required skills/responsabilities a Software Architect should have.
One of these (a little old now, but still valid) is:

https://dzone.com/articles/architecture-%E2%80%93-top-10-traits

  1.     Knowledge of relevant technologies
  2.     Strong analysis & design skills
  3.     Coding & POCs
  4.     Architecture & design activities
  5.     Modeling language/Tools
  6.     Architectural frameworks/Tools
  7.     Communication
  8.     Training/Mentoring
  9.     Sales/Pre-sales
  10.     Presentation Skills

PD: as usual, I'll be updating this Post as I find new resources or my own ideas...

  1. Code Review


12 May 2017

Java Muxer WLS



Go to Environment > Servers > your_Server > Tuning, under Advanced, set the Muxer Class based on your OS and reboot the server. 

Solaris/HP­UX Native Muxer : weblogic.socket.DevPollSocketMuxer 
POSIX Native Muxer : weblogic.socket.PosixSocketMuxer
Windows Native Muxer : weblogic.socket.NTSocketMuxer
Java Muxer : weblogic.socket.JavaSocketMuxer
 

java.lang.Thread.State: RUNNABLE
at sun.nio.ch.EPollArrayWrapper.epollWait(Native Method)

at sun.nio.ch.EPollArrayWrapper.poll(EPollArrayWrapper.java:269)
at sun.nio.ch.EPollSelectorImpl.doSelect(EPollSelectorImpl.java:79)
at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:87)
­ locked <0x0000000789f2b040> (a sun.nio.ch.Util$2)
­ locked <0x0000000789f2b030> (a java.util.Collections$UnmodifiableSet)
­ locked <0x0000000789f2adf8> (a sun.nio.ch.EPollSelectorImpl)
at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:98)
at weblogic.socket.NIOSocketMuxer$NIOInputStream.readInternal(NIOSocketMuxer.java:815) at weblogic.socket.NIOSocketMuxer$NIOInputStream.read(NIOSocketMuxer.java:759)
at weblogic.socket.NIOSocketMuxer$NIOInputStream.read(NIOSocketMuxer.java:742)
at weblogic.socket.JSSEFilterImpl.readFromNetwork(JSSEFilterImpl.java:462)
at weblogic.socket.JSSEFilterImpl.read(JSSEFilterImpl.java:424)
at weblogic.socket.JSSESocket$JSSEInputStream.read(JSSESocket.java:64)

Catastrophic Regexp (again)

Hitting a stuck thread:

"main" prio=5 tid=0x00007fd577005800 nid=0x1c03 runnable [0x00007000035db000]
   java.lang.Thread.State: RUNNABLE
    at java.util.regex.Pattern$5.isSatisfiedBy(Pattern.java:5151)
    at java.util.regex.Pattern$5.isSatisfiedBy(Pattern.java:5151)
    at java.util.regex.Pattern$CharProperty.match(Pattern.java:3694)
    at java.util.regex.Pattern$Curly.match0(Pattern.java:4158)
    at java.util.regex.Pattern$Curly.match(Pattern.java:4132)
    at java.util.regex.Pattern$Start.match(Pattern.java:3408)
    at java.util.regex.Matcher.search(Matcher.java:1199)
    at java.util.regex.Matcher.find(Matcher.java:592)
    at java.util.regex.Pattern.split(Pattern.java:1200)
    at java.lang.String.split(String.java:2313)
    at RegExpTest.main(RegExpTest.java:28)

Once again it's a "stuck" thread for the catastrophic issue in regexp:
https://github.com/devwebcl/regexp-playground/blob/master/src/main/java/cl/devweb/regexp/exploit/JxlsBug.java


My Blog List

Blog Archive

There was an error in this gadget

Disclaimer

The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.