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

SVT:Hovering and feature completion not working in server.xml #242

Closed
rumanaHaque opened this issue Nov 1, 2023 · 11 comments · Fixed by #243
Closed

SVT:Hovering and feature completion not working in server.xml #242

rumanaHaque opened this issue Nov 1, 2023 · 11 comments · Fixed by #243
Assignees
Labels
bug Something isn't working high priority

Comments

@rumanaHaque
Copy link

I have Liberty Tools installed in VSCode in Mac, with my Acme application.

When I try to see the features in server.xml, hovering or feature completion are not working.

image
@rumanaHaque rumanaHaque added the bug Something isn't working label Nov 1, 2023
@cherylking
Copy link
Member

I just installed the latest driver in VS Code on Mac and all language server functions in server.xml are working as expected.

@aparnamichael
Copy link

I also installed the latest driver in VS Code on Mac and hovering or feature completion are working as expected.

image

@rumanaHaque
Copy link
Author

I retried again, closing all my files, uninstalling and reinstalling the LT, but I still see the same problem.

@rumanaHaque
Copy link
Author

This seems to be a regression in the 23.0.12 drivers,
In the same env, I uninstalled 23.0.12, and installed 23.0.9 driver.
Using that driver - I don't see the problem.

image

@rumanaHaque
Copy link
Author

When I open server.xml - I see this in the output tab.

- Java : /Library/Java/JavaVirtualMachines/ibm-semeru-open-20.jdk/Contents/Home
 - VM Version : 20.0.2
 - Git 8379294 - [maven-release-plugin] prepare release 0.26.1
