IDEA13 Cannot locate our relative Spring contexts

Having a problem with a project migrated from IDEA 12. What's happening is IDEA13 is showing all imported our contexts as missing resources. Even though they're clearly present and the application runs without problems.  It seems there is a regression here as the Spring facet worked fine in IDEA 12 locates all imported contexts. The Spring Facet details are exactly the same as IJ12, indeed reopening same project file in 12 doesn't show the same issue.

Because IDEA13 fails to resolve these contexts I get warnings every time I open the project over missing configurations (they're not missing). Also the warning on the Spring facet settings page becomes ridiculously large taking up 90% of the dialog height (see screenshots).

Struggling to understand the root cause, the Spring facet seems correct, it should include imported resources. I tried creating a simple test project, but so far IDEA13 isn't showing the same error. I've also tried deleting and rebuilding the IJ13 facet context, even tried creating a new IJ13 project from the project pom, but still see the missing resources in the full project. Bit stumped here - anybody know what's likely to have changed between 12 & 13?



Attachment(s):
VeryBigIncorrectSpringFacetWarning.JPG
AnnoyingIncorrectSpringConfigNag.JPG
Idea13CannotLocateOurRelativeSpringContexts.JPG
7 comments
Comment actions Permalink

Hello Richard,

I've opened http://youtrack.jetbrains.com/issue/IDEA-118132 to improve error reporting in facet settings.

Should "conf" directory really be a package (would not match your <import>) or rather source root instead (and modules, ws, .. be first level of packages)?

Fixing the "<import>" errors should then get rid of all the warnings, but notification on project load (can be suppressed in various ways, see http://youtrack.jetbrains.com/issue/IDEA-117114#comment=27-633761) as well as in facet.

0
Comment actions Permalink

Hi Yann,

I'm suspecting the problem might be related to the projects folder structure. I think conf was marked as Source in earlier IDEAs as they didn't support Resource this has been carried between IDEA versions. I was wondering why conf was also marked as a (library home)? is that something to do with facets? Removing the source markup doesn't change anything except the web artifact build which now forgets to output the resources contained in conf...

The project structure is unusual. It's an eclipse project, this one imported from the eclipse project files - some IDEA versions ago. The root folder doubles up as the web document base, for sysdeo-tomcat plugin the eclipse devs use. It's a bit bizarre, but nothing I can change easily, big project, lots of devs, been like this for years. Seem to remember previous IDEA versions wouldn't let me mark the root folder as a resource/source... can't recall all the details now.

I'll try tweaking the big projects Sources configuration to see if I can't get the imports to resolve. Also try advancing my small spring demo to see if I can't reproduce the issue. Though IDEA12 doesn't share these problems?

PS on supressing the warnings would any harm be done if I created an ad-hoc spring context in the facets and dumped everything IDEA13 currently complains about in there?

0
Comment actions Permalink

AFAIK there should be no changes for source roots/project format with plain IJ projects. Do you use Maven/Gradle or some other build tool?

The most simple fix to disable "bad" config files detection is to disable Spring Facet detection for whole project temporarily.

0
Comment actions Permalink

This version is Apache Ant & Ivy (with IvyIdea). But I've also got an experimental branch of same project that uses just Maven which is an IDEA pom project. Both have same problems resolving in IDEA13 and both work fine in IDEA12.

FYI Notice in IDEA13 if I ctrl+space in the resource attribute of: <import resource="" it insists I must supply a protocol next; file:, http:, classpath*: or classpath: .
But same in IDEA12 includes completions for local files & folders as I'd expect?

0
Comment actions Permalink

Not sure how IvyIdea works in 13 or not. If there's a reproducible regression with Maven, please report it directly to our issue tracker.

You mean the protocols are the only variants shown in completion popup? The other "applicationContext---" files are not shown here (located in same directory/package)? Do they resolve if you enter path manually without any classpath: prefix? I cannot reproduce such a behaviour here.

0
Comment actions Permalink

Yes the other context files in the same folder do not show up during completion at all - popup demands a protocol prefix. If I add a prefix like classpath, this seems to resolve in IDEA13. But our application fails to startup like this (missing autowire dependencies) seems our code depends on file references somehow. file: and http: are fairly useless prefixes for a shippable war.

I've not seen able to produce a simplfied test project either. Simple case seems to resolve fine like IDEA12 does. Fustrating.



Attachment(s):
capture.jpg
SamePopupInIDEA12.jpg
0
Comment actions Permalink

Stumpled upon this again this morning, but this time I knew spring configs where resolving and know what change I made that stopped them.

Seems the 'Web resource directories' under the web facet can cause this issue to appear. If I don't have anything listsed IJ13 resolves the local context files OK. But if I add the project root directory as a root path in the Web resources ('/'). This causes the editor to stop being able to locate the context files. This also seems to be a difference between IJ12 and IJ13 (12 continues to resolve).

FYI I was adding the root folder to mimic the eclipse sysdeo plugin our eclipse devs all use, as our root folder doubles up as docbase (not something I approve of).

At least toggling this on & off is fairly easy. Previously I was juggling 2 versions of IDEA IDEs depending on what kind of dev tasks I was doing.

0

Please sign in to leave a comment.