Also just to point out, there's a number of GWT libraries for passing
persistent objects across the client/server barrier.  I'm not sure how well
they work or of any of the dragons involved, but they do exist
(hibernate4gwt was one back in the day - I believe it's been deprecated and
there are more robust ones available these days).

On Thu, Mar 12, 2009 at 2:48 PM, Sumit Chandel <[email protected]>wrote:

> Hi Poonam,
> Apart from making sure your Hibernate and applicationContext.xml
> configurations are correct, I think another major cause for the stack trace
> you're seeing is that you're mixing server-side Java code with client-side
> GWT code. It's important to recall that GWT code gets converted into
> equivalent JavaScript, therefore you can't directly use server-side Java
> concepts in GWT code and expect them to work as they would in a Java
> runtime.
>
> That said, there is a set of emulated JRE types supported in GWT. You can
> check out the link below to the types that are supported in the emulated
> JRE.
>
> Emulated JRE:
>
> http://code.google.com/docreader/#p=google-web-toolkit-doc-1-5&s=google-web-toolkit-doc-1-5&t=RefJreEmulation
>
> Vitali's suggestion of getting your server-side properly configured without
> introducing GWT at first, and then creating the client-side using GWT and
> integrating with the server-side using GWT RPC sounds like a sound approach
> if you're just getting started.
>
> Hope that helps,
> -Sumit Chandel
>
>
> On Tue, Mar 10, 2009 at 12:26 AM, Vitali Lovich <[email protected]> wrote:
>
>> This is more a Hibernate than GWT issue.  From your error log, it looks
>> like it boils down to you not configuring it correctly.  If you look at the
>> newer Hibernate, there's no XML configuration.  It's all done through
>> annotations, which are a lot easier to understand.
>>
>> You may want to look into just getting hibernate running on its own in a
>> standalone java application, and then just adding a GWT RPC glue layer
>> around it if you are indeed planning on doing some kind of web-app stuff.
>>
>>
>> On Tue, Mar 10, 2009 at 3:06 AM, poonam <[email protected]> wrote:
>>
>>>
>>> Hi,
>>>  I have developed the application using the 3parts tutorial from the
>>> site  www.eggsylife.blogspot.com as suggested by you.
>>> Actually for database I have used MySQL and for  the connection with
>>> database I have created the applicationContext.xml as follows :
>>>
>>> - applicationContext.xml
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <beans xmlns="http://www.springframework.org/schema/beans";
>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>>>  xmlns:aop="http://www.springframework.org/schema/aop";
>>> xmlns:tx="http://www.springframework.org/schema/tx";
>>>  xsi:schemaLocation=" http://www.springframework.org/schema/beans
>>> classpath:spring-beans-2.0.xsd<http://www.springframework.org/schema/beans%0Aclasspath:spring-beans-2.0.xsd>
>>> http://www.springframework.org/schema/tx
>>> classpath:spring-tx-2.0.xsd<http://www.springframework.org/schema/tx%0Aclasspath:spring-tx-2.0.xsd>
>>> http://www.springframework.org/schema/aop
>>> classpath:spring-aop-2.0.xsd<http://www.springframework.org/schema/aop%0Aclasspath:spring-aop-2.0.xsd>
>>> ">
>>>  <bean id="dataSource"
>>> class="org.apache.commons.dbcp.BasicDataSource">
>>>   <property name="driverClassName">
>>>       <value>com.mysql.jdbc.Driver</value>
>>>   </property>
>>>   <property name="url">
>>>      <value>>jdbc:mysql://localhost/test</value>
>>>   </property>
>>>
>>>  <property name="username">
>>>        <value>root</value>
>>>  </property>
>>>  <property name="password">
>>>     <value>root</value>
>>>   </property>
>>>   <property name="initialSize">
>>>       <value>2</value>
>>>   </property>
>>>   <property name="maxActive">
>>>            <value>5</value>
>>>   </property>
>>>   <property name="maxIdle">
>>>      <value>2</value>
>>>   </property>
>>>  </bean>
>>>   <bean id="sessionFactory"
>>> class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
>>>    <property name="dataSource">
>>>     <ref bean="dataSource"/>
>>>    </property>
>>>   <property name="configLocation">
>>>    <value>hibernate.cfg.xml</value>
>>>    </property>
>>>     <property  name="configurationClass">
>>>         <value>org.hibernate.cfg.AnnotationConfiguration</value>
>>>     </property>
>>>     <property name="hibernateProperties">
>>>       <props>
>>>          <prop
>>> key="hibernate.dialect">org.hibernate.dialect.HSQLDialect</prop>
>>>             <prop key="show_sql">true</prop>
>>>          </props>
>>>     </property>
>>>    </bean>
>>>    <bean id="txManager"
>>> class="org.springframework.orm.hibernate3.HibernateTransactionManager">
>>>     <property name="sessionFactory" ref="sessionFactory" />
>>>      </bean>
>>>      <!-- enable the configuration of transactional behavior based on
>>> annotations -->
>>>      <tx:annotation-driven transaction-manager="txManager" proxy-
>>> target-class="false" />
>>>
>>>          <bean id="pupilCollection"
>>> class="com.company.server.domain.PupilCollectionImpl"
>>> scope="prototype">  <property name="sessionFactory"><ref
>>> bean="sessionFactory"/></property> </bean>
>>>     </beans>
>>>
>>> Also, in the lib folder I have included the jar that is,  mysql-
>>> connector-java-5.0.4-bin.jar  in the 'lib' folder.
>>> But now I am getting the errors as,
>>>
>>> 1. [WARN] SQL Error: 0, SQLState: null
>>>
>>> 2. [WARN] Cannot create JDBC driver of class 'com.mysql.jdbc.Driver'
>>> for connect URL '>jdbc:mysql://localhost/test'
>>>
>>> 3. [WARN] Could not obtain connection metadata
>>> org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver
>>> of class 'com.mysql.jdbc.Driver' for connect URL '>jdbc:mysql://
>>> localhost/test'
>>>        at org.apache.commons.dbcp.BasicDataSource.createDataSource
>>> (BasicDataSource.java:1150)
>>>        at org.apache.commons.dbcp.BasicDataSource.getConnection
>>> (BasicDataSource.java:880)
>>>        at
>>>
>>> org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection
>>> (LocalDataSourceConnectionProvider.java:82)
>>>        at org.hibernate.cfg.SettingsFactory.buildSettings
>>> (SettingsFactory.java:84)
>>>        at
>>> org.hibernate.cfg.Configuration.buildSettings(Configuration.java:
>>> 2009)
>>>        at org.hibernate.cfg.Configuration.buildSessionFactory
>>> (Configuration.java:1292)
>>>        at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory
>>> (AnnotationConfiguration.java:915)
>>>        at
>>>
>>> org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory
>>> (LocalSessionFactoryBean.java:814)
>>>        at
>>>
>>> org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory
>>> (LocalSessionFactoryBean.java:732)
>>>        at
>>>
>>> org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet
>>> (AbstractSessionFactoryBean.java:211)
>>> Caused by: java.sql.SQLException: No suitable driver
>>>        at org.apache.commons.dbcp.BasicDataSource.createDataSource
>>> (BasicDataSource.java:1143)
>>>        at org.apache.commons.dbcp.BasicDataSource.getConnection
>>> (BasicDataSource.java:880)
>>>        at
>>>
>>> org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection
>>> (LocalDataSourceConnectionProvider.java:82)
>>>        at org.hibernate.cfg.SettingsFactory.buildSettings
>>> (SettingsFactory.java:84)
>>>        at
>>> org.hibernate.cfg.Configuration.buildSettings(Configuration.java:
>>> 2009)
>>>        at org.hibernate.cfg.Configuration.buildSessionFactory
>>> (Configuration.java:1292)
>>>        at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory
>>> (AnnotationConfiguration.java:915)
>>>        at
>>>
>>> org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory
>>> (LocalSessionFactoryBean.java:814)
>>>        at
>>>
>>> org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory
>>> (LocalSessionFactoryBean.java:732)
>>>        at
>>>
>>> org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet
>>> (AbstractSessionFactoryBean.java:211)
>>>
>>> 4. [WARN] no persistent classes found for query class:
>>>                  from com.company.server.persistent.Pupil as p  where
>>> p.teacher.teacherId = :teacherId  order by p.name
>>>
>>>
>>> Please help to solve these errors.
>>>
>>> Thanks,
>>> Poonam.
>>>
>>>
>>>
>>
>>
>>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to