Hi,
Since TRINIDAD-797 was closed, I created TRINIDAD-1150 to track this issue:
https://issues.apache.org/jira/browse/TRINIDAD-1150
And attached both patches (1.1 and 1.2 trunk) for completeness, though
only the 1.2 trunk needs to be applied at this time.
Thanks,
Yee-Wah
Scott O'Bryan wrote:
Yeah, it should have been ported Yee. Sorry about the oversite.
Scott
Yee-wah Lee wrote:
Hi Rogerio,
The patch is attached to issue 797
(trin11_797_deferredRenderers.patch
<https://issues.apache.org/jira/secure/attachment/12375620/trin11_797_deferredRenderers.patch>)
https://issues.apache.org/jira/browse/TRINIDAD-797
It looks like the fix was not ported to the 1.2.x branch. I will
create one and ask for it to be applied.
Thanks,
Yee-Wah
Rogerio Baldini wrote:
Hi ,
Have you solved this problem ?
I am trying to upgrade from Trinidad 1.2.1 to 1.2.8 and receiving this
error:
SEVERE: Exception sending context initialized event to listener
instance of
class com.sun.faces.config.ConfigureListener
java.lang.ExceptionInInitializerError
at
org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.jsLibs.Scriptlet.registerSelfWithKey(Scriptlet.java:163)
at
org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.jsLibs.Scriptlet.registerSelf(Scriptlet.java:92)
...
Caused by: java.lang.NullPointerException
at
org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.jsLibs.LocaleInfoScriptlet.getSupportedLocaleVariant(LocaleInfoScriptlet.java:168)
at
org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.jsLibs.NamedLocaleInfoScriptlet.<init>(NamedLocaleInfoScriptlet.java:62)
...
And I hava my own render kit.
public class PlcRenderKit extends CoreRenderKit {
public PlcRenderKit() {
super();
}
private void _addTrinidadRenderKit() {
FacesContext facesContext=null;
RenderKit trinidad = getTrinidadRenderKit(facesContext);
if (trinidad!=null) {
attachAggregatedRenderKit(trinidad);
}
}
private RenderKit getTrinidadRenderKit(FacesContext facesContext) {
RenderKitFactory rkf =
(RenderKitFactory)FactoryFinder.getFactory(FactoryFinder.RENDER_KIT_FACTORY);
return rkf.getRenderKit(facesContext,
CoreRenderKit.BASE_RENDER_KIT_ID);
}
@Override
public Renderer findRenderer(String family, String rendererType) {
Renderer renderer = super.findRenderer(family, rendererType);
if (renderer==null) {
RenderKit rk =
getTrinidadRenderKit(FacesContext.getCurrentInstance());
renderer = rk.getRenderer(family, rendererType);
}
return renderer;
}
}
Thanks a lot.
Rogerio Baldini
Yee-wah Lee wrote:
After some testing, the problem was due to the RenderingContext
being null. Scriptlet initialization was happening during a static
block of the SimpleInputColorRenderer, not during the render phase,
which explains why the RenderingContext is null.
This doesn't appear to be a problem for Trinidad because the
Trinidad renderkit implements deferred loading of renderers. In
Ian's case, he is extending a renderer and adding it to the Faces
renderkit.
I will submit an addition to the patch to allow for extended
renderers not being in the Trinidad renderkit.
Thanks,
Yee-Wah
Yee-wah Lee wrote:
I'll take a look at this. The line at which the code is failing
indicates the LocaleContext is null, or the FormattingLocale is
null. Not sure which is the problem here.
If anyone else has seen this problem, please reply with details on
your environment.
Thanks,
Yee-Wah
Matthias Wessendorf wrote:
that file "NamedLocaleInfoScriptlet" was add when fixing 797.
stay tuned.
-M
On Jan 18, 2008 4:37 AM, Ian Carr
<[EMAIL PROTECTED]> wrote:
I have tried to upgrade two applications to the Trinidad 1.0.5
release from 1.0.4. One worked fine the second results in an
exception during application startup. Both applications start
fine with 1.0.4.
I have checked the configurations and can't see anything
obviously in error. Does anybody have an idea of what I need to do?
I have looked at the release notes (which still say they are for
1.0.3) and didn't see anything there.
Both applications are using the sun reference implementation of
JSF (1.1_02) and the runtime environment is Tomcat 5.5.
Exception trace below:
===========================
SEVERE: Exception sending context initialized event to listener
instance of class com.sun.faces.config.ConfigureListener
java.lang.ExceptionInInitializerError
at
org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.jsLibs.Scriptlet.registerSelfWithKey(Scriptlet.java:163)
at
org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.jsLibs.Scriptlet.registerSelf(Scriptlet.java:92)
at
org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.SimpleInputColorRenderer.<clinit>(SimpleInputColorRenderer.java:622)
at
org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.InputColorRenderer.findTypeConstants(InputColorRenderer.java:45)
at
fsl.trinidad.extensions.kit.FSLInputColorRenderer.findTypeConstants(FSLInputColorRenderer.java:18)
at
org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.XhtmlRenderer.<init>(XhtmlRenderer.java:53)
at
org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.LabelAndMessageRenderer.<init>(LabelAndMessageRenderer.java:49)
at
org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.InputLabelAndMessageRenderer.<init>(InputLabelAndMessageRenderer.java:41)
at
org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.InputColorRenderer.<init>(InputColorRenderer.java:33)
at
fsl.trinidad.extensions.kit.FSLInputColorRenderer.<init>(FSLInputColorRenderer.java:9)
at
fsl.trinidad.extensions.kit.FSLRenderKit.<init>(FSLRenderKit.java:17)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at
java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at java.lang.Class.newInstance0(Class.java:350)
at java.lang.Class.newInstance(Class.java:303)
at
com.sun.faces.config.ConfigureListener.configure(ConfigureListener.java:935)
at
com.sun.faces.config.ConfigureListener.configure(ConfigureListener.java:426)
at
com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:348)
at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3763)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4211)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)
at
org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)
at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
at
org.apache.catalina.core.StandardService.start(StandardService.java:450)
at
org.apache.catalina.core.StandardServer.start(StandardServer.java:709)
at
org.apache.catalina.startup.Catalina.start(Catalina.java:551)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294)
at
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432)
Caused by: java.lang.NullPointerException
at
org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.jsLibs.LocaleInfoScriptlet.getSupportedLocaleVariant(LocaleInfoScriptlet.java:168)
at
org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.jsLibs.NamedLocaleInfoScriptlet.<init>(NamedLocaleInfoScriptlet.java:62)
at
org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.jsLibs.NamedLocaleInfoScriptlet.registerNamedLocales(NamedLocaleInfoScriptlet.java:47)
at
org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.jsLibs.XhtmlScriptletFactory.registerAllScriptlets(XhtmlScriptletFactory.java:75)
at
org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.XhtmlUtils.<clinit>(XhtmlUtils.java:531)
... 35 more
Thanks in advance
Ian