java

Ant BuildException Cannot run program “..\src\protoc”

Error that I am getting when trying to run mvn test on google protobuf library. [INFO] Executing tasks [INFO] ———————————————————————— [ERROR] BUILD ERROR [INFO] ———————————————————————— [INFO] An Ant BuildException has occured: Execute failed: java.io.IOException: Cannot run program "..\src\protoc": CreateProcess error=2, The system c annot find the file specified   [INFO] ———————————————————————— [INFO] For more information, …

Ant BuildException Cannot run program “..\src\protoc” Read More »

Ant BuildException Cannot run program “..\src\protoc”

Error that I am getting when trying to run mvn test on google protobuf library. [INFO] Executing tasks [INFO] ———————————————————————— [ERROR] BUILD ERROR [INFO] ———————————————————————— [INFO] An Ant BuildException has occured: Execute failed: java.io.IOException: Cannot run program "..\src\protoc": CreateProcess error=2, The system c annot find the file specified   [INFO] ———————————————————————— [INFO] For more information, …

Ant BuildException Cannot run program “..\src\protoc” Read More »

No Dialect mapping for JDBC type: -4

Yet another fun day with hibernate. While working on ResourcePhaseListener for JSF attachment problem I run into following problem while trying to retrieve BLOB from MySQL db. org.hibernate.MappingException: No Dialect mapping for JDBC type: -4 No Dialect mapping for JDBC type: -4org.hibernate.MappingException: No Dialect mapping for JDBC type: -4 No Dialect mapping for JDBC type: …

No Dialect mapping for JDBC type: -4 Read More »

Expanding Rich tree nodes programmatically

I have found two different methods for expanding nodes in Rich tree  from code, they both take  advantage of component binding and component state. Tree Setup <rich:tree value="#{ourbean.sampleTree}" binding="#{ourbean.sampleTreeBinding}"   var="node" nodeFace="simple" id="someid" > <rich:treeNode type="simple" > <h:outputText value="#{node}"/> </rich:treeNode> </rich:tree><rich:tree value="#{ourbean.sampleTree}" binding="#{ourbean.sampleTreeBinding}" var="node" nodeFace="simple" id="someid" > <rich:treeNode type="simple" > <h:outputText value="#{node}"/> </rich:treeNode> </rich:tree> Only thing to …

Expanding Rich tree nodes programmatically Read More »

How to read the files placed in WEB-INF from JSF

Reading files from WEB-INF in JSF This no different than reading files from a Servlet except it involves a extra step of getting ServletContext from FacesContext FacesContext context = FacesContext.getCurrentInstance(); ExternalContext externalContext = context.getExternalContext(); ServletContext sc = (ServletContext)externalContext.getContext(); String sc.getRealPath("/WEB-INF/somefile.xml");FacesContext context = FacesContext.getCurrentInstance(); ExternalContext externalContext = context.getExternalContext(); ServletContext sc = (ServletContext)externalContext.getContext(); String sc.getRealPath("/WEB-INF/somefile.xml"); Here we …

How to read the files placed in WEB-INF from JSF Read More »

UnsatisfiedLinkError: javaxpcomglue.dll: Can’t find dependent libraries

While playing around with JavaXPCOM I have run into couple issues. I am running on window 7 64 bit. When trying to initialize my GRE (Gecko Runtime Environment) I got following exception Exception in thread "main" java.lang.UnsatisfiedLinkError: D:\xulrunner-sdk\bin\javaxpcomglue.dll: Can’t find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1803) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1699) at java.lang.Runtime.load0(Runtime.java:770) at java.lang.System.load(System.java:1003) at org.mozilla.xpcom.internal.JavaXPCOMMethods.registerJavaXPCOMMethods(JavaXPCOMMethods.java:57) …

UnsatisfiedLinkError: javaxpcomglue.dll: Can’t find dependent libraries Read More »

Preventing ViewExpiredException in JSF

When our page is idle for x amount of time the view will expire and throw javax.faces.application.ViewExpiredException to prevent this from happening one solution is to create CustomViewHandler that extends ViewHandler and override restoreView method all the other methods are being delegated to the Parent import java.io.IOException; import javax.faces.FacesException; import javax.faces.application.ViewHandler; import javax.faces.component.UIViewRoot; import javax.faces.context.FacesContext; …

Preventing ViewExpiredException in JSF Read More »

Display all managed-beans in JSF at runtime

Sometimes we like to see whats going on under the hood of jsf application (Checkout my JSFConsole). One such task is being able to display all the registered managed-beans during runtime. Here we can see all registered beans, including implicit object(cookie,header,param etc…) Result a4j a4jSkin ajaxContext ajaxHandler application applicationScope beeHive — My Managed bean cookie …

Display all managed-beans in JSF at runtime Read More »