Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    making hibernate work with latest smartgwtee nightly

    The hibernate samples in the smartgwtee nightlies do not work without including the following dependencies in the lib folder and the class path:

    hibernate-validator-4.1.0.Final.jar; and
    hibernate-commons-annotations-3.2.0.Final.jar.

    Please correct me if I am wrong. If I'm right, can these be included in the smartgwtee nightly distribution and the class path settings in the sample projects updated to reference them?

    #2
    We're not seeing this. Can you clarify:
    - which specific sample(s) are you seeing the problem on, and how is it manifesting?
    - which nightly build are you using
    - what's your environment (GWT version? are you using the Eclipse gwt plugin? OS / Browser combo?)
    - are you encountering this in development mode or compiled mode (or both)

    ------
    EDIT: It looks like we may be seeing a misconfiguration in the "ds-hibernate" sample - one of our engineers is taking a look.
    Last edited by Isomorphic; 7 Jul 2011, 17:08.

    Comment


      #3
      I think the configuration issue pertains to any sample involving hibernate.

      Consider ds-hibernate on mac os x 10.6.8 running in firefox 4.0 dev mode built with spring source tool suite 2.7.0 on top of eclipse 3.6, gwt-2.3.0 and the latest google plugin for eclipse (gpe):

      (1) Download and expand the smartgwtee-2011.06.30 distribution;
      (2) Configure SGWTEE_HOME to point to the distribution folder;

      (3) Configure GWT_HOME to point to the gwt-2.3.0 sdk distribution and to work with build.xml;

      (4) make the following changes to build.xml to support gwt-2.3.0 --

      <target name="war" depends="build" description="Create a war file">
      <copy todir="war/WEB-INF/lib" file="${gwt.sdk}/gwt-servlet.jar" />
      <copy todir="war/WEB-INF/lib" file="${gwt.sdk}/gwt-servlet-deps.jar" />
      ...

      and

      <target name="gwtc" depends="javac" description="GWT compile to JavaScript">
      <java failonerror="true" fork="true" classname="com.google.gwt.dev.Compiler">
      <classpath>
      <pathelement location="src" />
      <path refid="project.class.path" />
      <pathelement location="${gwt.sdk}/validation-api-1.0.0.GA.jar" />
      <pathelement location="${gwt.sdk}/validation-api-1.0.0.GA-sources.jar" />
      </classpath>
      ...

      (5) run the war target in build.xml;
      (6) run the app in dev mode from within the ide with the gpe;
      (7) execute dev mode in firefox;
      (8) note the stack trace in the eclipse console:

      Code:
      === 2011-07-07 22:49:13,920 [l0-6] INFO  RequestContext - URL: '/hibernateds/supplyItemHibernateOperations.rpc', User-Agent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0) Gecko/20100101 Firefox/4.0': Moz (Gecko) with Accept-Encoding header
      === 2011-07-07 22:49:13,952 [l0-6] DEBUG XML - Parsed XML from (in memory stream): 2ms
      === 2011-07-07 22:49:13,955 [l0-6] DEBUG XML - Parsed XML from /Users/WPANNELL/Downloads/smartgwtee-2.5 7/samples/ds-hibernate/war/hibernateds/sc/system/schema/List.ds.xml: 1ms
      === 2011-07-07 22:49:13,958 [l0-6] DEBUG RPCManager - Processing 1 requests.
      === 2011-07-07 22:49:13,974 [l0-6] DEBUG XML - Parsed XML from /Users/WPANNELL/Downloads/smartgwtee-2.5 7/samples/ds-hibernate/war/ds/supplyItem.ds.xml: 4ms
      === 2011-07-07 22:49:14,092 [l0-6] DEBUG RPCManager - Request #1 (DSRequest) payload: {
          criteria:{
          },
          operationConfig:{
              dataSource:"supplyItem",
              operationType:"fetch",
              textMatchStyle:"substring"
          },
          startRow:0,
          endRow:75,
          componentId:"isc_ListGrid_0",
          appID:"builtinApplication",
          operation:"supplyItem_fetch",
          oldValues:{
          }
      }
      [WARN] /hibernateds/supplyItemHibernateOperations.rpc
      org.hibernate.HibernateException: Unable to get the default Bean Validation factory
      	at org.hibernate.cfg.beanvalidation.BeanValidationActivator.applyDDL(BeanValidationActivator.java:127)
      	at org.hibernate.cfg.Configuration.applyBeanValidationConstraintsOnDDL(Configuration.java:1674)
      	at org.hibernate.cfg.Configuration.applyConstraintsToDDL(Configuration.java:1624)
      	at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1415)
      	at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1826)
      	at com.smartgwt.sample.server.SupplyItemHibernateOperationsController.handleRequest(SupplyItemHibernateOperationsController.java:77)
      	at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
      	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:859)
      	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:793)
      	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:476)
      	at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:441)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1097)
      	at com.isomorphic.servlet.CompressionFilter.doFilter(CompressionFilter.java:259)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1088)
      	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
      	at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
      	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
      	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:729)
      	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
      	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
      	at org.mortbay.jetty.handler.RequestLogHandler.handle(RequestLogHandler.java:49)
      	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
      	at org.mortbay.jetty.Server.handle(Server.java:324)
      	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
      	at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:843)
      	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:647)
      	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
      	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
      	at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
      	at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488)
      Caused by: java.lang.reflect.InvocationTargetException
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:597)
      	at org.hibernate.cfg.beanvalidation.BeanValidationActivator.applyDDL(BeanValidationActivator.java:118)
      	... 32 more
      Caused by: org.hibernate.HibernateException: Unable to build the default ValidatorFactory
      	at org.hibernate.cfg.beanvalidation.TypeSafeActivator.getValidatorFactory(TypeSafeActivator.java:383)
      	at org.hibernate.cfg.beanvalidation.TypeSafeActivator.applyDDL(TypeSafeActivator.java:109)
      	... 37 more
      Caused by: javax.validation.ValidationException: Unable to find a default provider
      	at javax.validation.Validation$GenericBootstrapImpl.configure(Validation.java:264)
      	at javax.validation.Validation.buildDefaultValidatorFactory(Validation.java:111)
      	at org.hibernate.cfg.beanvalidation.TypeSafeActivator.getValidatorFactory(TypeSafeActivator.java:380)
      	... 38 more
      === 2011-07-07 22:49:17,917 [l0-6] INFO  RequestContext - URL: '/hibernateds/sc/skins/Enterprise/images/ListGrid/header_menu.png', User-Agent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0) Gecko/20100101 Firefox/4.0': Moz (Gecko) with Accept-Encoding header
      === 2011-07-07 22:49:17,918 [l0-6] INFO  Download - done streaming: /Users/WPANNELL/Downloads/smartgwtee-2.5 7/samples/ds-hibernate/war/hibernateds/sc/skins/Enterprise/images/ListGrid/header_menu.png
      === 2011-07-07 22:49:17,920 [l0-4] INFO  RequestContext - URL: '/hibernateds/sc/skins/Enterprise/images/ListGrid/header_Over.png', User-Agent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0) Gecko/20100101 Firefox/4.0': Moz (Gecko) with Accept-Encoding header
      === 2011-07-07 22:49:17,921 [l0-4] INFO  Download - done streaming: /Users/WPANNELL/Downloads/smartgwtee-2.5 7/samples/ds-hibernate/war/hibernateds/sc/skins/Enterprise/images/ListGrid/header_Over.png
      === 2011-07-07 22:49:18,238 [l0-4] INFO  RequestContext - URL: '/hibernateds/sc/skins/Enterprise/images/ListGrid/header_Over.png', User-Agent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0) Gecko/20100101 Firefox/4.0': Moz (Gecko) with Accept-Encoding header
      === 2011-07-07 22:49:18,240 [l0-4] INFO  Download - done streaming: /Users/WPANNELL/Downloads/smartgwtee-2.5 7/samples/ds-hibernate/war/hibernateds/sc/skins/Enterprise/images/ListGrid/header_Over.png
      (9) add the following dependencies to the lib folder of the smartgwtee distribution:

      hibernate-validator-4.1.0.Final.jar;
      hibernate-commons-annotations-3.2.0.Final.jar; and
      validation-api-1.0.0.GA.jar

      (10) add the new dependencies to the .classpath;

      (11) repeat (5), (6) and (7).

      This fixes the ds-hibernate sample.

      In a similar vein we can fix the HibernateSpringDMI sample.

      For the JPADS sample, the same fix applies but the broken dependencies on the old JPA 1.0 spec that exist in the .classpath shipped with the sample should be removed, and the db folder, which shipped without any content, should be copied from another project.

      Finally, for the ShowcaseEE sample, fix the dependencies in the .classpath as in the other samples, and note that the META-INF folder is missing from the project. Copy the META-INF folder from showcase.war at the root of the smartgwtee distribution to the ShowcaseEE project's src folder.

      The only outstanding issue remaining with the smartgwtee nightlies is that visual builder cannot be invoked because of changes to the visual builder api related to the uploadedFiles datasource.
      Last edited by wil.pannell; 8 Jul 2011, 03:10.

      Comment


        #4
        Here's a relevant post on the gwt forums about how gwt-2.3.0 breaks hibernate in gwt releases 2.2.0 and before:

        http://groups.google.com/group/googl...4ea31979796108.

        Here's my prior post on fixing the jpads sample in smartgwtee-2.5.2011-06-30:

        http://forums.smartclient.com/showthread.php?t=17760.

        Here's my prior post on VisualBuilder not working:

        http://forums.smartclient.com/showthread.php?t=17740.
        Last edited by wil.pannell; 8 Jul 2011, 03:08.

        Comment


          #5
          We've worked around the new GWT 2.3 requirements in the build file for this sample - please confirm that the sample is working for you again.

          Visual Builder was incorrectly loading a DataSource from an example - this regression existed for a couple of days and is fixed now - please confirm.

          Comment


            #6
            Nice work.

            I have verified that the hibernateDS and HibernateSpringDMI samples are working properly. I did not check any of the others, but will post back if I find anything unusual when I do.

            The only remaining thing that I can see with the EE 2.5 nightlies is that Visual Builder cannot be invoked due to exceptions such as this:

            WARN BasicDataSource - Couldn't create DataSource QuartzJobDataMap as an instance of class 'com.isomorphic.scheduler.QuartzJobDataMap'
            java.lang.ClassNotFoundException: com.isomorphic.scheduler.QuartzJobDataMap

            I've posted about this issue elsewhere:

            http://forums.smartclient.com/showthread.php?t=17740

            Please let me know if you require more information, such as error logs or a test scenario.

            Comment

            Working...
            X