GWT Hibernate issue

23 views
Skip to first unread message

Raul

unread,
May 15, 2009, 9:52:43 AM5/15/09
to Google Web Toolkit
Hello all,

At present I am trying to integrate GWT Hibernate and MySQL in
Tomcat5. I am using Hibernate to access my database in a servlet as

public class DBConnectionImpl extends RemoteServiceServlet implements
DBConnection {
private Session session;

public DBConnectionImpl() {
try {
session = HibernateUtil.getSessionFactory().openSession();
} catch (Exception ex) {
ex.printStackTrace();
}
}
}

I have configured all the necessary Hibernate requirements like
hybernate.cfg.xml, web.xml, context.xml and all necessary java
classes.

But when I want to connect with my database through a rpc call it
shows me error like:



May 15, 2009 7:00:44 PM org.apache.catalina.core.ApplicationContext
log
SEVERE: Exception while dispatching incoming RPC call
com.google.gwt.user.server.rpc.UnexpectedException: Service method
'public abstract com.duke.irb.client.data.User
com.duke.irb.client.dao.DBConnection.authenticateUser
(java.lang.String,java.lang.String)' threw an unexpected exception:
java.lang.UnsupportedOperationException: Not supported by
BasicDataSource
at com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure
(RPC.java:360)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse
(RPC.java:546)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall
(RemoteServiceServlet.java:166)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost
(RemoteServiceServlet.java:86)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter
(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke
(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke
(StandardContextValve.java:174)
at org.apache.catalina.core.StandardHostValve.invoke
(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke
(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke
(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service
(CoyoteAdapter.java:174)
at org.apache.coyote.http11.Http11Processor.process
(Http11Processor.java:874)
at org.apache.coyote.http11.Http11BaseProtocol
$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:
665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket
(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt
(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run
(ThreadPool.java:689)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.UnsupportedOperationException: Not supported by
BasicDataSource
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection
(BasicDataSource.java:899)
at org.hibernate.connection.DatasourceConnectionProvider.getConnection
(DatasourceConnectionProvider.java:89)
at org.hibernate.jdbc.ConnectionManager.openConnection
(ConnectionManager.java:446)
at org.hibernate.jdbc.ConnectionManager.getConnection
(ConnectionManager.java:167)
at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:142)
at org.hibernate.transaction.JDBCTransaction.begin
(JDBCTransaction.java:85)
at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:
1353)
at com.duke.irb.server.DBConnectionImpl.authenticateUser
(DBConnectionImpl.java:30)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse
(RPC.java:527)
... 18 more




Please help me out in solving this issue.

I will provide more information further if needed.

I am new to both GWT and Hibernate... :-)


Thanks in advance
Raul

Jim

unread,
May 15, 2009, 11:38:56 AM5/15/09
to Google Web Toolkit
You have to explicitly throw any exceptions in all service methods.


Jim
http://www.gwtorm.com For GWT ORM
http://code.google.com/p/dreamsource-orm/downloads/list

Raul

unread,
May 16, 2009, 9:10:13 AM5/16/09
to Google Web Toolkit
Hi Jim

Thanks for your reply.

I want to mention that I have already spent a lot of energy in
configuring hibernate. So wont wanna go for Leeonsoft for the time
being.

The main problem I am getting now is:



INFO org.hibernate.
impl.SessionFactoryObjectFactory - Not binding factory to JNDI, no
JNDI name configured
java.lang.UnsupportedOperationException:
Not supported by BasicDataSource
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection
(BasicDataSource.java:899)
at
org.hibernate.connection.DatasourceConnectionProvider.getConnection
(DatasourceConnectionProvider.java:89)



Well I think if I get a clue for this I will be a step ahead.......









On May 15, 8:38 pm, Jim <jim.p...@gmail.com> wrote:
> You have to explicitly throw any exceptions in all service methods.
>
> Jimhttp://www.gwtorm.comFor GWT ORMhttp://code.google.com/p/dreamsource-orm/downloads/list

Raul

unread,
May 19, 2009, 9:36:01 AM5/19/09
to Google Web Toolkit
Hi Jim/all

I have solved my problem

I have used c3p0 and its basic configuration, to do its work for me.

To use c3p0, I have configured my hibernate.cfg.xml file,
hibernate.properties file, Tomcat Context.xml file and add the
c3p0.jar file to my CLASSPATH that can be downloaded either from
http://sourceforge.net/projects/c3p0 or it also comes along with
Hibernate distribution.

The documentation comes along with the bundle of c3p0 and the
hibernate documentation helped me a lot to place all things in place:




Regards
Raul



On May 15, 8:38 pm, Jim <jim.p...@gmail.com> wrote:
> You have to explicitly throw any exceptions in all service methods.
>
> Jimhttp://www.gwtorm.comFor GWT ORMhttp://code.google.com/p/dreamsource-orm/downloads/list
>
> On May 15, 9:52 am, Raul <raahoo...@gmail.com> wrote:
>
> > Hello all,
>
> > At present I am trying to integrate GWTHibernateand MySQL in
> > Tomcat5. I am usingHibernateto access my database in a servlet as
>
> > public class DBConnectionImpl extends RemoteServiceServlet implements
> > DBConnection {
> >        private Session session;
>
> >         public DBConnectionImpl() {
> >                 try {
> >                         session = HibernateUtil.getSessionFactory().openSession();
> >                 } catch (Exception ex) {
> >                         ex.printStackTrace();
> >                 }
> >         }
>
> > }
>
> > I have configured all the necessaryHibernaterequirements like
> > I am new to both GWT andHibernate... :-)
>
> > Thanks in advance
> > Raul
Reply all
Reply to author
Forward
0 new messages