在没有 jRebel 的情况下启动时,jetty 的调试日志包含许多引用 MyApplicationScopedBean 的消息,例如:
13:46:29.620 [main] DEBUG o.e.jetty.webapp.WebAppClassLoader - loaded class MyApplicationScopedBean from WebAppClassLoader=571787213@2214c7cd
13:46:32.132 [main] DEBUG o.e.jetty.webapp.WebAppClassLoader - loaded class MyApplicationScopedBean$1 from WebAppClassLoader=571787213@2214c7cd
13:46:32.162 [main] DEBUG o.e.jetty.webapp.WebAppClassLoader - loaded class MyApplicationScopedBean$2 from WebAppClassLoader=571787213@2214c7cd
...
但是对于 jRebel,日志只包含一个关于 MyApplicationScopedBean 的字符串:
13:44:12.351 [main] DEBUG o.e.jetty.webapp.WebAppClassLoader - loaded class MyApplicationScopedBean from WebAppClassLoader=1298169768@4d607fa8
任何想法为什么会发生?
这里是maven插件:
<plugins>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>scala-compile-first</id>
<phase>process-resources</phase>
<goals>
<goal>add-source</goal>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>scala-test-compile</id>
<phase>process-test-resources</phase>
<goals>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<webAppConfig>
<sessionHandler implementation="org.eclipse.jetty.server.session.SessionHandler">
<sessionManager
implementation="org.eclipse.jetty.server.session.HashSessionManager">
<!-- Disable url sessions using JSessionID -->
<sessionIdPathParameterName>none</sessionIdPathParameterName>
</sessionManager>
</sessionHandler>
</webAppConfig>
<!-- <failOnMissingWebXml>false</failOnMissingWebXml> -->
</configuration>
</plugin>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<configuration>
<systemProperties>
<systemProperty>
<name>logback.configurationFile</name>
<value>./src/etc/logback.xml</value>
</systemProperty>
</systemProperties>
</configuration>
<dependencies>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.0.7</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.zeroturnaround</groupId>
<artifactId>jrebel-maven-plugin</artifactId>
<version>1.1.1</version>
<executions>
<execution>
<id>generate-rebel-xml</id>
<phase>process-resources</phase>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>