Introducing the SpringSource Application Platform

After many months of feverish coding, I am pleased to announce the beta release of the SpringSource Application Platform 1.0.
At the beginning of 2007 we began discussing possible alternatives to the monolithic and heavyweight application servers with which Enterprise Java has become synonymous. Customers were looking for a platform that was lightweight, modular and flexible enough to meet their development and deployment needs.
The Spring and Tomcat pairing demonstrates that developers and operators can successfully use a lightweight platform in production. Despite the success of this combination, the lack of modularity and explicit support for non-web applications limits its applicability and flexibility.
We set about building the SpringSource Application Platform to address these requirements and remove these limitations.
At the heart of the Platform is the Dynamic Module Kernel (DMK). The DMK is an OSGi-based kernel that takes full advantage of the modularity and versioning of the OSGi platform. The DMK builds on Equinox and extends its capabilities for provisioning and library management, as well as providing core function for the Platform.

To maintain a minimal runtime footprint, OSGi bundles are installed on demand by the DMK provisioning subsystem. This allows for an application to be installed into a running Platform and for its dependencies to be satisfied from an external repository. Not only does this remove the need to manually install all your application dependencies, which would be tedious, but it keeps memory usage to a minimum.
The DMK itself requires a minimal set of bundles to run, and is configured with a profile to control exactly the set of additional modules that are loaded. For example, the DMK does not require Tomcat to be present, but the default Platform profile includes Tomcat to allow web applications to be deployed. If you want to run a Platform without Tomcat, you can simply edit the profile and it won't be installed. (If you try this – remember that removing web support means that web modules will no longer deploy, so delete the contents of the pickup directory so the platform won't attempt to install the Admin and splash screen applications when it starts.) The default Platform configuration with the admin console installed takes only 15MB of memory.
One frustration I have always had with Enterprise Java is that applications are often shoe-horned into contrived silos, and that explicit support for different application types is lacking. Consider an application for an online store. This application has a web front-end, a message-driven order processing module, a batch-driven stock reordering module and a B2B web service module. Today, many applications like this would be packaged as a WAR or an EAR and the modules would look very similar, with little support for the differences in the module types. Interestingly, many people would refer to this as a web application, rather than an application with a web module.
In the SpringSource Application Platform, applications are modular and each module has a personality that describes what kind of module it is: web, batch, web service, etc. The Platform deploys modules of each personality in a personality-specific manner. For example, web modules are configured in Tomcat with web context. Each module in the application can be updated independently of the other modules whilst retaining the identity of being part of the larger application. Whatever kind of application you are building, the programming model remains standard Spring and Spring DM.
In the 1.0 Platform release we support the web and bundle personalities, which enable you to build sophisticated web applications. Future releases will include support for more personalities as detailed later.
Building Applications
The Platform supports applications packaged in three forms:
- Java EE WAR
- Raw OSGi bundles
- Platform Archive (PAR)
Standard WAR files are supported directly in the Platform. At deployment time, the WAR file is transformed into an OSGi bundle and installed into Tomcat. All the standard WAR contracts are honoured, and your existing WAR files should just drop in and deploy without change.
Any OSGi-compliant bundle can be deployed directly into the Platform, and can take full advantage of on-the-fly provisioning for any dependencies referred to by Import-Package and Require-Bundle.
The PAR format is the recommended approach for packaging and deploying applications for the Platform. A PAR is simply a collection of OSGi bundles (modules) grouped together in a standard JAR file, along with a name and a version that uniquely identify the application. The PAR file is deployed as a single unit into the Platform. The Platform will extract all the modules from the PAR and install them. Third-party dependencies will be installed on-the-fly as needed.
The PAR format has three main benefits over deploying the bundles directly into the Platform. Firstly, it's just easier. An average-sized enterprise application might contain 12+ bundles – deploying these by hand will be far too cumbersome. Secondly, the PAR file forms an explicit scope around all the bundles in the application which prevents applications that use overlapping types or services from clashing with each other. This scope is also used by some advanced features such as load-time weaving to ensure that weaving of one application doesn't interfere with weaving of another. Lastly, the PAR forms a logical grouping to define what modules are part of an application and what third-party dependencies the application has. This grouping is used by the management tools to provide a detailed view of the application. A typical PAR application looks like this:

