spring config jndi-lookup id="foo" marked red as not allowed

I have a spring 2.x config file that contains a <jee:jndi-lookup id="xxxxxDS"..../>
This is working fine but IntelliJ marks it as wrong:
Screen Shot 2013-01-31 at 19.24.58.PNG
If you check the documentation, this attribute is meant to be specified,
the xsd (http://www.springframework.org/schema/jee/spring-jee-2.0.xsd)
says that jndi-lookup extends jndiLocatingType which in turns extends beans:identifiedType that contains:
<xsd:attribute name="id" type="xsd:ID">

So why is IntelliJ saying that I can't have an id there ? I can't even turn it off. As you can see in the screenshot...

I'm using IDEA 12.0.2 on a Mac if that has anything to do with it.

Comment actions Permalink

Can you CTRL-click on "http://www.springframework.org/schema/jee/spring-jee-2.0.xsd" in the xsi:schemaLocation? To what file does it resolve to? What version of Spring library JARs do you use in your project?

Comment actions Permalink

I have the Spring 2.0.6 libraries in my project and the ⌘-click does open what the url points to, the expected xsd file spring-jee-2.0.xsd
However, that file does reference the beans one but does not specify the location and it looks like this:
Screen Shot 2013-01-31 at 21.27.53.PNG
I'm not sure that's the cause of the problem though.

Comment actions Permalink

According to your description it should work properly.

Does it open the XSD contained in your spring-2.0.6.jar? If not, which XSD file is linked? Could you double-check if you have a second spring.jar somewhere in your project? Did you setup custom mappings for Spring schema (Settings->Schemas and DTDs)?

Comment actions Permalink

The command-click xsd seems to come from intelliJ:
Screen Shot 2013-02-01 at 08.40.15.PNG
I have two custom schemas, one for WS-Security and one for my own XSD, so no interference here.
I also checked the spring jars and only have 2.0.6 there, seen as spring 2.0 in the dependencies.

I tried to upgrade the libraries to spring 3.1 and it solved the red mark on the id. (By the way, I used the "change version" button which conveniently downloaded the jars but not spring-web.jar, I had to download it myself).
Unfortunately it causes some conflicts that I don't have time to fix right now so I'll live with the red mark for now.

Thanks for your help,

Comment actions Permalink

Did you include spring-remoting.jar in your classpath (see http://forum.springsource.org/showthread.php?65317-Trouble-with-spring-jee-2-0-xsd). Also I found some posts about issues with XSD packaging issues in Spring 2.0.x distributions, I would also highly recommend you to upgrade to 2.5.6 or later, last but not least for security considerations.

spring-web.jar will be downloaded when you add support for Spring MVC framework.


Please sign in to leave a comment.