Re: wicket-atmosphere NullPointerException at initialization
You will need the atmosphere.xml, although I don't think you'll get an NPE when that file is missing. The NPE is probably caused by a misconfiguration in your web.xml. As suggested, the examples are a good starting point. The BroadcasterFactory is setup from the init method of the AtmosphereServlet. Perhaps you forgot to add AtmosphereServlet to your web.xml? AtmosphereServlet loads atmosphere.xml, which in turn fires up the WicketFilter. Best regards, Emond Papegaaij On Wednesday 13 June 2012 13:54:54 heapifyman wrote: > I think I had the same problem and was able to overcome it by adding > atmosphere.xml file in src/main/webapp/META-INF and changing the web.xml. > Both I took from the wicket examples. > > atmosphere.xml looks like this: > > class-name="org.atmosphere.handler.ReflectorServletProcessor"> > value="org.apache.wicket.protocol.http.WicketFilter" /> > > > > web.xml defines atmosphere servlet instead of default wicket filter: > > AtmosphereApplication > org.atmosphere.cpr.AtmosphereServlet > > applicationClassName > org.heapifyman.wicketatmospheretest.AtmosphereApplication m-value> > > org.atmosphere.useWebSocket > true > > > org.atmosphere.useNative > true > > > org.atmosphere.cpr.CometSupport.maxInactiveActivity > 3 > > > filterMappingUrlPattern > /atmo/* > > > org.atmosphere.websocket.WebSocketProtocol > org.atmosphere.websocket.protocol.EchoProtocol > > 1 > > > > AtmosphereApplication > /atmo/* > > > > 2012/6/13 Martin Grigorov > > > Hi, > > > > Check what is different between your web.xml and atmosphere.xml and > > the ones in wicket-examples.war. > > > > The NPE is caused by not set org.atmosphere.cpr.BroadcasterFactory but > > I'm not sure what exactly setups it. > > > > On Wed, Jun 13, 2012 at 11:29 AM, theAnthony > > > > wrote: > > > Hi, > > > > > > I wanted to play around with wicket 6.0.0-beta2 and wicket-atmosphere, I > > > created a quickstart created a simple page which would display a number > > > > and > > > > > that number would come from a simple bean with a method scheduled to be > > > executed every X seconds which would push the new value to the EventBus. > > > > But > > > > > at initialization of the application, I get a NullPointerException in > > > the > > > EventBus. > > > > > > So I went back to the quickstart and made it as simple as possible. Just > > > initializing the EventBus: > > > > > > mvn archetype:generate -DarchetypeGroupId=org.apache.wicket > > > -DarchetypeArtifactId=wicket-archetype-quickstart > > > -DarchetypeVersion=6.0.0-beta2 -DgroupId=com.company.ecom > > > -DartifactId=emm-client-push2 > > > -DarchetypeRepository=https://repository.apache.org/-DinteractiveMode=fa > > > lse > > > > > > Once created, I added the dependency in the pom file: > > > > > > > > > > > >org.apache.wicket > > >wicket-atmosphere > > >0.1 > > > > > > > > > > > > And finally modified init method of the WicketApplication class: > > >public void init() > > >{ > > > > > >super.init(); > > > > > >// add your configuration here > > >new EventBus(this); > > > > > >} > > > > > > And when I launch the Start.java, here is the exception > > > WARN - AbstractLifeCycle - FAILED wicket.emm-client-push2: > > > java.lang.NullPointerException > > > java.lang.NullPointerException > > > > > >at org.apache.wicket.atmosphere.EventBus.(EventBus.java:85) > > >at > > >com.bnpp.ecom.WicketApplication.init(WicketApplication.java:31) > > >at > > > > org.apache.wicket.Application.initApplication(Application.java:814) > > > > >at > > > > org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:379) > > > > >at > > > > org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:314) > > > > >at > > > > org.eclipse.jetty.servlet.FilterHolder.doStart(FilterHolder.java:102) > > > > >at > > > > org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle > > .java:59)> > > >at > > > > org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:74 > > 8)> > > >at > > > > org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContex > > tHandler.java:249)> > > >at > > > > org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:122 > > 2)> > > >at > > > > org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.jav > > a:676)> > > >at > > > > org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:455) > > > > >at > > > > org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle > > .java:59)> > > >at > > > > org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.jav > > a:90)> > > >at org.eclipse.jetty.server.Server.doStart(Server.java:260) > >
Re: wicket-atmosphere NullPointerException at initialization
I think I had the same problem and was able to overcome it by adding atmosphere.xml file in src/main/webapp/META-INF and changing the web.xml. Both I took from the wicket examples. atmosphere.xml looks like this: web.xml defines atmosphere servlet instead of default wicket filter: AtmosphereApplication org.atmosphere.cpr.AtmosphereServlet applicationClassName org.heapifyman.wicketatmospheretest.AtmosphereApplication org.atmosphere.useWebSocket true org.atmosphere.useNative true org.atmosphere.cpr.CometSupport.maxInactiveActivity 3 filterMappingUrlPattern /atmo/* org.atmosphere.websocket.WebSocketProtocol org.atmosphere.websocket.protocol.EchoProtocol 1 AtmosphereApplication /atmo/* 2012/6/13 Martin Grigorov > Hi, > > Check what is different between your web.xml and atmosphere.xml and > the ones in wicket-examples.war. > > The NPE is caused by not set org.atmosphere.cpr.BroadcasterFactory but > I'm not sure what exactly setups it. > > On Wed, Jun 13, 2012 at 11:29 AM, theAnthony > wrote: > > Hi, > > > > I wanted to play around with wicket 6.0.0-beta2 and wicket-atmosphere, I > > created a quickstart created a simple page which would display a number > and > > that number would come from a simple bean with a method scheduled to be > > executed every X seconds which would push the new value to the EventBus. > But > > at initialization of the application, I get a NullPointerException in the > > EventBus. > > > > So I went back to the quickstart and made it as simple as possible. Just > > initializing the EventBus: > > > > mvn archetype:generate -DarchetypeGroupId=org.apache.wicket > > -DarchetypeArtifactId=wicket-archetype-quickstart > > -DarchetypeVersion=6.0.0-beta2 -DgroupId=com.company.ecom > > -DartifactId=emm-client-push2 > > -DarchetypeRepository=https://repository.apache.org/-DinteractiveMode=false > > > > Once created, I added the dependency in the pom file: > > > > > >org.apache.wicket > >wicket-atmosphere > >0.1 > > > > > > And finally modified init method of the WicketApplication class: > > > >public void init() > >{ > >super.init(); > > > >// add your configuration here > >new EventBus(this); > >} > > > > And when I launch the Start.java, here is the exception > > WARN - AbstractLifeCycle - FAILED wicket.emm-client-push2: > > java.lang.NullPointerException > > java.lang.NullPointerException > >at org.apache.wicket.atmosphere.EventBus.(EventBus.java:85) > >at com.bnpp.ecom.WicketApplication.init(WicketApplication.java:31) > >at > org.apache.wicket.Application.initApplication(Application.java:814) > >at > org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:379) > >at > org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:314) > >at > org.eclipse.jetty.servlet.FilterHolder.doStart(FilterHolder.java:102) > >at > > > org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59) > >at > > > org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:748) > >at > > > org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:249) > >at > > > org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1222) > >at > > > org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:676) > >at > org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:455) > >at > > > org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59) > >at > > > org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:90) > > at org.eclipse.jetty.server.Server.doStart(Server.java:260) > >at > > > org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59) > >at com.company.ecom.Start.main(Start.java:66) > > > > I think I followed the instructions from the release note so I don't > > understand what I'm missing. Any clue ? > > > > Cheers > > > > -- > > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/wicket-atmosphere-NullPointerException-at-initialization-tp4649917.html > > Sent from the Users forum mailing list archive at Nabble.com. > > > > - > > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > > For additional commands, e-mail: users-h...@wicket.apache.org > > > > > > -- > Martin Grigorov > jWeekend > Training, Consulting, Development > http://jWeekend.com > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >
Re: wicket-atmosphere NullPointerException at initialization
Hi, Check what is different between your web.xml and atmosphere.xml and the ones in wicket-examples.war. The NPE is caused by not set org.atmosphere.cpr.BroadcasterFactory but I'm not sure what exactly setups it. On Wed, Jun 13, 2012 at 11:29 AM, theAnthony wrote: > Hi, > > I wanted to play around with wicket 6.0.0-beta2 and wicket-atmosphere, I > created a quickstart created a simple page which would display a number and > that number would come from a simple bean with a method scheduled to be > executed every X seconds which would push the new value to the EventBus. But > at initialization of the application, I get a NullPointerException in the > EventBus. > > So I went back to the quickstart and made it as simple as possible. Just > initializing the EventBus: > > mvn archetype:generate -DarchetypeGroupId=org.apache.wicket > -DarchetypeArtifactId=wicket-archetype-quickstart > -DarchetypeVersion=6.0.0-beta2 -DgroupId=com.company.ecom > -DartifactId=emm-client-push2 > -DarchetypeRepository=https://repository.apache.org/ -DinteractiveMode=false > > Once created, I added the dependency in the pom file: > > > org.apache.wicket > wicket-atmosphere > 0.1 > > > And finally modified init method of the WicketApplication class: > > public void init() > { > super.init(); > > // add your configuration here > new EventBus(this); > } > > And when I launch the Start.java, here is the exception > WARN - AbstractLifeCycle - FAILED wicket.emm-client-push2: > java.lang.NullPointerException > java.lang.NullPointerException > at org.apache.wicket.atmosphere.EventBus.(EventBus.java:85) > at com.bnpp.ecom.WicketApplication.init(WicketApplication.java:31) > at org.apache.wicket.Application.initApplication(Application.java:814) > at > org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:379) > at > org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:314) > at > org.eclipse.jetty.servlet.FilterHolder.doStart(FilterHolder.java:102) > at > org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59) > at > org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:748) > at > org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:249) > at > org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1222) > at > org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:676) > at > org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:455) > at > org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59) > at > org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:90) > at org.eclipse.jetty.server.Server.doStart(Server.java:260) > at > org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59) > at com.company.ecom.Start.main(Start.java:66) > > I think I followed the instructions from the release note so I don't > understand what I'm missing. Any clue ? > > Cheers > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/wicket-atmosphere-NullPointerException-at-initialization-tp4649917.html > Sent from the Users forum mailing list archive at Nabble.com. > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
wicket-atmosphere NullPointerException at initialization
Hi, I wanted to play around with wicket 6.0.0-beta2 and wicket-atmosphere, I created a quickstart created a simple page which would display a number and that number would come from a simple bean with a method scheduled to be executed every X seconds which would push the new value to the EventBus. But at initialization of the application, I get a NullPointerException in the EventBus. So I went back to the quickstart and made it as simple as possible. Just initializing the EventBus: mvn archetype:generate -DarchetypeGroupId=org.apache.wicket -DarchetypeArtifactId=wicket-archetype-quickstart -DarchetypeVersion=6.0.0-beta2 -DgroupId=com.company.ecom -DartifactId=emm-client-push2 -DarchetypeRepository=https://repository.apache.org/ -DinteractiveMode=false Once created, I added the dependency in the pom file: org.apache.wicket wicket-atmosphere 0.1 And finally modified init method of the WicketApplication class: public void init() { super.init(); // add your configuration here new EventBus(this); } And when I launch the Start.java, here is the exception WARN - AbstractLifeCycle - FAILED wicket.emm-client-push2: java.lang.NullPointerException java.lang.NullPointerException at org.apache.wicket.atmosphere.EventBus.(EventBus.java:85) at com.bnpp.ecom.WicketApplication.init(WicketApplication.java:31) at org.apache.wicket.Application.initApplication(Application.java:814) at org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:379) at org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:314) at org.eclipse.jetty.servlet.FilterHolder.doStart(FilterHolder.java:102) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59) at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:748) at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:249) at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1222) at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:676) at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:455) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59) at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:90) at org.eclipse.jetty.server.Server.doStart(Server.java:260) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59) at com.company.ecom.Start.main(Start.java:66) I think I followed the instructions from the release note so I don't understand what I'm missing. Any clue ? Cheers -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/wicket-atmosphere-NullPointerException-at-initialization-tp4649917.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org