JREBEL断开应用程序和会话范围的Bean的加载



在没有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>

我使用的是无蚀插件的jrebel 5.0。安装最新的Jrebel 5.1 Eclipse插件解决了问题。

更新:在我将试用许可证升级到社交许可之后,它就停止了加载JSF Bean。另外,我对他们的可疑营销解决方案感到恼火:
1.愚蠢的误导性陈述在编码器上的每个主题中都有:"这里是:jrebel ..."。
2.社会许可证允许将其发布给您的FB(或Twitter)。看来男人真的专注于以任何价格赚钱。

所以,我决定摆脱这个胡说八道并安装了DCEVM。它只是有效的!它是免费的开源。

http://ssw.jku.at/dcevm/

最新更新