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


03 May 2017

Design Patterns: A domain agnostic approach


a book about explaining in a different way GoF patterns, given several examples (use case) by pattern, this way providing a better explanation for each one, this means a leverage for a better understanding, and promoting GoF to a reference book.

A good approach used is to ask himself about different situations, including boundary cases and how each pattern may help or even not help (clarifying common misunderstanding).

A great companion book for Gof, and even Gof becomes as a reference book whereas DPA becomes the book to read.

24 March 2017

Analyzing WLS

A very (old) common question is how to analyze (stuck) WLS.

The first we need to do here is to take Heap and Thread Dumps.

Take several Thread dump and one heap dump (although the last one has an embedded thread dump), this will help to find out issues, OOM, connection leaks, recurrent garbage collector, etc.

jmap -dump:format=b,file=~/tmp/heap.hprof

kill -3

i.e.:

Last login: Thu Mar 23 17:57:43 on ttys002
hola$ ps -fea | grep -i weblogic
  501  6179  6178   0  4:04PM ttys001    0:00.00 sh /Users/German/Oracle/Middleware/Oracle_Home/user_projects/domains/base_domain/startWebLogic.sh
  501  6180  6179   0  4:04PM ttys001    0:00.02 /bin/sh /Users/German/Oracle/Middleware/Oracle_Home/user_projects/domains/base_domain/bin/startWebLogic.sh
  501  6225  6180   0  4:04PM ttys001    0:56.60 /Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home/bin/java -server -Xms256m -Xmx512m -XX:CompileThreshold=8000 -XX:PermSize=128m -XX:MaxPermSize=256m -Dweblogic.Name=AdminServer -Djava.security.policy=/Users/German/Oracle/Middleware/Oracle_Home/wlserver/server/lib/weblogic.policy -Xverify:none -Djava.endorsed.dirs=/Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home/jre/lib/endorsed:/Users/German/Oracle/Middleware/Oracle_Home/wlserver/../oracle_common/modules/endorsed -da -Dwls.home=/Users/German/Oracle/Middleware/Oracle_Home/wlserver/server -Dweblogic.home=/Users/German/Oracle/Middleware/Oracle_Home/wlserver/server -Dweblogic.utils.cmm.lowertier.ServiceDisabled=true weblogic.Server
  501  8061  7485   0 10:08AM ttys002    0:00.00 grep -i weblogic
[German@KDU ~]$ kill -3 6225
[German@KDU ~]$ kill -3 6225
[German@KDU ~]$ kill -3 6225
...
[German@KDU tmp]$ jmap -dump:format=b,file=/Users/German/tmp/heap.hprof 6225
Dumping heap to /Users/German/tmp/heap.hprof ...
Heap dump file created
[German@KDU tmp]$ 

16 March 2017

AWS productos canonicos

Productos básicos que sirve para armar un e-commerce en AWS:


Amazon EC2 Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides resizable compute capacity in the cloud. It is designed to make web-scale cloud computing easier for developers.


Amazon CloudWatch Amazon CloudWatch is a monitoring service for AWS cloud resources and the applications you run on AWS. You can use Amazon CloudWatch to collect and track metrics, collect and monitor log files, set alarms, and automatically react to changes in your AWS resources. Amazon CloudWatch can monitor AWS resources such as Amazon EC2 instances, Amazon DynamoDB tables, and Amazon RDS DB instances, as well as custom metrics generated by your applications and services, and any log files your applications generate. You can use Amazon CloudWatch to gain system-wide visibility into resource utilization, application performance, and operational health. You can use these insights to react and keep your application running smoothly.


Elastic Load Balancing Elastic Load Balancing automatically distributes your incoming application traffic across multiple targets, such as EC2 instances. It monitors the health of registered targets and routes traffic only to the healthy targets. Elastic Load Balancing supports two types of load balancers: Application Load Balancers and Classic Load Balancers. 

El producto Elastic Load Balancing tiene 2 posibilidades de uso: 

  • Classic Load Balancer
  • Application Load Balancer (es la opción que es mas versátil)



Amazon S3 Amazon Simple Storage Service (Amazon S3), provides developers and IT teams with secure, durable, highly-scalable cloud storage.


Amazon RDS Amazon Relational Database Service (Amazon RDS) makes it easy to set up, operate, and scale a relational database in the cloud. It provides cost-efficient and resizable capacity while managing time-consuming database administration tasks, freeing you up to focus on your applications and business. Amazon RDS provides you six familiar database engines to choose from, including Amazon Aurora, PostgreSQL, MySQL, MariaDB, Oracle, and Microsoft SQL Server.


Amazon DynamoDB Amazon DynamoDB is a fast and flexible NoSQL database service for all applications that need consistent, single-digit millisecond latency at any scale.


Amazon SQS Amazon Simple Queue Service (SQS) is a fast, reliable, scalable, fully managed message queuing service.


Amazon CloudFront Amazon CloudFront is a global Content Delivery Network (CDN) service that accelerates delivery of your websites, APIs, video content or other web assets. It integrates with other Amazon Web Services products to give developers and businesses an easy way to accelerate content to end users with no minimum usage commitments.

Amazon API Gateway
Amazon API Gateway is a fully managed service that makes it easy for developers to create, publish, maintain, monitor, and secure APIs at any scale. With a few clicks in the AWS Management Console, you can create an API that acts as a “front door” for applications to access data, business logic, or functionality from your back-end services, such as workloads running on Amazon Elastic Compute Cloud (Amazon EC2), code running on AWS Lambda, or any Web application.

 

Architecture Diagrams

Always it has been an issue how to diagram a design for an Architecture. There are a lot of discussion on this matter, with no solution. One good approach is from Simon Brown about his C4.

One good example is when you google for Spring MVC architecture:



















01 March 2017

Wat?

This Javascript presentation is already a classic:

https://www.destroyallsoftware.com/talks/wat


Besides, I can add the following:


jjs> 1/0
Infinity
jjs> Infinity/Infinity
NaN






13 February 2017

On this page we can find several of the most cool quotes from computer scientists:

http://goto.ucsd.edu/~mstepp/programming.html

A few of them:

"The fastest algorithm can frequently be replaced by one that is almost as fast and much easier to understand."
     - D. Jones

"The sooner you start to code, the longer the program will take."
     - R. Carlson

"Computer Science is no more about computers than astronomy is about telescopes."
     - Edsger Dijkstra

10 January 2017

Nature cannot be fooled

This a very famous quote from Richard Feynman.

"For a successful technology, reality must take precedence over public relations, for Nature cannot be fooled."

This quotes is not strictly for space shuttle construction, but also it cn be applied for Software Engineering, in particular for estimation when planning a new development project.

Similar references can be found at:

https://www.amazon.com/dp/0470486759/




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.