Registering a Wicket Application using OSGi HTTP service

2010-03-18 Thread Jaime Soriano Pastor
Hello,

I'm trying to start a Wicket Application using Felix implementation of
OSGi HTTP service, for that I just register the service using
WicketServlet with applicationClassName parameter set to the main
application class name:

props.put(applicationClassName, MainApplication.class.getName());
service = (HttpService)context.getService(httpReference);
service.registerServlet(/, new WicketServlet(), props, null);

But it fails to register saying that wicket is Unable to create
application of class es.warp.sample.HTTPLocalGUI.MainApplication.
The output error also includes some lines about class loader so I
thought it was something related with visibility. I tried to export
everything but I had the same failure.


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)



I use for deployment maven and pax runner with Felix framework (mvn
package install pax:run -Dframework=felix -Dprofiles=log,config).
If I use equinox instead of felix, the application is registered and
works perfectly, it's ok for development, but I need it working on
felix for production deployment.

I'm thinking that I'm not doing it on the right way, but I don't know
how to do it. I also tried to publish the servlet using Felix
Whiteboard service, and I had the same results, it worked when I used
equinox and it didn't work when I used felix.

What am I doing wrong?


Regards,

Jaime.

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



Re: Registering a Wicket Application using OSGi HTTP service

2010-03-18 Thread Jaime Soriano Pastor
Hi,

On Thu, Mar 18, 2010 at 3:58 PM, Fernando Wermus
fernando.wer...@gmail.com wrote:
 Take a look at Antilia

 http://code.google.com/p/antilia/

Thanks for the suggestion, Antilia seems to be a really interesting
project, but it didn't solve my problem :(

What I tried was to create a new Activator (AntiliaActivator) that
extends WicketServletServiceActivator and implements BundleActivator.
AntiliaActivator getApplicationClass() returns
AntiliaMainApplication.class that extends AntiliaWebApplication that
returns the MainPage class as Home Page.

The new thing is that this solution also fails with Equinox, with a
similar exception.

Regards,

Jaime.

 On Thu, Mar 18, 2010 at 12:01 PM, Jaime Soriano Pastor 
 jsorianopas...@gmail.com wrote:

 Hello,

 I'm trying to start a Wicket Application using Felix implementation of
 OSGi HTTP service, for that I just register the service using
 WicketServlet with applicationClassName parameter set to the main
 application class name:

 props.put(applicationClassName, MainApplication.class.getName());
 service = (HttpService)context.getService(httpReference);
 service.registerServlet(/, new WicketServlet(), props, null);

 But it fails to register saying that wicket is Unable to create
 application of class es.warp.sample.HTTPLocalGUI.MainApplication.
 The output error also includes some lines about class loader so I
 thought it was something related with visibility. I tried to export
 everything but I had the same failure.
 
 
 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)
 
 

 I use for deployment maven and pax runner with Felix framework (mvn
 package install pax:run -Dframework=felix -Dprofiles=log,config).
 If I use equinox instead of felix, the application is registered and
 works perfectly, it's ok for development, but I need it working on
 felix for production deployment.

 I'm thinking that I'm not doing it on the right way, but I don't know
 how to do it. I also tried to publish the servlet using Felix
 Whiteboard service, and I had the same results, it worked when I used
 equinox and it didn't work when I used felix.

 What am I doing wrong?


 Regards,

 Jaime.

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




 --
 Fernando Wermus.

 www.linkedin.com/in/fernandowermus


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



Re: Registering a Wicket Application using OSGi HTTP service

2010-03-22 Thread Jaime Soriano Pastor
Hi,

On Thu, Mar 18, 2010 at 9:12 PM, Ernesto Reinaldo Barreiro
reier...@gmail.com wrote:
 That's weird. Did you tried to check-out [1] and  [2]? They did work a
 couple of month ago when I tested them.

Don't worry, it wasn't an Antilia problem :)

I finally fixed it, the answer in StackOverflow:
http://stackoverflow.com/questions/2432263/starting-wicket-web-application-with-osgi-http-service/2473878#2473878

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



Static files with Wicket and OSGi

2010-03-24 Thread Jaime Soriano Pastor
Hi,

I register a wicket application in an OSGi http service using for that
a WicketServlet with applicationClassName set to the name of my main
application class. My problem now is that I don't know how to serve
static files as CSS and so.
Is there any place used by default to contain the static files?
Could I mount a directory as a resource? How?
Or should I configure the resource locator in some way?

Many thanks in advance.


Jaime.

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



Re: Static files with Wicket and OSGi

2010-03-24 Thread Jaime Soriano Pastor
On Wed, Mar 24, 2010 at 12:57 PM, Ernesto Reinaldo Barreiro
reier...@gmail.com wrote:
 *document root* on an OSGI environment?

Yes, it's what I was just trying and it worked :)

Many thanks!

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



Re: Static files with Wicket and OSGi

2010-03-24 Thread Jaime Soriano Pastor
On Wed, Mar 24, 2010 at 1:05 PM, Ernesto Reinaldo Barreiro
reier...@gmail.com wrote:
 Are you using bridge servlet approach?

I don't think so... Is it needed to have several Servlets? I have only one.
What I do is to launch Apache Felix Http Jetty as implementation of
the OSGi HTTP service and register the wicket servlet from the
Activator on / using Apache Felix Http Whiteboard.

 On Wed, Mar 24, 2010 at 12:57 PM, Ernesto Reinaldo Barreiro
 reier...@gmail.com wrote:
  *document root* on an OSGI environment?
 
 Yes, it's what I was just trying and it worked :)

And.. I have just discovered that I can download any file in the
bundle (including .htmls, .classes...) as well as I can download the
CSSs...

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



Re: Static files with Wicket and OSGi

2010-03-24 Thread Jaime Soriano Pastor
Weird, I have also tried to register the application on /foo instead
of on / and, as you said, I cannot access to static files.
I haven't seen anything special about root alias on OSGi specification
(only that is the only alias allowed to end with /)

Jaime.

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



Re: Static files with Wicket and OSGi

2010-03-24 Thread Jaime Soriano Pastor
On Wed, Mar 24, 2010 at 3:08 PM, Ernesto Reinaldo Barreiro
reier...@gmail.com wrote:
 Haven't had time to check the specification but this behavior (mounting on
 /) might pose a security risk as you can fetch invisible things form the
 class path (e.g. configuration files containing sensitive information like
 passwords). On the other hand I see HttpService class has a
 registerResources method you could use to register static resources. Maybe
 that is the one you need?

I'm using Whiteboard to register the application, so I don't have
access to the HttpService, I have discovered that Pax implementation
of whiteboard [0] can also publish resources, so I can use that to
control where I publish the static content. Anyway I'd still have the
security risk if I register the application in /.

[0] - Pax Whiteboard Extender -
http://wiki.ops4j.org/display/paxweb/Whiteboard+Extender

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