在tomcat中没有问题,移植到jboss7出现下面问题。[ERROR][com.opensymphony.xwork2.util.finder.ClassFinder]- Unable to read class [WEB-INF.classes.leo.test.action.ShowCustAction] [2011-12-19 16:30:51,421] 
16:30:51,421 INFO  [stdout] (MSC service thread 1-2) Could not load WEB-INF/classes/leo/test/action/ShowCustAction.class - [unknown location]
16:30:51,421 INFO  [stdout] (MSC service thread 1-2)  at com.opensymphony.xwork2.util.finder.ClassFinder.readClassDef(ClassFinder.java:785)
16:30:51,421 INFO  [stdout] (MSC service thread 1-2)  at com.opensymphony.xwork2.util.finder.ClassFinder.<init>(ClassFinder.java:165)
16:30:51,421 INFO  [stdout] (MSC service thread 1-2)  at org.apache.struts2.convention.PackageBasedActionConfigBuilder.findActions(PackageBasedActionConfigBuilder.java:376)
16:30:51,421 INFO  [stdout] (MSC service thread 1-2)  at org.apache.struts2.convention.PackageBasedActionConfigBuilder.buildActionConfigs(PackageBasedActionConfigBuilder.java:334)
16:30:51,421 INFO  [stdout] (MSC service thread 1-2)  at org.apache.struts2.convention.ClasspathPackageProvider.loadPackages(ClasspathPackageProvider.java:53)
16:30:51,421 INFO  [stdout] (MSC service thread 1-2)  at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:215)
16:30:51,421 INFO  [stdout] (MSC service thread 1-2)  at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:66)
16:30:51,421 INFO  [stdout] (MSC service thread 1-2)  at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:390)
16:30:51,421 INFO  [stdout] (MSC service thread 1-2)  at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:436)
16:30:51,421 INFO  [stdout] (MSC service thread 1-2)  at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:195)
16:30:51,421 INFO  [stdout] (MSC service thread 1-2)  at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:447)
16:30:51,421 INFO  [stdout] (MSC service thread 1-2)  at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3245)
16:30:51,421 INFO  [stdout] (MSC service thread 1-2)  at org.apache.catalina.core.StandardContext.start(StandardContext.java:3836)
16:30:51,421 INFO  [stdout] (MSC service thread 1-2)  at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:70)
16:30:51,421 INFO  [stdout] (MSC service thread 1-2)  at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824)
16:30:51,421 INFO  [stdout] (MSC service thread 1-2)  at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759)
16:30:51,421 INFO  [stdout] (MSC service thread 1-2)  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
16:30:51,421 INFO  [stdout] (MSC service thread 1-2)  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
16:30:51,421 INFO  [stdout] (MSC service thread 1-2)  at java.lang.Thread.run(Thread.java:722)

解决方案 »

  1.   

    加上web.xml配置文件<?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    id="WebApp_ID" version="2.5">
    <display-name>shop2</display-name>
    <servlet>
    <servlet-name>LogListener</servlet-name>
    <servlet-class>leo.test.listener.LogListener</servlet-class>
    <init-param>
    <param-name>log4j_properties</param-name>
    <param-value>WEB-INF/classes/log4j.properties</param-value>
    </init-param>
    <init-param>
    <param-name>log4j_outPutFile</param-name>
    <param-value>log.log</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
    </servlet> <!-- 配置spring的监听器 -->
    <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>classpath*:applicationContext*.xml</param-value>
    </context-param>
    <!-- 开启监听 -->
    <listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener> <!-- Character Encoding filter, should be before org.apache.struts2.dispatcher.FilterDispatcher -->
    <filter>
    <filter-name>encodingFilter</filter-name>
    <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
    <init-param>
    <param-name>encoding</param-name>
    <param-value>UTF-8</param-value>
    </init-param>
    <init-param>
    <param-name>forceEncoding</param-name>
    <param-value>true</param-value>
    </init-param>
    </filter>
    <filter-mapping>
    <filter-name>encodingFilter</filter-name>
    <url-pattern>/*</url-pattern>
    </filter-mapping> <!-- <context-param> <param-name>log4jExposeWebAppRoot</param-name> <param-value>false</param-value> 
    </context-param> -->
    <!-- 配置OpenSessionInViewFilter,必须在struts2监听之前 -->
    <filter>
    <filter-name>lazyLoadingFilter</filter-name>
    <filter-class>
    org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
    </filter-class>
    </filter> <!-- 配置struts2的过滤器 -->
    <filter>
    <filter-name>struts2</filter-name>
    <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
    <init-param>
    <param-name>encoding</param-name>
    <param-value>UTF-8</param-value>
    </init-param>
    <init-param>
    <param-name>actionPackages</param-name>
    <param-value>leo.test.action</param-value>
    </init-param>
    </filter>
    <filter-mapping>
    <filter-name>struts2</filter-name>
    <url-pattern>/*</url-pattern>
    </filter-mapping> <filter>
    <filter-name>struts-cleanup</filter-name>
    <filter-class>org.apache.struts2.dispatcher.ActionContextCleanUp</filter-class>
    </filter>
    <filter-mapping>
    <filter-name>struts-cleanup</filter-name>
    <url-pattern>/*</url-pattern>
    </filter-mapping>
    <!-- 配置欢迎页 -->
    <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
    </welcome-file-list> <session-config>
    <session-timeout>600</session-timeout>
    </session-config>
    <error-page>
    <error-code>404</error-code>
    <location>/404.jsp</location>
    </error-page>
    <error-page>
    <error-code>500</error-code>
    <location>/500.jsp</location>
    </error-page>
    </web-app>
      

  2.   

    w我也遇到了同样的问题啊,是不是jboss的bug
      

  3.   

    可试一下在struts.xml中加一行:
    <constant name="struts.convention.package.locators" value="controller"/>