You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jared Blitzstein <ma...@blitzstein.net> on 2006/12/05 03:44:31 UTC

404 when enabling StrutsTilesListener in struts2

When I add:

	<listener>
   		<listener-class>org.apache.struts2.tiles.StrutsTilesListener</ 
listener-class>
	</listener>

to my web.xml, all my actions are 404's now. If I comment that line  
out, my actions go back to working. I set break points in the actions  
to make sure they're just not finding JSP's, but it's not hitting the  
actions.  My config is below, any help would be appreciated.

struts jars:
struts2-api-2.0.1.jar
struts2-core-2.0.1.jar
struts2-tiles-plugin-2.0.1.jar

web.xml:

<display-name>My Test App</display-name>
     <filter>
         <filter-name>struts2</filter-name>
         <filter- 
class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
     </filter>
     <filter-mapping>
         <filter-name>struts2</filter-name>
         <url-pattern>/*</url-pattern>
     </filter-mapping>
     <listener>
         <listener- 
class>org.springframework.web.context.ContextLoaderListener</listener- 
class>
     </listener>
     <listener>
   		<listener-class>org.apache.struts2.tiles.StrutsTilesListener</ 
listener-class>
	</listener>	
     <context-param>
   		<param-name>tilesDefinitions</param-name>
      	<param-value>/WEB-INF/tiles-def.xml</param-value>
     </context-param>
     <welcome-file-list>
         <welcome-file>index.html</welcome-file>
     </welcome-file-list>

struts.xml
<struts>
	<include file="customer.xml"/>
</struts>

customer.xml
<struts>
     <package name="customer" namespace="/customer" extends="struts- 
default">
		<result-types>
		  <result-type name="tiles"  
class="org.apache.struts2.views.tiles.TilesResult"/>
		</result-types>

         <action name="*"  
class="net.blitzstein.struts2.test.Customer" method="{1}">
         	<result name="list">/pages/customer/list.jsp</result>
         	<result name="edit">/pages/customer/edit.jsp</result>
         	<result name="test" type="tiles">tilesWorks</result>
         </action>

         <!-- Add actions here -->
     </package>
</struts>

Re: 404 when enabling StrutsTilesListener in struts2

Posted by Jared Blitzstein <ma...@blitzstein.net>.
It's a NoClassDef. It's referencing a package I don't have. Am I  
supposed to have that there or is that supposed to be in the core  
libraries?

2006-12-05 10:08:05 StandardContext[/struts2]Error configuring  
application listener of class  
org.apache.struts2.tiles.StrutsTilesListener
java.lang.NoClassDefFoundError: org/apache/tiles/listener/TilesListener
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
	at java.security.SecureClassLoader.defineClass 
(SecureClassLoader.java:124)
	at org.apache.catalina.loader.WebappClassLoader.findClassInternal 
(WebappClassLoader.java:1634)
	at org.apache.catalina.loader.WebappClassLoader.findClass 
(WebappClassLoader.java:860)
	at org.apache.catalina.loader.WebappClassLoader.loadClass 
(WebappClassLoader.java:1307)
	at org.apache.catalina.loader.WebappClassLoader.loadClass 
(WebappClassLoader.java:1189)
	at org.apache.catalina.core.StandardContext.listenerStart 
(StandardContext.java:3775)
	at org.apache.catalina.core.StandardContext.start 
(StandardContext.java:4343)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java: 
1083)
	at org.apache.catalina.core.StandardHost.start(StandardHost.java:789)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java: 
1083)
	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java: 
478)
	at org.apache.catalina.core.StandardService.start 
(StandardService.java:480)
	at org.apache.catalina.core.StandardServer.start(StandardServer.java: 
2313)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:556)
	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:287)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425)


On Dec 4, 2006, at 10:16 PM, David H. DeWolf wrote:

> Hmm, we have another open issue about tiles failure with 2.0.1.    
> The problem seems to be with the version of tiles that's being  
> used. Unfortunately, since 2.0.1 was rolled with a snapshot, it's  
> hard to figure out exactly what it should be. . .
>
> Do you have a stack trace?  there should be one in catalina.out.   
> Can you send it along?  thanks.
>
> All of this should be fixed as soon as 2.0.2 comes out since we've  
> got a versioned snapshot we rely on now.
>
>
> Sorry for the frustration,
>
> David
>
> Jared Blitzstein wrote:
>> When I add:
>>     <listener>
>>           <listener- 
>> class>org.apache.struts2.tiles.StrutsTilesListener</listener- 
>> class>     </listener>
>> to my web.xml, all my actions are 404's now. If I comment that  
>> line out, my actions go back to working. I set break points in the  
>> actions to make sure they're just not finding JSP's, but it's not  
>> hitting the actions.  My config is below, any help would be  
>> appreciated.
>> struts jars:
>> struts2-api-2.0.1.jar
>> struts2-core-2.0.1.jar
>> struts2-tiles-plugin-2.0.1.jar
>> web.xml:
>> <display-name>My Test App</display-name>
>>     <filter>
>>         <filter-name>struts2</filter-name>
>>         <filter- 
>> class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
>>     </filter>
>>     <filter-mapping>
>>         <filter-name>struts2</filter-name>
>>         <url-pattern>/*</url-pattern>
>>     </filter-mapping>
>>     <listener>
>>         <listener- 
>> class>org.springframework.web.context.ContextLoaderListener</ 
>> listener-class>     </listener>
>>     <listener>
>>           <listener- 
>> class>org.apache.struts2.tiles.StrutsTilesListener</listener- 
>> class>     </listener>       <context-param>
>>           <param-name>tilesDefinitions</param-name>
>>          <param-value>/WEB-INF/tiles-def.xml</param-value>
>>     </context-param>
>>     <welcome-file-list>
>>         <welcome-file>index.html</welcome-file>
>>     </welcome-file-list>
>> struts.xml
>> <struts>
>>     <include file="customer.xml"/>
>> </struts>
>> customer.xml
>> <struts>
>>     <package name="customer" namespace="/customer" extends="struts- 
>> default">
>>         <result-types>
>>           <result-type name="tiles"  
>> class="org.apache.struts2.views.tiles.TilesResult"/>
>>         </result-types>
>>         <action name="*"  
>> class="net.blitzstein.struts2.test.Customer" method="{1}">
>>             <result name="list">/pages/customer/list.jsp</result>
>>             <result name="edit">/pages/customer/edit.jsp</result>
>>             <result name="test" type="tiles">tilesWorks</result>
>>         </action>
>>         <!-- Add actions here -->
>>     </package>
>> </struts>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: 404 when enabling StrutsTilesListener in struts2

Posted by "David H. DeWolf" <dd...@apache.org>.
Hmm, we have another open issue about tiles failure with 2.0.1.   The 
problem seems to be with the version of tiles that's being used. 
Unfortunately, since 2.0.1 was rolled with a snapshot, it's hard to 
figure out exactly what it should be. . .

Do you have a stack trace?  there should be one in catalina.out.  Can 
you send it along?  thanks.

All of this should be fixed as soon as 2.0.2 comes out since we've got a 
versioned snapshot we rely on now.


Sorry for the frustration,

David

Jared Blitzstein wrote:
> When I add:
> 
>     <listener>
>           
> <listener-class>org.apache.struts2.tiles.StrutsTilesListener</listener-class> 
> 
>     </listener>
> 
> to my web.xml, all my actions are 404's now. If I comment that line out, 
> my actions go back to working. I set break points in the actions to make 
> sure they're just not finding JSP's, but it's not hitting the actions.  
> My config is below, any help would be appreciated.
> 
> struts jars:
> struts2-api-2.0.1.jar
> struts2-core-2.0.1.jar
> struts2-tiles-plugin-2.0.1.jar
> 
> web.xml:
> 
> <display-name>My Test App</display-name>
>     <filter>
>         <filter-name>struts2</filter-name>
>         
> <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
>     </filter>
>     <filter-mapping>
>         <filter-name>struts2</filter-name>
>         <url-pattern>/*</url-pattern>
>     </filter-mapping>
>     <listener>
>         
> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> 
> 
>     </listener>
>     <listener>
>           
> <listener-class>org.apache.struts2.tiles.StrutsTilesListener</listener-class> 
> 
>     </listener>   
>     <context-param>
>           <param-name>tilesDefinitions</param-name>
>          <param-value>/WEB-INF/tiles-def.xml</param-value>
>     </context-param>
>     <welcome-file-list>
>         <welcome-file>index.html</welcome-file>
>     </welcome-file-list>
> 
> struts.xml
> <struts>
>     <include file="customer.xml"/>
> </struts>
> 
> customer.xml
> <struts>
>     <package name="customer" namespace="/customer" 
> extends="struts-default">
>         <result-types>
>           <result-type name="tiles" 
> class="org.apache.struts2.views.tiles.TilesResult"/>
>         </result-types>
> 
>         <action name="*" class="net.blitzstein.struts2.test.Customer" 
> method="{1}">
>             <result name="list">/pages/customer/list.jsp</result>
>             <result name="edit">/pages/customer/edit.jsp</result>
>             <result name="test" type="tiles">tilesWorks</result>
>         </action>
> 
>         <!-- Add actions here -->
>     </package>
> </struts>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org