Announcement

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

    DataSourceLoader AbstractHashedMap exception

    Hi Isomorphic,

    I have a strange problem, where after some time DataSourceLoader (v11.1p_2018-06-15) call throws an exception for a .ds.xml file. Restarting the server or touching the .ds.xml file makes the problem go away.
    The only difference I can see between this file an other files is that it uses a <valueMap> with ID for two fields. There are no duplicate ID values, if that matters.

    Code:
            <field name="COLUMN_NAME" length="30" type="text" escapeHTML="true" required="true" >
                <title><fmt:message key="columnName"/></title>
                <valueMap>
                    <value ID="SHORTNAME"><fmt:message key="shortname" /></value>
                    <value ID="NAME"><fmt:message key="name" /></value>
                    <value ID="DESCRIPTION"><fmt:message key="description" /></value>
                    <value ID="VARCHARVALUE"><fmt:message key="valueUsed" /></value>
                    <value ID="VARCHARVALUEDEFAULT"><fmt:message key="defaultValue" /></value>
                    <value ID="DISPLAYNAME"><fmt:message key="displayName" /></value>
                    <value ID="FULLNAME"><fmt:message key="fullName" /></value>
                </valueMap>
                <validators>
                    <validator type="isOneOf"></validator>
                    <validator type="isUnique" criteriaFields="TABLE_IDVALUE, TABLE_NAME, ISO_639_1_ALPHA_2" />
                </validators>        
            </field>
    The exception is this:
    Code:
    [B]javax.servlet.ServletException: DataSource 'V_TRANSLATION_USERTRANSLATION' failed to load due to an exception on the server:
    Instantiation of class: org.apache.commons.collections4.map.AbstractHashedMap$KeySet threw an InstantiationException - most likely cause is the class represents an abstract class, an interface, an array class, a primitive type, or void; or the class has no zero-argument constructor.
    See the server-side log for additional details.
        at com.isomorphic.servlet.DataSourceLoader.processRequest(DataSourceLoader.java:286)[/B]
        at com.isomorphic.servlet.DataSourceLoader.doGet(DataSourceLoader.java:107)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:635)
        at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:176)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
        at com.lmscompany.lms.server.MimeTypeFilter.doFilter(MimeTypeFilter.java:26)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
        at com.isomorphic.servlet.CompressionFilter._doFilter(CompressionFilter.java:260)
        at com.isomorphic.servlet.BaseFilter.doFilter(BaseFilter.java:93)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:595)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80)
        at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:624)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
        at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:799)
        at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
        at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1455)
        at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Unknown Source)
    Can you have a look if this means something to you? I'm a but confused about the problem only appearing after some time.

    Thank you & Best regards
    Blama

    #2
    We would have expected the "additional details" mentioned in the log message to appear as another stack trace. Did they?

    Best guess based on the detail we have so far is that two copies of the same .jar or overlapping .jars are being loaded at once.

    Comment


      #3
      Hi Isomorphic,

      sorry, it seems I did not copy the whole stack trace. There are indeed two exceptions.
      It does not seem that there is any class doubled in the classpath or WEB-INF/lib directory. Of course, there is commons-collections-3.2.2.jar and commons-collections4-4.1.jar, but this is OK.

      This is the whole stack trace (with the top exception being the new one):
      Code:
      === 2018-06-29 17:25:17,536 [ec-7] INFO  RequestContext - URL: '/lms/lms/sc/DataSourceLoader', User-Agent: 'Mozilla/5.0 (Windows NT 6.3; WOW64; rv:26.0) Gecko/20100101 Firefox/26.0': Moz (Gecko) with Accept-Encoding header
      === 2018-06-29 17:25:17,543 [ec-7] ERROR DataSourceLoader - Exception while attempting to load a DataSource
      java.lang.InstantiationException: Instantiation of class: org.apache.commons.collections4.map.AbstractHashedMap$KeySet threw an InstantiationException - most likely cause is the class represents an abstract class, an interface, an array class, a primitive type, or void; or the class has no zero-argument constructor.
      at com.isomorphic.base.Reflection.newInstance(Reflection.java:230)
      at com.isomorphic.base.Reflection.newInstance(Reflection.java:193)
      at com.isomorphic.util.DataTools.deepClone(DataTools.java:487)
      at com.isomorphic.util.DataTools.deepClone(DataTools.java:483)
      at com.isomorphic.util.DataTools.deepClone(DataTools.java:490)
      at com.isomorphic.util.DataTools.deepClone(DataTools.java:483)
      at com.isomorphic.util.DataTools.deepClone(DataTools.java:483)
      at com.isomorphic.util.DataTools.deepClone(DataTools.java:483)
      at com.isomorphic.datasource.DataSource._cloneConfigForSecurityAnnotations(DataSource.java:1645)
      at com.isomorphic.servlet.DataSourceLoader.processRequest(DataSourceLoader.java:226)
      at com.isomorphic.servlet.DataSourceLoader.doGet(DataSourceLoader.java:107)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:635)
      at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:176)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      at com.lmscompany.lms.server.MimeTypeFilter.doFilter(MimeTypeFilter.java:26)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      at com.isomorphic.servlet.CompressionFilter._doFilter(CompressionFilter.java:260)
      at com.isomorphic.servlet.BaseFilter.doFilter(BaseFilter.java:93)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:595)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80)
      at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:624)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
      at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:799)
      at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
      at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
      at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1455)
      at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      at java.lang.Thread.run(Unknown Source)
      === 2018-06-29 17:25:17,543 [ec-7] ERROR DataSourceLoader - BaseServlet Global Exception
      javax.servlet.ServletException: DataSource 'V_TRANSLATION_USERTRANSLATION' failed to load due to an exception on the server:
      Instantiation of class: org.apache.commons.collections4.map.AbstractHashedMap$KeySet threw an InstantiationException - most likely cause is the class represents an abstract class, an interface, an array class, a primitive type, or void; or the class has no zero-argument constructor.
      See the server-side log for additional details.
      at com.isomorphic.servlet.DataSourceLoader.processRequest(DataSourceLoader.java:286)
      at com.isomorphic.servlet.DataSourceLoader.doGet(DataSourceLoader.java:107)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:635)
      at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:176)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      at com.lmscompany.lms.server.MimeTypeFilter.doFilter(MimeTypeFilter.java:26)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      at com.isomorphic.servlet.CompressionFilter._doFilter(CompressionFilter.java:260)
      at com.isomorphic.servlet.BaseFilter.doFilter(BaseFilter.java:93)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:595)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80)
      at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:624)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
      at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:799)
      at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
      at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
      at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1455)
      at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      at java.lang.Thread.run(Unknown Source)
      === 2018-06-29 17:25:17,543 [ec-7] INFO  Compression - /lms/lms/sc/DataSourceLoader: 4184 -> 968 bytes
      Best regards
      Blama

      Comment


        #4
        Yes, this is a strange one indeed and is not reproduced or fixed yet. Could you please provide complete datasource definition causing this exception?

        Comment


          #5
          Hi Isomorphic,

          I'm sending you complete datasource definition (V_TRANSLATION_USERTRANSLATION.ds.xml):

          Code:
          <DataSource xmlns="lmscompany/ds" xmlns:fmt="lmscompany/fmt" dbName="Oracle" tableName="V_TRANSLATION_USERTRANSLATION" ID="V_TRANSLATION_USERTRANSLATION"
              contentTranslation="true" serverType="sql" serverConstructor="com.lmscompany.lms.server.LMSSQLDataSource">
              <fmt:bundle basename="com.lmscompany.lms.server.i18n.DSXMLResources-utf8" encoding="utf-8" />
              <fields>
                  <field name="TENANT_ID" type="integer" />
                  <!-- Primary key from base table, but as we only have one row per base table row, we know that this is unique -->
                  <field name="TRANSLATION_USERCONTENT_ID" primaryKey="true" hidden="true" />
                  <field name="TABLE_IDVALUE" type="integer" escapeHTML="true" required="true" displayField="DEFAULT_TRANSLATION">
                      <title><fmt:message key="translationDefault"/></title>
                      <validators>
                          <validator type="isUnique" criteriaFields="TABLE_NAME, COLUMN_NAME, ISO_639_1_ALPHA_2" >
                              <errorMessage><fmt:message key="validatorTranslationExistsLanguage" /></errorMessage>
                          </validator>                
                      </validators>
                  </field>
                  <field name="TABLE_IDVALUE_HIDDEN" type="integer" detail="true" customSelectExpression="V_TRANSLATION_USERTRANSLATION.TABLE_IDVALUE">
                      <title><fmt:message key="idSource"/></title>
                  </field>
          
                  <field name="TABLE_NAME" length="30" type="text" escapeHTML="true" required="true" >
                      <title><fmt:message key="tableName"/></title>
                       <valueMap>
                          <value ID="T_LEADTYPE"><fmt:message key="leadType" /></value>
                          <value ID="T_CAMPAIGN"><fmt:message key="campaign" /></value>
                          <value ID="T_LEADTEMPERATURE"><fmt:message key="leadTemperature" /></value>
                          <value ID="T_STATUS"><fmt:message key="status" /></value>
                          <value ID="T_DEALREG"><fmt:message key="dealReg" /></value>
                          <value ID="T_WONLOST"><fmt:message key="wonLost" /></value>
                          <value ID="T_SETTINGS"><fmt:message key="settings" /></value>
                          <value ID="T_FIELD_CONFIG"><fmt:message key="fieldConfig" /></value>
                          <value ID="T_INDUSTRY"><fmt:message key="industry" /></value>
                          <value ID="T_PRODUCT"><fmt:message key="product" /></value>
                          <value ID="T_PRODUCTCATEGORY"><fmt:message key="productCategory" /></value>
                          <value ID="T_COUNTRY"><fmt:message key="country" /></value>
                          <value ID="T_LANGUAGE"><fmt:message key="language" /></value>
                          <value ID="T_CATEGORY1"><fmt:message key="category1" /></value>
                          <value ID="T_CATEGORY2"><fmt:message key="category2" /></value>
                          <value ID="T_CATEGORY3"><fmt:message key="category3" /></value>
                          <value ID="T_CATEGORY4"><fmt:message key="category4" /></value>
                          <value ID="T_CATEGORY5"><fmt:message key="category5" /></value>
                          <value ID="T_CATEGORY6"><fmt:message key="category6" /></value>
                          <value ID="T_CATEGORY7"><fmt:message key="category7" /></value>
                          <value ID="T_CATEGORY8"><fmt:message key="category8" /></value>
                          <value ID="T_CATEGORY9"><fmt:message key="category9" /></value>
                      </valueMap>
                      <validators>
                          <validator type="isOneOf"></validator>
                          <validator type="isUnique" criteriaFields="TABLE_IDVALUE, COLUMN_NAME, ISO_639_1_ALPHA_2" >
                              <errorMessage><fmt:message key="validatorTranslationExistsLanguage" /></errorMessage>
                          </validator>
                          <validator type="isUnique" criteriaFields="COLUMN_NAME, ISO_639_1_ALPHA_2, TRANSLATION">
                              <errorMessage><fmt:message key="validatorTranslationInUseOtherStatus" /></errorMessage>
                          </validator>                                    
                      </validators>
                  </field>
                  <field name="COLUMN_NAME" length="30" type="text" escapeHTML="true" required="true" >
                      <title><fmt:message key="columnName"/></title>
                       <valueMap>
                          <value ID="NAME"><fmt:message key="name" /></value>
                          <value ID="DESCRIPTION"><fmt:message key="description" /></value>
                          <value ID="DISPLAYNAME"><fmt:message key="displayName" /></value>
                          <value ID="FULLNAME"><fmt:message key="fullName" /></value>
                          <value ID="VARCHARVALUEDEFAULT"><fmt:message key="defaultValue" /></value>
                      </valueMap>
                        <validators>
                          <validator type="isOneOf"></validator>
                          <validator type="isUnique" criteriaFields="TABLE_IDVALUE, TABLE_NAME, ISO_639_1_ALPHA_2" >
                              <errorMessage><fmt:message key="validatorTranslationExistsLanguage" /></errorMessage>
                          </validator>    
                          <validator type="isUnique" criteriaFields="TABLE_NAME, ISO_639_1_ALPHA_2, TRANSLATION">
                              <errorMessage><fmt:message key="validatorTranslationInUseOtherStatus" /></errorMessage>
                          </validator>                                
                      </validators>        
                  </field>
                  <field foreignKey="T_LANGUAGE.ISO_639_1_ALPHA_2" name="ISO_639_1_ALPHA_2" displayField="NAME_TRANSLATED" length="2" type="text" escapeHTML="true" required="true">
                      <title><fmt:message key="language"/></title>
                      <validators>
                          <validator type="isUnique" criteriaFields="TABLE_IDVALUE, TABLE_NAME, COLUMN_NAME" >
                              <errorMessage><fmt:message key="validatorTranslationExistsLanguage" /></errorMessage>
                          </validator>        
                          <validator type="isUnique" criteriaFields="TABLE_NAME, COLUMN_NAME, TRANSLATION">
                              <errorMessage><fmt:message key="validatorTranslationInUseOtherStatus" /></errorMessage>
                          </validator>                                
                      </validators>
                  </field>
                  <field name="NAME_TRANSLATED" includeFrom="T_LANGUAGE.NAME_TRANSLATED" />
                  <field name="TRANSLATION" length="400" type="text" escapeHTML="true" required="true" >
                      <title><fmt:message key="translation"/></title>
                      <validators>
                          <validator type="isUnique" criteriaFields="TABLE_NAME, COLUMN_NAME, ISO_639_1_ALPHA_2">
                              <errorMessage><fmt:message key="validatorTranslationInUseOtherStatus" /></errorMessage>
                          </validator>                
                      </validators>
                  </field>
                  <field name="DEFAULT_TRANSLATION" length="1000" type="text" escapeHTML="true">
                      <title><fmt:message key="translationDefault"/></title>
                  </field>
              </fields>
              <serverObject lookupStyle="new" className="com.lmscompany.lms.server.worker.V_TRANSLATION_USERTRANSLATION" />    
              <operationBindings>
                  <operationBinding operationType="add" requiresRole="editSetting" />
                  <operationBinding operationType="update" requiresRole="editSetting" />
                  <operationBinding operationType="remove" requiresRole="editSetting" />
                  <operationBinding operationType="validate" requiresRole="editSetting" />
                  <operationBinding operationType="fetch" requiresRole="editSetting" />
              </operationBindings>
          </DataSource>
          Best regards
          Pavo

          Comment


            #6
            Nothing special here. We've already tried turning your previous snippet into a completed DS and running it through DataSourceLoader thousands of times, and couldn't get any exceptions to occur.

            Best guess is still that your JVM is somehow getting confused about types, due to duplicate class loading.

            Right now there's nothing further we can do. Let us know if you find a way to make the problem reproducible.

            Comment

            Working...
            X