You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Jaime Soriano Pastor <js...@gmail.com> on 2010/03/18 15:01:23 UTC

Registering a Wicket Application using OSGi HTTP service

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-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Registering a Wicket Application using OSGi HTTP service

Posted by Jaime Soriano Pastor <js...@gmail.com>.
Hi,

On Thu, Mar 18, 2010 at 9:12 PM, Ernesto Reinaldo Barreiro
<re...@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-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Registering a Wicket Application using OSGi HTTP service

Posted by Ernesto Reinaldo Barreiro <re...@gmail.com>.
Hi,

That's weird. Did you tried to check-out [1] and  [2]? They did work a
couple of month ago when I tested them.

Ernesto

References,

1-http://code.google.com/p/antilia/source/browse/#svn/com.antilia.wstarter
2-
http://code.google.com/p/antilia/source/browse/#svn/com.antilia.wstarter.demo






On Thu, Mar 18, 2010 at 5:45 PM, Jaime Soriano Pastor <
jsorianopastor@gmail.com> wrote:

> Hi,
>
> On Thu, Mar 18, 2010 at 3:58 PM, Fernando Wermus
> <fe...@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 <
> > jsorianopastor@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-unsubscribe@wicket.apache.org
> >> For additional commands, e-mail: users-help@wicket.apache.org
> >>
> >>
> >
> >
> > --
> > Fernando Wermus.
> >
> > www.linkedin.com/in/fernandowermus
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Registering a Wicket Application using OSGi HTTP service

Posted by Jaime Soriano Pastor <js...@gmail.com>.
Hi,

On Thu, Mar 18, 2010 at 3:58 PM, Fernando Wermus
<fe...@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 <
> jsorianopastor@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-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
>
> --
> Fernando Wermus.
>
> www.linkedin.com/in/fernandowermus
>

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


Re: Registering a Wicket Application using OSGi HTTP service

Posted by Fernando Wermus <fe...@gmail.com>.
Take a look at Antilia

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

On Thu, Mar 18, 2010 at 12:01 PM, Jaime Soriano Pastor <
jsorianopastor@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-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Fernando Wermus.

www.linkedin.com/in/fernandowermus