Dependencies between modules in an application are typically expressed using Import-Package and Export-Package. Dependencies on third-party libraries can be expressed in the same way, but for many libraries this can be error-prone and time-consuming. When using a library such as Hibernate, you will typically have to import more packages than you initially expect. To get around this you could use Require-Bundle, but this has some semantic rough edges such as split packages where a logical package is split across two or more class loaders causing problems at runtime. The Platform introduces two new mechanisms for referring to third-party dependencies: Import-Bundle and Import-Libary. Import-Bundle is analogous to Require-Bundle except it prevents split packages and the other problems with Require-Bundle. Import-Library provides a mechanism to refer to all the packages exported by a group of bundles, for instance all bundles in the Spring Framework, in a single declaration:
Bundle-Version: 1.0.0
Import-Bundle: org.apache.commons.dbcp;version="1.2.2.osgi"
Import-Library: org.springframework.spring;version="2.5.4.A"
Here I have a module bundle that depends on the Commons DBCP bundle and the Spring Framework library. The Spring Framework library contains all the bundles needed to use Spring in your application.
Import-Library and Import-Bundle expand under the covers into Import-Package and are therefore consistent with standard OSGi semantics.
The Platform understands the personality of a module, and from this can infer how to configure the module's execution environment. When deploying a web module, all the servlet infrastructure needed for a typical Spring MVC application is created automatically, removing the need to recreate this boilerplate code across applications. In the 1.0 final release, more smarts will be added to the web module personality to support additional technologies such as Spring Web Flow.
Whatever packaging format you choose, the programming model is simply Spring Framework and Spring Dynamic Modules, with the other Spring Portfolio products running on top.
Serviceability
Serviceability was a critical consideration for the whole engineering team. We have spent an inordinate amount of time worrying about the format of log messages and the size of stack traces to make sure that diagnosing problems with your applications is as easy as possible. Any time we find a task that is repetitive and time-consuming we look for a way to automate it or remove it altogether.
To aid with problem diagnosis the Platform has a strong split between log and trace messages. Log messages are intended for end-user consumption and allow you to get access to the most important failure information without having to trawl through gigabytes of trace content. All application failures are displayed and coded in the log output – the codes serving as a convenient way to access knowledge base or support content. To understand why this is so useful, consider the following output from Platform startup:
[2008-04-29 12:12:04.037] main <SPKE0000I> Boot subsystems installed.
[2008-04-29 12:12:06.013] main <SPKE0001I> Base subsystems installed.
[2008-04-29 12:12:07.396] platform-dm-1 <SPPM0000I> Installing profile 'web'.
[2008-04-29 12:12:07.674] platform-dm-1 <SPPM0001I> Installed profile 'web'.
[2008-04-29 12:12:07.721] platform-dm-14 <SPSC0000I> Creating ServletContainer on port 8080
[2008-04-29 12:12:08.036] platform-dm-10 <SPPM0002I> Platform open for business with profile 'web'.
[2008-04-29 12:12:09.405] fs-watcher <SPSC1000I> Creating web application '/admin'
[2008-04-29 12:12:09.652] async-delivery-thread-1 <SPSC1001I> Deploying web application '/admin'
Gone are the pages and pages of output detailing the inner workings of every single type in the startup call chain. Instead, you get messages that actually mean something. Of course, this doesn't mean you can't find out what every type is doing: we still maintain an extensive trace. Indeed, because we split out the most important log messages from trace, our trace can be more verbose because it is intended to be read less often.
Critical failures in the Platform generate a service dump that can be passed to support personnel to aid in the diagnosis process. This dump contains state from all the major subsystems in the Platform and is hooked in via AspectJ to make sure we pick up every possible site where an unchecked Exception can be raised.
The Platform also actively monitors for problems in the JVM and triggers a dump. In the 1.0 release this is limited to deadlock monitoring only, but will include memory, lock contention and CPU contention in future releases.
Roadmap
This beta release is only the start for the SpringSource Application Platform. We have tentatively defined a roadmap to cover the 2.0 release with a focus on five main areas: the Admin Console, middleware integration, additional personalities, clustering and DMK 2.0.
With the Admin Console we want to exploit all the application knowledge that the Platform has, and make this available to the end-user. The Admin Console will allow for detailed inspection of applications starting at the module level and running right down to the bean level. Applications will be linked to the libraries and bundles they depend on, and the Admin Console will provide the ability to upgrade these libraries dynamically. By understanding the different types of beans that an application contains, the Admin Console will provide for detailed insight into application internals and allow for dynamic reconfiguration of certain application components.
To support typical enterprise deployment scenarios, the 2.0 version of the Platform will provide explicit support for common enterprise middleware components such as Oracle, TIBCO EMS and IBM MQSeries. Integration with the Admin Console will allow for connections to these middleware providers to be established in minutes rather than hours or days. Applications will be able to access these connections using the OSGi service registry and Spring DM's <osgi:reference>.
The 2.0 release will introduce additional personalities to cover batch, web services and SOA applications.
Clustering is an important feature for the 2.0 release, with cluster-wide Single System Image (SSI) being the critical piece, and load-balancing and clustered caching being on the roadmap as well. Using the SSI support, administration and deployment operations will be propagated across the cluster. Ultimately, we want to support per-module updates across the cluster, with full cluster-rollback if the upgrade breaks a deployed application.
DMK 2.0 will include improvements to the concurrency subsystem to support large numbers of bundles that change frequently and to support larger numbers of modules with more complex interdependencies. Also included will be updates to the provisioning subsystem and integrated resource management and monitoring for memory, threads, IO and CPU.
What next?
Please download the Platform and try it out. We are keen to hear about your experiences building new applications and deploying existing ones. All feedback, positive or negative, is welcome. We are particularly interested to hear how we can make the process of building and deploying applications easier and more enjoyable.
The binary releases and forums can be found here. Both the user's guide and programmer's guide are available online. We have a JIRA instance set up here.
Similar Posts
- dm Server 2.0.0 released
- dm Server 2.0 RC1 released
- Spring Dynamic Modules reaches 1.0!
- SpringSource Application Platform Deployment Options
- Running Spring Applications on OSGi with the SpringSource Application Platform











