Bug 64227 - Template Error
Summary: Template Error
Status: RESOLVED FIXED
Alias: None
Product: JMeter
Classification: Unclassified
Component: Main (show other bugs)
Version: 5.2.1
Hardware: PC All
: P2 normal (vote)
Target Milestone: JMETER_5.3.0
Assignee: JMeter issues mailing list
URL:
Keywords: FixedInTrunk
Depends on:
Blocks:
 
Reported: 2020-03-15 00:38 UTC by Anderson Benício
Modified: 2020-03-25 15:28 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Anderson Benício 2020-03-15 00:38:29 UTC
When clicking on template this error appears below:

2020-03-14 21:35:24,630 INFO o.a.j.p.h.s.HTTPSamplerBase: Parser for text/html is org.apache.jmeter.protocol.http.parser.LagartoBasedHtmlParser
2020-03-14 21:35:24,630 INFO o.a.j.p.h.s.HTTPSamplerBase: Parser for application/xhtml+xml is org.apache.jmeter.protocol.http.parser.LagartoBasedHtmlParser
2020-03-14 21:35:24,631 INFO o.a.j.p.h.s.HTTPSamplerBase: Parser for application/xml is org.apache.jmeter.protocol.http.parser.LagartoBasedHtmlParser
2020-03-14 21:35:24,631 INFO o.a.j.p.h.s.HTTPSamplerBase: Parser for text/xml is org.apache.jmeter.protocol.http.parser.LagartoBasedHtmlParser
2020-03-14 21:35:24,631 INFO o.a.j.p.h.s.HTTPSamplerBase: Parser for text/vnd.wap.wml is org.apache.jmeter.protocol.http.parser.RegexpHTMLParser
2020-03-14 21:35:24,631 INFO o.a.j.p.h.s.HTTPSamplerBase: Parser for text/css is org.apache.jmeter.protocol.http.parser.CssParser
2020-03-14 21:35:24,854 INFO o.a.j.e.KeyToolUtils: keytool found at 'keytool'
2020-03-14 21:35:24,854 INFO o.a.j.p.h.p.ProxyControl: HTTP(S) Test Script Recorder SSL Proxy will use keys that support embedded 3rd party resources in file C:\Users\Anderson Benício\Desktop\apache-jmeter-5.2.1\apache-jmeter-5.2.1\bin\proxyserver.jks
2020-03-14 21:35:24,931 INFO o.a.j.s.FileServer: Default base='C:\Users\Anderson Benício\Desktop\apache-jmeter-5.2.1\apache-jmeter-5.2.1\bin'
2020-03-14 21:35:25,336 INFO o.a.j.s.SampleResult: Note: Sample TimeStamps are START times
2020-03-14 21:35:25,336 INFO o.a.j.s.SampleResult: sampleresult.default.encoding is set to ISO-8859-1
2020-03-14 21:35:25,336 INFO o.a.j.s.SampleResult: sampleresult.useNanoTime=true
2020-03-14 21:35:25,336 INFO o.a.j.s.SampleResult: sampleresult.nanoThreadSleep=5000
2020-03-14 21:35:42,354 INFO o.a.j.g.a.t.TemplateManager: Reading templates from: C:\Users\Anderson Benício\Desktop\apache-jmeter-5.2.1\apache-jmeter-5.2.1\bin\templates\templates.xml
2020-03-14 21:35:42,355 WARN o.a.j.g.a.t.TemplateManager: Ignoring template file:'C:\Users\Anderson Benício\Desktop\apache-jmeter-5.2.1\apache-jmeter-5.2.1\bin\templates\templates.xml', an error occurred parsing the file
java.net.MalformedURLException: unknown protocol: c
	at java.net.URL.<init>(Unknown Source) ~[?:1.8.0_241]
	at java.net.URL.<init>(Unknown Source) ~[?:1.8.0_241]
	at java.net.URL.<init>(Unknown Source) ~[?:1.8.0_241]
	at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source) ~[xercesImpl-2.12.0.jar:2.12.0]
	at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source) ~[xercesImpl-2.12.0.jar:2.12.0]
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) ~[xercesImpl-2.12.0.jar:?]
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) ~[xercesImpl-2.12.0.jar:?]
	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) ~[xercesImpl-2.12.0.jar:?]
	at org.apache.xerces.parsers.DOMParser.parse(Unknown Source) ~[xercesImpl-2.12.0.jar:?]
	at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source) ~[xercesImpl-2.12.0.jar:?]
	at javax.xml.parsers.DocumentBuilder.parse(Unknown Source) ~[?:1.8.0_241]
	at org.apache.jmeter.gui.action.template.TemplateManager.parseTemplateFile(TemplateManager.java:176) ~[ApacheJMeter_core.jar:5.2.1]
	at org.apache.jmeter.gui.action.template.TemplateManager.readTemplates(TemplateManager.java:102) ~[ApacheJMeter_core.jar:5.2.1]
	at org.apache.jmeter.gui.action.template.TemplateManager.<init>(TemplateManager.java:65) ~[ApacheJMeter_core.jar:5.2.1]
	at org.apache.jmeter.gui.action.template.TemplateManager.<clinit>(TemplateManager.java:56) ~[ApacheJMeter_core.jar:5.2.1]
	at org.apache.jmeter.gui.action.SelectTemplatesDialog.init(SelectTemplatesDialog.java:245) ~[ApacheJMeter_core.jar:5.2.1]
	at org.apache.jmeter.gui.action.SelectTemplatesDialog.<init>(SelectTemplatesDialog.java:112) ~[ApacheJMeter_core.jar:5.2.1]
	at org.apache.jmeter.gui.action.TemplatesCommand$IODH.<clinit>(TemplatesCommand.java:36) ~[ApacheJMeter_core.jar:5.2.1]
	at org.apache.jmeter.gui.action.TemplatesCommand.doActionAfterCheck(TemplatesCommand.java:48) ~[ApacheJMeter_core.jar:5.2.1]
	at org.apache.jmeter.gui.action.AbstractActionWithNoRunningTest.doAction(AbstractActionWithNoRunningTest.java:45) ~[ApacheJMeter_core.jar:5.2.1]
	at org.apache.jmeter.gui.action.ActionRouter.performAction(ActionRouter.java:88) ~[ApacheJMeter_core.jar:5.2.1]
	at org.apache.jmeter.gui.action.ActionRouter.lambda$actionPerformed$0(ActionRouter.java:70) ~[ApacheJMeter_core.jar:5.2.1]
	at java.awt.event.InvocationEvent.dispatch(Unknown Source) [?:1.8.0_241]
	at java.awt.EventQueue.dispatchEventImpl(Unknown Source) [?:1.8.0_241]
	at java.awt.EventQueue.access$500(Unknown Source) [?:1.8.0_241]
	at java.awt.EventQueue$3.run(Unknown Source) [?:1.8.0_241]
	at java.awt.EventQueue$3.run(Unknown Source) [?:1.8.0_241]
	at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_241]
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source) [?:1.8.0_241]
	at java.awt.EventQueue.dispatchEvent(Unknown Source) [?:1.8.0_241]
	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) [?:1.8.0_241]
	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) [?:1.8.0_241]
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) [?:1.8.0_241]
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source) [?:1.8.0_241]
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source) [?:1.8.0_241]
	at java.awt.EventDispatchThread.run(Unknown Source) [?:1.8.0_241]
2020-03-14 21:35:42,372 ERROR o.a.j.JMeter: Uncaught exception in thread Thread[AWT-EventQueue-0,6,main]
java.lang.ExceptionInInitializerError: null
	at org.apache.jmeter.gui.action.TemplatesCommand.doActionAfterCheck(TemplatesCommand.java:48) ~[ApacheJMeter_core.jar:5.2.1]
	at org.apache.jmeter.gui.action.AbstractActionWithNoRunningTest.doAction(AbstractActionWithNoRunningTest.java:45) ~[ApacheJMeter_core.jar:5.2.1]
	at org.apache.jmeter.gui.action.ActionRouter.performAction(ActionRouter.java:88) ~[ApacheJMeter_core.jar:5.2.1]
	at org.apache.jmeter.gui.action.ActionRouter.lambda$actionPerformed$0(ActionRouter.java:70) ~[ApacheJMeter_core.jar:5.2.1]
	at java.awt.event.InvocationEvent.dispatch(Unknown Source) ~[?:1.8.0_241]
	at java.awt.EventQueue.dispatchEventImpl(Unknown Source) ~[?:1.8.0_241]
	at java.awt.EventQueue.access$500(Unknown Source) ~[?:1.8.0_241]
	at java.awt.EventQueue$3.run(Unknown Source) ~[?:1.8.0_241]
	at java.awt.EventQueue$3.run(Unknown Source) ~[?:1.8.0_241]
	at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_241]
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source) ~[?:1.8.0_241]
	at java.awt.EventQueue.dispatchEvent(Unknown Source) ~[?:1.8.0_241]
	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) [?:1.8.0_241]
	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) [?:1.8.0_241]
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) [?:1.8.0_241]
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source) [?:1.8.0_241]
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source) [?:1.8.0_241]
	at java.awt.EventDispatchThread.run(Unknown Source) [?:1.8.0_241]
Caused by: java.lang.NullPointerException
	at org.apache.jmeter.gui.action.SelectTemplatesDialog.populateTemplatePage(SelectTemplatesDialog.java:351) ~[ApacheJMeter_core.jar:5.2.1]
	at org.apache.jmeter.gui.action.SelectTemplatesDialog.init(SelectTemplatesDialog.java:271) ~[ApacheJMeter_core.jar:5.2.1]
	at org.apache.jmeter.gui.action.SelectTemplatesDialog.<init>(SelectTemplatesDialog.java:112) ~[ApacheJMeter_core.jar:5.2.1]
	at org.apache.jmeter.gui.action.TemplatesCommand$IODH.<clinit>(TemplatesCommand.java:36) ~[ApacheJMeter_core.jar:5.2.1]
	... 18 more

I look forward to your comments
Comment 1 Felix Schumacher 2020-03-15 10:03:37 UTC
Thanks for the report. Could you try the next nightly or build JMeter from trunk, to see, if the fix works for you?

commit 3354f6e929b2a7b3b215951da73c72a565b13723
AuthorDate: Sun Mar 15 10:45:48 2020 +0100

    Error when loading Templates on Windows
    
    The document parser expects an URI and not a file path.
    So let us convert the file to a string representation of
    the URI.
    
    Bugzilla Id: 64227
---
 .../java/org/apache/jmeter/gui/action/template/TemplateManager.java     | 2 +-
 xdocs/changes.xml                                                       | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
Comment 2 Felix Schumacher 2020-03-15 10:39:20 UTC
commit 346f87d593126fea1e61665258343e3c01b94f43
AuthorDate: Sun Mar 15 11:33:49 2020 +0100

    Error when loading Templates on Windows
    
    The document builder accepts a file directly, so use it.
    
    Bugzilla Id: 64227
---
 .../java/org/apache/jmeter/gui/action/template/TemplateManager.java     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 3 Felix Schumacher 2020-03-25 15:28:49 UTC
commit 33e23b80ebf7c769950c8d3852281f1cd63ad35d
Author: Felix Schumacher <felix.schumacher@internetallee.de>
AuthorDate: Wed Mar 25 16:23:40 2020 +0100

    Use correct conversion for URLs to File
    
    After using File directly for TemplateManager the tests failed for Files
    that are created by reading resources from classes, when those resources
    are located inside of directories containing spaces.
    
    Use Paths API to convert the URIs to Files that have correctly decoded
    names.
    
    Bugzilla Id: 64227
---
 .../jmeter/gui/action/template/TestTemplateManager.java   | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)