13 June 2018

Cookies WLS Admin Console

Whenever you cannot login into WLS Admin Console thru FireFox, try first removing Cookies for that specific IP, instead of cleaning cache/cookies, etc.

12 June 2018

BEA-290015

When the message :

<BEA-290015> <Domain wide secret mismatch>

Appears, then probably the issue is not synchronized servers among AdminServer and Managed Server(s).

This could be resolved using nptd.

-Djava.awt.headless=true

There is a common issue when creating PDF in WebLogic Server:


<[ServletContext@26791009[app:foo-rest module:foo-rest.war path:null spec-version:3.0]] Root cause of ServletException.
java.lang.NoClassDefFoundError: Could not initialize class net.sf.jasperreports.engine.util.JRStyledTextParser
                at net.sf.jasperreports.engine.fill.JRBaseFiller.(JRBaseFiller.java:108)
                at net.sf.jasperreports.engine.fill.JRVerticalFiller.(JRVerticalFiller.java:69)
                at net.sf.jasperreports.engine.fill.JRVerticalFiller.(JRVerticalFiller.java:57)
                at net.sf.jasperreports.engine.fill.JRFiller.createBandReportFiller(JRFiller.java:200)
                at net.sf.jasperreports.engine.fill.JRFiller.createReportFiller(JRFiller.java:215)
                Truncated. see log file for complete stacktrace

...
...
<[ServletContext@1852380706[app:bar module:bar.war path:null spec-version:3.0]] Root cause of ServletException.
java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11GraphicsEnvironment
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:195)
        at java.awt.GraphicsEnvironment.createGE(GraphicsEnvironment.java:102)
        at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:81)
        at net.sf.jasperreports.engine.util.JRStyledTextParser.(JRStyledTextParser.java:94)
        at net.sf.jasperreports.engine.fill.JRBaseFiller.(JRBaseFiller.java:108)
        at net.sf.jasperreports.engine.fill.JRVerticalFiller.(JRVerticalFiller.java:69)
        at net.sf.jasperreports.engine.fill.JRVerticalFiller.(JRVerticalFiller.java:57)
        at net.sf.jasperreports.engine.fill.JRFiller.createBandReportFiller(JRFiller.java:200)
        at net.sf.jasperreports.engine.fill.JRFiller.createReportFiller(JRFiller.java:215)
        at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:115)
        at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:667)
        at cl.ejemplo.common.reporteria.service.impl.ReporteriaServiceJasperImpl.construirBarFooReporte(ReporteriaServiceJasperImpl.java:306)
        at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)


This is solved by adding the following argument to WLS script:

 -Djava.awt.headless=true

OPTIMIZER_FEATURES_ENABLE

Sometimes it's necessary to downgrade features for Oracle DB:
NOTE: Modifying the OPTIMIZER_FEATURES_ENABLE parameter generally is strongly discouraged and should only be used as a short term measure at the suggestion of Oracle Global Support.

The parameter can be set from the system or session level:

alter system set optimizer_features_enable='10.2.0.4' scope=spfile;

alter session set optimizer_features_enable='10.2.0.4';


It can also be set by adding a hint:

SELECT /*+ optimizer_features_enable('10.2.0.4') */ ENAME FROM EMP;

When setting this parameter, remember that all optimizer parameter settings will revert back to the older version. Thus, any 'new' optimizer features will not be used and other queries may be detrimentally affected





_WL_TEMP_APP_DOWNLOADS

When using plan.xml to update an application, if the config-root element is erroneously set to wrong value or empty then the directory is recursively updated with the content :

$DOMAIN_HOME/servers/adminServer /tmp/_WL_TEMP_APP_DOWNLOADS/[APP_NAME]

The server may run out of space. There is a patch to avoid it.

11 June 2018

Dominosa

Reading an old version of Knuth Dancing Links draft. I thought I found an error, but it was already found and solved.

# Knuth Dancing Links. Wrong original
0 0 5 2 1 4 1 2
1 4 5 3 5 3 5 6
1 1 5 6 0 0 4 4
4 4 5 6 2 2 2 3
0 0 5 6 1 3 3 6
6 6 2 0 3 2 5 1
1 5 0 4 4 0 3 2


# Knuth Dancing Links. Correct version :P
0 6 5 2 1 4 1 2
1 4 5 3 5 3 3 6
1 1 5 6 0 0 4 4
4 4 5 6 2 2 2 3
0 0 5 6 1 3 3 6
6 6 2 0 3 2 5 1
1 5 0 4 4 0 3 2


Anyway, I was able to learn who invented the Dominio game called Dominos, which I knew from Gardner article and has appeared in several magazines/online sites.
Dominosa was developed by O. S. Adler in 1874. It was patented by Richard Osa (pseudonym for O. S. Adler) in Germany in 1893 as German Reichs Patent No. 71539 and published in 1894 under the name of “Dominosa” , combining ‘Domino’ with Adler’s initials. It later appeared in 1912 in a domino puzzle book , co-authored by Fritz 2 Jahn [4].
Source: https://www.researchgate.net/publication/282626601_Reconstruction_of_domino_tilings-Combinatorial_and_probabilistic_questions?_sg=PPGfibelUd_bhFkR01XbmeYluzhKQhBCWWhYB6NsPIVoBAESijOVXxcnXFi8Af5Blm7G0y-xww

http://libridigiochi.blogspot.com/2015/01/domino-pubblicazioni-in-lingua-tedesca.html


Besides, it is announced the new Fascicle of TAOCP: The Art of Computer Programming, Volume 4B, Fascicle 5: The: Mathematical Preliminaries Redux; Backtracking; Dancing Links

06 June 2018

JMC + JFR

- jmc comes with JDK 1.7.0_u40+, but it discontinued on JDK9. (and now OpenJDK 11 has it).
- jfr profiler, can save events in a fixed period.
- jmc is open source now: https://github.com/JDKMissionControl/jmc
- right button to save (very intuitive)
- enable: -XX:+UnlockCommercialFeatures -XX:+FlightRecorder  (if you are using JDK8_40+, you can dynamically enable JFR.

You can use the following flags to improve accuracy.
-XX:+UnlockDiagnosticVMOptions -XX:+DebugNonSafepoints

-XX:StartFlightRecording=delay=10s,duration=90s,name=Test,filename=recording.jfr,settings=profile

$ java -XX:+UnlockDiagnosticVMOptions -XX:+DebugNonSafepoints -XX:+UnlockCommercialFeatures -XX:+FlightRecorder -XX:StartFlightRecording=delay=10s,duration=90s,name=Test,filename=recording-test.jfr,settings=profile -jar target/hola-0.0.1.jar

-XX:FlightRecorderOptions=loglevel=info


JMC = Java Mission Control
JFR = Java Flight Recorder

05 June 2018

Alphabest Prize

Thanks for the Prize http://www.gamepuzzles.com/ about Alphabest.


Jax London 2018 Constraint Puzzle

There was a small contest from Jax London 2018.

This puzzle required Constraint Programming, which is solvable using JaCop (among other libraries)

Give it a try (although the contest is over, and I didn't win, but the answer was correct :P ).


High CPU (old fashion)

    A good old way to identify high CPU threads.
    • identify WLS PID : jps -v. (or lsof -i @IP:port)
    • take Thread Dumps: kill -3 <PID>jstack -l <PID>, jcmd <PID> Thread.print
    • top -H -b -p <PID>
    • identify child process from %CPU column
    • convert those PID to Hex (ie: 3141): printf "%x " 3141
    • search those Hex to Thread dump: nid=0xc45

    Blog Archive

    Disclaimer

    Qux