Pluggable styling with SpringSource Slices

Engineering | Andy Wilkinson | July 10, 2009 | ...

Since we announced SpringSource Slices, a number of users and customers have asked about using Slices to make the styling and branding of their Web sites pluggable. In this blog, I'll demonstrate how easy it is with Slices.

Pluggable styling

I have a standard war file, named styled.host.war, that contains a very simple index.html page:
<html>
	<head>
		<title>SpringSource Slices Pluggable Styling Demonstration</title>
		<link rel="StyleSheet" href="styles/main.css" type="text/css" />
	</head>
	<body>
		<div class="header">
			<div class="title">SpringSource Slices</div>
			<div class="subtitle">Pluggable Styling Demonstration</div>
		</div>
	</body>
</html>

As you can see, it's looking for a CSS file…

Using Yourkit to Find a Memory Leak

Engineering | Dave Syer | July 05, 2009 | ...

I had such a great experience today with Yourkit that I thought I'd write a quick plug. It's been a couple of years since I used it in anger, and even then it was the best tool I could find, but now it really is ultra slick. I haven't done an exhaustive survey of the marketplace, and that wasn't the object of the exercise: I just wanted a tool to solve a problem.

Here's the story of my day; frustration, then irritation, then finally satisfaction. I had a suspected memory leak in Spring Batch and I needed to track it down quickly. The back story to this is I've seen plenty of memory leaks, but I haven't had to deal with one at the coal face for quite some time. I live in STS these days (sometimes dream in it as well), so I needed a tool that worked well in the IDE. I tried two tools, but only because the first choice didn't work. The two I tried were TPTP and Yourkit

STS 2.1.0.RC1 Updated for Eclipse 3.5

Releases | Adam Fitzgerald | June 26, 2009 | ...

The latest release candidate for SpringSource Tool Suite has been updated to run on the brand new Eclipse Galileo release. STS 2.1.0.RC1 includes support for Spring Roo, SpringSource dm Server and tc Server, enterprise OSGi tools, as well as all the usual great Spring development tools. This newest version also provides support for a Mac OS X 64 bit Cocoa client. Of course the download for SpringSource Tool Suite is free so get started with the best IDE for enterprise Java development today.

Download | New Feature List | Forum | JIRA

Maven PAR Plugin 1.0.0.M1

Engineering | Ben Hale | June 24, 2009 | ...

Shortly after the introduction of SpringSource dm Server (Application Platform at the time), Thorsten Maus created a Maven plugin for creating PAR files. This was a great community contribution and we even used it in the Getting Started Guide for dm Server 1.0.x.

As dm Server's 2.0 milestones have progressed we've been adding new functionality to the PAR file. The most interesting feature is that now a PAR file can contain more than just JAR files. With the introduction of OSGi RFC 66, the dm Server has deprecated Web Modules in favor of the standard Web Container files using a .war

Installing STS into Eclipse 3.5

Engineering | Christian Dupuis | June 24, 2009 | ...

Today marks a big day for Eclipse and for everybody involved with the Eclipse ecosystem: Congratulations to the Eclipse folks for releasing Eclipse 3.5 aka Galileo. You can read more about the release at http://www.eclipse.org/galileo/. I encourage everybody to download Eclipse 3.5 today and try it out.

Since SpringSource is strongly committed to Eclipse and we are building our SpringSource Tool Suite on top of the Eclipse technology stack, I'm excited to report that STS can be installed and used with 3.5. Here are some instructions to get started:

Update: The instructions in this post are outdated and might not work for you. Please refer to the STS Installation Instructions

OSGi Test Stubs 1.0.0.M1

Engineering | Ben Hale | June 23, 2009 | ...

I'm pleased to announce the 1.0.0.M1 release of SpringSource's OSGi Test Stubs.  These stubs offer a way to unit test complex OSGi Framework interactions without needing a full OSGi container.

The Problem

