escort
14 years agoNew Contributor
Different custom components share one GroovyClassLoader
Dear all,
I am trying to implememt a test loader with some custom LoadUI component. I am testing my own external Java library. Now I have an issue.
I have more than one component to test. Some objects are being sent among these components via the "Message". For instance.
In component A, I created a object "ObjectA" and sent it to component B.
Component B receives it and can recogonizes it as correct class. But the problem is, the instance created in the component B can not be used with component A. I get following exception.
"client.active.channel.BaseMioSubscriptionListener@dc10b6","com.sun.jnlp.JNLPClassLoader@10fe2b9","class client.active.channel.DefaultActiveChannel","No signature of method:
client.active.channel.DefaultActiveChannel.subscribe() is applicable for argument types: (common.types.subscription.Subscription, client.active.channel.BaseMioSubscriptionListener) values: [common.types.subscription.Subscription@1c83981, client.active.channel.BaseMioSubscriptionListener@37785b]
Possible solutions: subscribe(common.types.subscription.Subscription, client.active.channel.MioSubscriptionListener), subscribe(java.lang.Class, client.active.channel.ClientTypeSubscription, client.active.channel.ClientTypeMioSubscriptionListener), unsubscribe(java.lang.String), isSubscribed(java.lang.String)
The following classes appear as argument class and as parameter class, but are defined by different class loader:
common.types.subscription.Subscription (defined by 'groovy.lang.GroovyClassLoader@bcf04e' and 'groovy.lang.GroovyClassLoader@d652c1')
If one of the method suggestions matches the method you wanted to call,
then check your class loader setup.","7","client.active.channel.DefaultActiveChannel@1edd411","common.types.subscription.Subscription@fde079","client.active.MioRemote@1ae24e3","groovy.lang.GroovyClassLoader$InnerLoader@19d6193","165007099"
I assume because Component A and Compoenent B are not using the same GroovyClassLoader. I tried to creat everything in Component A and pass all of them to Component B. It works. I am wondering, whether there is way to set the GroovyClassLoader for each Component ( Groovy script ). Or I really need to create everything from the one simple component.
I tried to GroovyClassLoader by this.class.getClassLoader() . but it returns the Java classloader instead of GroovyClassLoader
Thanks for your help in advance.
I am trying to implememt a test loader with some custom LoadUI component. I am testing my own external Java library. Now I have an issue.
I have more than one component to test. Some objects are being sent among these components via the "Message". For instance.
In component A, I created a object "ObjectA" and sent it to component B.
Component B receives it and can recogonizes it as correct class. But the problem is, the instance created in the component B can not be used with component A. I get following exception.
"client.active.channel.BaseMioSubscriptionListener@dc10b6","com.sun.jnlp.JNLPClassLoader@10fe2b9","class client.active.channel.DefaultActiveChannel","No signature of method:
client.active.channel.DefaultActiveChannel.subscribe() is applicable for argument types: (common.types.subscription.Subscription, client.active.channel.BaseMioSubscriptionListener) values: [common.types.subscription.Subscription@1c83981, client.active.channel.BaseMioSubscriptionListener@37785b]
Possible solutions: subscribe(common.types.subscription.Subscription, client.active.channel.MioSubscriptionListener), subscribe(java.lang.Class, client.active.channel.ClientTypeSubscription, client.active.channel.ClientTypeMioSubscriptionListener), unsubscribe(java.lang.String), isSubscribed(java.lang.String)
The following classes appear as argument class and as parameter class, but are defined by different class loader:
common.types.subscription.Subscription (defined by 'groovy.lang.GroovyClassLoader@bcf04e' and 'groovy.lang.GroovyClassLoader@d652c1')
If one of the method suggestions matches the method you wanted to call,
then check your class loader setup.","7","client.active.channel.DefaultActiveChannel@1edd411","common.types.subscription.Subscription@fde079","client.active.MioRemote@1ae24e3","groovy.lang.GroovyClassLoader$InnerLoader@19d6193","165007099"
I assume because Component A and Compoenent B are not using the same GroovyClassLoader. I tried to creat everything in Component A and pass all of them to Component B. It works. I am wondering, whether there is way to set the GroovyClassLoader for each Component ( Groovy script ). Or I really need to create everything from the one simple component.
I tried to GroovyClassLoader by this.class.getClassLoader() . but it returns the Java classloader instead of GroovyClassLoader
Thanks for your help in advance.