Saturday, February 6, 2010

Common local repository location for spring-build ivy artifacts

0 comments
SpringFramework in version 3 came out with a common ant + ivy build system across most of the projects.
One thing that was driving me insane is that this build would pull artifacts into a project specific repository directory during ivy resolution vs. a common directory (like maven). As I was playing with the different projects and different versions of those projects disk usage was going through the roof.

The only way that I found to have a common location is to provide a -D flag to ant:

export ANT_OPTS="-Divy.cache.dir=$HOME/.spring-build-ivy-cache"


Single location, minimize disk usage. But there is always a but in there somewhere. dm-server code base for one makes some assumptions about where that repository is located, i.e. "../ivy-cache/repository/[artifact]". I ended up creating a symbolik link for those situations. Not the best solutions but freed about 1G of space on my machine.

Friday, January 22, 2010

WebFlow on dmServer

0 comments
It should be easy to use webflow on dmServer right? Well, not if you depend on maven to copy dependencies.
Just ran into few issues and wanted to share:

1. Bundle-Import both org.springframework.webflow and org.springframework.binding (too many packages to import individually)
WebFlow xml config will try to add a ConversionService from binding to your app context and if you don't have binding packages imported - BOOM...
2. Don't forget el libraries
WebFlow libd (library) has an optional dependency on org.jboss.el:com.springsource.org.jboss.el:2.0.0.GA and does not even lists ognl. org.springframework.binding imports javax.el, org.jboss.el and ognl as optional so resolution does not fail until you try to create an app context and webflow can't find any el parser to use and throws up.

That is it for now.

Saturday, December 12, 2009

dmServer plans and osgi services

0 comments
SpringSource dmServer is very nice piece of equipment. One of the major additions to the OSGi arsenal is concept of plans. Plans are deployment descriptors that allow for composition of application assemblies and provided added capabilities like scoping. You can think of scoped plan as a pseudo bundle that shades all included artifacts and creates a concept of a nested classloader. Very similar to jee concept of nesting wars and ejb-jars in ear. This is very useful addition that allows normal use of ORM libraries like hibernate that use TCCL (thread context class loader) and expect all classes to be found by classpath scanning. Scoping also hides services published within a scoped plan. No service gets out from a scope into a global service registry.
This is all nice and dandy, but what if you do want to "jail break" a service from a plan? Well there is a very simple way to do it. As Glyn describes in this thread on SpringSource dmServer forums, it's as simple as adding a service property.

Example:


<service id="publishIntoGlobal" interface="java.lang.CharSequence">
<service-properties>
<beans:entry key="com.springsource.service.scope" value="global" />
</service-properties>
<beans:bean class="java.lang.String">
<beans:constructor-arg value="foo"/>
</beans:bean>
</service>

Friday, December 11, 2009

Is JSR294 Active or Inactive?

0 comments
I was surprised to find out that JSR 294 was marked inactive (here). Is it really inactive? It depends on who you ask. From Alex Buckley email for JSR 294 mail list, 294 is still alive:

The PMO has a new rule: a JSR that doesn't produce an EDR for 18 months is marked inactive. Nothing else happens, just the marker.

Officially, 294's last EDR was December 2007. However, as per the agreement with 277 and 294 EG members in December 2008, 294 was revived ain January 2009.

Materials for an EDR were presented privately to the 294 EG in June 2009. You and BJ sent useful comments. Just about the time I was ready to file the EDR, the Simple Module System proposal showed up. I can only imagine the complaints had I proceeded with the EDR at that time.

So, I will file an EDR this month based on the materials from June, along the following lines:

- Module accessibility is a JLS concept; runtime module is a JVMS concept.

- Module compilation unit is a JLS concept; it defines a module name + version; it is annotatable; its contents are implementation-defined.

- java.* APIs are limited to representing runtime modules and (the runtime form of) module compilation units.

Direct link here