Thierry Templier

author
+ Follow
since Jan 26, 2010
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Thierry Templier

You're welcome, Johan!

A link to an interview of Adrian Colyer about dm Server and Virgo: http://jaxenter.com/Adrian-Colyer-Why-dm-Server-Is-Moving-To-Eclipse-10106.html. It surely will interest you...

Thierry
14 years ago
We're welcome! Personally I enjoyed doing that
14 years ago
Hi Johann,

Sorry for my late answer! Your question is quite hard to answer . I think using OSGi for applications can scare people since things work a bit differently regarding organizations, classloading and runtime. But this technology allows develop more modular and structured applications and you can benefit of a lightweight service oriented feature and runtime facilities for application administration. Perhaps, one drawback for OSGi use is sometimes the difficulties to identify problems caused by strict classloading...

dm Server tries to address such aspects. I find concepts and implementations of the tool really interesting ... I think the SpringSource label can be a problem to adopters because they probably want tools independent of a company, especially from new concepts like PAR which aren't standardized and part of the JavaEE specification (even if they aim to simply use of OSGi technology)...

A lot of work is done at the moment in order to provide specifications dedicated to enterprise development based on OSGi. I think that creation of Virgo and Gemini projects go in that way...

Hope it answer your question
Thierry
14 years ago
Hello,

The main advantages of using OSGi is component based and service oriented approaches to organize and modularize your applications during development. At this level, Spring DM provides facilities to use Spring within OSGi bundles and to add dynamics within dependency injection. Moreover, at runtime, you don't have conflicts any more between different versions of tools and your application administration is much flexible. No more need to stop the application to update it!

Regarding cool applications, you can find some in the Spring DM distribution and in the source of the book (http://code.google.com/p/springdm-in-action/) . For the later, you can see chapter 6 for application organization, chapter 7 for data access and chapter 8 for Web...

Hope it answers to your questions.
Thierry
14 years ago
Hello,

Regarding OSGi and Eclipse, you can use PDE (Plugin Development Environment) since it provides facilities to develop plugins (which are primarly OSGi bundles). To simplify, an Eclipse plugin is an OSGi bundle with support of extension points. PDE allows develop OSGi bundle by specifying this kind at plugin creation:
"The plugin s targeted to run with:
- an OSGi framework: standard".

Regarding Maven, some tools like felix-bundle-plugin or bundlor allow building OSGi bundle configuration based on the Maven configuration (pom.xml).

Both can be used to develop Spring DM applications / bundles...

Hope it answers your questions.
Thierry
14 years ago
To be honest, I think a book like Spring in action or Spring in practice would better suit you... As matter of fact, Spring DM in action describes how to use this tool in order to develop enterprise applications based on Spring and OSGi. So if you aren't interested in OSGi...
You can also notice that we did reminders (on Spring, OSGi, JPA technology and main Web frameworks) and describe things step by step.

Thierry
14 years ago
Hello,

Regarding your problem, you must be aware of implications of strict classloading of OSGi. As a matter of fact, it isn't sure that Spring bundles can see your classes by default. Since Spring also looks at thread context classloader, you can try to set the classloader of your bundle (this containing your activator) in TCCL. It will solve your problem but I agree with you that it's not easy to diagnose the problem...



If you use Spring DM, the tool will handle all these aspects for you . However, Spring DM doesn't use OSGi activator but the extender pattern to manage Spring powered bundles...

Thierry
14 years ago
Hello Alaa,

Yes, of course, the book describes how to setup these Web containers In fact, there is nothing to do for Tomcat 5.5 except putting corresponding bundles within the OSGi container. In addition, for Tomcat 6 and Jetty, you need to define configuration fragment bundles to configure Tomcat 6 (jsp support...) and select Jetty as used Web container (by default, Tomcat is used).

Thierry
PS: You can notice that the book is already available in a draft version through the MEAP...
14 years ago
Hi David,

We only describe Java based Web frameworks:

- Action-based Web frameworks: Spring MVC
- Component-based Web frameworks: JSF/MyFaces, Wicket
- AJAX frameworks: DWR, GWT
- Web service frameworks: Spring WS, Restlet

Thierry
14 years ago
Hi David,

I'm sorry! I didn't see that your question was related to Spring DM...

Chapter 10, "Advanced concepts", deals with advanced concepts of Spring DM ;-) and shows how to adapt standard behaviours of the framework to your needs. Here is the list of these aspects:

