Why is the autodetect option not available to me?

I am trying to use autowire = "autodetect" ..

In the eclipse clause, the clause does not show me autodetection as a parameter. But it shows other values ​​like byname, bytype, constructor ..

what is missing in my application?

+4
source share
2 answers

He does not offer you autodetect, because (according to the documentation ) is autodetectnot an option. Valid byName, byTypeamd constructor.

, . @Autowired @Inject - . .

update: autodetect Spring 3.x, . (. javadoc), , , .

+5

.

Spring Framework 4.1.6 :

Caused by: org.xml.sax.SAXParseException; lineNumber: 7; columnNumber: 83; cvc-enumeration-valid: Value 'autodetect' is not facet-valid with respect to enumeration '[default, no, byName, byType, constructor]'. It must be a value from the enumeration.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)

, autowire , .. [default, no, byName, byType, constructor]

0

Source: https://habr.com/ru/post/1761157/


All Articles