aspose file tools*
The moose likes Struts and the fly likes struts2 question! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "struts2 question!" Watch "struts2 question!" New topic
Author

struts2 question!

Kevin lee
Greenhorn

Joined: Sep 20, 2007
Posts: 5
That exception when i startup the tomcat.
严重: Actual exception
Caught Exception while registering Interceptor class org.apache.struts2.interceptor.debugging.DebuggingInterceptor - interceptor - jar:file:/D:/Program%20Files/Apache%20Software%20Foundation/Tomcat%206.0/webapps/struts2/WEB-INF/lib/struts2-core-2.0.11.jar!/struts-default.xml:98:115
at org.apache.struts2.impl.StrutsObjectFactory.buildInterceptor(StrutsObjectFactory.java:78)
at com.opensymphony.xwork2.config.providers.InterceptorBuilder.constructInterceptorReference(InterceptorBuilder.java:57)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.lookupInterceptorReference(XmlConfigurationProvider.java:905)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadInterceptorStack(XmlConfigurationProvider.java:743)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadInterceptorStacks(XmlConfigurationProvider.java:756)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadInterceptors(XmlConfigurationProvider.java:777)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:410)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages(XmlConfigurationProvider.java:239)
at org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:111)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reload(DefaultConfiguration.java:152)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:52)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:395)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:452)
at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:201)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:108)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3693)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)
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:525)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:825)
at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:714)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1023)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1015)
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:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: com.opensymphony.xwork2.inject.DependencyException: com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyException: No mapping found for dependency [type=org.apache.struts2.views.freemarker.FreemarkerManager, name='default'] in public void org.apache.struts2.interceptor.debugging.DebuggingInterceptor.setFreemarkerManager(org.apache.struts2.views.freemarker.FreemarkerManager).
at com.opensymphony.xwork2.inject.ContainerImpl.addInjectorsForMembers(ContainerImpl.java:157)
at com.opensymphony.xwork2.inject.ContainerImpl.addInjectorsForMethods(ContainerImpl.java:126)
at com.opensymphony.xwork2.inject.ContainerImpl.addInjectors(ContainerImpl.java:103)
at com.opensymphony.xwork2.inject.ContainerImpl$1.create(ContainerImpl.java:84)
at com.opensymphony.xwork2.inject.ContainerImpl$1.create(ContainerImpl.java:82)
at com.opensymphony.xwork2.inject.util.ReferenceCache$CallableCreate.call(ReferenceCache.java:155)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at com.opensymphony.xwork2.inject.util.ReferenceCache.internalCreate(ReferenceCache.java:81)
at com.opensymphony.xwork2.inject.util.ReferenceCache.get(ReferenceCache.java:121)
at com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:452)
at com.opensymphony.xwork2.inject.ContainerImpl$6.call(ContainerImpl.java:492)
at com.opensymphony.xwork2.inject.ContainerImpl$6.call(ContainerImpl.java:491)
at com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:542)
at com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:490)
at com.opensymphony.xwork2.ObjectFactory.injectInternalBeans(ObjectFactory.java:131)
at com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:156)
at com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:143)
at org.apache.struts2.impl.StrutsObjectFactory.buildInterceptor(StrutsObjectFactory.java:53)
... 40 more
Caused by: com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyException: No mapping found for dependency [type=org.apache.struts2.views.freemarker.FreemarkerManager, name='default'] in public void org.apache.struts2.interceptor.debugging.DebuggingInterceptor.setFreemarkerManager(org.apache.struts2.views.freemarker.FreemarkerManager).
at com.opensymphony.xwork2.inject.ContainerImpl.createParameterInjector(ContainerImpl.java:239)
at com.opensymphony.xwork2.inject.ContainerImpl.getParametersInjectors(ContainerImpl.java:229)
at com.opensymphony.xwork2.inject.ContainerImpl$MethodInjector.<init>(ContainerImpl.java:282)
at com.opensymphony.xwork2.inject.ContainerImpl$3.create(ContainerImpl.java:130)
at com.opensymphony.xwork2.inject.ContainerImpl$3.create(ContainerImpl.java:128)
at com.opensymphony.xwork2.inject.ContainerImpl.addInjectorsForMembers(ContainerImpl.java:154)
... 58 more
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

problem is in your struts.xml file, post that xml file here .. Along with directory structure of file.


[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
Kevin lee
Greenhorn

Joined: Sep 20, 2007
Posts: 5
thanks Sagar Rohankar.
The struts.xml is:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">

<struts>
<package name="lee" extends="struts-default">
<action name="Login" class="com.lining.action.LoginAction">
<result name="success">/welcome.jsp</result>
<result name="error">/error.jsp</result>
<result name="input">/index.jsp</result>
</action>
<action name="GetBooks" class="com.lining.action.GetBooksAction">
<result name="success">/showBook.jsp</result>
<result name="login">/login.jsp</result>
</action>
</package>
</struts>
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

add below lines in your struts.xml file after DTD declration and before "struts" tag ..



better way is to unzip the struts2-blank.war file that comes with the download and use that as the basis for your struts project. This will help you to avoid a lot of simple configuration mistakes.
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9349
    
    2

Originally posted by Sagar Rohankar:
add below lines in your struts.xml file after DTD declration and before "struts" tag ..



better way is to unzip the struts2-blank.war file that comes with the download and use that as the basis for your struts project. This will help you to avoid a lot of simple configuration mistakes.


I wanted to know why do we need to use those constants in the struts.xml file? Can you please explain?


SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

hi,

make sure you have the struts2-core-2.0.6.jar in your lib folder..

and just add <%@ taglib prefix="s" uri="/struts-tags" %> in your jsp.
no need to add any entry in web.xml.

are you using

<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">

in your web.xml header.?

Thanks,

I wanted to know why do we need to use those constants in the struts.xml file? Can you please explain?


I thought it may help , because as they are in struts2-blank.war file, but after googling i found they are not necessary !! And about there use , here is it .. info
Kevin lee
Greenhorn

Joined: Sep 20, 2007
Posts: 5
Originally posted by Sagar Rohankar:
hi,

make sure you have the struts2-core-2.0.6.jar in your lib folder..

and just add <%@ taglib prefix="s" uri="/struts-tags" %> in your jsp.
no need to add any entry in web.xml.

are you using

<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">

in your web.xml header.?

Thanks,



I thought it may help , because as they are in struts2-blank.war file, but after googling i found they are not necessary !! And about there use , here is it .. info


thanks.
I have the struts2-core-2.0.6.jar in my lib folder.However, the problem is not resolved.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: struts2 question!