As the dm Server team has been developing, we found that one of the biggest problem areas for testing for us was in BundleActivators.  Our BundleActivators do quite a bit of publishing services to the service registry as well as consuming services using ServiceTrackers.  These kinds of tasks involve many interwoven calls to BundleContexts, Bundles, ServiceRegistrations, and ServiceReferences.  In the beginning, these activators were simple enough that not much unit testing was done on them, and we depended on integration tests to catch any bugs that were introduced.  As time went on though, the activators became more complex and unit testing became a more pressing need.  We started using EasyMock for these tests, but found that they were very complex, hard to maintain, and most importantly hard to understand.
@Test
public void startAndStop() throws Exception {
    BundleActivator bundleActivator = new DumpBundleActivator();
    BundleContext context = createMock(BundleContext.class);
    Filter filter = createMock(Filter.class);
    
    String filterString = "(objectClass=" + DumpContributor.class.getName() + ")";
    
    expect(context.createFilter(filterString)).andReturn(filter);
    context…

Messaging meets OSGi at OSGi DevCon Europe

Engineering | Iwein Fuld | June 23, 2009 | ...

Yesterday I was speaking at OSGi DevCon Europe about using Spring Integration and dm Server to tackle common problems in large applications in a pragmatic way. Before and after my session I talked to various people that liked to have a little more information about these ideas. This blog will give an overview of what I talked about.

I'll jump right in with a summary of the presentation.

Any project will grow during its lifetime of active development. Usually developers add features and fix problems raised by the product owners by adding code. This process will naturally grow the code base…

Modular Web Applications with SpringSource Slices

Engineering | Rob Harrop | June 22, 2009 | ...

Updated: added sub module instructions for Git.

I've talked in the past about providing support for truly modular applications, and I'm pleased to announce that you can now access the early prototype code of SpringSource Slices.

Building and Installing

You can access the source code from our Git repository:

git clone git://git.springsource.org/slices/slices.git
git submodule init
git submodule update

To build a packaged version of Slices simply run ant clean jar package from the build-slices directory:

cd slices/build-slices
ant clean jar package

This will result in a zip file in target/artifacts that contains the Slices subsystem which can then be installed on top of dm Server 2.0

Installing Slices is simply a matter of adding the new subsystem to dm Server and then updating dmServer's profile to start the new subsystem. Slices should work with any recent dm Server 2.0 snapshot build. Here I'm using 2.0.0.CI-R326-B274 which I've already downloaded and unzipped on my desktop:

 unzip target/artifacts/springsource-slices-BUILD-20090622083953.zip -d ~/Desktop/springsource-dm-server-2.0.0.CI-R326-B274

Next, dm Server's kernel.properties configuration must be updated to include the new slices subsystem. Open your dm Server installation's config/kernel.properties file, and edit the Profile Configuration section to list the slices subsystem and to give the profile a suitable name (I've called it slices):

#######################
# Profile Configuration
#######################
profile.name=slices…

dm Server Repository Content via JMX

Engineering | Ben Hale | June 22, 2009 | ...

In the dm Server 2.0.0.M1 release we added support for shared repositories. As a followup to this new functionality, we've added support for browsing those repositories via JMX.

Connecting to a running dm Server instance with a JMX client now shows you a Repository group. Under this group, each configured repository (with the exception of chained repositories) has a bean that returns synopses of all of the artifacts contained inside. The bean also exposes a method for returning the entire, detailed ArtifactDescriptor for a given bean based on it's type, name, and version.

JMX Repository Browsing

Obviously, something like JConsole is mostly useful for displaying small targeted amounts of data.  For larger datasets, the AMS team is currently working on visualization that is a bit easier on the eyes.

Exploring Roo's Architecture

Engineering | Ben Alex | June 18, 2009 | ...

Last month we discovered how easy it is to build a fully-fledged enterprise application in just a few minutes using Spring Roo - our new productivity tool for Java developers. While many Java developers have already started evaluating Roo to help save time on their projects, I've received a lot of questions from people curious about how Roo actually works. In this blog entry I will explore Roo's architecture in depth, including its goals, alternatives prototyped, design rationale and implementation details. By the end you'll have a good understanding of what makes Roo tick and why its approach…

Get the Spring newsletter

Thank you for your interest. Someone will get back to you shortly.

Get ahead

VMware offers training and certification to turbo-charge your progress.

Learn more

Get support

Tanzu Spring Runtime offers support and binaries for OpenJDK™, Spring, and Apache Tomcat® in one simple subscription.

Learn more

Upcoming events

Check out all the upcoming events in the Spring community.

View all