type Status reportmessage Servlet action is not availabledescription The requested resource (Servlet action is not available) is not available.下面是我的部分重要代码。(出现上面的错误似乎和下面这些数据有关,因为我如果仅仅用Struts+hibernate来实现操作的话就没有任何问题,加入spring代理的以下代码就出现上面的错误了)Struts-config里主要的代码:
<controller processorClass="org.springframework.web.struts.DelegatingRequestProcessor"/>
  <message-resources parameter="com.luoxg.struts.ApplicationResources" />
  <plug-in className="org.springframework.web.struts.ContextLoaderPlugIn" >
     <set-property property="contextConfigLocation" value="/WEB-INF/applicationContext.xml" />
  </plug-in> /WEB-INF下的Spring配置文件 applicationContext里的主要代码:
<bean name="/user" class="com.luoxg.struts.action.UserAction"
abstract="false" lazy-init="default" autowire="default"
dependency-check="default">
<property name="userService">
<ref local="userService" />
</property>
</bean>有人提议把plug-in属性从Struts配置文件里替换到web.xml中试一下 我也照做了:
  web.xml主要代码:
 <context-param>   
<param-name>contextConfigLocation</param-name>   
<param-value>/WEB-INF/applicationContext.xml</param-value>   
</context-param>   
<servlet>   
<servlet-name>context</servlet-name>   
<servlet-class>org.springframework.web.context.ContextLoaderServlet</servlet-class>   
<load-on-startup>1</load-on-startup>   
</servlet> 但是无论如何还是有上面的那个错, 即使我再把Spring.jar这个myeclipse没有导入的包手工导入后,结果还是错。哪位朋友能帮我解决下上面的问题啊,万分感谢。。

解决方案 »

  1.   

          我也遇到过类似的问题,后来解决了。我觉得应该是bean的属性userService有问题,你的userService是个什么样的
    类,写出来看看呀。建议你先把bean “/user”的属性去掉即写成下面的样子
    <bean name="/user" class="com.luoxg.struts.action.UserAction" 
    abstract="false" lazy-init="default" autowire="default" 
    dependency-check="default"> 
    </bean>  然后再改改相关的文件配置再测试看看。把复杂的问题简单化嘛。
    如果按我说的做 没有出现错误的话 那就证明struts和spring的整合设置没有错,
    错在你的property属性的userService上了
      

  2.   

    终于找出错误了,myeclipse少导入了一个名为commons-pool.jar的包,我从网上下载了一个手工导入后就没问题了。还是谢谢了,真是郁闷,myeclipse经常少导入一些包。spring.jar也是手工导入