[Error - 11:48:21 AM] Nov 02, 2023 11:48:21 io.openliberty.tools.langserver.lemminx.util.XmlReader hasServerRoot()
Message: Error received trying to read XML file: /Users/rumanahaque/Documents/Acme_ee10/acme-ee/AcmeAnnuityWeb/target/classes/com/ibm/wssvt/acme/annuity/struts/actions/ManageHolder-validation.xml
[Error - 11:49:36 AM] Nov 02, 2023 11:49:36 io.openliberty.tools.langserver.lemminx.util.XmlReader hasServerRoot()
Message: Error received trying to read XML file: /Users/rumanahaque/Documents/Acme_ee10/acme-ee/AcmeAnnuityWeb/target/classes/com/ibm/wssvt/acme/annuity/struts/actions/ManageContact-validation.xml
[Error - 11:50:51 AM] Nov 02, 2023 11:50:51 io.openliberty.tools.langserver.lemminx.util.XmlReader hasServerRoot()
Message: Error received trying to read XML file: /Users/rumanahaque/Documents/Acme_ee10/acme-ee/AcmeAnnuityWeb/target/classes/com/ibm/wssvt/acme/annuity/struts/actions/ManageHolder-ManageHolder_save-validation.xml
[Error - 11:50:51 AM] Nov 02, 2023 11:50:51 io.openliberty.tools.langserver.lemminx.util.XmlReader hasServerRoot()
Message: Error received trying to read XML file: /Users/rumanahaque/Documents/Acme_ee10/acme-ee/AcmeAnnuityWeb/src/struts.xml
[Error - 11:50:51 AM] Nov 02, 2023 11:50:51 io.openliberty.tools.langserver.lemminx.util.XmlReader hasServerRoot()
Message: Error received trying to read XML file: /Users/rumanahaque/Documents/Acme_ee10/acme-ee/AcmeAnnuityWeb/src/acme.xml
[Error - 11:52:06 AM] Nov 02, 2023 11:52:06 io.openliberty.tools.langserver.lemminx.util.XmlReader hasServerRoot()
Message: Error received trying to read XML file: /Users/rumanahaque/Documents/Acme_ee10/acme-ee/AcmeAnnuityWeb/src/main/java/com/ibm/wssvt/acme/annuity/struts/actions/ManageHolder-validation.xml
[Error - 11:53:21 AM] Nov 02, 2023 11:53:21 io.openliberty.tools.langserver.lemminx.util.XmlReader hasServerRoot()
Message: Error received trying to read XML file: /Users/rumanahaque/Documents/Acme_ee10/acme-ee/AcmeAnnuityWeb/src/main/java/com/ibm/wssvt/acme/annuity/struts/actions/ManageContact-validation.xml
[Error - 11:54:36 AM] Nov 02, 2023 11:54:36 io.openliberty.tools.langserver.lemminx.util.XmlReader hasServerRoot()
Message: Error received trying to read XML file: /Users/rumanahaque/Documents/Acme_ee10/acme-ee/AcmeAnnuityWeb/src/main/java/com/ibm/wssvt/acme/annuity/struts/actions/ManageHolder-ManageHolder_save-validation.xml
[Info  - 11:54:36 AM] Nov 02, 2023 11:54:36 io.openliberty.tools.langserver.lemminx.services.LibertyProjectsManager setWorkspaceFolders()
Message: Adding Liberty workspace for sub-module: file:/Users/rumanahaque/Documents/Acme_ee10/acme-ee/AcmeWebEjbEar/
[Info  - 11:54:36 AM] Nov 02, 2023 11:54:36 io.openliberty.tools.langserver.lemminx.services.LibertyProjectsManager setWorkspaceFolders()
Message: Adding Liberty workspace for sub-module: file:/Users/rumanahaque/Documents/Acme_ee10/acme-ee/config/
[Info  - 11:54:36 AM] Nov 02, 2023 11:54:36 io.openliberty.tools.langserver.lemminx.LibertyExtension doSave()
Message: Liberty XML settings updated
[Info  - 11:54:36 AM] Nov 02, 2023 11:54:36 io.openliberty.tools.langserver.lemminx.LibertyXSDURIResolver generateServerSchemaXsd()
Message: Using schema file at: file:/Users/rumanahaque/Documents/Acme_ee10/acme-ee/AcmeWebEjbEar/target/.libertyls/ol-23.0.0.10.xsd
[Info  - 11:54:36 AM] Nov 02, 2023 11:54:36 io.openliberty.tools.langserver.lemminx.LibertyXSDURIResolver generateServerSchemaXsd()
Message: Using schema file at: file:/Users/rumanahaque/Documents/Acme_ee10/acme-ee/AcmeWebEjbEar/target/.libertyls/ol-23.0.0.10.xsd
[Info  - 11:54:36 AM] Nov 02, 2023 11:54:36 io.openliberty.tools.langserver.lemminx.LibertyXSDURIResolver generateServerSchemaXsd()
Message: Using schema file at: file:/Users/rumanahaque/Documents/Acme_ee10/acme-ee/AcmeWebEjbEar/target/.libertyls/ol-23.0.0.10.xsd
[Info  - 11:54:37 AM] Nov 02, 2023 11:54:37 io.openliberty.tools.langserver.lemminx.services.LibertyWorkspace getFeatureListGraph()
Message: Generating installed features list and storing to cache for workspace file:/Users/rumanahaque/Documents/Acme_ee10/acme-ee/AcmeWebEjbEar/
[Info  - 11:54:37 AM] Nov 02, 2023 11:54:37 io.openliberty.tools.langserver.lemminx.services.FeatureService generateFeatureListXml()
Message: Generating feature list file from: /Users/rumanahaque/Documents/Acme_ee10/acme-ee/AcmeWebEjbEar/target/liberty/wlp/bin/tools/ws-featurelist.jar
[Info  - 11:54:37 AM] Nov 02, 2023 11:54:37 io.openliberty.tools.langserver.lemminx.services.FeatureService generateFeatureListXml()
Message: Generating feature list file at: /Users/rumanahaque/Documents/Acme_ee10/acme-ee/AcmeWebEjbEar/target/.libertyls/featurelist-ol-23.0.0.10.xml
[Info  - 11:54:38 AM] Nov 02, 2023 11:54:38 io.openliberty.tools.langserver.lemminx.services.FeatureService generateFeatureListXml()
Message: Using feature list file at: file:/Users/rumanahaque/Documents/Acme_ee10/acme-ee/AcmeWebEjbEar/target/.libertyls/featurelist-ol-23.0.0.10.xml
[Info  - 11:54:38 AM] Nov 02, 2023 11:54:38 io.openliberty.tools.langserver.lemminx.services.FeatureService getInstalledFeaturesList()
Message: Returning installed features: 33
[Info  - 11:54:38 AM] Nov 02, 2023 11:54:38 io.openliberty.tools.langserver.lemminx.services.LibertyWorkspace getFeatureListGraph()
Message: Config element validation for missing features enabled for workspace: file:/Users/rumanahaque/Documents/Acme_ee10/acme-ee/AcmeWebEjbEar/
[Info  - 11:54:39 AM] Nov 02, 2023 11:54:39 io.openliberty.tools.langserver.lemminx.services.FeatureService getFeatures()
Message: Getting features for: ol-23.0.0.10
[Info  - 11:54:39 AM] Nov 02, 2023 11:54:39 io.openliberty.tools.langserver.lemminx.services.FeatureService fetchFeaturesForVersion()
Message: Returning public features from Maven: 260
[Info  - 11:54:39 AM] Nov 02, 2023 11:54:39 io.openliberty.tools.langserver.lemminx.services.FeatureService getFeatures()
Message: Getting cached features for: ol-23.0.0.10
[Info  - 11:54:39 AM] Nov 02, 2023 11:54:39 io.openliberty.tools.langserver.lemminx.services.FeatureService getFeatures()
Message: Getting cached features for: ol-23.0.0.10
[Info  - 11:54:39 AM] Nov 02, 2023 11:54:39 io.openliberty.tools.langserver.lemminx.services.FeatureService getFeatures()
Message: Getting cached features for: ol-23.0.0.10
[Info  - 11:54:39 AM] Nov 02, 2023 11:54:39 io.openliberty.tools.langserver.lemminx.services.FeatureService getFeatures()
Message: Getting cached features for: ol-23.0.0.10
[Info  - 11:54:39 AM] Nov 02, 2023 11:54:39 io.openliberty.tools.langserver.lemminx.services.FeatureService getFeatures()
Message: Getting cached features for: ol-23.0.0.10
[Info  - 11:54:39 AM] Nov 02, 2023 11:54:39 io.openliberty.tools.langserver.lemminx.services.FeatureService getFeatures()
Message: Getting cached features for: ol-23.0.0.10
[Info  - 11:54:39 AM] Nov 02, 2023 11:54:39 io.openliberty.tools.langserver.lemminx.services.FeatureService getFeatures()
Message: Getting cached features for: ol-23.0.0.10
[Info  - 11:54:39 AM] Nov 02, 2023 11:54:39 io.openliberty.tools.langserver.lemminx.services.FeatureService getFeatures()
Message: Getting cached features for: ol-23.0.0.10
[Info  - 11:54:39 AM] Nov 02, 2023 11:54:39 io.openliberty.tools.langserver.lemminx.services.FeatureService getFeatures()
Message: Getting cached features for: ol-23.0.0.10
[Info  - 11:54:39 AM] Nov 02, 2023 11:54:39 io.openliberty.tools.langserver.lemminx.services.FeatureService getFeatures()
Message: Getting cached features for: ol-23.0.0.10
[Info  - 11:54:39 AM] Nov 02, 2023 11:54:39 io.openliberty.tools.langserver.lemminx.services.FeatureService getFeatures()
Message: Getting cached features for: ol-23.0.0.10
[Info  - 11:54:39 AM] Nov 02, 2023 11:54:39 io.openliberty.tools.langserver.lemminx.services.FeatureService getFeatures()
Message: Getting cached features for: ol-23.0.0.10
[Info  - 11:54:39 AM] Nov 02, 2023 11:54:39 io.openliberty.tools.langserver.lemminx.services.FeatureService getFeatures()
Message: Getting cached features for: ol-23.0.0.10
[Info  - 11:54:39 AM] Nov 02, 2023 11:54:39 io.openliberty.tools.langserver.lemminx.services.FeatureService getFeatures()
Message: Getting cached features for: ol-23.0.0.10
[Info  - 11:54:39 AM] Nov 02, 2023 11:54:39 io.openliberty.tools.langserver.lemminx.services.FeatureService getFeatures()
Message: Getting cached features for: ol-23.0.0.10
[Error - 11:55:51 AM] Nov 02, 2023 11:55:51 io.openliberty.tools.langserver.lemminx.util.XmlReader hasServerRoot()
Message: Error received trying to read XML file: /Users/rumanahaque/Documents/Acme_ee10/acme-ee/AcmeAnnuityWeb/target/classes/com/ibm/wssvt/acme/annuity/struts/actions/ManageHolder-validation.xml
[Error - 11:55:51 AM] Nov 02, 2023 11:55:51 io.openliberty.tools.langserver.lemminx.util.XmlReader hasServerRoot()
Message: Error received trying to read XML file: /Users/rumanahaque/Documents/Acme_ee10/acme-ee/AcmeAnnuityWeb/target/classes/com/ibm/wssvt/acme/annuity/struts/actions/ManageHolder-validation.xml
[Info  - 11:55:51 AM] Nov 02, 2023 11:55:51 org.eclipse.lemminx.uriresolver.CacheResourcesManager lambda$downloadResource$0()
Message: Downloading http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd to /Users/rumanahaque/.lemminx/cache/http/www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd...

