Skip to main content

glassfishv3+apache felix+jaxws+spring

7 replies [Last post]
carloliwanag
Offline
Joined: 2010-03-15

Hi All,

I have a project that requires these technologies. I am very new to java web but I have been building applications using the j2se. I have made some tutorials in spring+glasshfish+jaxws and it was very helpful for me. This is wiring the web services using spring. I have also made some osgi using pojo and the apache felix.

I was thinking if it's possible to put all my business logic as osgi bundles, put in all in the apache felix which is inside glassfish. These bundles should be accessible for the web services through spring.
Is this possible?

Thanks

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Sahoo

It is not clear what role Spring plays in your case. Can you elaborate?
You can definitely deploy web services as OSGi bundles.

Thanks,
Sahoo

glassfish@javadesktop.org wrote:
> Hi All,
>
> I have a project that requires these technologies. I am very new to java web but I have been building applications using the j2se. I have made some tutorials in spring+glasshfish+jaxws and it was very helpful for me. This is wiring the web services using spring. I have also made some osgi using pojo and the apache felix.
>
> I was thinking if it's possible to put all my business logic as osgi bundles, put in all in the apache felix which is inside glassfish. These bundles should be accessible for the web services through spring.
> Is this possible?
>
> Thanks
> [Message sent by forum member 'carloliwanag']
>
> http://forums.java.net/jive/thread.jspa?messageID=395401
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

carloliwanag
Offline
Joined: 2010-03-15

Hi Sahoo,

Thanks for the reply.

I would like Spring to wire my webservice (kindly refer to my configuration, applicationContext.xml).
These configurations wire the beans fine but do not initialize the beans. So whenever I try to invoke the web method, the runnable bean does not run.

Am I in the wrong direction for using spring for wiring the classes?

As for the osgi bundles, I was hoping I can "get bean" from a factory from the apache felix to be used by my web service.

(Sorry if I not able to say it as clearly as it should be :) )

Thanks,

Sahoo

No, I am not able to follow you. AFAIK, in Java EE, you can either
develop an EJB or Servlet based web service end point. Now, there is a
third option: which is JAX-RS. When you designate your Java class with
one of those component types, an appropriate container manages their
life cycle and hence will perform necessary dependency management. So
far, I don't see any need for Spring. You can then package the
components into an archive (e.g., a war file) and deploy it. If you add
necessary OSGi metadata, then you can deploy as an OSGi bundle.

Thanks,
Sahoo

glassfish@javadesktop.org wrote:
> Hi Sahoo,
>
> Thanks for the reply.
>
> I would like Spring to wire my webservice (kindly refer to my configuration, applicationContext.xml).
> These configurations wire the beans fine but do not initialize the beans. So whenever I try to invoke the web method, the runnable bean does not run.
>
> Am I in the wrong direction for using spring for wiring the classes?
>
> As for the osgi bundles, I was hoping I can "get bean" from a factory from the apache felix to be used by my web service.
>
> (Sorry if I not able to say it as clearly as it should be :) )
>
> Thanks,
> [Message sent by forum member 'carloliwanag']
>
> http://forums.java.net/jive/thread.jspa?messageID=395438
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

carloliwanag
Offline
Joined: 2010-03-15

I'll try again. =)
I have a business rule (e.g "return subscriber info") and I want it as a bundle installed in apache felix inside gfv3.Now, the client of this bundle will be a web service. A plain java class that has an annotation @WebService @WebMethod. So technically, I will be building two files, the jar for the bundle and the war for the web service. The question now is how will I able to reference the bundle in my web service? =)

thanks

Sahoo

Hi,

Perfect. This time your explanation is very easy to follow. I have put
together an example exactly for this scenario. Please look at [1]. In a
nut shell, if you deploy the war as an OSGi bundle, then you can
reference the service interface exported by your first OSGi bundle via
normal OSGi import-package mechanism. Hope this helps,

Thanks,
Sahoo

[1]
http://www.java.net/blog/ss141213/archive/2010/04/08/jax-ws-web-service-...

glassfish@javadesktop.org wrote:
> I'll try again. =)
> I have a business rule (e.g "return subscriber info") and I want it as a bundle installed in apache felix inside gfv3.Now, the client of this bundle will be a web service. A plain java class that has an annotation @WebService @WebMethod. So technically, I will be building two files, the jar for the bundle and the war for the web service. The question now is how will I able to reference the bundle in my web service? =)
>
> thanks
> [Message sent by forum member 'carloliwanag']
>
> http://forums.java.net/jive/thread.jspa?messageID=395807
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

carloliwanag
Offline
Joined: 2010-03-15

Thanks, sahoo
I'll check it out for sure.

Thanks again.

carloliwanag
Offline
Joined: 2010-03-15

Hi Sahoo,
Your post have been very helpful to me. :)

Thanks a lot.