Hi I checked the link that you sent and this is will work of course but you will have to create a lot of DTO objects for your application and map the POJO objects from Hibernate to the DTO which will require a lot of coding. The example should work, your DTOs should be serialized, Now what I don't understand is that if you're using Hibernate why use JDBC directly?. You can get a Connection to your database from the Session object or create an a SQLQuery. From what I'm reading it looks like you're using java.net.Socket on the GWT Client side and this is not a valid class.
Regards, Néstor Boscán On Sat, Feb 5, 2011 at 2:52 PM, Debashish <[email protected]> wrote: > Hi Néstor, > > Thank you for the response regarding the Hibernate with GWT. > > However I have followed the similar approach given in the below link > > http://code.google.com/webtoolkit/articles/using_gwt_with_hibernate.html > which suggets to use DTO approach to map the hibernate domain object > to DTO > and passed to the data to GWT layer. > > I have a query on the Local Database connectivity from GWT. Is it > possible to make a > JDBC call(using Oracle Thin Driver). I have tried a normal jdbc > connection from GWT > using classes12.jar file in classpath and using > Class.forName("Oracle.jdbc.driver.OracleDriver"). > I have deployed on Google Apps server. > > I am getting the below error message while while running the > application. > > ---------------------------------------------------------------------------------------------------------------------- > java.net.Socket is a restricted class. Please see the Google App > Engine developer's guide for more details. > [ERROR] javax.servlet.ServletContext log: Exception while dispatching > incoming RPC call > com.google.gwt.user.server.rpc.UnexpectedException: Service method > 'public abstract java.lang.Long > > com.google.musicstore.client.MusicStoreService.saveAccount(com.google.music > store.client.dto.AccountDTO)' > threw an unexpected exception: java.lang.ExceptionInInitializerError > at > com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java: > 378) > > --------------------------------------------------------------------------------------------------------------------- > > Could you please suggest me of any good links or site which provides > an approach to develope GWT aplications > using local database. > > Thanks > Dev > > > > > > On Jan 26, 5:20 pm, Néstor Boscán <[email protected]> wrote: > > This is very tipical in Hibernate applications that have to serialize > > objects through the network be it GWT, Web Services, JSON, etc. Hibernate > > will leave his own POJO in your objects for lazy initialization purposes. > > When GWT or a Web Service tries to serialize the objects and opens the > > hibernate POJO it will throw LazyInitializationException because the > > connection is already closed. What I've done in my applications is to > clean > > the POJO of any Hibernate references. This is done with a Hibernate > Cleaner > > class. On the web there are a couple of examples of this. > > > > Regards, > > > > Néstor Boscán > > > > > > > > On Tue, Jan 25, 2011 at 2:33 PM, Debashish <[email protected]> > wrote: > > > Hi > > > > > I am trying for a sample using GWT and database layer as Hibernate > > > with Oracle on Google Aps server. > > > > > I have done a sample for Hibernate with JSP as presentation layer, > > > which is working fine. > > > But the same approach is not working with GWT. > > > > > Here is a verygood link on this topic > > > > > > http://code.google.com/webtoolkit/articles/using_gwt_with_hibernate.html > > > and my approach is almost similar. > > > > > I have followed the below approach, > > > The RemoteServiceServlet makes a call to Hibernate layer and tries the > > > initializes the SessionFactory as below, > > > sessionFactory = new > > > Configuration().configure().buildSessionFactory(); > > > > > I have added the jars necessary for the Hibernate layer (and > > > classes12.jar for oracle driver). > > > > > However while running , it is giving me an error as below, > > > > > > -------------------------------------------------------------------------------------------------------- > > > Initial SessionFactory creation failed.java.lang.NoClassDefFoundError: > > > java.net.Socket is a restricted class. Please see the Google App > > > Engine developer's guide for more details. > > > [ERROR] javax.servlet.ServletContext log: Exception while dispatching > > > incoming RPC call > > > com.google.gwt.user.server.rpc.UnexpectedException: Service method > > > 'public abstract java.lang.Long > > > > > > com.google.musicstore.client.MusicStoreService.saveAccount(com.google.musicstore.client.dto.AccountDTO)' > > > threw an unexpected exception: java.lang.ExceptionInInitializerError > > > at > > > com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java: > > > 378) > > > > > > -------------------------------------------------------------------------------------------------------- > > > I have one through some of the threads which suggested me to download > > > the google apps jar files and try it. I have downladed it. but there > > > is no proper direction on how to make use of which jar file. > > > > > Have anybody tried the same. Please let me know if anything I am doing > > > wrong. > > > *** Note that I am using Oracle 9.2 as local database. > > > > > Thanks > > > Dev > > > > > -- > > > You received this message because you are subscribed to the Google > Groups > > > "Google Web Toolkit" group. > > > To post to this group, send email to > [email protected]. > > > To unsubscribe from this group, send email to > > > [email protected]<google-web-toolkit%[email protected]> > <google-web-toolkit%2Bunsubs[email protected]> > > > . > > > For more options, visit this group at > > >http://groups.google.com/group/google-web-toolkit?hl=en.- Hide quoted > text - > > > > - Show quoted text - > > -- > You received this message because you are subscribed to the Google Groups > "Google Web Toolkit" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<google-web-toolkit%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/google-web-toolkit?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
