title: Starting Wicket web application with OSGi HTTP Service
body: <p>I'm trying to start a Wicket Application using Felix implementation of OSGi HTTP service, for that I just register the service using <code>WicketServlet</code> with <code>applicationClassName</code> parameter:</p>
  
  <pre><code>props.put("applicationClassName", MainApplication.class.getName());
  service = (HttpService)context.getService(httpReference);
  service.registerServlet("/", new WicketServlet(), props, null);
  </code></pre>
  
  <p>I have also tried using Felix Whiteboard implementation and registering the web service as a <code>Servlet</code> one:</p>
  
  <pre><code>props.put("alias", "/");
  props.put("init.applicationClassName", MainApplication.class.getName());
  registration = context.registerService(Servlet.class.getName(), new WicketServlet(), props);
  </code></pre>
  
  <p>In both cases it fails when I deploy it using Pax Runner and Felix (<code>mvn package install pax:run -Dframework=felix -Dprofiles=log,config</code>), the exception seems to be related with the <code>ClassLoader</code>:</p>
  
  <pre><code>[Jetty HTTP Service] ERROR org.apache.felix.http.whiteboard - Failed to register servlet
  org.apache.wicket.WicketRuntimeException: Unable to create application of class es.warp.sample.HTTPLocalGUI.MainApplication
  ....
  ....
  at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
  at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
  at java.lang.Class.forName0(Native Method)
  at java.lang.Class.forName(Class.java:247)
  ....
  ....
  </code></pre>
  
  <p>I have tried to export everything in the bundle and it does the same.</p>
  
  <p>The strangest thing is that it works perfectly if I deploy it using Equinox (<code>mvn package install pax:run -Dframework=felix -Dprofiles=log,config</code>).</p>
  
  <p>It seems to be a visibilty issue, but I don't know how to fix it, am I doing something wrong? Should I try to extend <code>WicketServlet</code> to take control on the instantiation of the application? Or maybe using an application Factory?</p>
  
  <p><strong>Update: Or maybe using an application Factory?</strong></p>
  
  <p>I tried to set the parameter <code>applicationFactoryClassName</code> to <code>ContextParamWebApplicationFactory.class.getName()</code> it and didn't help, still failing with felix and working with equinox.</p>
  
  <p>Any light is welcomed.</p>