This week's giveaway is in the Testing forum.
We're giving away four copies of TDD for a Shopping Website LiveProject and have Steven Solomon on-line!
See this thread for details.
Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Invalid content was found starting with element 'beans:bean'

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hey guys i'm unsure why i'm getting this error or how to go about fixing it

here is the code from the spring-security.xml

error

cvc-complex-type.2.4.a: Invalid content was found starting with element 'http'. One of '{"http://
www.springframework.org/schema/beans":description, "http://www.springframework.org/schema/beans":import,
"http://www.springframework.org/schema/beans":alias, "http://www.springframework.org/schema/beans":bean,
WC[##other:"http://www.springframework.org/schema/beans"], "http://www.springframework.org/schema/
beans":beans}' is expected.


spring-security.xml



pom.xml

 
Saloon Keeper
Posts: 25463
180
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I cannot see it, although our XML syntax highlighter seems to think that something is different about the xsi attribute.

Moving to the Spring forum.
 
Ranch Hand
Posts: 734
7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

i'm unsure why i'm getting this error...

cvc-complex-type.2.4.a: Invalid content was found starting with element 'http'. One of '{"http://
www.springframework.org/schema/beans":description, "http://www.springframework.org/schema/beans":import,
"http://www.springframework.org/schema/beans":alias, "http://www.springframework.org/schema/beans":bean,
WC[##other:"http://www.springframework.org/schema/beans"], "http://www.springframework.org/schema/
beans":beans}' is expected.


The reason though is absolutely clear. It means in the namespace "http://www.springframework.org/schema/beans" (as it is prefixed by beans as well as being the default namespace in your spring-security.xml), under the root beans only description, import, alias, bean or some element other than that in the same namespace are allowed. Now your xml has http, ... under it. Consequently, it is not an valid xml. You can deduce the reasoning all by looking at the xsd for the beans prefix as documented in the root as well... I won't insist this, it is too cumbersome to explain in prose.

In any case, you might be a bit careless in merging from various sources/tutorials to construct the spring-security.xml. Here are the main errors: the http etc are in fact in the http://.../security rather than in http://.../context namespace !!! Then if you want to spare prefix for the security namespace, you have to make it default rather than keeping the beans namespace as default. Third, the location of the security xsd is wrong and furthermore the version maybe as well.

Brief, thses are the corrections which probably make it work already, if not, the remaining correction should be related to finer behaviours sought after, such as this rather that etc. Whereas you may or may not want to have a lower version than 4.0 (such as 3.2, or 3.1 or 3.0.3 ... according to your need). Anything else is kind of detail.

 
That feels good. Thanks. Here's a tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic