Summary: | Strange ClassCastException when try to save test plan with TestBean GUI and collection properties (TableEditor) | ||
---|---|---|---|
Product: | JMeter - Now in Github | Reporter: | Mingun <Alexander_Sergey> |
Component: | Main | Assignee: | JMeter issues mailing list <issues> |
Status: | RESOLVED DUPLICATE | ||
Severity: | major | CC: | p.mouawad, vherilier |
Priority: | P2 | Keywords: | APIBug |
Version: | 3.0 | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Linux | ||
URL: | https://bitbucket.org/Mingun/jmeter-bug | ||
Bug Depends on: | 58743 | ||
Bug Blocks: | |||
Attachments: |
Log file when I try to save test plan Default.jmx in my plugin repository with added element in ConnectSampler.recycler collection
<jmeter>/bin/jmeter.properties <jmeter>/bin/saveservice.properties <jmeter>/bin/user.properties Open plan.jmsx from jmeter-bug, seect first sampler, try save (2 exceptions in log), then select second sapler and save |
Description
Mingun
2016-09-13 05:53:56 UTC
This should not be a bugzilla as it's related to custom code where we cannot help you. Please ask your question on user mailing list of either JMeter or XStream project. Closing as INVALID. Unless it is not the bug tracker of the JMeter project? If it not here, then where? The link (http://jmeter.apache.org/issues.html) from the official site of JMeter carries here. The bug in the JMeter code because my class differs in nothing from the similar JMeter class `org.apache.jmeter.config.Argument`, but with this class there is no such problem for some reason. Anyway, `ClassCastException` arises in JMeter and shall be fixed, not very well what reasons lead to it. If I somehow incorrectly implemented my class, then there shall be or a compilation error (preferably) or at least a distinct message in runtime how to correct implement my class (should I implement some interface? Or add some annotation?). Earlier I said that with my class `Refine` the problem isn't reproduced. I was mistaken. The problem is reproduced always with any collections in my samplers, but for some reason only on Ubuntu. On Windows I can't reproduce it. Perhaps, a problem in various JDK. On Monday I will look what JDK is used on Ubuntu and create a small demo project with problem demonstration. On Windows machine: ---------------------------------------------------------------- $ java -version java version "1.8.0_101" Java(TM) SE Runtime Environment (build 1.8.0_101-b13) Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode) ---------------------------------------------------------------- (In reply to Mingun from comment #2) > Unless it is not the bug tracker of the JMeter project? If it not here, then > where? The link (http://jmeter.apache.org/issues.html) from the official > site of JMeter carries here. The issue is happening with your custom code right ? That's why I was thinking it's not a JMeter issue. Besides without the provided code, there's nothing we can do. > > The bug in the JMeter code because my class differs in nothing from the > similar JMeter class `org.apache.jmeter.config.Argument`, but with this > class there is no such problem for some reason. Anyway, `ClassCastException` > arises in JMeter and shall be fixed, not very well what reasons lead to it. > If I somehow incorrectly implemented my class, then there shall be or a > compilation error (preferably) or at least a distinct message in runtime how > to correct implement my class (should I implement some interface? Or add > some annotation?). > > Earlier I said that with my class `Refine` the problem isn't reproduced. I > was mistaken. The problem is reproduced always with any collections in my > samplers, but for some reason only on Ubuntu. On Windows I can't reproduce > it. Perhaps, a problem in various JDK. On Monday I will look what JDK is > used on Ubuntu and create a small demo project with problem demonstration. Ok in this case: - please provide sampler code broken - version of jdk - user.properties - jmeter.properties - saveservice.properties > > On Windows machine: > ---------------------------------------------------------------- > $ java -version > java version "1.8.0_101" > Java(TM) SE Runtime Environment (build 1.8.0_101-b13) > Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode) > ---------------------------------------------------------------- I reproduce bug. Conditions: 1) at least 2 nodes (samplers) with collection properties 2) at least one node have non-empty collection -- exception when this node is saved I create small maven project in https://bitbucket.org/Mingun/jmeter-bug to demonstrate problem. Try load and they save Plan.jmx inside it. Created attachment 34267 [details]
<jmeter>/bin/jmeter.properties
Reproduce on Ubuntu 16.04:
---------------------------------------------------------------------
$ uname -a
Linux ayanichkin-desktop 4.4.0-36-generic #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
$ java -version
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)
---------------------------------------------------------------------
Created attachment 34268 [details]
<jmeter>/bin/saveservice.properties
Created attachment 34269 [details]
<jmeter>/bin/user.properties
Hello Serguei, Thanks for your report. Unfortunately we have a lot of work on Core JMeter and I am afraid I won't have time to investigate issue in custom code. For completeness maybe you could provide the stack trace related to your github code as the one in this issue relates to code we don't have. Maybe later I can have some time but I doubt it . Regards Out of project scope (In reply to Philippe Mouawad from comment #8) > Hello Serguei, > Thanks for your report. > Unfortunately we have a lot of work on Core JMeter and I am afraid I won't > have time to investigate issue in custom code. > > For completeness maybe you could provide the stack trace related to your > github code as the one in this issue relates to code we don't have. > > Maybe later I can have some time but I doubt it . > Regards Sorry, I didn't miss this comment. You tried to reproduce a problem on the demonstration https://bitbucket.org/Mingun/jmeter-bug project? It has no dependences and gathers in any IDE having support of maven and just from command line. I attach jmeter.log when I load Plan.jmx from jmeter-bug demo project and try to save when first sapler is selected, then select second sampler and save the plan. Created attachment 34369 [details]
Open plan.jmsx from jmeter-bug, seect first sampler, try save (2 exceptions in log), then select second sapler and save
(In reply to Mingun from comment #11) > Created attachment 34369 [details] > Open plan.jmsx from jmeter-bug, seect first sampler, try save (2 exceptions > in log), then select second sapler and save Thanks Serguei for your perseverance. There is indeed a bug in JMeter as I was able to reproduce issue with CompareAssertion. Scenario: - Create a Compare Assertion and fill in a row with 2 fields - Create another Compare Assertion and keep it empty Select last Compare Assertion and save => OK Select first Compare Assertion and save => KO 2016/10/12 22:58:16 ERROR - jmeter.gui.action.ActionRouter: Error processing org.apache.jmeter.gui.action.Save@584f54e6 java.lang.ClassCastException: org.apache.jmeter.assertions.SubstitutionElement cannot be cast to org.apache.jmeter.testelement.property.JMeterProperty at org.apache.jmeter.testelement.property.PropertyIteratorImpl.next(PropertyIteratorImpl.java:41) at org.apache.jmeter.testelement.property.PropertyIteratorImpl.next(PropertyIteratorImpl.java:24) at org.apache.jmeter.save.converters.MultiPropertyConverter.marshal(MultiPropertyConverter.java:57) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69) at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58) at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:88) at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(AbstractCollectionConverter.java:66) at org.apache.jmeter.save.converters.TestElementConverter.marshal(TestElementConverter.java:74) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69) at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58) at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:88) at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(AbstractCollectionConverter.java:66) at org.apache.jmeter.save.converters.HashTreeConverter.marshal(HashTreeConverter.java:53) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69) at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58) at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:88) at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(AbstractCollectionConverter.java:66) at org.apache.jmeter.save.converters.HashTreeConverter.marshal(HashTreeConverter.java:54) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69) at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58) at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:88) at org.apache.jmeter.save.ScriptWrapperConverter.marshal(ScriptWrapperConverter.java:79) at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69) at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58) at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43) at com.thoughtworks.xstream.core.TreeMarshaller.start(TreeMarshaller.java:82) at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.marshal(AbstractTreeMarshallingStrategy.java:37) at com.thoughtworks.xstream.XStream.marshal(XStream.java:1067) at com.thoughtworks.xstream.XStream.marshal(XStream.java:1056) at com.thoughtworks.xstream.XStream.toXML(XStream.java:1029) at org.apache.jmeter.save.SaveService.saveTree(SaveService.java:304) at org.apache.jmeter.gui.action.Save.doAction(Save.java:225) at org.apache.jmeter.gui.action.ActionRouter.performAction(ActionRouter.java:80) at org.apache.jmeter.gui.action.ActionRouter.access$000(ActionRouter.java:40) at org.apache.jmeter.gui.action.ActionRouter$1.run(ActionRouter.java:62) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756) at java.awt.EventQueue.access$500(EventQueue.java:97) at java.awt.EventQueue$3.run(EventQueue.java:709) at java.awt.EventQueue$3.run(EventQueue.java:703) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76) at java.awt.EventQueue.dispatchEvent(EventQueue.java:726) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) at java.awt.EventDispatchThread.run(EventDispatchThread.java:82) I'll try to investigate. This is the same issue (https://bz.apache.org/bugzilla/show_bug.cgi?id=58743) I reported one year ago. CompareAssertion provides the same issue in same kind of "scenario saving" situation. Yesterday, users, I'm working with, have experienced once again, the same issue and have lost their jmx file content. Data integrity is compromised by this issue. *** This bug has been marked as a duplicate of bug 58743 *** This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/4110 |