Announcement

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

    SmartGWT 13 SkinUtil.getThemes() NullPointerException

    We're upgrading an application from SmartGWT 12.1 to 13.0 (Enterprise 13.0-p20220311). Without any other changes to the application besides the version change, we're now getting this exception:

    Code:
    2022-04-11 14:41:41 ERROR Download:216 - - Problem sending static file: __USE_CONTAINER__/titan/sc/skins/AABlue/load_skin.js
    java.lang.NullPointerException
        at com.isomorphic.util.SkinUtil.getThemes(SkinUtil.java:214)
        at com.isomorphic.servlet.ServletTools.sendStaticFile(ServletTools.java:1522)
        at com.isomorphic.servlet.FileDownload.doGet(FileDownload.java:202)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:503)
        at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:178)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:590)
        at org.eclipse.jetty.servlet.ServletHolder$NotAsync.service(ServletHolder.java:1419)
        at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:764)
        at org.eclipse.jetty.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1624)
        at com.assaabloy.protech.server.web.filter.MDCFilter.doFilterInternal(MDCFilter.java:52)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
        at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
        at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1594)
    I wasn't able to find any other references to this error. Is there something else we should be doing?

    #2
    We haven't seen this problem before. One possibility might be that you've done an incomplete update - something like updating the server side JAR files but failing to update configuration files like server.properties to merge in new or changed attributes.

    The install docs here may help shed some light on what's going on: https://www.smartclient.com/smartgwt...dkInstall.html

    If this continues to be a problem, you could try some basic sanity checks like installing your custom skin into one of the 13.0 shipped sample projects like built-in DS and comparing what you see there with what you're hitting in your "real" usage.

    Regards
    Isomorphic Software

    Comment


      #3
      I'm still banging my head against the wall on this one....

      I made a very small executable application that demonstrates this issue with Tahoe, it uses the maven multi-module archetype. We've been using this successfully in version 12.1 without issue. We're able to get around the issue by removing the FileDownload servlet from web.xml, but then we don't get proper caching for things like images, which causes them to flicker.

      Here's the startup logs:

      Code:
      === SmartClient Init: log4j.isc.config.xml not found in CLASSPATH. Assuming log4j configuration for com.isomorphic is located in some other log4j configuration file.
      2022-05-25 13:51:06.565 user= INFO com.isomorphic.base.ISCInit:228 - - Isomorphic SmartClient/SmartGWT Framework - Initializing
      2022-05-25 13:51:06.656 user= INFO com.isomorphic.base.Config:228 - - Applying system property webdriver.http.factory: apache
      2022-05-25 13:51:06.658 user= INFO com.isomorphic.log.Logger:228 - - Logging system started.
      2022-05-25 13:51:06.665 user= INFO com.isomorphic.base.ISCInit:228 - - JMS JNDI publishing is enabled, but configured messaging.jms.vm.factory class org.apache.activemq.ActiveMQConnectionFactory is not present in runtime - proceeding without publishing isomorphic JMS stub to JNDI
      2022-05-25 13:51:06.666 user= ERROR com.isomorphic.base.ISCInit:212 - - Can't find marker file for webRoot: C:/Users/apder/workspace/test-app/test-app-server/src/main/webapp/test/sc for configured/autodetected webRoot - if you moved the 'isomorphic' directory, please set isomorphicPathRootRelative in server.properties to the new location and restart the servlet engine.
      2022-05-25 13:51:06.667 user= INFO com.isomorphic.base.ISCInit:228 - - WebRoot auto-detection failed - using container IO
      2022-05-25 13:51:06.667 user= INFO com.isomorphic.base.ISCInit:228 - - Isomorphic SmartClient/SmartGWT Framework (v13.0p_2022-05-25/Enterprise Deployment 2022-05-25) - Initialization Complete
      2022-05-25 13:51:06.667 user= WARN com.isomorphic.base.ISCInit:220 - - Potentially insecure settings: Domain synching is enabled and not restricted to any baseDomains. See the "XSS and CSRF Security" overview in the client reference for details to disable this warning
      2022-05-25 13:51:06.787 user= INFO com.isomorphic.servlet.PreCache:228 - - Isomorphic PreCache servlet loading
      2022-05-25 13:51:06.873 user= INFO com.isomorphic.pool.PoolManager:228 - - SmartClient pooling started for 'simpleTypes' objects
      2022-05-25 13:51:07.218 user= ERROR com.isomorphic.taglib.BaseTag:212 - - LoadSystemSchemaTag.getFrameworkDataSources(): the following path configured for framework.datasources is not a directory: __USE_CONTAINER__/test/sc/system/schema
      2022-05-25 13:51:07.218 user= ERROR com.isomorphic.taglib.BaseTag:212 - - LoadSystemSchemaTag.getFrameworkDataSources(): the following path configured for framework.datasources is not a directory: __USE_CONTAINER__/test/sc/../tools/datasources
      2022-05-25 13:51:07.219 user=[INFO] Started o.e.j.m.p.JettyWebAppContext@443a06ad{/,[file:///C:/Users/apder/workspace/test-app/test-app-server/src/main/webapp/, file:///C:/Users/apder/workspace/test-app/target/gwt/launcherDir/],AVAILABLE}{[file:///C:/Users/apder/workspace/test-app/test-app-server/src/main/webapp/, file:///C:/Users/apder/workspace/test-app/target/gwt/launcherDir/]}
       INFO com.isomorphic.servlet.PreCache:228 - - Isomorphic PreCache complete (432ms)
      [INFO] Started ServerConnector@6921cfa{HTTP/1.1, (http/1.1)}{0.0.0.0:8080}
      [INFO] Started @13752ms
      [INFO] Started Jetty Server
      2022-05-25 13:51:10.822 user= ERROR com.isomorphic.download.Download:216 - - Problem sending static file: __USE_CONTAINER__/test/sc/skins/Tahoe/load_skin.js
      java.lang.NullPointerException
          at com.isomorphic.util.SkinUtil.getThemes(SkinUtil.java:214)
          at com.isomorphic.servlet.ServletTools.sendStaticFile(ServletTools.java:1522)
          at com.isomorphic.servlet.FileDownload.doGet(FileDownload.java:202)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
          at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:178)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
          at org.eclipse.jetty.servlet.ServletHolder$NotAsync.service(ServletHolder.java:1459)
          at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:799)
          at org.eclipse.jetty.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1631)
          at org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:292)
          at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
          at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)
          at com.isomorphic.servlet.CompressionFilter._doFilter(CompressionFilter.java:263)
          at com.isomorphic.servlet.BaseFilter.doFilter(BaseFilter.java:91)
          at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:201)
          at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)
          at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:548)
          at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
          at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:600)
          at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
          at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)
          at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1624)
          at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
          at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1440)
          at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
          at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:501)
          at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1594)
          at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
          at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1355)
          at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
          at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:191)
          at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:146)
          at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
          at org.eclipse.jetty.server.Server.handle(Server.java:516)
          at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:487)
          at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:732)
          at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:479)
          at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277)
          at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
          at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
          at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
          at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338)
          at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315)
          at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173)
          at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
          at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409)
          at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883)
          at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034)
          at java.base/java.lang.Thread.run(Thread.java:829)
      I can send the application, but obviously it's a zip or archive since it's more than 1 file. I've attached a screenshot of the project structure.

      Our server.properties file doesn't have much in it either:

      Code:
      webRoot:__AUTODETECT__
      gwtModuleName:test
      isomorphicPathRootRelative:$gwtModuleName/sc
      project.datasources:$webroot/ds
      project.ui:$webRoot/shared/ui
      project.apps:$webRoot/shared/app
      RPCManager.enabledBuiltinMethods:exportImage, getPdfObject, xmlToJS, uploadProgressCheck, exportClientData, downloadClientExport, setAttributes
      modulesDir:modules/
      fileUpload.maxFileSize:104857600
      DSRequest.maxUploadFileSize:104857600
      fileUpload.maxSize:209715200
      Any other ideas what the issue could be?
      Attached Files

      Comment


        #4
        Here's the application if you're able to look at it. Just change the file extension from .txt to .zip.
        Attached Files

        Comment


          #5
          Sorry you're having trouble with this. This is just a standard setup, so something is special about your environment, beyond this layout.

          It's good that you provided complete logs this time (note: always required!), because, now we can see that the problem starts earlier.

          Our software tries to figure out if you've got the resources on disk vs want to use classpath-based loading from .jars (getResource()), and we decide, based on where your servlet engine told us the deployment is, that nothing is accessible on the filesystem:

          022-05-25 13:51:06.666 user= ERROR com.isomorphic.base.ISCInit:212 - - Can't find marker file for webRoot: C:/Users/apder/workspace/test-app/test-app-server/src/main/webapp/test/sc for configured/autodetected webRoot - if you moved the 'isomorphic' directory, please set isomorphicPathRootRelative in server.properties to the new location and restart the servlet engine.

          So, we fall back to classpath-based loading from .jars (getResource()). Then, before we even get to the skin-related request, the system is already reporting that we can't load any of the expected framework files from the classpath either:

          2022-05-25 13:51:07.218 user= ERROR com.isomorphic.taglib.BaseTag:212 - - LoadSystemSchemaTag.getFrameworkDataSources(): the following path configured for framework.datasources is not a directory: __USE_CONTAINER__/test/sc/system/schema
          2022-05-25 13:51:07.218 user= ERROR com.isomorphic.taglib.BaseTag:212 - - LoadSystemSchemaTag.getFrameworkDataSources(): the following path configured for framework.datasources is not a directory: __USE_CONTAINER__/test/sc/../tools/datasources

          So:

          1. did you intend to use filesystem-based loading? If so, is the path we autodetected wrong? If it is, did you apply any kind of special configuration to Jetty that might cause it to steer us to the wrong area of the filesystem?

          2. assuming you really did intend to load from jars instead, are the jars with various core resources actually on the classpath?

          3. are they intact, with the actual files present and not zero length?

          4. Does your JVM have permissions to access the needed JARs?

          5. are there duplicates of the JAR lying around, also on the classpath?

          6. is there anything special about the filesystem: like it's a mounted drive, special drive letter, anything like that?

          Comment


            #6
            I tested this same sample app, changing the SmartGWT version from 13.0-p20220525 to 12.1-p20220107, worked with no issue:

            Code:
            === SmartClient Init: log4j.isc.config.xml not found in CLASSPATH. Assuming log4j configuration for com.isomorphic is located in some other log4j configuration file.
            2022-05-25 14:48:26.352 user= INFO com.isomorphic.base.ISCInit:228 - - Isomorphic SmartClient/SmartGWT Framework - Initializing
            2022-05-25 14:48:26.401 user= INFO com.isomorphic.base.Config:228 - - Applying system property webdriver.http.factory: apache
            2022-05-25 14:48:26.403 user= INFO com.isomorphic.log.Logger:228 - - Logging system started.
            2022-05-25 14:48:26.407 user= INFO com.isomorphic.base.ISCInit:228 - - JMS JNDI publishing is enabled, but configured messaging.jms.vm.factory class org.apache.activemq.ActiveMQConnectionFactory is not present in runtime - proceeding without publishing isomorphic JMS stub to JNDI
            2022-05-25 14:48:26.408 user= ERROR com.isomorphic.base.ISCInit:212 - - Can't find marker file for webRoot: C:/Users/apder/workspace/test-app/test-app-server/src/main/webapp/test/sc for configured/autodetected webRoot - if you moved the 'isomorphic' directory, please set isomorphicPathRootRelative in server.properties to the new location and restart the servlet engine.
            2022-05-25 14:48:26.409 user= INFO com.isomorphic.base.ISCInit:228 - - WebRoot auto-detection failed - using container IO
            2022-05-25 14:48:26.409 user= INFO com.isomorphic.base.ISCInit:228 - - Isomorphic SmartClient/SmartGWT Framework (v12.1p_2022-01-07/Enterprise Deployment 2022-01-07) - Initialization Complete
            2022-05-25 14:48:26.505 user= INFO com.isomorphic.servlet.PreCache:228 - - Isomorphic PreCache servlet loading
            2022-05-25 14:48:26.527 user= ERROR com.isomorphic.taglib.BaseTag:212 - - LoadSystemSchemaTag.getFrameworkDataSources(): the following path configured for framework.datasources is not a directory: __USE_CONTAINER__/test/sc/system/schema
            2022-05-25 14:48:26.527 user= INFO com.isomorphic.servlet.PreCache:228 - - Isomorphic PreCache complete (22ms)
            [INFO] Started o.e.j.m.p.JettyWebAppContext@6de7778f{/,[file:///C:/Users/apder/workspace/test-app/test-app-server/src/main/webapp/, file:///C:/Users/apder/workspace/test-app/target/gwt/launcherDir/],AVAILABLE}{[file:///C:/Users/apder/workspace/test-app/test-app-server/src/main/webapp/, file:///C:/Users/apder/workspace/test-app/target/gwt/launcherDir/]}
            [INFO] Started ServerConnector@69069866{HTTP/1.1, (http/1.1)}{0.0.0.0:8080}
            [INFO] Started @5519ms
            [INFO] Started Jetty Server
            2022-05-25 14:48:40.050 user= INFO com.isomorphic.pool.PoolManager:228 - - SmartClient pooling started for 'simpleTypes' objects
            Here' the answer to your questions:

            1. No, set to "__AUTODETECT__". I don't think the auto detect works correctly with the maven multi-module archetype. The web root is from the server module src/main/webroot, but the sc folder is in the maven project build directory /target/gwt/launcherDir/[module]/sc. No special configuration to Jetty, it's whatever was set in the maven archetype.
            2. I'm letting maven handle the classpath, I haven't set this myself. For this type of testing, I always run a "mvn clean" before starting the server.
            3. Yes. I've tried multiple builds from 13.0 all with the same issue, and also no issue in 12.1.
            4. Yes, standard install of Amazon Corretto 11.0.15_9. Again, works great with 12.1.
            5. Not that I'm aware of. I've been able to switch back and forth between different versions of SmartGWT 12.0 and 12.1 without issue.
            6. No, standard Windows filesystem. My workspace folder is in my user directory on the C drive.

            Comment


              #7
              That doesn't appear to be "working correctly". Note the same issue we showed you before:

              2022-05-25 14:48:26.527 user= ERROR com.isomorphic.taglib.BaseTag:212 - - LoadSystemSchemaTag.getFrameworkDataSources(): the following path configured for framework.datasources is not a directory: __USE_CONTAINER__/test/sc/system/schema

              So, both your 12.1 and 13.0 installations are broken, and broken in the same way. It's just that your 13.0 installation reveals the failure sooner.

              So, sorry, we know you want to "just let Maven handle the classpath", but, you have to actually look and see what it did, because, it does not appear to be correct.

              Comment


                #8
                The error from 12.1 was just from the PreCache, disabling that while running locally made that work fine.

                I generated an application from the quickstart archetype and merged all of my code back into it, all working now. I tried to look at what was different, but too many changes to isolate it. Thanks

                Comment

                Working...
                X