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

Posted on Leave a commentPosted in Uncategorized

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 […]

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

Posted on Leave a commentPosted in java

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 […]

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

Posted on Leave a commentPosted in java

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) […]