@rumanaHaque
Copy link
Author

It took a long time to eventually load in the OUTLINE TAB:
image

@rumanaHaque
Copy link
Author

Here's the ManageHolder-validation.xml file

<!DOCTYPE validators PUBLIC
        "-//OpenSymphony Group//XWork Validator 1.0.2//EN"
        "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">

<validators>
    <field name="holderId">
        <field-validator type="requiredstring">
            <message key="requiredstring"/>
        </field-validator>
    </field>
    <!--  
     <field name="holderFirstName">
        <field-validator type="requiredstring">
            <message key="requiredstring"/>
        </field-validator>
    </field>
     -->    
</validators>

@rumanaHaque
Copy link
Author

rumanaHaque commented Nov 2, 2023

Here's the ManageContact-validation.xml file:

<!DOCTYPE validators PUBLIC
        "-//OpenSymphony Group//XWork Validator 1.0.2//EN"
        "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">

<validators>
    
    <field name="contactEmail">
        <field-validator type="email">
            <message key="errors.email"/>
        </field-validator>
    </field>
    
</validators>

@rumanaHaque
Copy link
Author

Once I see the Grammars update in the OUTLINE view - after that everything in server.xml works as expected.

image image

@TrevCraw TrevCraw transferred this issue from OpenLiberty/liberty-tools-vscode Nov 2, 2023
@cherylking
Copy link
Member

Thanks for the additional details Rumana. The xml files that it is getting an ERROR on all have a non-accessible DTD referenced at the top of the file. This is causing a very long delay for each of those files when we check for the <server> root element.

I will be adding logic to suppress DTD validation. There are a couple other improvements that I will make when processing XML files, such as handling when the first entry in the xml is not a start element, and skipping processing of xml files in the target/build dir.

@rumanaHaque
Copy link
Author

I retested this using the VSCode driver that has this fix, and verifies that the fix works.
Now when I open server.xml, I see Outline populated immediately, and then hovering works as expected.

image

@cherylking cherylking moved this from ✅ Done to 23.0.12 in Liberty Tools Release Plan Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working high priority
Projects
Status: 23.0.12
Development

Successfully merging a pull request may close this issue.

3 participants