Forwarding this to the OS WebWork list. Note: I use Pico integration kit rather than the integration described on OS Wiki at http://wiki.opensymphony.com/space/PicoContainer+Integration
- Vincent > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf Of Vincent > Tence > Sent: Thursday, November 27, 2003 11:45 AM > To: [EMAIL PROTECTED] > Subject: [picocontainer-dev] Pico-WW2/XWork integration generates NPE > > > Hi all, > > I'm trying to use Pico container in a WW2/XWork environment. > > <disclaimer>First experience with both, so I may be facing a trivial > issue</disclaimer> > > I'm getting a NPE in PicoActionInvocation.getParentContainer() because > getStack() happens to return null. > > Here's how I setup my WW2 environment: > > - Added a listener for Pico in web.xml: > <!-- PicoContainer Hook --> > <listener> > > <listener-class>org.picoextras.webwork2.WebWork2ContainerListener< > /listener- > class> > </listener> > > - Replaced default WW2 Servlet Dispatcher in web.xml with: > > <servlet> > <servlet-name>webwork</servlet-name> > <!-- PicoContainer enabled dispatcher --> > > <servlet-class>org.picoextras.webwork2.PicoServletDispatcher</serv > let-class> > </servlet> > > - Defined my ContainerAssembler in web.xml: > > <context-param> > <param-name>assembler</param-name> > <param-value>mypackage.MyContainerAssembler</param-value> > </context-param> > > So far so good, my assembler is called and sets up the > PicoContainer (did it > easy first): > > public void assembleContainer(MutablePicoContainer > mutablePicoContainer, > String string) { > mutablePicoContainer.registerComponentImplementation( > SomeService.class, > SomeServiceImpl.class); > } > > Now my XWork Action depends on SomeService, but can't be instanciated. It > seems that the ognl value stack is not ready when > PicoActionInvocation.getParentContainer() is called, resulting in a NPE. > > I looked briefly at the current DefaultActionInvocation code (in > CVS) and it > looks like createAction() is called at construction time, before the stack > is ready. And PicoActionInvocation uses the stack in createAction(). As I > said, I just starting using both Pico and WW2, so I may be totally > off-track. > > > Anyone experienced the same problem and can help? > > Thanks, > - Vincent > > _______________________________________________ > picocontainer-dev mailing list > [EMAIL PROTECTED] > http://lists.codehaus.org/mailman/listinfo/picocontainer-dev > ------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/ _______________________________________________ Opensymphony-webwork mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork