private Connection getConnection() throws NamingException, SQLException {Context ctx = null;try {ctx = new InitialContext();} catch (NamingException exp) {}DataSource ds = (DataSource) ctx.lookup("java:/comp/env/jdbc/postgres"); return (ds.getConnection());}
Do you use DevMode with GWT's embedded jetty? If yes, JNDI DataSources only work in Jetty if configured correctly: https://wiki.eclipse.org/Jetty/Howto/Configure_JNDI_Datasource . However GWT has never officially supported jetty configuration files inside your GWT project, so it might be a better idea to use DevMode with -noserver and setup a correctly configured server of your choice on your local host yourself.
Also if you ignore exceptions then it is quite obvious that you will not see any error messages, right? You should never have empty catch blocks in your code. At least put a log statement in it.
-- J.
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment