Meaningless Drivel is fun!*
The moose likes Struts and the fly likes Error with Struts 2 and Tiles 2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Error with Struts 2 and Tiles 2" Watch "Error with Struts 2 and Tiles 2" New topic
Author

Error with Struts 2 and Tiles 2

Dattatray Sutar
Ranch Hand

Joined: Jul 12, 2006
Posts: 46
Hi Ranchers,
Help needed again from you guys!!!

I am trying to user tiles 2 with Struts 2 and getting following error:


22:01:15,246 INFO [BasicTilesContainer] Initializing Tiles2 container. . .
22:01:15,266 ERROR [[/cht-war]] Exception sending context initialized event to listener instance of class org.apache.struts2.tiles.StrutsTilesListener
java.lang.NoClassDefFoundError: org/apache/commons/digester/Rule
at org.apache.tiles.definition.UrlDefinitionsFactory.init(UrlDefinitionsFactory.java:118)
at org.apache.tiles.impl.BasicTilesContainer.initializeDefinitionsFactory(BasicTilesContainer.java:185)
at org.apache.tiles.impl.BasicTilesContainer.init(BasicTilesContainer.java:121)
at org.apache.tiles.factory.TilesContainerFactory.initializeContainer(TilesContainerFactory.java:232)
at org.apache.tiles.factory.TilesContainerFactory.createTilesContainer(TilesContainerFactory.java:198)
at org.apache.tiles.factory.TilesContainerFactory.createContainer(TilesContainerFactory.java:163)
at org.apache.tiles.web.startup.TilesListener.createContainer(TilesListener.java:90)
at org.apache.struts2.tiles.StrutsTilesListener.createContainer(StrutsTilesListener.java:66)
at org.apache.tiles.web.startup.TilesListener.contextInitialized(TilesListener.java:57)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3854)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4359)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:761)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:741)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:553)
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.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:297)
at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.apache.catalina.core.StandardContext.init(StandardContext.java:5310)
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.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:297)
at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.web.tomcat.service.TomcatDeployer.performDeployInternal(TomcatDeployer.java:301)
at org.jboss.web.tomcat.service.TomcatDeployer.performDeploy(TomcatDeployer.java:104)
at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:375)
at org.jboss.web.WebModule.startModule(WebModule.java:83)
at org.jboss.web.WebModule.startService(WebModule.java:61)

at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
at sun.reflect.GeneratedMethodAccessor155.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
at $Proxy0.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:417)
at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy45.start(Unknown Source)
at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:466)
at sun.reflect.GeneratedMethodAccessor108.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
at org.jboss.ws.integration.jboss42.DeployerInterceptor.start(DeployerInterceptor.java:93)
at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)
at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy46.start(Unknown Source)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1015)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
at sun.reflect.GeneratedMethodAccessor18.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke


with regards<br />Datta.<br /> <br />To the world you might be one person, but to one person you just might be the world !
stefano Tra
Greenhorn

Joined: Apr 09, 2009
Posts: 10
Hi,
is a older post but is the same as my problem.

have you solve it? how?

thanks.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

java.lang.NoClassDefFoundError: org/apache/commons/digester/Rule

Do you have all the Tiles2 dependencies deployed?
stefano Tra
Greenhorn

Joined: Apr 09, 2009
Posts: 10
David Newton wrote:
java.lang.NoClassDefFoundError: org/apache/commons/digester/Rule

Do you have all the Tiles2 dependencies deployed?


what's it?

what libraries I've to put into my project?

i don't have here the libraries but it'll be: struts-tiles-pluging and 3 libraries with suffix tiles. isn't?
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

What libraries are you deploying? As far as I know there's no Commons Digester dependency for Tiles 2.
stefano Tra
Greenhorn

Joined: Apr 09, 2009
Posts: 10
hi.
the error is changed:

Error configuring application listener of class org.apache.struts2.tiles.StrutsTilesListener
java.lang.ClassNotFoundException: org.apache.struts2.tiles.StrutsTilesListener

i've put these libraries:
commons-beanutils-1.8.0.jar
commons-digester-1.8.1.jar
commons-logging-1.0.4.jar
commons-logging-api-1.1.jar
freemarker-2.3.8.jar
ognl-2.6.11.jar
struts2-core-2.0.14.jar
tiles-api-2.1.2.jar
tiles-compat-2.1.2.jar
tiles-core-2.1.2.jar
tiles-jsp-2.1.2.jar
tiles-portlet-2.1.2.jar
tiles-servlet-2.1.2.jar
xwork-2.0.7.jar


maybe the location of struts listener is somewhere else, but where?

David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Where's the tiles plugin?
stefano Tra
Greenhorn

Joined: Apr 09, 2009
Posts: 10
i think there is but i'm not write it down.
but someone has ever used the jboss with struts2 and tiles2?

because i've read over the net that's quite impossible to use struts2 and tiles2 inside jboss.

David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

You *think* it is, or it actually *is*?

You should remove the Tiles libraries you're not actually using, as they may introduce the dependency on digester (I'm thinking of tiles-compat--see here for why I believe that). You can't just put random libraries into a project if you're not using something to manage your transitive dependencies like Maven, Ivy, Buildr, etc.
stefano Tra
Greenhorn

Joined: Apr 09, 2009
Posts: 10
commons-beanutils-1.7.0.jar
commons-chain-1.2.jar
commons-collections-3.2.jar
commons-digester-1.8.jar
commons-fileupload-1.2.1.jar
commons-io-1.3.2.jar
commons-lang-2.3.jar
commons-logging-1.0.4.jar
commons-logging-api-1.1.jar
commons-validator-1.3.1.jar
freemarker-2.3.13.jar
ognl-2.6.11.jar
struts2-core-2.1.6.jar
struts2-tiles-plugin-2.1.6.jar
tiles-api-2.0.6.jar
tiles-core-2.0.6.jar
tiles-jsp-2.0.6.jar
xwork-2.1.2.jar

these are my libraries.

the error now is:

David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Need to see the S2 configs that are generating the error.

At one point also there was an issue with either XW2 or S2 regarding spaces in path names; I don't recall if that was a JBoss-specific issue or not but there's probably a issue tracker ticket for it somewhere (it's been fixed, but I don't know for which version).

My initial reaction is that you're using a tiles result without having defined the tiles result type in the package you're trying to use it in.
stefano Tra
Greenhorn

Joined: Apr 09, 2009
Posts: 10
well,
this is the struts.xml



the tiles.xml




web.xml



stefano Tra
Greenhorn

Joined: Apr 09, 2009
Posts: 10
someone can help me?
stefano Tra
Greenhorn

Joined: Apr 09, 2009
Posts: 10
WORKS! i soved it!

so, the netbeans when i clean and build the projects put all the lib (jar) inside the root of the ear.
so the ear is:

all the jars
web allpication.war
ejb application.jar

the jars has to be in WEB-INF/lib of the webApplication, someone knows how to do that? i've to move it by myself?

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error with Struts 2 and Tiles 2