Announcement

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

    Hibernate DS SmartGWT 12 Error

    I'm in the process of updating from SmartGWT 6.1 to 12, specifically: Isomorphic SmartClient/SmartGWT Framework (v12.0p_2019-08-07/Enterprise Deployment 2019-08-07).

    On our Hibernate datasources, we're now getting the error:

    Code:
    Attempted lookup of DataSource-specific Hibernate config for DataSource 'Manufacturer' failed; the returned object was null.  We will use the system-level config instead.
    The datasources worked in 6.1, and still work in 12. I have the configBean property set correctly. Does this error mean anything? I can remove these messages from the log, but I want to make sure that this isn't a bug.

    #2
    This is reporting that we attempted to look up your specified configBean via Spring and null was returned, so the default Hibernate configuration is being used.

    As we cover in the Hibernate Configuration docs, it would be rare to use the configBean feature. Since things are working, it's likely you never actually needed it in the first place, and it may never have actually worked - perhaps you were getting those logs before, as well.

    Comment


      #3
      I tried this again, with version v12.0p_2019-10-31/Enterprise Deployment 2019-10-31, still getting the errors. The application however is working fine, and I have confirmed it does query from the correct session factory. We have 2 hibernate session factories for 2 separate databases. This is for a released production application. We're going from version 6.1 to 12.0 and POWER to ENTERPRISE. The only thing I changed in our project was the SmartGWT dependency versions in the maven pom.xml, everything else is untouched.

      I pulled up the error line in the com.isomorphic.hibernate.HibernateDSGenerator class in the decompiler in IntelliJ just to see it. I'm not claiming this decompiled code is accurate, but if it is, there's definitely an error with the 2 lines:

      Code:
                  Map spring = null;
                  if (spring == null) {
      in this function:

      Code:
          public static Map getConfigFromMapping(String entityName, String ID, boolean generateRelations, boolean extended, Map deriverConfig) throws Exception {
              Configuration cfg = null;
              if (deriverConfig != null && deriverConfig.get("configBean") != null) {
                  log.debug("Obtaining local Hibernate config for DataSource '" + ID + "' via Spring bean '" + deriverConfig.get("configBean") + "'.");
                  Map serverObjectConfig = new HashMap();
                  serverObjectConfig.put("bean", "&" + deriverConfig.get("configBean"));
                  serverObjectConfig.put("lookupStyle", "spring");
                  Map spring = null;
                  if (spring == null) {
                      log.error("Attempted lookup of DataSource-specific Hibernate config for DataSource '" + ID + "' failed; the returned object was null.  We will use the system-level config instead.");
                  } else {
                      cfg = (Configuration)((Map)spring).get("config");
                  }
              }
      
              Map config = getConfigFromMapping(cfg, entityName, ID, generateRelations, extended);
              if (deriverConfig != null && deriverConfig.get("configBean") != null) {
                  config.put("configBean", deriverConfig.get("configBean"));
              }
      
              return config;
          }
      Can someone take a look at this section to see if this is truly an issue? The error message seems to be only cosmetic as our application still works, but I don't to have error messages in our logs all of a sudden.

      Thanks!

      Comment


        #4
        We've eliminated the spurious error log and will get back to you once we analyze on whether there is a true underlying error. This update will be available as of tomorrow's builds (Nov 2).

        Regards
        Isomorphic software

        Comment


          #5
          Error is gone now, thank you!

          Comment

          Working...
          X