-
Bug
-
Resolution: Won't Do
-
Critical
-
None
-
6.4.0.GA
-
None
While rebasing JBoss Operations Network on top of EAP 6.4.22, I noticed a regression/non-trivial change in the returned org.jboss.vfs.VirtualFile instances.
Before EAP 6.4.22(going back many releases), the following access pattern was supported.
###
Enumeration<URL> fileUrls = getClass().getClassLoader().getResources("META-INF/persistence.xml");
VirtualFile virtualFile = (VirtualFile) fileUrl.openConnection().getContent();
was ok. Starting with 6.4.21 and 6.4.22, the access pattern above causes runtime class cast exceptions as below:
###
13:07:29,537 WARN [org.rhq.enterprise.server.plugin.pc.alert.AlertSenderPluginManager] (pool-6-thread-1) Plugin component failed to start plugin [alert-cli]: java.lang.ClassCastException: java.io.FileInputStream cannot be cast to org.jboss.vfs.VirtualFile
at org.rhq.enterprise.server.plugins.alertCli.CliComponent.loadPackagesNames(CliComponent.java:165) [alert-cli-4.12.0.JON330GA.jar:4.12.0.JON330GA]
...
###
While it might be possible to work around the instances we discover, it is concerning that there may be other runtime failures like this lurking within other code paths not fully exercised during each release. Also, there are 3rd party plugins who may well be encounter this issue suddenly merely by being installed into and EAP 6.4.21+ server.
Please see attached reproducer webapp for deployment into an affected EAP server. I catch the exception in the jsp, but the problem should be visible in what's provided.