Matt Raible says:
Added on April 30th, 2008 at 4:05 pmI'll believe it's good if it'll solve my Spring MVC FreeMarker in OSGi problem.
Rob Harrop says:
Added on April 30th, 2008 at 4:57 pmMatt,
If it doesn't I'd like to know about it:)
It's exactly these kind of problems we are trying to solve in the Platform. We have added various compatibility layers into the Platform to make common libraries work.
The problem you are having may well be fixed by the work done on the bundle repository (http://www.springsource.com/repository), if not we can certainly get a fix in the Platform if it doesn't work already – it looks like a basic class loading issue, possibly an issue in the bundle manifests – we'll be able to get better diagnostics running this in the Platform.
Cheers,
Rob
Ben says:
Added on April 30th, 2008 at 6:36 pmI know you guys aren't EJB fans but it does look like a match made in heaven between this and OpenEJB also OSGi-based.
Erwin Vervaet says:
Added on April 30th, 2008 at 11:36 pmThat's indeed a cool secret project!
Congrats!
Erwin
Jeremy Wales says:
Added on April 30th, 2008 at 11:45 pmSounds very cool. Enterprise OSGi developers have needed something like Import-Library/Import-Bundle for a very long time
A few questions:
1. Will SSAP Profiles fit in with JEE 6 Profiles in any way?
2. Is it likely that ideas like Import-Library/Import-Bundle will be standardised through the OSGi Enterprise Experts group for OSGi 5?
3. When you talk about separating the LTW of different deployments, does that imply you've actually made LTW work well in OSGi???
4. I notice the license for the beta is GPL v3. Will that be the license you stick with for the full release?
Larry Whineart says:
Added on May 1st, 2008 at 2:01 amI'd really love to hear more about this "PAR" format you guys have introduced. Mainly around how you guys manage to contain bundles and services that form part of the PAR such that they don't interfere with other bundles and services within the OSGI environment. Or do you simply run a seperate OSGI container for each PAR file deployed into the server?
Rob Harrop says:
Added on May 1st, 2008 at 3:28 amBen,
We have no plans to integrate OpenEJB ourselves, but if it is something that the community is interested in, it should be pretty easy to construct a new personality backed by OpenEJB.
Regards,
Rob
Rob Harrop says:
Added on May 1st, 2008 at 3:29 amErwin,
Thanks a lot! It was pretty hard to keep this a secret for so long
Rob
Rob Harrop says:
Added on May 1st, 2008 at 3:38 amJeremy,
We like Import-Library/Import-Bundle a lot so I'm glad you do too.
1. Will SSAP Profiles fit in with JEE 6 Profiles in any way?
> Absolutely. Our profile support allows for many different configurations of the Platform to be created on top of the base kernel. We already support much of what is planned for the Java EE 6 web profile, and when this is finalized I see no reason why we wouldn't support at least that.
2. Is it likely that ideas like Import-Library/Import-Bundle will be standardised through the OSGi Enterprise Experts group for OSGi 5?
> We hope so. We are on both the Core Platform Expert Group and Enterprise Expert Group. We are committed to keep the programming and deployment model as standardised as possible so we'll definitely feeding those requirements along with a few others back into the expert groups.
3. When you talk about separating the LTW of different deployments, does that imply you've actually made LTW work well in OSGi???
> Yes we have
. We have full support for weaving any bundle apart from the system bundle, and this is then linked into the Spring LoadTimeWeaver support transparently. We can scope the weaving behaviour, limiting it to the application boundaries and preventing shared libraries from getting woven accidentally. In the final release we'll have support for pulling a copy of a shared library into an application's scope – so then the application can do what it wants to that library instance without affecting other applications. The final piece of weaving is support for throwaway classloading which fully honours OSGi loading semantics – this is implemented on top of the Equinox internals so we get exactly what we want without a lot reimplementation.
4. I notice the license for the beta is GPL v3. Will that be the license you stick with for the full release?
> Yes.
Regards,
Rob
J. EE. says:
Added on May 1st, 2008 at 11:34 amAll hail our new overlords and masters.
Wim Lambrecht says:
Added on May 1st, 2008 at 3:27 pmThis looks very promising.
Congrats! -wil-
Roman says:
Added on May 1st, 2008 at 4:42 pmSSAP will be licensed under GPL 3.0.
It's very interesting because on Springs about site I can read
"All Spring projects are licensed under the terms of the Apache License, Version 2.0."
And that means I can use Spring-Projects in commercial projects which is not the case with GPL 3.0
Or I'm wrong?
Rod Johnson (blog author) says:
Added on May 1st, 2008 at 5:56 pmSpringSource Application Platform is distinct from Spring Portfolio projects. We are not changing the license of Spring Framework or other projects.
Kaushik says:
Added on May 1st, 2008 at 11:02 pmI had a couple of questions.
1) It is mentioned that some changes had been done to equinox to support application platform. Could you give some details on what kind of changes were done.
2) We currently use equinox as our osgi impl and are also looking at kf/felix. Would application platform be equinox exclusive or do you plan to add support for other containers down the line?
Monal says:
Added on May 2nd, 2008 at 1:38 amRob,
Very promising! The missing piece in the spring arsenal, I think.
1> Is the SpringSource Application Platform programmatically configurable? This would facilitate in automating the provisioning of the platform for different environments.
2> Does SpringSource Application Platform support promoting (or moving) an application from one SpringSource Application Platform instance to another. This could be helpful in moving a tested application build through different environments (dev -> staging -> production)?
3> Can SpringSource Application Platform download the dependencies (bundles or libraries) from a specified URL (http, ftp, ssh etc.)?
4> 3> What is your view about packaging application configuration into OSGi bundles such that it can be easily updated, or customized for different environments?
Eugene Miller says:
Added on May 2nd, 2008 at 3:44 amhi Rob,
been playing with s2ap for the last few hours and i am sure it has a bright future(at least in my projects). I enjoy the integrated tomcat a lot and look forward to check out the clustering feature and the middleware integration in the 2.0-release.
Is there a time-frame for the 2.0-release yet?
ciao!
Rob Harrop (blog author) says:
Added on May 2nd, 2008 at 4:23 amEugene,
I'm glad that you like the Platform. We have no timeframe for the Platform 2.0 release, but as soon as we have defined that roadmap along with dates I'll post an update here.
Regards,
Rob
Rob Harrop (blog author) says:
Added on May 2nd, 2008 at 6:11 am[quote comment="104983"]I had a couple of questions.
1) It is mentioned that some changes had been done to equinox to support application platform. Could you give some details on what kind of changes were done.
2) We currently use equinox as our osgi impl and are also looking at kf/felix. Would application platform be equinox exclusive or do you plan to add support for other containers down the line?[/quote]
Kaushik,
1) No changes have been made to Equinox. Instead, we have used the supplied extension hooks to add the behaviour we need. We are using a standard build from eclipse.org.
2) The Platform is currently coupled to Equinox because of the need to use the extension hooks I mentioned above. This isn't to say that we won't support other OSGi platforms in the future, but that is not yet planned.
Rob
Rob Harrop (blog author) says:
Added on May 2nd, 2008 at 6:58 am[quote comment="104994"]Rob,
Very promising! The missing piece in the spring arsenal, I think.
1> Is the SpringSource Application Platform programmatically configurable? This would facilitate in automating the provisioning of the platform for different environments.
2> Does SpringSource Application Platform support promoting (or moving) an application from one SpringSource Application Platform instance to another. This could be helpful in moving a tested application build through different environments (dev -> staging -> production)?
3> Can SpringSource Application Platform download the dependencies (bundles or libraries) from a specified URL (http, ftp, ssh etc.)?
4> 3> What is your view about packaging application configuration into OSGi bundles such that it can be easily updated, or customized for different environments?[/quote]
Monal,
For 1) and 2), these are definitely features we are interested in supporting. I would love to understand more about your requirements. Can you post a JIRA (http://issuetracker.springsource.com/).
3) is definitely on the roadmap – we plan to integrate with the Enterprise Bundle Repository.
4) this is something we are working on. We have some support here using bundles, Andy Wilkinson from the Platform team has been working with database failover on the Platform so he'll be commenting soon. Again, I'd really like to get a feel for what process you have at the moment, what you like and what you think can be improved.
Ping me an email if you'd like to discuss in more detail. (rob.harrop a t springsource.com)
Rob
Andy Wilkinson says:
Added on May 2nd, 2008 at 10:26 amMonal,
Packaging your configuration into OSGi bundles such that it can be easily updated and customized for different environments is exactly the sort of modular design that the Platform hopes to encourage.
In working on the forthcoming Petclinic sample I've created two separate bundles that publish javax.sql.Datasource instances to the OSGi service registry, one that points to MySQL and one that points to HSQLDB. This datasource is then consumed by a JDBC-based bundle in the application. By simply changing which of these bundles is included in the application's PAR file I can easily switch between databases.
Taking this one stage further it's also possible to deploy a PAR file that includes both datasource infrastructure bundles. By stopping and starting these two datasource infrastructure bundles I can control which database is used at runtime without any need to stop, or redeploy the application. This is enabled by the use of Spring DM which maintains a proxy to the datasource service and, from the application's perspective, seamlessly handles to move from one datasource to the other.
We have plans to provide explicit support for configuration bundles such that they can be easily hot-deployed, that you can control which, if any, of the bundles is started by default, etc. As Rob mentioned it'd be great to hear what you're requirements are in this area and how you'd like to see this work in the platform. Please feel free to send me (andy.wilkinson at springsource.com) or Rob an e-mail if you have any suggestions.
Andy
Yuval Goldstein says:
Added on May 3rd, 2008 at 12:45 pmHey,
Congrats on the release.
Any word about pre-integrated JMS?
We need it.
Thanks,
Yuval Goldstein.
Nils Wloka says:
Added on May 5th, 2008 at 1:05 amHello there,
congratulations on the release of this project. Being able to not only provide a reasonable programming model for enterprise applications but also a dedicated runtime platform will make arguing in Spring's favour even easier in the future. Now if you were secretly working on a Maven plugin for building those PARs…
Nils
Setya says:
Added on May 5th, 2008 at 4:26 amHi,
So Spring DM is not an OSGI implementation but it's an OSGI application on top of an OSGI implementation (Equinox) ?
Regards,
Setya
Durga says:
Added on May 6th, 2008 at 4:15 amThis is very cool and interesting
My Query is there a way that the Spring Application server be integrated as an Engine for services [Service container] in the larger context of web-app,when we are using an App Server .
In Simple Can i use SpringApplication Server as a Service container in the larger context of Application when i am using an app server[say Jboss], so that the features of app-server are also utilised.
seks says:
Added on May 6th, 2008 at 9:27 amWow, great stuff.
Pavel Tcholakov says:
Added on May 6th, 2008 at 10:16 amThat is fantastic news! I love the idea of OSGI deployment bundles, we have been trying to accomplish something similar on top of a regular J2EE platform using EARs and Maven, but obviously that only works "offline" and shared resources are a bit of a nightmare. Good luck!
Rob Harrop says:
Added on May 6th, 2008 at 12:16 pm[quote comment="105341"]Hi,
So Spring DM is not an OSGI implementation but it's an OSGI application on top of an OSGI implementation (Equinox) ?
Regards,
Setya[/quote]
Setya,
That's right – Spring DM is not an OSGi implementation, instead it runs on top of standand OSGi implementations.
Rob
Rob Harrop says:
Added on May 6th, 2008 at 12:26 pm[quote comment="105434"]This is very cool and interesting
My Query is there a way that the Spring Application server be integrated as an Engine for services [Service container] in the larger context of web-app,when we are using an App Server .
In Simple Can i use SpringApplication Server as a Service container in the larger context of Application when i am using an app server[say Jboss], so that the features of app-server are also utilised.[/quote]
Durga,
This is not something we have tried or really thought about. In theory, we should be able to run the base kernel inside other environments, but there is a chance that some other components, for instance Tomcat, would clash.
Rob
Durga says:
Added on May 6th, 2008 at 11:05 pmI belive this can be achieved indirectly through an approach in application design as listed
Say there are 3 context files[spring] for web-app one for modal layer spring-testmodal.xml [MVC layer], ,spring-testservices.xml[Service level Say OSGI implementation ],spring-testdata.xml [DAO level].
As there is a integration of Spring-DM with Spring MVC ,Spring-DM context(which in this case is a service layer only] can be pulled into spring-MVC using "org.springframework.osgi.web.context.support.OsgiBundleXmlWebApplicationContext" , and Spring MVC is integrated with the App-server that will be in use[where in facilities of app-server can be utilised] . hence the service layer module is isolated as an osgi module from the rest of the web-app .
Please share your thoughts on the above approach ….
Antoni Alatalo says:
Added on May 9th, 2008 at 3:45 amHi,
i did try to upload Liferay portal war as it is to tha application platform and it doesn't work. The error is
[2008-05-09 10:51:01.906] platform-tomcat-thread-5 Deployment failed
.
com.springsource.platform.deployer.core.DeploymentException: Deployment artefact
'file [E:\javatools\springsource-ap-1.0.0.beta1\work\com.springsource.platform.
deployer\Module\liferay-portal-4.4.2.war-0\liferay-portal-4.4.2.war]' does not h
ave a bundle manifest
………….
Caused by: java.io.FileNotFoundException: E:\javatools\springsource-ap-1.0.0.bet
a1\work\com.springsource.platform.deployer\Module\liferay-portal-4.4.2.war-0\lif
eray-portal-4.4.2.war\META-INF\MANIFEST.MF (The system cannot find the path spec
ified)
In you blog you are writing that
********************
Standard WAR files are supported directly in the Platform. At deployment time, the WAR file is transformed into an OSGi bundle and installed into Tomcat.
********************
Is there something i miss up or is it just some bug?
I did try Liferays portal 4.4.2
Thanks
Antoni
Rob Harrop says:
Added on May 9th, 2008 at 1:03 pmAntoni,
That sounds like a bug. I've created a JIRA issue to track this:
http://issuetracker.springsource.com/browse/PLATFORM-34
Rob
technology says:
Added on July 23rd, 2008 at 3:59 amI still newly in spring, how to create application use spring?
pappa adak says:
Added on June 6th, 2009 at 11:45 amGive ans me.