Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code Cleanup - Refactor autoComplete components to be more efficient, avoid duplicate id warnings in server logs #6360

Closed
mheppler opened this issue Nov 12, 2019 · 2 comments
Labels
Component: Code Infrastructure formerly "Feature: Code Infrastructure" Component: JSF Involves modifying JSF (Jakarta Server Faces) code, which is being replaced with React. Feature: Performance & Stability Type: Bug a defect UX & UI: New React UI Needs enough design work that it should probably go in the new React UI, not JSF

Comments

@mheppler
Copy link
Contributor

mheppler commented Nov 12, 2019

Searching the project, as part of the development for #5615, found that we have 13 p:autoComplete components, of which 4 have the binding attribute (known bug ref Stack Overflow), and 2 of those are wrapped in p:fragment components (also, there are 3 other examples of p:autoComplete components wrapped in p:fragment or p:outputPanel components). So there are four variations to how the component is used, and we should review each, and get them all optimized and functioning properly to avoid these VERY server log heavy (#5749) duplicate id warnings.

dashboard-datamove.xhtml	
  <p:autoComplete id="sourceDatasetMenu"      [position 39:41]	
  <p:autoComplete id="destinationDataverseMenu"      [position 85:41]	

dataset.xhtml	
  <p:autoComplete id="selectHostDataverse"      [position 537:45]	
  <p:autoComplete id="dataverseLinkName"      [position 1358:41]	

dataverse.xhtml	
  <p:autoComplete id="selectHostDataverse"      [position 72:37]	
  <p:autoComplete id="dvName"      [position 682:33]	

explicitGroup-new-dialog.xhtml	
  <p:autoComplete id="roleAssigneeName" placeholder="#{bundle['dataverse.permissions.usersOrGroups.assignDialog.userOrGroup.enterName']}"      [position 63:25]	

harvestclients.xhtml	
  <p:autoComplete id="destinationDataverseMenu"      [position 256:41]	
manage-groups.xhtml	
  <p:autoComplete id="addRoleAssigneeName" placeholder="#{bundle['dataverse.manageGroups.tab.action.btn.view.dialog.enterName']}"      [position 117:37]	

firstLogin.xhtml	
  <p:autoComplete id="selectedEmailMoreThanOneToPickFrom"       [position 89:37]	
permissions-manage-files.xhtml	
  <p:autoComplete id="userGroupNameAssign" placeholder="#{bundle['dataverse.permissionsFiles.assignDialog.userOrGroup.enterName']}"      [position 261:41]	

provenance-popups-fragment.xhtml	
  <p:autoComplete id="provJsonNameDropdown"       [position 83:25]	

roles-assign.xhtml	
  <p:autoComplete id="userGroupNameAssign" placeholder="#{bundle['dataverse.permissions.usersOrGroups.assignDialog.userOrGroup.enterName']}"      [position 23:25]	

Example from server log of duplicate id warning from autoComplete component with binding attribute.

 +id: selectHostDataverse
             type: org.primefaces.component.autocomplete.AutoComplete@b0ae9d0
              +id: j_idt221  <===============
               type: org.primefaces.component.column.Column@6f127b3a
                +id: j_idt222
                 type: javax.faces.component.html.HtmlOutputText@52dbbd4d
              +id: j_idt223
               type: org.primefaces.component.column.Column@731cdcc7
                +id: j_idt224
                 type: javax.faces.component.html.HtmlOutputText@2f04ff1d
              +id: j_idt221  <===============
               type: org.primefaces.component.column.Column@53339a6c
                +id: j_idt222
                 type: javax.faces.component.html.HtmlOutputText@5c0d6492
              +id: j_idt223
               type: org.primefaces.component.column.Column@49626130
                +id: j_idt224
                 type: javax.faces.component.html.HtmlOutputText@41968316
              +id: j_idt221  <===============
               type: org.primefaces.component.column.Column@e3991b2
                +id: j_idt222
                 type: javax.faces.component.html.HtmlOutputText@39a74d13
              +id: j_idt223
               type: org.primefaces.component.column.Column@6396d0f6
                +id: j_idt224
@poikilotherm
Copy link
Contributor

With 4.19 this is starting to flood my logs as many fields now are providing autocomplete feature (which itself is great).

@mheppler
Copy link
Contributor Author

Just searched my 31 server.log files, dating back to when upgraded to Payara 5. Was not able to find any of the <=============== characters used to point out duplicate id warnings. I did find this when searching for references to the autoComplete component.

Searching 31 files for "org.primefaces.component.autocomplete"

