Mar Java Mit Java Blog

What is CORS and how is it used 0

What is CORS and how is it used

Let’s say we wanted to provide a service at http://orlandotemp.net/temp that responds to AJAX GET requests from the external site example.com with a JSON object containing the current temperature in Orlando, FL. All we need to do to enable this...

How to enable CORS in Tomcat and JBOSS 0

How to enable CORS in Tomcat and JBOSS

For jboss we can use a solution from thetransactioncompany: web.xml: maven: If you use apache Tomcat you can use built-in CorsFilter: web.xml: pom.xml:

What should we avoid in thread dumps 0

What should we avoid in thread dumps

One of the most common trick is knowing what to ignore safely. Let’s have a look at sample thread dump: “Atmosphere-Scheduler-3162” nid=137911 state=TIMED_WAITING [] java.lang.Thread.State: TIMED_WAITING – waiting on <0x2db6a729> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject) – locked...

What is an example of Livelock 0

What is an example of Livelock

Here’s a very simple Java example of livelock where a husband and wife are trying to eat soup, but only have one spoon between them. Each spouse is too polite, and will pass the...

What is difference between ORACLE JDK and OPENJDK 0

What is difference between ORACLE JDK and OPENJDK

Oracle’s BCL-licensed JDK historically contained “commercial features” that were not available in OpenJDK builds. As promised, however, over the past year Oracle has contributed these features to the OpenJDK Community, including: Java Flight Recorder, Java...

How does redis cluster work 0

How does redis cluster work

So this is how redis cluster will look like which has 3 masters and 3 slaves.Each master node has a slave node. If master node goes down, slave node will be promoted to the...

How to enable redis in cluster mode 0

How to enable redis in cluster mode

To configure redis in cluster mode we need to run some ruby script. So we first need to download and install ruby. Download Ruby from http://rubyinstaller.org/downloads/ Now that ruby is installed we can run the...

How to use infinispan as a caching engine 0

How to use infinispan as a caching engine

There are many popular caching engines available in the market like redis, ehcache, memcached, jcs etc. In this article we will be covering infinispan.   Download inifinispan server from http://infinispan.org/download/ . Go for ‘server’ Go to...

Ext’s doLayout is not working after upgrade 0

Ext’s doLayout is not working after upgrade

I recently upgraded EXT js from version 4.1 to 6.6 and suddenly saw following code getting broken tabPanel.doLayout() This code I used to use to render the layout After raising ticket with the EXT...