在一个简单而无BUG的strut2.1的项目项目中,加入C:/jboss-4.2.2.GA/client目录中的JAR文件,部署到apache-tomcat-6.0.18上,立马出现以下的BUG
consoled的输出
2009-12-14 12:15:25 org.apache.catalina.core.AprLifecycleListener init
信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:/jdk1.6.0_11/bin;C:/apache-tomcat-6.0.18/bin
2009-12-14 12:15:25 org.apache.coyote.http11.Http11Protocol init
信息: Initializing Coyote HTTP/1.1 on http-8888
2009-12-14 12:15:25 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 579 ms
2009-12-14 12:15:25 org.apache.catalina.core.StandardService start
信息: Starting service Catalina
2009-12-14 12:15:25 org.apache.catalina.core.StandardEngine start
信息: Starting Servlet Engine: Apache Tomcat/6.0.18
2009-12-14 12:15:26 org.apache.catalina.loader.WebappClassLoader validateJarFile
信息: validateJarFile(C:/apache-tomcat-6.0.18/webapps/456789/WEB-INF/lib/servlet-api.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
DEBUG [main] (CommonsLogger.java:57) - Loading action configurations from: struts-default.xml
DEBUG [main] (CommonsLogger.java:57) - Loaded action configuration from: struts-default.xml
INFO [main] (CommonsLogger.java:31) - Parsing configuration file [struts-default.xml]
DEBUG [main] (CommonsLogger.java:57) - Loaded type: name:xwork impl:com.opensymphony.xwork2.ObjectFactory
DEBUG [main] (CommonsLogger.java:57) - Loaded type:com.opensymphony.xwork2.ObjectFactory name:struts impl:org.apache.struts2.impl.StrutsObjectFactory
DEBUG [main] (CommonsLogger.java:57) - Loaded type:com.opensymphony.xwork2.ActionProxyFactory name:xwork impl:com.opensymphony.xwork2.DefaultActionProxyFactory
DEBUG [main] (CommonsLogger.java:57) - Loaded type:com.opensymphony.xwork2.ActionProxyFactory name:struts impl:org.apache.struts2.impl.StrutsActionProxyFactory
DEBUG [main] (CommonsLogger.java:57) - Loaded type:com.opensymphony.xwork2.conversion.ObjectTypeDeterminer name:tiger impl:com.opensymphony.xwork2.conversion.impl.DefaultObjectTypeDeterminer
DEBUG [main] (CommonsLogger.java:57) - Loaded type:com.opensymphony.xwork2.conversion.ObjectTypeDeterminer name:notiger impl:com.opensymphony.xwork2.conversion.impl.DefaultObjectTypeDeterminer
DEBUG [main] (CommonsLogger.java:57) - Loaded type:com.opensymphony.xwork2.conversion.ObjectTypeDeterminer name:struts impl:com.opensymphony.xwork2.conversion.impl.DefaultObjectTypeDeterminer
DEBUG [main] (CommonsLogger.java:57) - Loaded type:com.opensymphony.xwork2.util.PatternMatcher name:struts impl:com.opensymphony.xwork2.util.WildcardHelper
DEBUG [main] (CommonsLogger.java:57) - Loaded type:org.apache.struts2.dispatcher.mapper.ActionMapper name:struts impl:org.apache.struts2.dispatcher.mapper.DefaultActionMapper
DEBUG [main] (CommonsLogger.java:57) - Loaded type:org.apache.struts2.dispatcher.mapper.ActionMapper name:composite impl:org.apache.struts2.dispatcher.mapper.CompositeActionMapper
DEBUG [main] (CommonsLogger.java:57) - Loaded type:org.apache.struts2.dispatcher.mapper.ActionMapper name:restful impl:org.apache.struts2.dispatcher.mapper.RestfulActionMapper
DEBUG [main] (CommonsLogger.java:57) - Loaded type:org.apache.struts2.dispatcher.mapper.ActionMapper name:restful2 impl:org.apache.struts2.dispatcher.mapper.Restful2ActionMapper
DEBUG [main] (CommonsLogger.java:57) - Loaded type:org.apache.struts2.dispatcher.multipart.MultiPartRequest name:struts impl:org.apache.struts2.dispatcher.multipart.JakartaMultiPartRequest
DEBUG [main] (CommonsLogger.java:57) - Loaded type:org.apache.struts2.dispatcher.multipart.MultiPartRequest name:jakarta impl:org.apache.struts2.dispatcher.multipart.JakartaMultiPartRequest
DEBUG [main] (CommonsLogger.java:57) - Loaded type:org.apache.struts2.views.TagLibrary name:s impl:org.apache.struts2.views.DefaultTagLibrary
DEBUG [main] (CommonsLogger.java:57) - Loaded type: name:struts impl:org.apache.struts2.views.freemarker.FreemarkerManager
DEBUG [main] (CommonsLogger.java:57) - Unable to load optional class: java.lang.NoClassDefFoundError: org/apache/velocity/context/Context
DEBUG [main] (CommonsLogger.java:57) - Loaded type: name:default impl:org.apache.struts2.components.template.TemplateEngineManager
DEBUG [main] (CommonsLogger.java:57) - Loaded type:org.apache.struts2.components.template.TemplateEngine name:ftl impl:org.apache.struts2.components.template.FreemarkerTemplateEngine
DEBUG [main] (CommonsLogger.java:57) - Loaded type:org.apache.struts2.components.template.TemplateEngine name:vm impl:org.apache.struts2.components.template.VelocityTemplateEngine
DEBUG [main] (CommonsLogger.java:57) - Loaded type:org.apache.struts2.components.template.TemplateEngine name:jsp impl:org.apache.struts2.components.template.JspTemplateEngine
DEBUG [main] (CommonsLogger.java:57) - Loaded type:com.opensymphony.xwork2.conversion.impl.XWorkConverter name:struts impl:com.opensymphony.xwork2.conversion.impl.XWorkConverter
DEBUG [main] (CommonsLogger.java:57) - Loaded type:com.opensymphony.xwork2.conversion.impl.XWorkConverter name:xwork1 impl:com.opensymphony.xwork2.conversion.impl.XWorkConverter
DEBUG [main] (CommonsLogger.java:57) - Loaded type: name:default impl:com.opensymphony.xwork2.conversion.impl.XWorkBasicConverter
DEBUG [main] (CommonsLogger.java:57) - Loaded type:com.opensymphony.xwork2.TextProvider name:xwork1 impl:com.opensymphony.xwork2.TextProviderSupport
DEBUG [main] (CommonsLogger.java:57) - Loaded type:com.opensymphony.xwork2.TextProvider name:struts impl:com.opensymphony.xwork2.TextProviderSupport
DEBUG [main] (CommonsLogger.java:57) - Loaded type:org.apache.struts2.components.UrlRenderer name:struts impl:org.apache.struts2.components.ServletUrlRenderer
DEBUG [main] (CommonsLogger.java:57) - Loaded type:com.opensymphony.xwork2.util.ValueStackFactory name:struts impl:com.opensymphony.xwork2.ognl.OgnlValueStackFactory
DEBUG [main] (CommonsLogger.java:57) - Loaded type:com.opensymphony.xwork2.util.reflection.ReflectionProvider name:struts impl:com.opensymphony.xwork2.ognl.OgnlReflectionProvider
DEBUG [main] (CommonsLogger.java:57) - Loaded type:com.opensymphony.xwork2.util.reflection.ReflectionContextFactory name:struts impl:com.opensymphony.xwork2.ognl.OgnlReflectionContextFactory
DEBUG [main] (CommonsLogger.java:57) - Loaded type:com.opensymphony.xwork2.TextProvider name:system impl:com.opensymphony.xwork2.DefaultTextProvider
DEBUG [main] (CommonsLogger.java:57) - Loaded type:com.opensymphony.xwork2.conversion.NullHandler name:java.lang.Object impl:com.opensymphony.xwork2.conversion.impl.InstantiatingNullHandler
DEBUG [main] (CommonsLogger.java:57) - Loaded type:com.opensymphony.xwork2.validator.ActionValidatorManager name:struts impl:com.opensymphony.xwork2.validator.AnnotationActionValidatorManager
DEBUG [main] (CommonsLogger.java:57) - Loaded type:com.opensymphony.xwork2.validator.ActionValidatorManager name:no-annotations impl:com.opensymphony.xwork2.validator.DefaultActionValidatorManager
DEBUG [main] (CommonsLogger.java:57) - Loaded type:com.opensymphony.xwork2.validator.ValidatorFactory name:default impl:com.opensymphony.xwork2.validator.DefaultValidatorFactory
DEBUG [main] (CommonsLogger.java:57) - Loaded type:com.opensymphony.xwork2.validator.ValidatorFileParser name:default impl:com.opensymphony.xwork2.validator.DefaultValidatorFileParser
DEBUG [main] (CommonsLogger.java:57) - Loaded type: name:default impl:com.opensymphony.xwork2.ognl.OgnlUtil
DEBUG [main] (CommonsLogger.java:57) - Loaded type:ognl.PropertyAccessor name:com.opensymphony.xwork2.util.CompoundRoot impl:com.opensymphony.xwork2.ognl.accessor.CompoundRootAccessor
DEBUG [main] (CommonsLogger.java:57) - Loaded type:ognl.PropertyAccessor name:java.lang.Object impl:com.opensymphony.xwork2.ognl.accessor.ObjectAccessor
DEBUG [main] (CommonsLogger.java:57) - Loaded type:ognl.PropertyAccessor name:java.util.Iterator impl:com.opensymphony.xwork2.ognl.accessor.XWorkIteratorPropertyAccessor
DEBUG [main] (CommonsLogger.java:57) - Loaded type:ognl.PropertyAccessor name:java.util.Enumeration impl:com.opensymphony.xwork2.ognl.accessor.XWorkEnumerationAccessor
DEBUG [main] (CommonsLogger.java:57) - Loaded type:ognl.PropertyAccessor name:java.util.List impl:com.opensymphony.xwork2.ognl.accessor.XWorkListPropertyAccessor
DEBUG [main] (CommonsLogger.java:57) - Loaded type:ognl.PropertyAccessor name:java.util.Set impl:com.opensymphony.xwork2.ognl.accessor.XWorkCollectionPropertyAccessor
DEBUG [main] (CommonsLogger.java:57) - Loaded type:ognl.PropertyAccessor name:java.util.Map impl:com.opensymphony.xwork2.ognl.accessor.XWorkMapPropertyAccessor
DEBUG [main] (CommonsLogger.java:57) - Loaded type:ognl.PropertyAccessor name:java.util.Collection impl:com.opensymphony.xwork2.ognl.accessor.XWorkCollectionPropertyAccessor
DEBUG [main] (CommonsLogger.java:57) - Loaded type:ognl.PropertyAccessor name:com.opensymphony.xwork2.ognl.ObjectProxy impl:com.opensymphony.xwork2.ognl.accessor.ObjectProxyPropertyAccessor
DEBUG [main] (CommonsLogger.java:57) - Loaded type:ognl.MethodAccessor name:java.lang.Object impl:com.opensymphony.xwork2.ognl.accessor.XWorkMethodAccessor
DEBUG [main] (CommonsLogger.java:57) - Loaded type:ognl.MethodAccessor name:com.opensymphony.xwork2.util.CompoundRoot impl:com.opensymphony.xwork2.ognl.accessor.CompoundRootAccessor
DEBUG [main] (CommonsLogger.java:57) - Loaded type: name:default impl:org.apache.struts2.views.jsp.ui.OgnlTool
DEBUG [main] (CommonsLogger.java:57) - Loaded type:org.apache.struts2.dispatcher.StaticContentLoader name:struts impl:org.apache.struts2.dispatcher.DefaultStaticContentLoader
DEBUG [main] (CommonsLogger.java:57) - Loaded type:com.opensymphony.xwork2.UnknownHandlerManager name:struts impl:com.opensymphony.xwork2.DefaultUnknownHandlerManager
DEBUG [main] (CommonsLogger.java:57) - Loaded type:ognl.PropertyAccessor name:java.util.ArrayList impl:com.opensymphony.xwork2.ognl.accessor.XWorkListPropertyAccessor
DEBUG [main] (CommonsLogger.java:57) - Loaded type:ognl.PropertyAccessor name:java.util.HashSet impl:com.opensymphony.xwork2.ognl.accessor.XWorkCollectionPropertyAccessor
DEBUG [main] (CommonsLogger.java:57) - Loaded type:ognl.PropertyAccessor name:java.util.HashMap impl:com.opensymphony.xwork2.ognl.accessor.XWorkMapPropertyAccessor
DEBUG [main] (CommonsLogger.java:57) - Loading action configurations from: struts-plugin.xml
INFO [main] (CommonsLogger.java:31) - Unable to locate configuration files of the name struts-plugin.xml, skipping
INFO [main] (CommonsLogger.java:31) - Parsing configuration file [struts-plugin.xml]
DEBUG [main] (CommonsLogger.java:57) - Loading action configurations from: struts.xml
INFO [main] (CommonsLogger.java:31) - Unable to locate configuration files of the name struts.xml, skipping
INFO [main] (CommonsLogger.java:31) - Parsing configuration file [struts.xml]
DEBUG [main] (CommonsLogger.java:57) - struts.properties missing
INFO [main] (CommonsLogger.java:31) - Choosing bean (struts) for class com.opensymphony.xwork2.ObjectFactory
INFO [main] (CommonsLogger.java:31) - Choosing bean (struts) for class com.opensymphony.xwork2.conversion.impl.XWorkConverter
INFO [main] (CommonsLogger.java:31) - Choosing bean (struts) for interface com.opensymphony.xwork2.TextProvider
INFO [main] (CommonsLogger.java:31) - Choosing bean (struts) for interface com.opensymphony.xwork2.ActionProxyFactory
INFO [main] (CommonsLogger.java:31) - Choosing bean (struts) for interface com.opensymphony.xwork2.conversion.ObjectTypeDeterminer
INFO [main] (CommonsLogger.java:31) - Choosing bean (struts) for interface org.apache.struts2.dispatcher.mapper.ActionMapper
INFO [main] (CommonsLogger.java:31) - Choosing bean (jakarta) for interface org.apache.struts2.dispatcher.multipart.MultiPartRequest
INFO [main] (CommonsLogger.java:31) - Choosing bean (struts) for class org.apache.struts2.views.freemarker.FreemarkerManager
DEBUG [main] (CommonsLogger.java:57) - Choosing bean (struts) for class org.apache.struts2.views.velocity.VelocityManager to be loaded from the ObjectFactory
INFO [main] (CommonsLogger.java:31) - Choosing bean (struts) for interface org.apache.struts2.components.UrlRenderer
INFO [main] (CommonsLogger.java:31) - Choosing bean (struts) for interface com.opensymphony.xwork2.validator.ActionValidatorManager
INFO [main] (CommonsLogger.java:31) - Choosing bean (struts) for interface com.opensymphony.xwork2.util.ValueStackFactory
INFO [main] (CommonsLogger.java:31) - Choosing bean (struts) for interface com.opensymphony.xwork2.util.reflection.ReflectionProvider
INFO [main] (CommonsLogger.java:31) - Choosing bean (struts) for interface com.opensymphony.xwork2.util.reflection.ReflectionContextFactory
INFO [main] (CommonsLogger.java:31) - Choosing bean (struts) for interface com.opensymphony.xwork2.util.PatternMatcher
INFO [main] (CommonsLogger.java:31) - Choosing bean (struts) for interface org.apache.struts2.dispatcher.StaticContentLoader
INFO [main] (CommonsLogger.java:31) - Choosing bean (struts) for interface com.opensymphony.xwork2.UnknownHandlerManager
DEBUG [main] (CommonsLogger.java:57) - Added default resource bundle 'org/apache/struts2/struts-messages' to default resource bundles = [org/apache/struts2/struts-messages, com/opensymphony/xwork2/xwork-messages]
DEBUG [main] (CommonsLogger.java:57) - Loaded [BUILDER] {PackageConfig Name:struts-default namespace: parents:[]}
DEBUG [main] (CommonsLogger.java:57) - Loading validator definitions.
DEBUG [main] (CommonsLogger.java:57) - new I18nInterceptor()
DEBUG [main] (CommonsLogger.java:57) - new I18nInterceptor()
DEBUG [main] (CommonsLogger.java:57) - new I18nInterceptor()
2009-12-14 12:15:30 org.apache.catalina.core.ApplicationContext log
信息: ContextListener: contextInitialized()
2009-12-14 12:15:30 org.apache.catalina.core.ApplicationContext log
信息: SessionListener: contextInitialized()
2009-12-14 12:15:30 org.apache.coyote.http11.Http11Protocol start
信息: Starting Coyote HTTP/1.1 on http-8888
2009-12-14 12:15:30 org.apache.jk.common.ChannelSocket init
信息: JK: ajp13 listening on /0.0.0.0:8889
2009-12-14 12:15:30 org.apache.jk.server.JkMain start
信息: Jk running ID=0 time=0/125 config=null
2009-12-14 12:15:30 org.apache.catalina.startup.Catalina start
信息: Server startup in 5152 ms
具体情况是:
Struts2的包有:
commons-fileupload-1.2.1.jar
commons-io-1.3.2.jar
commons-logging-1.1.jar
freemarker-2.3.13.jar
ognl-2.6.11.jar
struts2-core-2.1.6.jar
xwork-2.1.2.jar
而jboss的版本是 jboss-4.2.2.GA
tomcat的版本是 apache-tomcat-6.0.18
平台是MyEclipse7.0
JDK是jdk1.6.0_11 (版本 1.5也试过)
问题尝试解决:
1.更改compiler 包括Tomcat 和project
一样出问题
2.改Struts的filter
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
org.apache.struts2.dispatcher.FilterDispatcher
不行
3.新建工程
该工程只有Struts的包和jboss client上的包
和web.xml文件
web.xml文件的代码为
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<filter>
<filter-name>struts2</filter-name>
<!--<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>-->
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>
还是不行
4.Google
发现有人集成了Struts2和EJB3
http://biaowen.javaeye.com/blog/344887
可我还是弄不懂