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:
> <atmosphere-handlers>
> <atmosphere-handler context-root="/*"
> class-name="org.atmosphere.handler.ReflectorServletProcessor">
> <property name="filterClassName"
> value="org.apache.wicket.protocol.http.WicketFilter" />
> </atmosphere-handler>
> </atmosphere-handlers>
> 
> web.xml defines atmosphere servlet instead of default wicket filter:
> <servlet>
> <servlet-name>AtmosphereApplication</servlet-name>
> <servlet-class>org.atmosphere.cpr.AtmosphereServlet</servlet-class>
> <init-param>
> <param-name>applicationClassName</param-name>
> <param-value>org.heapifyman.wicketatmospheretest.AtmosphereApplication</para
> m-value> </init-param>
> <init-param>
> <param-name>org.atmosphere.useWebSocket</param-name>
> <param-value>true</param-value>
> </init-param>
> <init-param>
> <param-name>org.atmosphere.useNative</param-name>
> <param-value>true</param-value>
> </init-param>
> <init-param>
> <param-name>org.atmosphere.cpr.CometSupport.maxInactiveActivity</param-name>
> <param-value>30000</param-value>
> </init-param>
> <init-param>
> <param-name>filterMappingUrlPattern</param-name>
> <param-value>/atmo/*</param-value>
> </init-param>
> <init-param>
> <param-name>org.atmosphere.websocket.WebSocketProtocol</param-name>
> <param-value>org.atmosphere.websocket.protocol.EchoProtocol</param-value>
> </init-param>
> <load-on-startup>1</load-on-startup>
> </servlet>
> 
> <servlet-mapping>
> <servlet-name>AtmosphereApplication</servlet-name>
> <url-pattern>/atmo/*</url-pattern>
> </servlet-mapping>
> 
> 
> 2012/6/13 Martin Grigorov <mgrigo...@apache.org>
> 
> > 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 <anthony.ric...@gmail.com>
> > 
> > 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:
> > > 
> > > <dependency>
> > > 
> > >        <groupId>org.apache.wicket</groupId>
> > >        <artifactId>wicket-atmosphere</artifactId>
> > >        <version>0.1</version>
> > > 
> > > </dependency>
> > > 
> > > 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.<init>(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)
> > >        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-NullPointerEx
> > ception-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

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to