Tuesday, July 13, 2010

Setup EJB 3 MDB on Weblogic using Eclipse

Setup EJB 3 MDB Project on Eclipse Shown below is a common exception which occurs when class is executed from Eclipse that depends on Weblogic libraries -
Exception in thread "main" java.lang.NoClassDefFoundError: weblogic/kernel/KernelStatus 
    at weblogic.jndi.Environment.,clinit9(Environment.java:78) 
    at weblogic.judi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:117) 
    at javax.naming spi NamingManager.getInitialContext(NamingManager.java:667) 
    at javax.naming InitialContext.getDefaultInitCtx(InitialContext.java:288) 
    at javax.naming.InitialContext.init(InitialContext.java:223) 
    at javax.naming InitialContext.einit,(InitialContext.java:197) 
    at com.MessageGenerator.getInitialContext(MessageGenerator.java:42) 

Monday, July 12, 2010

Images in Web Pages

DD_belatedPNG will (usually) solve all of your IE6 transaprency headaches with a little javascript: Medicine for your IE6/PNG headache!
It may slow down the page a little in IE6 (make sure you use conditional statements to prevent loading in other browsers), but it's much better than horrible grey blocks.

Good information overall in this article; however the easiest way to choose whether to use PNG/JPG or even GIF is:
Is the image a photograph? Yes = JPG
Must it use transparency? Yes = PNG
Does the image contain predominately blocks of colour? Yes = PNG or GIF, No = JPG
Is the PNG/GIF image very small (less than 10px x 10px)? Yes = GIF, No = PNG
Does the PNG/GIF image use >256 colours? Yes = PNG, No = 8-bit PNG/GIF

Even though GIF is an old format, it still seems to produce smaller filesizes when images are very very small. Also, it's a lossless format too so if your image contains less than 256 colours, then you won't lose any image details.
On a side note; it is a very good idea to store originals in a lossless format such as PNG. However, when storing photo originals, you'll achieve a better lossless compression using the TIFF file format, rather than PNG. This is because TIFFs are specialised for storage of photos without losing data, whereas PNG files are specialised for storing block colour graphics.