RE: Re: Struts 2.5.x to 6.4.0
John Wilson <[email protected]> Mon, 27 Jan 2025 08:53:15 -0500
| Newsgroups | gmane.comp.jakarta.struts.user |
|---|---|
| Message-ID | <CAOqZQta9EFiFccSXNPjK_JnWMPOQfKZ+QK=GAb57hs9VkB+RMQ@mail.gmail.com> |
Yes. It should be using Spring to inject it as it did on 2.5.33. We have the struts2-spring-plugin which my understanding sets the object factory in the web.xml to spring. On 2025/01/26 06:29:29 Lukasz Lenart wrote: > czw., 23 sty 2025 o 17:51 jw1474674 <[email protected]> napisał(a): > > Hi, I’m facing issues upgrading struts versions. > > In particular with a custom StrutsTypeConverter. > > > > The custom converter has a @PersistenceContext annotation for the > > EntityManager which used to work. > > > > The entityManager is used to find class types for conversion. > > > > But now I am getting an NPE in the overridden convertFromString as the > > entityManager is null, ie isn’t being injected. > > > > I’ve tried different ways of injecting the entityManager, field injections > > constructor injection. Autowired, etc, but none of the injections seem to > > work here anymore. > > > > The @PersistenceContext annotation is working elsewhere to inject the > > entityManager though. > > > > Any help would be appreciated. > > Do you use Spring to inject this? > > > Cheers > Łukasz > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >