Autowiring fails: Not an managed Type

前端 未结 13 1970
清酒与你
清酒与你 2020-12-02 12:30

I have a big problem in my diploma project and would be very glad if you guys could help me! I made a Maven Multi Module Project and have 3 \"Core-projects\"

  • <
相关标签:
13条回答
  • 2020-12-02 13:09

    I got an very helpful advice from Oliver Gierke:

    The last exception you get actually indicates a problem with your JPA setup. "Not a managed bean" means not a type the JPA provider is aware of. If you're setting up a Spring based JPA application I'd recommend to configure the "packagesToScan" property on the LocalContainerEntityManagerFactory you have configured to the package that contains your JPA entities. Alternatively you can list all your entity classes in persistence.xml, but that's usually more cumbersome.

    The former error you got (NoClassDefFound) indicates the class mentioned is not available on the projects classpath. So you might wanna check the inter module dependencies you have. As the two relevant classes seem to be located in the same module it might also just be an issue with an incomplete deployment to Tomcat (WTP is kind of bitchy sometimes). I'd definitely recommend to run a test for verification (as you already did). As this seems to lead you to a different exception, I guess it's really some Eclipse glitch

    Thanks!

    0 讨论(0)
提交回复
热议问题