Announcement

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

    Interesting bug during DataSourceLoader (StackOverflowError or VM crash)

    Hi Isomorphic,

    after no suspicious change I now get the following VM crashs or uncaught serverside exceptions during the first call, most likely related to the DataSourceLoader.
    Please see the attached logs (from two different Tomcat powercycles). Starting point is always a fresh started Tomcat in debug mode.

    I'll try to include all relevant files. I assume it is somehow related to V_USER_MODIFIED_BY including fields from T_USER, which in turn link to V_USER_MODIFIED_BY (=itself).

    As workaround I'll try to copy the plain field definitions to V_USER_MODIFIED_BY (without foreignKey), but perhaps you are interested in the report nevertheless.

    Best regards,
    Blama

    V_USER_MODIFIED_BY.ds.xml
    Code:
    <DataSource dbName="Oracle" tableName="V_USER_MODIFIED_BY" ID="V_USER_MODIFIED_BY" dataSourceVersion="1" serverType="sql" serverConstructor="com.lmscompany.lms.server.LMSSQLDataSource" inheritsFrom="T_USER">
    	<operationBindings>
    		<operationBinding operationType="update" requiresRole="readonly" />
    		<operationBinding operationType="add" requiresRole="readonly" />
    		<operationBinding operationType="remove" requiresRole="readonly" />
    	</operationBindings>
    </DataSource>
    T_USER.ds.xml
    Code:
    <DataSource dbName="Oracle" tableName="T_USER" ID="T_USER" dataSourceVersion="1" serverType="sql" serverConstructor="com.lmscompany.lms.server.LMSSQLDataSource">
    	<fields>
    		<field primaryKey="true" hidden="true" name="ID" type="sequence" foreignKey="V_USER_ROLELIST.USER_ID" joinType="outer"></field>
    		<field hidden="true" name="TENANT_ID" type="integer" canEdit="false"></field>
    		<field foreignKey="V_USER_CREATED_BY.ID" name="CREATED_BY" title="Erstellt von" type="creator"></field>
    		<field name="CREATED_AT" title="Erstellt am" type="creatorTimestamp"></field>
    		<field foreignKey="V_USER_MODIFIED_BY.ID" name="MODIFIED_BY" title="Geändert von" type="modifier"></field>
    		<field name="MODIFIED_AT" title="Geändert am" type="modifierTimestamp"></field>
    
    		<field foreignKey="T_COMPANY.ID" joinType="outer" name="BELONGSTO_COMPANY_ID" title="Firma" type="integer"></field>
    		<field name="COMPANY_NAME" includeFrom="T_COMPANY.NAME" canSave="false" hidden="true"></field>
    		<field foreignKey="T_DISTRIBUTOR.ID" joinType="outer" name="BELONGSTO_DISTRIBUTOR_ID" title="Distributor" type="integer"></field>
    		<field name="DISTRIBUTOR_NAME" includeFrom="T_DISTRIBUTOR.NAME" canSave="false" hidden="true"></field>
    		<field foreignKey="T_RESELLER.ID" joinType="outer" name="BELONGSTO_RESELLER_ID" title="Reseller" type="integer"></field>
    		<field name="RESELLER_NAME" includeFrom="T_RESELLER.NAME" canSave="false" hidden="true"></field>
    		<field name="FIRMENNAME"
    			customSelectExpression="CASE WHEN belongsto_company_id IS NOT NULL THEN t_company.name WHEN belongsto_distributor_id IS NOT NULL THEN t_distributor.name WHEN belongsto_reseller_id IS NOT NULL THEN t_reseller.name END">
    		</field>
    
    		<field name="ANREDE" title="Anrede" length="10" type="text" escapeHTML="true"></field>
    		<field name="GIVENNAME" title="Vorname" length="30" type="text" escapeHTML="true"></field>
    		<field name="SURNAME" title="Nachname" length="30" type="text" escapeHTML="true" required="true"></field>
    		<field name="LOGINNAME" title="Loginname" length="20" type="text" escapeHTML="true" required="true">
    			<validators>
    				<validator type="isUnique" errorMessage="Der Benutzername ist schon vergeben!"></validator>
    			</validators>
    		</field>
    		<field name="FUNCTION" title="Funktion" length="50" type="text" escapeHTML="true" required="true"></field>
    		<field name="BCRYPTHASH" title="Passwort" length="60" type="text" escapeHTML="true"></field>
    		<field name="PASSWORD1" customSelectExpression="''" title="Passwort" length="60" type="text" escapeHTML="true" canEdit="true">
    			<validators>
    				<validator type="regexp" expression="^((?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^\s\w\d]).{8,20})$"
    					errorMessage="Bitte wählen Sie ein Passwort mit 8-20 Zeichen, jeweils mindestens einen Klein- bzw. Großbuchstaben, eine Ziffer und ein Sonderzeichen enthalten. Folgende Fehler liegen vor:"></validator>
    				<validator type="regexp" expression="^((?=.*\d).*)$" errorMessage="Keine Ziffer enthalten"></validator>
    				<validator type="regexp" expression="^((?=.*[a-z]).*)$" errorMessage="Kein Kleinbuchstabe enthalten."></validator>
    				<validator type="regexp" expression="^((?=.*[A-Z]).*)$" errorMessage="Kein Großbuchstabe enthalten."></validator>
    				<validator type="regexp" expression="^((?=.*[^\s\w\d]).*)$" errorMessage="Kein Sonderzeichen enthalten."></validator>
    				<validator type="regexp" expression="^.{0,20}$" errorMessage="Zu lang."></validator>
    				<validator type="regexp" expression="^.{8,}$" errorMessage="Zu kurz."></validator>
    			</validators>
    		</field>
    		<field name="PASSWORD2" customSelectExpression="''" title="Passwortwiederholung" length="60" type="text" escapeHTML="true" canEdit="true">
    			<validators>
    				<validator type="matchesField" otherField="PASSWORD1" errorMessage="Passwort und Passwortwiederholung müssen übereinstimmen!"></validator>
    			</validators>
    		</field>
    		<field name="GUELTIGVON" title="Account aktiv von" type="date" required="true" canEdit="true">
    			<validators>
    				<!-- Erklärung unter http://forums.smartclient.com/showthread.php?p=108718#post108718 
    									  #if((! $!record.GUELTIGBIS) && ("$!record.GUELTIGBIS" == ""))
    				-->
    				<validator type="serverCustom">
    					<serverCondition><![CDATA[
    					  #if(         "$!record.GUELTIGBIS" != "" )
    					    #set( $gb = $!record.GUELTIGBIS.getTime() )
    					  ##elseif(     "$!dataSource.fetchById($record.ID).GUELTIGBIS" != "" )
    					    ##set( $gb = $!dataSource.fetchById($record.ID).GUELTIGBIS.getTime() )
    					  #else
    					    #set( $gb = -1 )
    					  #end
    					  
    					  $value.getTime() <= $gb || $gb == -1]]></serverCondition>
    					<errorMessage>Bitte beachten Sie, dass das Startdatum nicht kleiner als das Enddatum sein darf (sofern ein Enddatum gesetzt ist)!</errorMessage>
    				</validator>
            <!--TODO: Add validator to prevent changing dates in the past
    				<validator type="serverCustom">
    					<serverCondition><![CDATA[
    				    ##Required field
    				    #set( $neu = $!value.getTime() )
    				    
    				    ##Can be NULL when adding new entry
    				    #if(          "$!dataSource.fetchById($record.ID).GUELTIGVON" != "" )
    					    #set( $alt = $!dataSource.fetchById($record.ID).GUELTIGVON.getTime() )
    					  #else
    					    #set( $alt = -1 )
    					  #end
    					  
    					  ##New created
    					  $alt == -1 
    					  ##Unchanged
    					  || $neu == $alt
    					  ##Moved in future
    					  || ($transactionDate < $neu && $transactionDate < $alt) 
    					  ]]></serverCondition>
    					<errorMessage>Bitte beachten Sie, dass sie ein bereits vergangenes Startdatum nicht mehr verändern können.</errorMessage>
    				</validator>-->
    			</validators>
    		</field>
    		<field name="GUELTIGBIS" title="Account aktiv bis" type="date" canEdit="true">
    			<validators>
    				<!-- Erklärung unter http://forums.smartclient.com/showthread.php?p=108718#post108718 -->
    				<validator type="serverCustom">
    					<serverCondition><![CDATA[
    					  #if(         "$!value" != "" )
    					    #set( $gb = $!value.getTime() )
    					  #else
    					    #set( $gb = -1 )
    					  #end
    
    					  #if( "$!record.GUELTIGVON" != "" )
    					    #set( $gv = $!record.GUELTIGVON.getTime() )
    					  #else
    					    #set( $gv = $!dataSource.fetchById($record.ID).GUELTIGVON.getTime() )
    					  #end
    					  $gv <= $gb || $gb == -1]]></serverCondition>
    					<errorMessage>Bitte beachten Sie, dass das Startdatum nicht kleiner als das Enddatum sein darf (sofern ein Enddatum gesetzt ist)!</errorMessage>
    				</validator>
    			</validators>
    		</field>
    		<field name="GUELTIGJETZT"
    			customSelectExpression="CASE WHEN TRUNC(sysdate) BETWEEN gueltigvon AND gueltigbis OR (gueltigvon &lt;= TRUNC(sysdate) AND gueltigbis IS NULL) THEN 'Y' ELSE 'N' END"
    			title="Account aktuell aktiv?" length="1" type="boolean" sqlStorageStrategy="singleCharYN" escapeHTML="true"></field>
    		<field name="FEHLERHAFT" title="Anzahl fehlerhafter Logins" type="integer" required="true"></field>
    		<field name="LASTLOGIN" title="letztes Login am" type="datetime"></field>
    		<field name="EMAIL" title="eMail" length="50" type="text" escapeHTML="true">
    			<validators>
    				<validator type="regexp"
    					expression="^[a-zA-Z0-9._%+-]+@(?:[a-zA-Z0-9-]+\.)+(?:[a-zA-Z]{2}|[cC][oO][mM]|[oO][rR][gG]|[nN][eE][tT]|[eE][dD][uU]|[gG][oO][vV]|[mM][iI][lL]|[bB][iI][zZ]|[iI][nN][fF][oO]|[mM][oO][bB][iI]|[nN][aA][mM][eE]|[aA][eE][rR][oO]|[aA][sS][iI][aA]|[jJ][oO][bB][sS]|[mM][uU][sS][eE][uU][mM])$"
    					errorMessage="Bitte geben Sie eine gültige Emailadresse ein."></validator>
    			</validators>
    		</field>
    		<field name="FULLNAME" title="Name" length="61" type="text" escapeHTML="true" canSave="false" canEdit="false"></field>
    		<field includeFrom="V_USER_ROLELIST.ROLELIST"></field>
    		<!-- TENANT_IDs for WHERE-clause generation -->
    		<field name="COMPANY_TENANT_ID" includeFrom="T_COMPANY.TENANT_ID" hidden="true"></field>
    		<field name="DISTRIBUTOR_TENANT_ID" includeFrom="T_DISTRIBUTOR.TENANT_ID" hidden="true"></field>
    		<field name="RESELLER_TENANT_ID" includeFrom="T_RESELLER.TENANT_ID" hidden="true"></field>
    		<field name="USER_ROLELIST_TENANT_ID" includeFrom="V_USER_ROLELIST.TENANT_ID" hidden="true"></field>
    	</fields>
    	<serverObject lookupStyle="new" className="com.lmscompany.lms.server.worker.T_USER" />
    	<operationBindings>
    		<operationBinding operationType="fetch" operationId="fetchUserIdForLoginname" serverMethod="fetchUserIdForLoginname"
    			outputs="ID, TENANT_ID, GIVENNAME, SURNAME, BELONGSTO_COMPANY_ID, COMPANY_NAME, BELONGSTO_DISTRIBUTOR_ID, DISTRIBUTOR_NAME, BELONGSTO_RESELLER_ID, RESELLER_NAME, FIRMENNAME, ROLELIST">
    		</operationBinding>
    		<operationBinding operationType="add">
    		</operationBinding>
    		<operationBinding operationType="update">
    		</operationBinding>
    	</operationBindings>
    </DataSource>
    T_CAMPAIGN.ds.xml
    Code:
    <DataSource dbName="Oracle" tableName="T_CAMPAIGN" ID="T_CAMPAIGN" dataSourceVersion="1" serverType="sql" serverConstructor="com.lmscompany.lms.server.LMSSQLDataSource">
    	<fields>
    		<field primaryKey="true" hidden="true" name="ID" type="sequence"></field>
    		<field hidden="true" name="TENANT_ID" type="integer" canEdit="false"></field>
    		<field foreignKey="V_USER_CREATED_BY.ID" name="CREATED_BY" title="Erstellt von" type="creator"></field>
    		<field name="CREATED_AT" title="Erstellt am" type="creatorTimestamp"></field>
    		<field foreignKey="V_USER_MODIFIED_BY.ID" name="MODIFIED_BY" title="Geändert von" type="modifier"></field>
    		<field name="MODIFIED_AT" title="Geändert am" type="modifierTimestamp"></field>
    		<field name="CREATED_BY_COMPANY_ID" includeFrom="V_USER_CREATED_BY.BELONGSTO_COMPANY_ID" hidden="true"></field>
    		<field name="CREATED_BY_DISTRIBUTOR_ID" includeFrom="V_USER_CREATED_BY.BELONGSTO_DISTRIBUTOR_ID" hidden="true"></field>
    		<field name="CREATED_BY_RESELLER_ID" includeFrom="V_USER_CREATED_BY.BELONGSTO_RESELLER_ID" hidden="true"></field>
    		<field name="SHORTNAME" title="Kurzname" length="30" type="text" escapeHTML="true" required="true">
    			<validators>
    				<validator type="isUnique" errorMessage="Der Kurzname wird bereits verwendet!" serverOnly="true"></validator>
    			</validators>
    		</field>
    		<field name="NAME" title="Name" length="60" type="text" escapeHTML="true" required="true">
    			<validators>
    				<validator type="isUnique" errorMessage="Der Name wird bereits verwendet!" serverOnly="true"></validator>
    			</validators>
    		</field>
    		<field name="DESCRIPTION" title="Beschreibung" length="1000" type="text" escapeHTML="true"></field>
    		<field name="STARTDATE" title="Startdatum" type="date" required="true">
    			<validators>
    				<validator type="serverCustom" serverOnly="true">
    					<serverCondition><![CDATA[
    					  #if(         "$!record.ENDDATE" != "" )
    					    #set( $gb = $!record.ENDDATE.getTime() )
    					  ##elseif(     "$!dataSource.fetchById($record.ID).ENDDATE" != "" )
    					    ##set( $gb = $!dataSource.fetchById($record.ID).ENDDATE.getTime() )
    					  #else
    					    #set( $gb = -1 )
    					  #end
    					  
    					  $value.getTime() <= $gb || $gb == -1]]></serverCondition>
    					<errorMessage>Bitte beachten Sie, dass das Startdatum nicht kleiner als das Enddatum sein darf (sofern ein Enddatum gesetzt ist)!</errorMessage>
    				</validator>
    			</validators>
    		</field>
    		<field name="ENDDATE" title="Enddatum" type="date">
    			<validators>
    				<!-- Erklärung unter http://forums.smartclient.com/showthread.php?p=108718#post108718 -->
    				<validator type="serverCustom" serverOnly="true">
    					<serverCondition><![CDATA[
    					  #if(         "$!value" != "" )
    					    #set( $gb = $!value.getTime() )
    					  #else
    					    #set( $gb = -1 )
    					  #end
    
    					  #if( "$!record.STARTDATE" != "" )
    					    #set( $gv = $!record.STARTDATE.getTime() )
    					  #else
    					    #set( $gv = $!dataSource.fetchById($record.ID).STARTDATE.getTime() )
    					  #end
    					  $gv <= $gb || $gb == -1]]></serverCondition>
    					<errorMessage>Bitte beachten Sie, dass das Startdatum nicht kleiner als das Enddatum sein darf (sofern ein Enddatum gesetzt ist)!</errorMessage>
    				</validator>
    			</validators>
    		</field>
    		<!-- TENANT_IDs for WHERE-clause generation -->
    		<field name="CREATED_BY_TENANT_ID" includeFrom="V_USER_CREATED_BY.TENANT_ID" hidden="true"></field>
    		<field name="MODIFIED_BY_TENANT_ID" includeFrom="V_USER_MODIFIED_BY.TENANT_ID" hidden="true"></field>
    	</fields>
    	<serverObject lookupStyle="new" className="com.lmscompany.lms.server.worker.T_CAMPAIGN" />
    	<operationBindings>
    		<operationBinding operationType="fetch" operationId="fetchLeadDropdown" serverMethod="fetchLeadDropdown">
    		</operationBinding>
    	</operationBindings>
    </DataSource>
    DataSourceLoader fragment:
    Code:
    <script type="text/javascript" language="javascript" src="lms/sc/DataSourceLoader?dataSource=emailType, MV_ZIPCODE, T_ADDRESS, T_CAMPAIGN, T_CAPABILITY, T_CATEGORY1, T_CATEGORY2, T_CATEGORY3, T_CATEGORY4, T_CATEGORY5, T_CATEGORY6, T_CATEGORY7, T_CATEGORY8, T_CATEGORY9, T_COMPANY, T_COUNTRY, T_DISTRIBUTOR, T_DISTRIBUTOR_COMPANY, T_LEAD, T_LEADRESELLERDEFAULT, T_LEADTEMPERATURE, T_LEAD_HISTORY, T_LEAD_ONLYDISTRIBUTOR, T_LEAD_ONLYRESELLER, T_LEAD_PRODUCTINTEREST, T_LEAD_USERDISMISSED, T_PRODUCT, T_PRODUCTCATEGORY, T_RESELLER, T_RESELLER_DISTRIBUTOR, T_ROLE, T_ROLE_CAPABILITY, T_SETTINGS, T_STATUS, T_USER, T_USER_ROLE, T_WONLOST, V_USER_CREATED_BY, V_USER_MODIFIED_BY, V_CATEGORYDEFAULTS, V_CURRENT_ACCOUNT_COUNT, V_LEAD_CREATED, V_LEAD_MATCHED_UNDISMISSED, V_LEAD_RESELLER_MATCH, V_LEAD_UNFINISHED, V_SETTINGSANDDEFAULTS, V_USER, V_USER_ROLE, V_USER_ROLELIST"></script>
    Attached Files

    #2
    Hi Isomorphic,

    the workaround of copying the plain field definitions (without FKs) worked. So there seems to be a cycle somewhere in the resolution of the field definitions.

    Best regards,
    Blama

    Comment

    Working...
    X