Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Incomplete
-
2.1.2
-
None
-
None
-
Any
Description
As of Tiles 2.1.1, the TilesConfigurer that was written by the Spring guys no longer works as they are using deprecated attributes in Tiles. They are working on a new tiles configurer for v3 of Spring. In the meantime, there have been some solutions submitted by the community. They work in a regular environment but not within an OSGi environment.
(see here for details on the issue raised: http://jira.springframework.org/browse/SPR-5411)
The problem is this:
public SpringTilesConfigurer()
protected TilesContainer createTilesContainer() throws TilesException
{ ServletContextAdapter adaptedContext = new ServletContextAdapter(new DelegatingServletConfig()); TilesApplicationContext preliminaryContext = new ServletTilesApplicationContext(adaptedContext); AbstractTilesApplicationContextFactory contextFactory = AbstractTilesApplicationContextFactory.createFactory(preliminaryContext); this.tilesContext = contextFactory.createApplicationContext(adaptedContext); AbstractTilesContainerFactory factory = AbstractTilesContainerFactory.getTilesContainerFactory(this.tilesContext); return factory.createContainer(this.tilesContext); }
When trying to create the context factory, it will try to initialize WildcardServletTilesApplicationContextFactory in AbstractTilesApplicationContextFactory:80 with the help of ClassUtil. Now WildcardServletTilesApplicationContextFactory is located in the tiles-servlet bundle while ClassUtil is located in tiles-api. Tiles-api does not have an import dependency on tiles-servlet (as it should be) so when ClassUtil tries to instantiate the class it cannot find it. This problem also occurs when trying to instantiate the TilesContainerFactory.
Is there something the Tiles team needs to do in order to make this a work within OSGi or is the Spring community going at it the wrong way?
Cheers
bjorn