Re: freemarker.template.Configuration (v.2.3.22) cannot be injected because of final method decleration in OSGI environment

Daniel Dekany <[email protected]> Thu, 21 May 2015 00:59:25 +0200
Newsgroups gmane.comp.web.freemarker.user
Message-ID <[email protected]>
Note that "works on OSGi" doesn't imply at all that it can be (easily)
proxyed (for Buleprint or whatever). It just means that you can drop
the jar into an OSGi container, and then can link to it from the other
bundles.

OTOH surely if somebody for some reason wants to proxy Configuration,
final methods make it hard (requires byte code manipulation). I will
consider making them non-final in 2.3.23.


Wednesday, May 20, 2015, 4:30:43 PM, halil wrote:

> Hi All,
>
> I could not create a reference of freemarker.template.Configuration
> on OSGI blueprint file. I referenced it as below. Blueprint throwed
> exception which states that Configuration class has final method
> declerations. It seems that OSGI (org.apache.felix.framework-4.4.1)
> does not support injection of classes having final method declerations...
>
> <reference id="freemarkerCfgRef"
> interface="freemarker.template.Configuration"  ext:proxy-method='classes' />
>
> When I did below steps, I succeed.
>
> 1. create an interface of Configuration class
> 2. put it a new package named freemarker.template.api.
> 3. Configuration class now implements
> freemarker.template.api.FreeMarkerConfigurationInt
> 3. reference it as below
>
> <reference id="freemarkerCfgRef"
> interface="freemarker.template.api.FreeMarkerConfigurationInt" />
>
> Now, it works perfectly...
>
> I read some mails of developers stating that freemarker works on
> OSGI but I could not succeed until I have done it as above...
>
>
> I would like to inform you,
>
>
> best,
>
>
> -halil.

-- 
Thanks,
 Daniel Dekany


------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y