Author name: greg

GLSurfaceView queueEvent and onTouchEvent seams broken!!!

What a title, I know but thats exactly what it is. This issue is happening on Android 1.6 so it might already been fixed. Just as per documentation i have implemented my GLSurfaceView as GameGLSurfaceView and overridden public boolean onTouchEvent(final MotionEvent event) method as so. /** * Capture touch event and delegate it to our …

GLSurfaceView queueEvent and onTouchEvent seams broken!!! 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 »

Show last executed query SQL Server – Disected

I found this online, without explanation so I will dissect the query and explain what is happening. SELECT deqs.last_execution_time AS [TIME], dest.TEXT AS [Query] FROM sys.dm_exec_query_stats AS deqs CROSS APPLY sys.dm_exec_sql_text(deqs.sql_handle) AS dest ORDER BY deqs.last_execution_time DESCSELECT deqs.last_execution_time AS [Time], dest.TEXT AS [Query] FROM sys.dm_exec_query_stats AS deqs CROSS APPLY sys.dm_exec_sql_text(deqs.sql_handle) AS dest ORDER BY deqs.last_execution_time …

Show last executed query SQL Server – Disected Read More »

Including spaces/html entities in JSF component output.

Rather a silly problem but a problem nevertheless, including html entities as spaces special charactes etc… causes them to be escaped by the jsf. So something like getSpacedName(){return “Hello   world”;} will be outputed in the pages exactly as we have entered in out method above. On regulat h:outputText we can use ‘escape’ attribute and set it …

Including spaces/html entities in JSF component output. Read More »

Why do I get a java.sql.SQLException: “Unable to get information from SQL Server” when trying to connect to an SQL Server instance?

Possible solution 1 I am using jtds driver so I would suggest checkingout their proposed solution first here http://jtds.sourceforge.net/faq.html#instanceGetInfo Possible solution 2 Their solution did not for me so here is what I did : From cmd prompt run sqlcmd -L and make sure that the server you are connecting is listed in the returned …

Why do I get a java.sql.SQLException: “Unable to get information from SQL Server” when trying to connect to an SQL Server instance? 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 »

org.hibernate.HibernateException: The chosen transaction strategy requires access to the JTA TransactionManager

While setting up a simple web app on JBoss 5 using container manager transaction I run into following exception Caused by: org.hibernate.HibernateException: The chosen transaction strategy requires access to the JTA TransactionManager at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:361) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1327)Caused by: org.hibernate.HibernateException: The chosen transaction strategy requires access to the JTA TransactionManager at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:361) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1327) Well after some …

org.hibernate.HibernateException: The chosen transaction strategy requires access to the JTA TransactionManager Read More »