users@javaserverfaces.java.net

Exception with Groovy support

From: Kito D. Mann <kmann_at_virtua.com>
Date: Wed, 21 May 2008 15:19:13 -0400

Hello,

I tried out the Groovy support, but I get the following exception any time I
put something in the WEB-INF/groovy directory (if I don't put anything in
this dir, it works fine).

SEVERE: Exception sending context initialized event to listener instance of
class com.sun.faces.config.ConfigureListener
com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! null
        at
com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:212)
        at
com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.
java:195)
        at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:
3764)
        at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4216)
        at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:7
60)
        at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
        at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
        at
org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:926)
        at
org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:889
)
        at
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
        at
org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
        at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
        at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSuppor
t.java:120)
        at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
        at
org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
        at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
        at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
        at
org.apache.catalina.core.StandardService.start(StandardService.java:448)
        at
org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
        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:597)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
Caused by: java.io.FileNotFoundException
        at
org.apache.naming.resources.DirContextURLConnection.getInputStream(DirContex
tURLConnection.java:298)
        at
groovy.util.GroovyScriptEngine.updateCacheEntry(GroovyScriptEngine.java:315)
        at
groovy.util.GroovyScriptEngine.loadScriptByName(GroovyScriptEngine.java:265)
        at
com.sun.faces.scripting.GroovyHelperImpl$MojarraGroovyClassLoader.loadClass(
GroovyHelperImpl.java:132)
        at
org.apache.shale.faces.ShaleVariableResolver.<init>(ShaleVariableResolver.ja
va:68)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
        at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAcces
sorImpl.java:39)
        at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstruc
torAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at
com.sun.faces.config.processor.AbstractConfigProcessor.createInstance(Abstra
ctConfigProcessor.java:238)
        at
com.sun.faces.config.processor.ApplicationConfigProcessor.addVariableResolve
r(ApplicationConfigProcessor.java:481)
        at
com.sun.faces.config.processor.ApplicationConfigProcessor.process(Applicatio
nConfigProcessor.java:239)
        at
com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractCo
nfigProcessor.java:108)
        at
com.sun.faces.config.processor.LifecycleConfigProcessor.process(LifecycleCon
figProcessor.java:119)
        at
com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractCo
nfigProcessor.java:108)
        at
com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigP
rocessor.java:132)
        at
com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:202)
        ... 25 more

This happens when the ClassLoader gets to
org.apache.shale.tiger.faces.VariableResolverImpl (which is in my
classpath). The actual text of the error message from Groovy is:

"Could not parse scriptName:
org\apache\shale\tiger\faces\VariableResolverImpl.groovy"

I'm not sure what's special about this class. Any ideas? I'm using 1.2_09
beta 1.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Kito D. Mann - Author, JavaServer Faces in Action
http://www.virtua.com - JSF/Java EE consulting, training, and mentoring
http://www.JSFCentral.com - JavaServer Faces FAQ, news, and info
phone: +1 203-653-2989
fax: +1 203-653-2988