/usr/local/payara5/glassfish/domains/domain1/logs/server.log_2021-02-02T11-42-18:
 3794  
 3795  [2021-02-02T10:21:27.230-0500] [Payara 5.2020.7] [WARNING] [AS-WEB-UTIL-00035] [javax.enterprise.web.util] [tid: _ThreadID=101 _ThreadName=admin-thread-pool::admin-listener(1)] [timeMillis: 1612279287230] [levelValue: 900] [[
 3796:   Unable to load class org.primefaces.component.autocomplete.AutoCompleteBase, reason: java.lang.OutOfMemoryError: Metaspace]]
 3797  
 3798  [2021-02-02T10:21:27.917-0500] [Payara 5.2020.7] [WARNING] [AS-WEB-UTIL-00035] [javax.enterprise.web.util] [tid: _ThreadID=101 _ThreadName=admin-thread-pool::admin-listener(1)] [timeMillis: 1612279287917] [levelValue: 900] [[
 ....
 3824  
 3825  [2021-02-02T10:21:35.215-0500] [Payara 5.2020.7] [WARNING] [AS-WEB-UTIL-00035] [javax.enterprise.web.util] [tid: _ThreadID=101 _ThreadName=admin-thread-pool::admin-listener(1)] [timeMillis: 1612279295215] [levelValue: 900] [[
 3826:   Unable to load class org.primefaces.component.autocomplete.AutoComplete, reason: java.lang.OutOfMemoryError: Metaspace]]
 3827  
 3828  [2021-02-02T10:21:36.139-0500] [Payara 5.2020.7] [WARNING] [AS-WEB-UTIL-00035] [javax.enterprise.web.util] [tid: _ThreadID=101 _ThreadName=admin-thread-pool::admin-listener(1)] [timeMillis: 1612279296139] [levelValue: 900] [[
 ....
 4196  
 4197  [2021-02-02T10:23:18.951-0500] [Payara 5.2020.7] [WARNING] [AS-WEB-UTIL-00035] [javax.enterprise.web.util] [tid: _ThreadID=101 _ThreadName=admin-thread-pool::admin-listener(1)] [timeMillis: 1612279398951] [levelValue: 900] [[
 4198:   Unable to load class org.primefaces.component.autocomplete.AutoComplete, reason: java.lang.OutOfMemoryError: Metaspace]]
 4199  
 4200  [2021-02-02T10:23:19.818-0500] [Payara 5.2020.7] [WARNING] [AS-WEB-UTIL-00035] [javax.enterprise.web.util] [tid: _ThreadID=101 _ThreadName=admin-thread-pool::admin-listener(1)] [timeMillis: 1612279399818] [levelValue: 900] [[
 ....
 4568  
 4569  [2021-02-02T10:24:55.266-0500] [Payara 5.2020.7] [WARNING] [AS-WEB-UTIL-00035] [javax.enterprise.web.util] [tid: _ThreadID=101 _ThreadName=admin-thread-pool::admin-listener(1)] [timeMillis: 1612279495266] [levelValue: 900] [[
 4570:   Unable to load class org.primefaces.component.autocomplete.AutoCompleteRenderer, reason: java.lang.OutOfMemoryError: Metaspace]]
 4571  
 4572  [2021-02-02T10:24:55.995-0500] [Payara 5.2020.7] [WARNING] [AS-WEB-UTIL-00035] [javax.enterprise.web.util] [tid: _ThreadID=101 _ThreadName=admin-thread-pool::admin-listener(1)] [timeMillis: 1612279495995] [levelValue: 900] [[

4 matches in 1 file

In reference to those OutOfMemoryError's, this Stack Overflow answer suggests they're easy to resolve.

You should probably remove -XX:MaxMetaspaceSize=512m altogether.

My guess is, that in Java 7 you've needed to increase the permanent generation to get things to run at all, because the default max was too low.

In Java 8, the metaspace that holds your classes can expand without limit by default, so you probably don't run into the issue you have tried to solve for Java 7 in the first place. Instead, as you have experienced, you run into another issue: Setting too low a metaspace limit. Removing said limit will probably solve the issue and allow the JVM to make suitable decisions for you.

@pdurbin pdurbin added the Component: JSF Involves modifying JSF (Jakarta Server Faces) code, which is being replaced with React. label Oct 7, 2022
@pdurbin pdurbin added the UX & UI: New React UI Needs enough design work that it should probably go in the new React UI, not JSF label Oct 8, 2023
@pdurbin pdurbin closed this as completed Oct 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Code Infrastructure formerly "Feature: Code Infrastructure" Component: JSF Involves modifying JSF (Jakarta Server Faces) code, which is being replaced with React. Feature: Performance & Stability Type: Bug a defect UX & UI: New React UI Needs enough design work that it should probably go in the new React UI, not JSF
Projects
None yet
Development

No branches or pull requests

3 participants