There was an issue with Tomcat port.
With stopped Tomcat -> tomcat start failed
With started Tomcat -> port is already in use
After that changed port from 8080 to 8084 and after another system reboot its finally working even with data from DB
-- With stopped Tomcat -> tomcat start failed
With started Tomcat -> port is already in use
After that changed port from 8080 to 8084 and after another system reboot its finally working even with data from DB
Thanks for hint with Jetty becuase this is my first implementation of using DB in GWT
Dne čtvrtek, 10. dubna 2014 15:06:29 UTC+2 Zbyněk Kočí napsal(a):
Dne čtvrtek, 10. dubna 2014 15:06:29 UTC+2 Zbyněk Kočí napsal(a):
Hello,Iam using RPC communication, JDBC driver (included in Tomcat libraries) & DB from previous project (Java & JSP only)Debian, NetBeans 7.4, Apache Tomcat 6
On server side Iam connection into the DB, retreiving data, trying to catch them immediately and next print them out in alert message (with RPC example)When I clean&build project, copy WAR file into the TomCat6 server it works fine in production mode and data are retreived properly, even System.out in Catalina logs works, but when Iam trying to do the same in DEV mode, it returns (null) as string text value instead. But no error message or logI guess its some kind problem with accesing JDBC or diff address location while in DEV mode at address: http://127.0.0.1:8888/?gwt.codesvr=127.0.0.1: 9997 Iam unable to find this issue while happen only in DEV mode.Can anyone hint me whats wrong?Contect.xml (tried only / as path, maybe issue here)<Context antiJARLocking="true" path="/RPC"><Resource auth="Container" driverClassName="org.postgresql.Driver" maxActive="20" maxIdle="10" name="jdbc/postgres" password="pass" type="javax.sql.DataSource" url="jdbc:postgresql://127.0. 0.1:5432/firstdb " username="user" validationQuery="select 1"/></Context>Connection method (I found another one, but it doesnt seem working properly)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());}Still in server Impl file as the only one JAVA server-side codetry {String query = "SELECT * FROM users WHERE id = ?";connection = getConnection();stmt = connection.prepareStatement(query); stmt.setInt(1, 1);rs = stmt.executeQuery();while (rs.next()) {id = rs.getInt("id");nam = rs.getString("nam");srn = rs.getString("srn");System.out.println(nam + " " + srn);}and then after catch exceptionsString messageString = "Hello " + nam + " " + srn + "!" +"message:" + input;Feel free to ask me for more info/codeThanks
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