• 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
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

Old 1.x 'singleton' attribute in use - upgrade to 'scope' declaration

 
Ranch Hand
Posts: 91
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear all,

I upgrade the web project from JDK 1.5 to JDK 1.7.
It show some compile errors as below:
Old 1.x 'singleton' attribute in use - upgrade to 'scope' declaration



I searched in the web and find https://stackoverflow.com/questions/28262225/configuration-issue-during-spring-upgrade.
But it said scope="singleton". But in my case, it is false.
what should be scope="xxxxx"?
or ignore it??

Please help

Capture.PNG
[Thumbnail for Capture.PNG]
 
Saloon Keeper
Posts: 14682
330
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here's a list of available bean scopes: https://docs.spring.io/spring/docs/5.0.1.RELEASE/spring-framework-reference/core.html#beans-factory-scopes

You have to select the one that matches your use case. If it's not singleton, then most of the time it's request.
 
Bartender
Posts: 1108
19
Mac OS X IntelliJ IDE Oracle Spring VI Editor 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
Singleton is the default scope, the alternative would be a prototype.   The others are really for web-based application development.

Here's some old documentation showing how it used to be done in XML --> Spring Bean Scope
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic