tag:rmalla.svbtle.com,2014:/feedRatnakar Malla2015-07-13T16:26:11-07:00Ratnakar Mallahttps://rmalla.svbtle.comSvbtle.comtag:rmalla.svbtle.com,2014:Post/installing-hue-on-hdp-212015-07-13T16:26:11-07:002015-07-13T16:26:11-07:00Installing Hue on HDP 2.1<p>When installing Hue on Hadoop Data Platform from Horton Works, you might run into issue compiling the code.<br>
Maven fails with the following stack trace:</p>
<p>cd hue-3.8.1/desktop/libs/hadoop/java && mvn clean install -DskipTests </p>
<p>Jul 13, 2015 10:49:26 p.m. com.google.inject.internal.MessageProcessor visit</p>
<p>INFO: An exception was caught and reported. Message: java.util.NoSuchElementException</p>
<p>java.util.NoSuchElementException</p>
<p>at java.util.AbstractList$1.next(libgcj.so.10)</p>
<p>at com.google.inject.spi.InjectionPoint.forMember(InjectionPoint.java:116)</p>
<p>at com.google.inject.spi.InjectionPoint.(InjectionPoint.java:73)</p>
<p>at com.google.inject.spi.InjectionPoint$InjectableMethod.toInjectionPoint(InjectionPoint.java:459)</p>
<p>at com.google.inject.spi.InjectionPoint.getInjectionPoints(InjectionPoint.java:725)</p>
<p>at com.google.inject.spi.InjectionPoint.forInstanceMethodsAndFields(InjectionPoint.java:358)</p>
<p>at com.google.inject.spi.InjectionPoint.forInstanceMethodsAndFields(InjectionPoint.java:377)</p>
<p>at com.google.inject.internal.BindingBuilder.toInstance(BindingBuilder.java:84)</p>
<p>at org.codehaus.plexus.DefaultPlexusContainer$ContainerModule.configure(DefaultPlexusContainer.java:803)</p>
<p>at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:229)</p>
<p>at com.google.inject.spi.Elements.getElements(Elements.java:103)</p>
<p>at com.google.inject.spi.Elements.getElements(Elements.java:80)</p>
<p>at org.sonatype.guice.bean.binders.MergedModule.configure(MergedModule.java:54)</p>
<p>at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:229)</p>
<p>at com.google.inject.spi.Elements.getElements(Elements.java:103)</p>
<p>at com.google.inject.internal.InjectorShell$Builder.build(InjectorShell.java:136)</p>
<p>at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:104)</p>
<p>at com.google.inject.Guice.createInjector(Guice.java:94)</p>
<p>at com.google.inject.Guice.createInjector(Guice.java:71)</p>
<p>at com.google.inject.Guice.createInjector(Guice.java:61)</p>
<p>at org.codehaus.plexus.DefaultPlexusContainer.addPlexusInjector(DefaultPlexusContainer.java:470)</p>
<p>at org.codehaus.plexus.DefaultPlexusContainer.(DefaultPlexusContainer.java:196)</p>
<p>at org.codehaus.plexus.DefaultPlexusContainer.(DefaultPlexusContainer.java:160)</p>
<p>at org.apache.maven.cli.MavenCli.container(MavenCli.java:375)</p>
<p>at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:191)</p>
<p>at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)</p>
<p>at java.lang.reflect.Method.invoke(libgcj.so.10)</p>
<p>at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)</p>
<p>at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)</p>
<p>at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)</p>
<p>at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)</p>
<p>Jul 13, 2015 10:49:26 p.m. com.google.inject.internal.MessageProcessor visit</p>
<p>INFO: An exception was caught and reported. Message: java.util.NoSuchElementException</p>
<p>java.util.NoSuchElementException</p>
<p>at java.util.AbstractList$1.next(libgcj.so.10)</p>
<p>at com.google.inject.spi.InjectionPoint.forMember(InjectionPoint.java:116)</p>
<p>at com.google.inject.spi.InjectionPoint.(InjectionPoint.java:73)</p>
<p>at com.google.inject.spi.InjectionPoint$InjectableMethod.toInjectionPoint(InjectionPoint.java:459)</p>
<p>at com.google.inject.spi.InjectionPoint.getInjectionPoints(InjectionPoint.java:725)</p>
<p>at com.google.inject.spi.InjectionPoint.forInstanceMethodsAndFields(InjectionPoint.java:358)</p>
<p>at com.google.inject.spi.InjectionPoint.forInstanceMethodsAndFields(InjectionPoint.java:377)</p>
<p>at com.google.inject.internal.BindingBuilder.toInstance(BindingBuilder.java:84)</p>
<p>at org.codehaus.plexus.DefaultPlexusContainer$DefaultsModule.configure(DefaultPlexusContainer.java:836)</p>
<p>at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:229)</p>
<p>at com.google.inject.spi.Elements.getElements(Elements.java:103)</p>
<p>at com.google.inject.spi.Elements.getElements(Elements.java:80)</p>
<p>at org.sonatype.guice.bean.binders.MergedModule.configure(MergedModule.java:54)</p>
<p>at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:229)</p>
<p>at com.google.inject.spi.Elements.getElements(Elements.java:103)</p>
<p>at com.google.inject.internal.InjectorShell$Builder.build(InjectorShell.java:136)</p>
<p>at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:104)</p>
<p>at com.google.inject.Guice.createInjector(Guice.java:94)</p>
<p>at com.google.inject.Guice.createInjector(Guice.java:71)</p>
<p>at com.google.inject.Guice.createInjector(Guice.java:61)</p>
<p>at org.codehaus.plexus.DefaultPlexusContainer.addPlexusInjector(DefaultPlexusContainer.java:470)</p>
<p>at org.codehaus.plexus.DefaultPlexusContainer.(DefaultPlexusContainer.java:196)</p>
<p>at org.codehaus.plexus.DefaultPlexusContainer.(DefaultPlexusContainer.java:160)</p>
<p>at org.apache.maven.cli.MavenCli.container(MavenCli.java:375)</p>
<p>at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:191)</p>
<p>at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)</p>
<p>at java.lang.reflect.Method.invoke(libgcj.so.10)</p>
<p>at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)</p>
<p>at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)</p>
<p>at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)</p>
<p>at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)</p>
<p>[ERROR] Error executing Maven.</p>
<p><strong>WORKAROUND/FIX</strong></p>
<p>This is caused because maven is compiling against libgcj, which comes with OpenJDK instead of Oracle JDK.</p>
<p>Steps to fix:</p>
<ol>
<li>Update java alternatives to point to Oracle JDK.
<em>alternatives –config java</em>
</li>
<li>If your preferred JDK is not showing up in the list, run the following command.
*alternatives –install /usr/bin/java java /opt/WebSphere/AppServer/java/bin/java 3 *</li>
<li>Rerun step 1, alternatives, and choose the correct JDK.</li>
<li>This should fix the above error.</li>
</ol>
tag:rmalla.svbtle.com,2014:Post/silicon-valley-code-camp-2014-presentation2014-10-14T16:44:46-07:002014-10-14T16:44:46-07:00Solving performance problems on Java web applications - Our experiences<p>This material is from my presentation at Silicon Valley Code Camp - 2014<br>
<a href="https://docs.google.com/presentation/d/1UZ-Z41FD9IPif-jIaADGBZ7rH8g1JLyuU_77TZ61sew/edit?usp=sharing"><img src="https://svbtleusercontent.com/1wihjy32guskbq_small.png" alt="svcc-2014-presentation.PNG"></a></p>
tag:rmalla.svbtle.com,2014:Post/trouble-with-ehcache2014-08-19T08:22:42-07:002014-08-19T08:22:42-07:00Trouble with EhCache<p>We are running EhCache in production, and the cache has been configured with Cache size in memory and on the disk.<br>
However, upon analysis of heap dump using Eclipse Memory Analysis Tool (MAT), we noticed the EhCache was using almost 80% of the memory.</p>
<p><a href="https://svbtleusercontent.com/jftmmmz5loyy9g.png"><img src="https://svbtleusercontent.com/jftmmmz5loyy9g_small.png" alt="Heap Snapshot"></a></p>
<p>Further research of EhCache , and reading forums, we noticed that the open source version of EhCache was a crippleware, with a serious limitation.<br>
Here is what I read from EhCache forums:</p>
<p>*As you have noticed the open-source disk stores do not store the entire cache on disk. Instead the values are stored on the disk, and the keys are stored in memory mapped to value objects which reference where on disk the associated value object can be found. This means each on-disk mapping has an associated in-memory overhead equal to it’s key-size plus a fixed overhead per mapping. *</p>
<p>Ref: <a href="http://forums.terracotta.org/forums/posts/list/5032.page"> EhCache Forum Post </a></p>
<p>In conclusion it is very important that unless you are using BigMemory or other commercial caching engines, Open source EhCache , will choke your application. Caveat Emptor !!!</p>