Cannot resolve package 'struts-default' in struts.xml Follow
Answered
Environment: IntelliJ 9.0.3
The file struts.xml has multiple errors (in red) because struts-default.xml is not resolved.
Example:
<package name="abc" extends="struts-default">
with the error message:
Cannot resolve package 'struts-default'
I added:
Project Settings / Facets / Struts 2 / My Fileset
with the missing 'struts-default.xml' (from Maven struts2-core-2.1.8.1.jar!/struts-default.xml)
This does not resolve the problem.
What other settings are required to clear this error message?
Thanks
Mark
Please sign in to leave a comment.
I assume your own struts.xml is included in the same fileset? Where is it located? It must be inside any source-roots, also make sure to include corresponding source root in web facet source roots (checkbox). Yann
Sure, struts.xml is included. It is in Default File Set for Struts 2 Facet.
Is this an existing project or a new project created with IDEA's project wizard? It sounds like a more general problem with your project setup. Can you send me a stripped down ZIP of your project
? Thanks.No post (wrong topic)
Please find attached iml-file for the project.
Which .idea files could be helpful?
Attachment(s):
ABC.iml.zip
your own struts.xml is not in the same fileset as struts-default.xml, please try to group them
THANKS. This resolved the issue.
I'm having the same issue, but by me, the files are grouped in the same fileset. Wonder what the issue can be?
Could you please share a screenshot of your facet setup? Is everything else resolving properly in your struts.xml?
No, it's causing numerous problems with my struts.xml file. Here is the screenshot:
Please try creating the Struts2 facet under the Web facet see https://confluence.jetbrains.com/pages/viewpage.action?pageId=35367
That seems to have resolved it. Thanks so much!
I'm afraid I celebrated a bit prematurely.... I saved the project, and all the errors resurfaced. Here is the current screenshot of my facets:
Is it possible for you to share your project to reproduce? You could upload it to https://uploads.services.jetbrains.com/ and share filename here.
Which files should I upload; the iml files?
ideally the whole project
Uploaded the project. This is the ID: 2021_03_12_CvWrZeBNVB8M1ncK
Ok, the errors I can reproduce locally (project did not setup 100% on my machine) are related to resolving <result> location. And this is specific to Web facet setup, specifically "Web Resource Directories" must be setup correctly to match local web resources path(s) and their corresponding deployment roots.
Please make sure there is only one (1) Web Facet and its setup is specifying paths correctly (see screenshot). Then resolving works for me.
Please see https://www.jetbrains.com/help/idea/web-facet-page.html.
Good now. It seems that it was indeed a duplicate web facet that caused it.
Thanks so much for your help!