Java

Building a Webapp Store

So I have been silent for some time. Mainly due to deep diving into new territories since I left Oracle. Now I think it is time to put my new skills to some work and test them out. To that end, I thought that I need to build a webapp project for myself. Just to assert what I am learning and to learn even more from hands on practice.

The Database Backend

The first thing that any webapp needs is a persistance storage. Generally speaking Oracle databases are generally a very safe choice. But for small and medium based businesses this can result in prohibitive costs. Mysql/MariaDB is a popular choice here and is running most of the web. But at this point I am deciding against the popular choice and going for Postgre. The main thinking and reason being that Postgre is considered very close to an Oracle DB. Hence later if I wish moving my schema over to an Oracle DB is generally considered do-able.

Memory Profiling for Novices ( Heap OutOfMemory OOME error )

So sometimes out of memory errors crop up in you application. But to troubleshoot these should not be that complicated. Let me show you with Oracle's Visual VM, how you can quickly get down to the root cause of your out of memory errors. All you need Oracle's Java JDK installed on your system and the VisualVM tool that comes with it. At the time of writing the version I used was with JDK 8 (1.8.0_144). On a Mac OSX system all you need to do is type "jvisualvm" on your terminal and it will just popup. If you have your paths properly setup under windows and linux, it should also just work.

Lambda Recipe for attribute validation of Collection of POJOs

So here is a recipe you can use to validate a POJO attribute for some value. In my case I will show you how to check if attributes were set to null. But you can expand on the example as an exercise for yourself.

So here is the template method for a single object and a collection of objects:

Part 3 : Output Debug SQL statements on a Managed Server on a Production Weblogic 10.3 Cluster

So if you have already read my debugging adventures on a production clone Weblogic server part 1 and part 2, this can be called the part 3 of that series.

Part 2 : Remote Debugging a Managed Server on Production Weblogic 10.3 Cluster via SSH tunnelling

So this is a follow up article to part 1 here. If you are reading this, I am assuming you were not able to connect your debugger to the port opened in part 1, same as me. Well don't despair. There is a solution. In my case apparently only common ports were opened on the system, as it was supposed to be built close to a production system. Or actually some network switch or a physical hardware must be blocking access to the port. For this part, I was not sure. And the IT person supporting me also probably also didn't know the cause.

Part 1 : Remote Debugging a Managed Server on Production Weblogic 10.3 Cluster

Importing Sample Maven projects in Eclipse for the book OReilly's Enterprise JavaBeans 3.1

So while reading this book, I though I might as well get the source code and look and run it in an IDE instead of just glance at it in the book. So turned my attention to section V, examples and proceeded to the anonymous git cloning instruction and building as below :

Regex Lookahead and Lookbehind : Match Prefix and Suffix string but only accepting anything in between

Reg ex, lookahead, lookbehind

So there is a little known construct in regex of lookahead and lookbehind, that java regex also supports atleast upwards from java 5. This is exactly what you need if the desired match lives between a known prefix and suffix String. Or depending on if you have a prefix you can use the lookbehind construct and if you have a suffix only, you can use the lookahead construct.

So the lookbehind is represented by (?<=X) and lookahead is represented by (?=X).

Java keytool command references

Here are some commands I just found lying around that I once used when working with SSL enablement for a product. I think they should be useful examples for some one wanting to work with the keytool. So decided to just put these out there simply.

First a quick quotation from Oracle Java what the keyool is and does from their doc page here. ( I have linked to java se 6 docu as I believe that is what I actually used for the example commands ) :

Subscribe to RSS - Java