Yeah, weekends, it seams you always hit me, when I'm not in front of an pc... The documentation is for 0.8 master and not for the 0.7 release :( while 0.8 is coming with a bundle listener you habe to register services for classloading, injection and mounting manually :(
https://github.com/openengsb/openengsb/blob/master/ui/common/src/main/resources/META-INF/spring/wicket-context.xml May give a good example for that. Kind regards, Andreas On Aug 7, 2011 2:15 PM, "RainerW" <[email protected]> wrote: > Got a running SpringDM with pax-wicket 0.7.2. > > BundleA exports a VotingService. BundleB (wicket) via a plain Service > can use that service -> so SpringDM works. > > In my OverviewPage (BundleB) i added an AjaxFallback Link which calls a > service-method. > > but when the services ping() method got called, a NPE occurs: > > java.lang.NullPointerException > at > org.ops4j.pax.wicket.util.proxy.LazyInitProxyFactory$JdkHandler.invoke(LazyInitProxyFactory.java:233) > at org.ops4j.pax.wicket.util.proxy.$Proxy17.ping(Unknown Source) > at de.bitnoise.konferenz.web.OverviewPage$1.onClick(OverviewPage.java:98) > at > org.apache.wicket.ajax.markup.html.AjaxFallbackLink$1.onEvent(AjaxFallbackLink.java:73) > > > Where OverviewPage.java:98 is: > > String result = ref1.ping("call0"); > > where ref1 is : > > @PaxWicketBean > ExampleService ref1; > > ExampleService is actually a service inside the same bundle. But the > same error occurs with the VotingService from the other bundle. > > i'm a little bit confused by the Documentation: > http://team.ops4j.org/wiki/display/paxwicket/Injection+%28Quick%29 > > it say's : > "Injection is always local. Components in Bundle A can only receive > beans available in Bundle A's application context" > > Where some lines below : > > "As you might guess already it does not have to be a classic bean only > but could also be a <reference> or a <list> or any other named entity in > SpringDM or Blueprint." -> Which would be a not local bean!??? > > Anyway. The Bean in my case ( ExampleService ) is local + exported as > service, but it's still a local bean. > > At the moment i think pax-wicket doesn't know the correct Spring > context. Is there someway to register the Spring context? > > PS: > For completeness, there is no BundelActivator. I use a Spring > postConstruct to register the wicket app: > > @PostConstruct > public void init() > { > System.out.println("##### Start " + bc); > String mountPoint = "deptStore"; > String applicationName = "departmentstore"; > store = new RootContentAggregator(bc, applicationName, "swp"); > store.register(); > > overviewPageFactory = new OverviewPageFactory(bc, store, > applicationName, > "overview"); > overviewPageFactory.register(); > > PaxWicketApplicationFactory applicationFactory = new > PaxWicketApplicationFactory( > bc, OverviewPage.class, mountPoint, applicationName); > > // This registers the pax-wicket service as OSGi Service. > serviceRegistration = applicationFactory.register(); > System.out.println("##### DONE"); > } > > > create via : > > <beans:bean class="de.bitnoise.konferenz.web.internal.MyAppFactory" > init-method="init"/> > > > Cheers Rainer > > > _______________________________________________ > general mailing list > [email protected] > http://lists.ops4j.org/mailman/listinfo/general
_______________________________________________ general mailing list [email protected] http://lists.ops4j.org/mailman/listinfo/general