- How to configure components through configuration fragments or with beans
- How to parameterize both standard and Web extenders of Spring DM
- How to configure embedded Web containers
- How Spring DM integrates with Java 2 security and the OSGi security model
- Description of advanced patterns (Implementation provider and chained class loader patterns)

Can you be more explicit on "existing custom classloaders"? As a matter of fact, as you probably know, OSGi has a specific class loader management...

Hope it answers your questions!
Thierry
14 years ago
Hi Vyas,

You're right! When using OSGi, all the needed dependencies must now be present within the OSGi container as components. You can convert classic jar files into bundles (i.e. adding OSGi manifest headers) with tools like Bnd or Bundlor but this task can be tricky. That's why SpringSource provides a repository (http://www.springsource.com/repository) containing a huge set of bundles for enterprise application development with OSGi. When getting all you need, you have to provision your OSGi container with these components. After this first stage done, you can begin to develop your component... with Spring DM or not ;-)

Regarding Tomcat, the approach is similar. As a matter of fact, corresponding components must be added within the container. SpringSource provides such components which simply wrap the standard tool and start/stop it programmatically. Same features of Tomcat are usable! In addition, Spring DM provides a mechanism to manage components containing Web application based on component lifecycle. When a Web component is started, Spring DM deploys it within the Web container (Tomcat or Jetty) and undeploys it when stopped. You can notice that the standization of this mechanim is in progress through the RFC 66 (OSGi Web container).

Whereas it's possible to embed an OSGi container within a Web app, it's recommanded to embed the Web container within an OSGi container...

Thierry

PS: See also the following thread in this forum - https://coderanch.com/t/482120/Spring/Application-Frameworks/Spring-DM-Web-Applications
14 years ago
Hi Anil,

Yes, Spring DM targets OSGi platform only. To simplify, the aim of Spring DM is to leverage Spring facilities to develop OSGi components and make them interact through the OSGi service registry... For that, a dedicated Spring container is embedded in each Spring DM powered component and dependency injection can now be done between components. You are now able to develop same Spring (enterprise or not) applications within an OSGi container ;-)

Otherwise, as David said, the DI is static with Spring only but with Spring DM and OSGi, this behaviour is quite different since you can now update at runtime dependency graphs based on OSGi services. If you inject a service, you can update the dependency at runtime and it's automatically taken into account (internally basing on proxies). Spring DM natively integrates this dynamic behaviour of OSGi...

Hope it answers your question!
Thierry
14 years ago
To complete what Andy said, we deal with Hibernate JPA, OpenJPA and EclipseLink. The main problems when trying to use JPA within an OSGi container consist in the mapped clas visibility and the use of load time weaving to intrument managed entities when required.

The first point is directlty adresses by Spring DM with its thread context classloader management at service level.

The second point can be much more problematic since load time weaving isn't supported by all OSGi containers but the great news is that not all JPA implementations require this feature: Hibernate doesn't need it and OpenJPA leaves you the choice... Moreover, when load time weaving is required within Equinox container, you can use Equinox Aspects and its adapter for Spring.

Thierry
14 years ago
Hello Rainer,

It's now possible to develop Web bundles with Spring DM. As a matter of fact, the framework provides a web extender allowing managing web applications contained in bundles. When the bundle starts, the web application is deployed within the Tomcat or Jetty container present in the OSGi container. Spring DM considers bundles as Web bundles when either a WEB-INF directory or the Web-ContextPath header is present in the MANIFEST file.

We must notice that approach is quite different from HTTP Service and that the actual Web support of Spring DM will be deprecated and replaced by the RFC 66 (OSGi Web Container) support sooner (when specification will be finalized).

Regarding the use JSF within an OSGi container, we made it work with Myfaces 1.2.2 after fixing a small issue (see http://issues.apache.org/jira/browse/MYFACES-2442). You can find a complete working sample in code source of the "Spring DM in action" book at the following url: http://code.google.com/p/springdm-in-action/source/browse/#svn/trunk/ch08/ch08-web-jsf-myfaces

Hope it answers to your question!
Thierry
14 years ago