[Beginner's Corner] - Trying to get JBoss 6.1 Going - having errors with VirtualFileFilter
by Lance Goforth
Lance Goforth [https://community.jboss.org/people/lancexenos] created the discussion
"Trying to get JBoss 6.1 Going - having errors with VirtualFileFilter"
To view the discussion, visit: https://community.jboss.org/message/726075#726075
--------------------------------------------------------------
A little background:
We've had an EJB2 application in production running under JBoss 4.x for several years. I've been working on re-writing all the server code to use EJB3 - and running under JBoss 5.1 but I have been running into issues with Hibernate that I thought might be resolved with the newer versions of Hibernate under the newer JBoss versions. Several recommendations were to not try to jump from 5 to 7, so I was trying to get 6 up and working before trying 7. I'm not a system admin, but I'm at a small company so I'm the only option - and it's frustrating me.
I think I have gotten the datasources and message queues moved over. But now trying to deploy the EJB3 application I am getting an error about org.jboss.virtual.VirtualFileFilter class not found. I can't figure out where that's coming from - I don't find it in any of my code, or in any jar or xml file in the server directories.
Any suggestions appreciated.
I'm running JBoss 6.1.0 Final on a linux box with java 1.6.0.11-b03 installed. The application uses a jdbc datasource pointing to an AS400 Legacy DB400 database.
The log starting with the error is:
[quote]
INFO | jvm 1 | 2012/03/22 16:51:36 | 16:51:36,439 ERROR [AbstractKernelController] Error installing to Real: name=vfs:///opt/jboss-6.1.0.Final/server/dev3/deploy/psa-server-jboss-ejb3.jar state=PreReal mode=Manual requiredState=Real: org.jboss.deployers.spi.DeploymentException: Error deploying psa-server-jboss-ejb3.jar: org/jboss/virtual/VirtualFileFilter
INFO | jvm 1 | 2012/03/22 16:51:36 | at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:194) [:6.1.0.Final]
INFO | jvm 1 | 2012/03/22 16:51:36 | at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:60) [:6.1.0.Final]
INFO | jvm 1 | 2012/03/22 16:51:36 | at org.jboss.deployers.vfs.spi.deployer.AbstractSimpleVFSRealDeployer.deploy(AbstractSimpleVFSRealDeployer.java:56) [:2.2.2.GA]
INFO | jvm 1 | 2012/03/22 16:51:36 | at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:63) [:2.2.2.GA]
INFO | jvm 1 | 2012/03/22 16:51:36 | at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:55) [:2.2.2.GA]
INFO | jvm 1 | 2012/03/22 16:51:36 | at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:179) [:2.2.2.GA]
INFO | jvm 1 | 2012/03/22 16:51:36 | at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1832) [:2.2.2.GA]
INFO | jvm 1 | 2012/03/22 16:51:36 | at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1550) [:2.2.2.GA]
INFO | jvm 1 | 2012/03/22 16:51:36 | at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1491) [:2.2.2.GA]
INFO | jvm 1 | 2012/03/22 16:51:36 | at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:379) [jboss-dependency.jar:2.2.0.SP2]
INFO | jvm 1 | 2012/03/22 16:51:36 | at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2044) [jboss-dependency.jar:2.2.0.SP2]
INFO | jvm 1 | 2012/03/22 16:51:36 | at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1083) [jboss-dependency.jar:2.2.0.SP2]
INFO | jvm 1 | 2012/03/22 16:51:36 | at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1322) [jboss-dependency.jar:2.2.0.SP2]
INFO | jvm 1 | 2012/03/22 16:51:36 | at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1246) [jboss-dependency.jar:2.2.0.SP2]
INFO | jvm 1 | 2012/03/22 16:51:36 | at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1139) [jboss-dependency.jar:2.2.0.SP2]
INFO | jvm 1 | 2012/03/22 16:51:36 | at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:939) [jboss-dependency.jar:2.2.0.SP2]
INFO | jvm 1 | 2012/03/22 16:51:36 | at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:654) [jboss-dependency.jar:2.2.0.SP2]
INFO | jvm 1 | 2012/03/22 16:51:36 | at org.jboss.deployers.plugins.deployers.DeployersImpl.change(DeployersImpl.java:1983) [:2.2.2.GA]
INFO | jvm 1 | 2012/03/22 16:51:36 | at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:1076) [:2.2.2.GA]
INFO | jvm 1 | 2012/03/22 16:51:36 | at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:679) [:2.2.2.GA]
INFO | jvm 1 | 2012/03/22 16:51:36 | at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.process(MainDeployerPlugin.java:106) [:6.1.0.Final]
INFO | jvm 1 | 2012/03/22 16:51:36 | at org.jboss.profileservice.dependency.ProfileControllerContext$DelegateDeployer.process(ProfileControllerContext.java:143) [:0.2.2]
INFO | jvm 1 | 2012/03/22 16:51:36 | at org.jboss.profileservice.dependency.ProfileDeployAction.deploy(ProfileDeployAction.java:151) [:0.2.2]
INFO | jvm 1 | 2012/03/22 16:51:36 | at org.jboss.profileservice.dependency.ProfileDeployAction.installActionInternal(ProfileDeployAction.java:94) [:0.2.2]
INFO | jvm 1 | 2012/03/22 16:51:36 | at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54) [jboss-kernel.jar:2.2.0.SP2]
INFO | jvm 1 | 2012/03/22 16:51:36 | at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42) [jboss-kernel.jar:2.2.0.SP2]
INFO | jvm 1 | 2012/03/22 16:51:36 | at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62) [jboss-dependency.jar:2.2.0.SP2]
INFO | jvm 1 | 2012/03/22 16:51:36 | at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71) [jboss-dependency.jar:2.2.0.SP2]
INFO | jvm 1 | 2012/03/22 16:51:36 | at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51) [jboss-dependency.jar:2.2.0.SP2]
INFO | jvm 1 | 2012/03/22 16:51:36 | at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:379) [jboss-dependency.jar:2.2.0.SP2]
INFO | jvm 1 | 2012/03/22 16:51:36 | at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2044) [jboss-dependency.jar:2.2.0.SP2]
INFO | jvm 1 | 2012/03/22 16:51:36 | at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1083) [jboss-dependency.jar:2.2.0.SP2]
INFO | jvm 1 | 2012/03/22 16:51:36 | at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1322) [jboss-dependency.jar:2.2.0.SP2]
INFO | jvm 1 | 2012/03/22 16:51:36 | at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1246) [jboss-dependency.jar:2.2.0.SP2]
INFO | jvm 1 | 2012/03/22 16:51:36 | at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1139) [jboss-dependency.jar:2.2.0.SP2]
INFO | jvm 1 | 2012/03/22 16:51:36 | at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:939) [jboss-dependency.jar:2.2.0.SP2]
INFO | jvm 1 | 2012/03/22 16:51:36 | at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:654) [jboss-dependency.jar:2.2.0.SP2]
INFO | jvm 1 | 2012/03/22 16:51:36 | at org.jboss.profileservice.dependency.ProfileActivationWrapper$BasicProfileActivation.start(ProfileActivationWrapper.java:190) [:0.2.2]
INFO | jvm 1 | 2012/03/22 16:51:36 | at org.jboss.profileservice.dependency.ProfileActivationWrapper.start(ProfileActivationWrapper.java:87) [:0.2.2]
INFO | jvm 1 | 2012/03/22 16:51:36 | at org.jboss.profileservice.dependency.ProfileActivationService.activateProfile(ProfileActivationService.java:215) [:0.2.2]
INFO | jvm 1 | 2012/03/22 16:51:36 | at org.jboss.profileservice.dependency.ProfileActivationService.activate(ProfileActivationService.java:159) [:0.2.2]
INFO | jvm 1 | 2012/03/22 16:51:36 | at org.jboss.profileservice.bootstrap.AbstractProfileServiceBootstrap.activate(AbstractProfileServiceBootstrap.java:112) [:0.2.2]
INFO | jvm 1 | 2012/03/22 16:51:36 | at org.jboss.profileservice.resolver.BasicResolverFactory$ProfileResolverFacade.deploy(BasicResolverFactory.java:87) [:0.2.2]
INFO | jvm 1 | 2012/03/22 16:51:36 | at org.jboss.profileservice.bootstrap.AbstractProfileServiceBootstrap.start(AbstractProfileServiceBootstrap.java:91) [:0.2.2]
INFO | jvm 1 | 2012/03/22 16:51:36 | at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:132) [:6.1.0.Final]
INFO | jvm 1 | 2012/03/22 16:51:36 | at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:56) [:6.1.0.Final]
INFO | jvm 1 | 2012/03/22 16:51:36 | at org.jboss.bootstrap.impl.base.server.AbstractServer.startBootstraps(AbstractServer.java:827) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-6]
INFO | jvm 1 | 2012/03/22 16:51:36 | at org.jboss.bootstrap.impl.base.server.AbstractServer$StartServerTask.run(AbstractServer.java:417) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-6]
INFO | jvm 1 | 2012/03/22 16:51:36 | at java.lang.Thread.run(Thread.java:619) [:1.6.0_11]
INFO | jvm 1 | 2012/03/22 16:51:36 | Caused by: java.lang.NoClassDefFoundError: org/jboss/virtual/VirtualFileFilter
INFO | jvm 1 | 2012/03/22 16:51:36 | at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:162) [:6.1.0.Final]
INFO | jvm 1 | 2012/03/22 16:51:36 | ... 48 more
INFO | jvm 1 | 2012/03/22 16:51:36 | Caused by: java.lang.ClassNotFoundException: org.jboss.virtual.VirtualFileFilter from BaseClassLoader@af07c4{vfs:///opt/jboss-6.1.0.Final/server/dev3/conf/jboss-service.xml}
INFO | jvm 1 | 2012/03/22 16:51:36 | at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:480) [jboss-classloader.jar:2.2.1.GA]
INFO | jvm 1 | 2012/03/22 16:51:36 | at java.lang.ClassLoader.loadClass(ClassLoader.java:252) [:1.6.0_11]
INFO | jvm 1 | 2012/03/22 16:51:36 | at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) [:1.6.0_11]
INFO | jvm 1 | 2012/03/22 16:51:36 | ... 49 more
INFO | jvm 1 | 2012/03/22 16:51:36 |
INFO | jvm 1 | 2012/03/22 16:51:36 | 16:51:36,530 INFO [xnio] XNIO Version 2.1.0.CR2
INFO | jvm 1 | 2012/03/22 16:51:36 | 16:51:36,541 INFO [nio] XNIO NIO Implementation Version 2.1.0.CR2
INFO | jvm 1 | 2012/03/22 16:51:36 | 16:51:36,696 INFO [remoting] JBoss Remoting version 3.1.0.Beta2
INFO | jvm 1 | 2012/03/22 16:51:36 | 16:51:36,806 INFO [TomcatDeployment] deploy, ctxPath=/
INFO | jvm 1 | 2012/03/22 16:51:37 | 16:51:36,977 INFO [HornetQServerImpl] trying to deploy queue jms.queue.DLQ
INFO | jvm 1 | 2012/03/22 16:51:37 | 16:51:37,027 INFO [HornetQServerImpl] trying to deploy queue jms.queue.NotifierQueue
INFO | jvm 1 | 2012/03/22 16:51:37 | 16:51:37,031 INFO [HornetQServerImpl] trying to deploy queue jms.queue.ExpiryQueue
INFO | jvm 1 | 2012/03/22 16:51:37 | 16:51:37,065 INFO [service] Removing bootstrap log handlers
INFO | jvm 1 | 2012/03/22 16:51:37 | 16:51:37,190 ERROR [ProfileServiceBootstrap] Failed to load profile:: org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
INFO | jvm 1 | 2012/03/22 16:51:37 |
INFO | jvm 1 | 2012/03/22 16:51:37 | DEPLOYMENTS IN ERROR:
INFO | jvm 1 | 2012/03/22 16:51:37 | Deployment "vfs:///opt/jboss-6.1.0.Final/server/dev3/deploy/psa-server-jboss-ejb3.jar" is in error due to the following reason(s): java.lang.ClassNotFoundException: org.jboss.virtual.VirtualFileFilter from BaseClassLoader@af07c4{vfs:///opt/jboss-6.1.0.Final/server/dev3/conf/jboss-service.xml}
INFO | jvm 1 | 2012/03/22 16:51:37 |
INFO | jvm 1 | 2012/03/22 16:51:37 | at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:1228) [:2.2.2.GA]
INFO | jvm 1 | 2012/03/22 16:51:37 | at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:905) [:2.2.2.GA]
INFO | jvm 1 | 2012/03/22 16:51:37 | at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.checkComplete(MainDeployerPlugin.java:87) [:6.1.0.Final]
INFO | jvm 1 | 2012/03/22 16:51:37 | at org.jboss.profileservice.deployment.ProfileDeployerPluginRegistry.checkAllComplete(ProfileDeployerPluginRegistry.java:107) [:0.2.2]
INFO | jvm 1 | 2012/03/22 16:51:37 | at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:135) [:6.1.0.Final]
INFO | jvm 1 | 2012/03/22 16:51:37 | at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:56) [:6.1.0.Final]
INFO | jvm 1 | 2012/03/22 16:51:37 | at org.jboss.bootstrap.impl.base.server.AbstractServer.startBootstraps(AbstractServer.java:827) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-6]
INFO | jvm 1 | 2012/03/22 16:51:37 | at org.jboss.bootstrap.impl.base.server.AbstractServer$StartServerTask.run(AbstractServer.java:417) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-6]
INFO | jvm 1 | 2012/03/22 16:51:37 | at java.lang.Thread.run(Thread.java:619) [:1.6.0_11]
INFO | jvm 1 | 2012/03/22 16:51:37 |
INFO | jvm 1 | 2012/03/22 16:51:37 | 16:51:37,207 INFO [org.apache.coyote.http11.Http11Protocol] Starting Coyote HTTP/1.1 on http-10.110.40.25-8080
INFO | jvm 1 | 2012/03/22 16:51:37 | 16:51:37,212 INFO [org.apache.coyote.ajp.AjpProtocol] Starting Coyote AJP/1.3 on ajp-10.110.40.25-8009
INFO | jvm 1 | 2012/03/22 16:51:37 | 16:51:37,221 INFO [org.jboss.bootstrap.impl.base.server.AbstractServer] JBossAS [6.1.0.Final "Neo"] Started in 47s:491ms
[/quote]
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/726075#726075]
Start a new discussion in Beginner's Corner at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
14 years
[JBoss Tools] - CDI Builder error while parse seam-beans.xml
by Ronaldo Campos
Ronaldo Campos [https://community.jboss.org/people/ronaldocwb] created the discussion
"CDI Builder error while parse seam-beans.xml"
To view the discussion, visit: https://community.jboss.org/message/725744#725744
--------------------------------------------------------------
I started haven trouble when I added to seam-beans.xml some additional config. My seam-beans.xml:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:s="urn:java:ee"
xmlns:t="urn:java:org.jboss.seam.transaction"
xmlns:ft="urn:java:org.jboss.seam.faces.transaction"
xmlns:sc="urn:java:org.jboss.solder.core"
xsi:schemaLocation="
http://java.sun.com/xml/ns/javaee
http://docs.jboss.org/cdi/beans_1_0.xsd">
<t:SeSynchronizations>
<s:modifies />
</t:SeSynchronizations>
<t:EntityTransaction>
<s:modifies />
</t:EntityTransaction>
<sc:Veto>
<s:Qualifier />
</sc:Veto>
<ft:TransactionPhaseListener>
<s:replaces />
<sc:Veto />
</ft:TransactionPhaseListener>
</beans>
The error:
Errors occurred during the build.
Errors running builder 'CDI (Context and Dependency Injection) Builder' on project 'VeereJSF'.
java.lang.NullPointerException
Eclipse log:
!MESSAGE Errors running builder 'CDI (Context and Dependency Injection) Builder' on project 'VeereJSF'.
!STACK 0
java.lang.NullPointerException
at org.jboss.tools.cdi.seam.config.core.ConfigDefinitionContext.addAnnotation(ConfigDefinitionContext.java:149)
at org.jboss.tools.cdi.seam.config.core.scanner.SeamDefinitionBuilder.scanAnnotation(SeamDefinitionBuilder.java:140)
at org.jboss.tools.cdi.seam.config.core.scanner.SeamDefinitionBuilder.scanElement(SeamDefinitionBuilder.java:101)
at org.jboss.tools.cdi.seam.config.core.scanner.SeamDefinitionBuilder.scanRoot(SeamDefinitionBuilder.java:85)
at org.jboss.tools.cdi.seam.config.core.scanner.SeamDefinitionBuilder.createDefinition(SeamDefinitionBuilder.java:75)
at org.jboss.tools.cdi.seam.config.core.CDISeamConfigExtension.buildDefinitions(CDISeamConfigExtension.java:147)
at org.jboss.tools.cdi.core.CDICoreBuilder.build(CDICoreBuilder.java:227)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:728)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:239)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:292)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:295)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:351)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:374)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:143)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:241)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
My app is running on Tomcat 7 normally, but CDI Builder keeps throwing this error and I havo no code completitions on my JSF pages. Is it a bug?
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/725744#725744]
Start a new discussion in JBoss Tools at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
14 years
[jBPM] - JBPM Workflow colliding with Task Service
by vchmakov
vchmakov [https://community.jboss.org/people/vchmakov] created the discussion
"JBPM Workflow colliding with Task Service"
To view the discussion, visit: https://community.jboss.org/message/725969#725969
--------------------------------------------------------------
Hi,
As recommended in JBPM/Drools documentation to support my workflow/Drools operations I’m exposing a singleton service object. The workload on the JBPM/Drools engine is very lite at the moment and therefore I create one session and serialize all commands receiving them via the message queue. Everything seems to be working fine. Now, when the Task Server (MINA implementation) is completing tasks and resuming suspended workflows they inevitably collide with the execution of the main trunk. It is not a problem to make my service singleton thread-safe, however I’m also exposing a transactional context including one-per-transaction instance of the Entity Manager which obviously should be different for the Task Completion thread. Besides I have no control over the transactional context of the Task Server and therefore unable to prepare the data and services for processing of the command.
Here come the questions:
* Is there a solution for the issue?
* Is there an issue at all or I’m overlooking/misunderstanding something?
* What is the best practices for programming such sort of operations in JBPM?
* Has anyone been dealing with such kind of problems working with JBPM?
I do not mind looking through the sources of the JBPM/Drools which I do all the time when debugging, but if possible I’d like to hear from the gurus.
Any advice is highly appreciated.
Thanks,
Vlad
1. P.S.: the current version I’m working with is 5.1.2, however, my tests show the same results working with 5.2.0. Besides, I’m working with modified version of the 5.1.2 Human Tasks code, where I implement JTA-style transactions, which is now standard in 5.2.0.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/725969#725969]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
14 years
[Javassist] - ClassCastException when modifiying JOptionPane behaviour
by Telcontar Thorongil
Telcontar Thorongil [https://community.jboss.org/people/telcontarvi] created the discussion
"ClassCastException when modifiying JOptionPane behaviour"
To view the discussion, visit: https://community.jboss.org/message/725909#725909
--------------------------------------------------------------
I'm triying to modify the JOptionPane behaviour to log all the user responses. If do it when the class is loaded with HotsSapper is OK, but i can't do it whith the HotSwapper because the application it's launched by Java Web Start and i haven't be able to open the needed socket.
If i try to modify the class before it's loaded i have an ClassCastException throwed by BasicOptionPaneUI. there is the code i use:
public class Test2 {
public static void main(String[] args) throws Exception {
ClassPool cp = ClassPool.getDefault();
CtClass cc = cp.get("javax.swing.JOptionPane");
CtMethod[] methods = cc.getMethods();
for (CtMethod method : methods) {
if (method.getName().equals("showConfirmDialog")) {
if(method.getLongName().equals("javax.swing.JOptionPane.showConfirmDialog(java.awt.Component,java.lang.Object, java.lang.String,int,int,javax.swing.Icon)")){
String after = "System.out.println(\"User answered: \" + $_ );";
method.insertAfter(after);
}
}
}
try{
Class c=cc.toClass();
c.newInstance();
}catch(CannotCompileException ex){
ex.printStackTrace();
}
JOptionPane.showConfirmDialog(null,"Yer or Not?");
}
}
Why is this happening? how can i fix it?
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/725909#725909]
Start a new discussion in Javassist at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
14 years