26 March 2019

Proof of Concept (POC)

POC is therefore a prototype that is designed to determine feasibility, but does not represent deliverables.

Persistence, Affinity, Sticky session and others


Affinity: this is when we use information from a layer below the application layer to maintain a client request to a single server

Persistence: this is when we use Application layer information to stick a client to a single server

sticky session: a sticky session is a session maintained by persistence

The main advantage of the persistence over affinity is that it’s much more accurate, but sometimes, Persistence is not doable, so we must rely on affinity.

Using persistence, we mean that we’re 100% sure that a user will get redirected to a single server.

Using affinity, we mean that the user may be redirected to the same server…

https://www.haproxy.com/blog/load-balancing-affinity-persistence-sticky-sessions-what-you-need-to-know/

More info:

https://stackoverflow.com/questions/2528935/sending-cookie-with-http-request-in-java

https://stackoverflow.com/questions/4166129/apache-httpclient-4-0-3-how-do-i-set-cookie-with-sessionid-for-post-request

https://docs.oracle.com/cd/E24329_01/web.1211/e21049/sessions.htm#WBAPP323

https://stackoverflow.com/questions/4166129/apache-httpclient-4-0-3-how-do-i-set-cookie-with-sessionid-for-post-request

https://docs.oracle.com/cd/E24329_01/web.1211/e24425/bigip.htm#CLUST574

https://docs.oracle.com/cd/E11035_01/wls100/cluster/load_balancing.html#wp1028843
https://devcentral.f5.com/questions/sticky-session-for-cookiless-clients  (cooki-less) !!!

https://community.oracle.com/thread/3379174

https://serverfault.com/questions/903386/apache-balancing-towards-weblogic-backends-mod-wl-vs-mod-proxy-balancer

16 March 2019

The History of Computer Chess: An AI Perspective

Very impressive talk with chess authorities and computer scientists.

David Levy, Knuth (talking about its paper alpha-beta).


08 March 2019

Decompiling Java

Simple example:

public class Hola {

    public static void main(String[] args) {


        double pi = 3.14156;
       
        System.out.println("pi="+pi);
       
    }
}


Using javap -c can be solved:

$ javap -c Hola.class Compiled from "Hola.java"
public class Hola {
  public Hola();
    Code:
       0: aload_0      
       1: invokespecial #8                  // Method java/lang/Object."":()V
       4: return       

  public static void main(java.lang.String[]);
    Code:
       0: ldc2_w        #16                 // double 3.14156d
       3: dstore_1     
       4: getstatic     #18                 // Field java/lang/System.out:Ljava/io/PrintStream;
       7: new           #24                 // class java/lang/StringBuilder
      10: dup          
      11: ldc           #26                 // String pi=
      13: invokespecial #28                 // Method java/lang/StringBuilder."":(Ljava/lang/String;)V
      16: dload_1      
      17: invokevirtual #31                 // Method java/lang/StringBuilder.append:(D)Ljava/lang/StringBuilder;
      20: invokevirtual #35                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      23: invokevirtual #39                 // Method java/io/PrintStream.println:(Ljava/lang/String;)V
      26: return       
}



javap -verbose MyClass | grep "major"
to know java version.
 


25 February 2019

common log4j2/slf4 error by duplication

####<Nov 23, 2018 12:20:05 PM CLST> <Error> <Deployer> <machine1> <WLSSandbox01> <[STANDBY] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1542986405456> <BEA-149231> <Unable to set the activation state to true for the application "foo-bar-qux-rest".
weblogic.application.ModuleException: java.lang.NoClassDefFoundError: org/apache/logging/log4j/util/ReflectionUtil
    at weblogic.application.internal.ExtensibleModuleWrapper.start(ExtensibleModuleWrapper.java:140)
    at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:124)
    at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:216)
    at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:211)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:42)
    at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:73)
    at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:24)



---


<Feb 22, 2019 1:14:48,804 PM CLST> <Error> <Console> <BEA-240003> <Administration Console encountered the following error: weblogic.application.ModuleException: java.lang.IncompatibleClassChangeError: Class org.apache.logging.slf4j.Log4jLoggerFactory does not implement the requested interface org.slf4j.ILoggerFactory
    at weblogic.application.internal.ExtensibleModuleWrapper.start(ExtensibleModuleWrapper.java:140)
    at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:124)
    at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:216)
    at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:211)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:42)

15 February 2019

Haskell Ubuntu install

sudo apt-get install -y software-properties-common
sudo add-apt-repository ppa:hvr/ghc
sudo apt-get update
sudo apt-get install ghc-8.6.3

sudo apt-get install cabal-install-2.4


i.e.:
export PATH=/opt/ghc/8.0.2/bin/:$PATH
export PATH=/opt/ghc/bin/:$PATH

multiple ghc:
$ activate-hs
You must be root to activate a particular Haskell Platform.
Please rerun this command sudo:
    sudo /usr/local/bin/activate-hs 


16 January 2019

Log4j2 name JMX MBeans

To let name through JMX at MBeans, this can be assigned through

        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-web</artifactId>
            <version>${log4j2.version}</version>
            <scope>provided</scope>
        </dependency>
      
and can be customized:

    <context-param>
        <param-name>log4jContextName</param-name>
        <param-value>spring-mvc-simple-32-nombre</param-value>
    </context-param>


https://logging.apache.org/log4j/2.x/manual/webapp.html

It must be web.xml 3.0

Blog Archive

Disclaimer

Qux