Jetty用spring bean格式配置hotdeploy不生效

【问题】jetty独立启动使用原生的xml格式,hotdeploy是ok的,
但是embedded到mq中,采用spring bean格式,配置报错,但配置应该是正确的。

spring bean配置段如下:放置在server bean配置属性中。
/////////begin///////
<!--  hotdeploy =begin= -->
<property name="bean">
<list>
<bean id="deploymentManager" class="org.eclipse.jetty.deploy.DeploymentManager">
<property name="contexts" ref="contexts"/>
<property name="appProviders">
<list>
<bean id="webAppProvider" class="org.eclipse.jetty.deploy.providers.WebAppProvider">
<property name="monitoredDirName" value="webapps"/>
<property name="scanInterval" value="1"/>
<property name="extractWars" value="true"/>
</bean>
</list>
</property>
</bean>
</list>
</property>
<!--  hotdeploy =end= -->
/////////end/////////

生效的hotdeploy
///////////begin////////
[root@rfstdlinux165 bin]# grep Deploy ./jmap_01.txt
436:             5            160  org.eclipse.jetty.deploy.DeploymentManager$AppEntry
441:             2            160  org.eclipse.jetty.deploy.DeploymentManager
743:             2             32  org.eclipse.jetty.deploy.bindings.StandardDeployer
[root@rfstdlinux165 bin]# grep Webapp ./jmap_01.txt
[root@rfstdlinux165 bin]# grep WebApp ./jmap_01.txt
201:             4           1152  org.eclipse.jetty.webapp.WebAppContext
325:             4            384  org.eclipse.jetty.webapp.WebAppClassLoader
410:             2            192  org.eclipse.jetty.deploy.providers.WebAppProvider
529:             4             96  org.eclipse.jetty.webapp.WebAppContext$Context
763:             2             32  org.eclipse.jetty.deploy.providers.WebAppProvider$Filter
//////////end///////////

不起作用的hotdeploy
///////////begin///////////
[root@rfstdlinux165 bin]# grep WebApp ./jmap_local_01.txt
506:             3            864  org.eclipse.jetty.webapp.WebAppContext
779:             3            288  org.eclipse.jetty.webapp.WebAppClassLoader
807:             2            256  org.springframework.web.context.support.XmlWebApplicationContext
1214:             1             96  org.eclipse.jetty.deploy.providers.WebAppProvider
1267:             3             72  org.eclipse.jetty.webapp.WebAppContext$Context
1649:             2             32  org.springframework.web.context.support.WebApplicationContextUtils$WebRequestObjectFactory
1666:             2             32  org.springframework.web.context.support.WebApplicationContextUtils$RequestObjectFactory
1705:             2             32  org.springframework.web.context.support.WebApplicationContextUtils$SessionObjectFactory
2062:             1             16  org.eclipse.jetty.deploy.providers.WebAppProvider$Filter
[root@rfstdlinux165 bin]# grep Deploy ./jmap_local_01.txt
1246:             1             80  org.eclipse.jetty.deploy.DeploymentManager
///////////end/////////////
【分析】
1、从内存对象看,StandardDeployer类没有被加载到==>???
2、使用AMQ原有的配置文件,进行同样的配置,hotdeploy提示同样的配置错误,
   不支持<property name="beans">吗?
3、http://wiki.eclipse.org/Jetty/Feature/Deployment_Manager
jetty原生的deployManager配置有两种:
3.1>>>
///////////begin////////
<Configure id="Server" class="org.eclipse.jetty.server.Server">
        <Ref id="DeploymentManager">
          <Call name="addAppProvider">
            <Arg>
              <New class="org.eclipse.jetty.deploy.providers.ContextProvider">
                <Set name="monitoredDirName"><Property name="jetty.home" default="." />/contexts</Set>
                <Set name="scanInterval">1</Set>
              </New>
            </Arg>
          </Call>
        </Ref>
</Configure>
////////////end///////////
3.2>>>
////////////begin/////////
<Configure id="Server" class="org.eclipse.jetty.server.Server">

    <Call name="addBean">
      <Arg>
        <New id="DeploymentManager" class="org.eclipse.jetty.deploy.DeploymentManager">
          <Set name="contexts">
            <Ref id="Contexts" />
          </Set>
          <Call name="setContextAttribute">
            <Arg>org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern</Arg>
            <Arg>.*/.*jsp-api-[^/]*\.jar$|.*/.*jsp-[^/]*\.jar$|.*/.*taglibs[^/]*\.jar$</Arg>
          </Call>
         
        </New>
      </Arg>
    </Call>
</Configure>
////////////end////////////
4、Server类内部属性有:
   4.1、Connector[] _connectors
   4.2、ThreadPool _threadPool
   4.3、String __version
   4.4、AttributesMap _attributes
   4.5、Container _container
   4.6、SessionIdManager _sessionIdManager
   4.7、boolean _sendServerVersion
   4.8、boolean _sendDateHeader
   4.9、boolean _stopAtShutdown
   4.10、Handler _handler
   4.11、Server _server
   其中没有DeploymentManager或者bean的get方法。

你可能感兴趣的:(spring,jetty)