[NPMCLI-43] 'magnolia.resources.dir' must use proper slash - no backslash Created: 26/Jul/16  Updated: 22/Aug/16  Resolved: 29/Jul/16

Status: Closed
Project: Magnolia CLI
Component/s: None
Affects Version/s: None
Fix Version/s: 0.0.1

Type: Bug Priority: Critical
Reporter: Christopher Zimmermann Assignee: Federico Grilli
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0d
Time Spent: 5.5h
Original Estimate: Not Specified

Attachments: Text File tomcat-windows-problem.log    
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:
Sprint: Basel 54
Story Points: 2

 Description   

The origin of the problem is that npm-cli writes a proper windows path with backslash for the magnolia.resources.dir property.
That's why java.nio.file.InvalidPathException is thrown.
So, we should replace the backslash with slash - then it starts up properly.

I'm not sure whether we should core in a way that the backslash is accepted.


To reproduce:
Run "mgnl jumpstart" on Windows 7 with JRE 8 installed.
Then start magnolia.
Result: Errors in log, Magnolia cannot be run in browser.

See attached file for full log.

A snippet.

INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that wer
e scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
2016-07-26 13:16:21,063 ERROR info.magnolia.init.MagnoliaServletContextListener : Oops, Magnolia could not be started
java.nio.file.InvalidPathException: Illegal char <      > at index 32: C:UsersmagnoliaDocumentsmagnolia opher   estcli2light-modules
        at sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182)
        at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)
        at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
        at sun.nio.fs.WindowsPath.parse(WindowsPath.java:94)
        at sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:255)
        at java.nio.file.Paths.get(Paths.java:84)
        at info.magnolia.module.model.reader.LightModuleDefinitionReader.collectLightModuleDescriptorFiles(LightModuleDefinitionReader.java:
185)
        at info.magnolia.module.model.reader.LightModuleDefinitionReader.readAll(LightModuleDefinitionReader.java:110)
        at info.magnolia.module.ModuleManagerImpl.loadDefinitions(ModuleManagerImpl.java:174)
        at info.magnolia.init.MagnoliaServletContextListener.contextInitialized(MagnoliaServletContextListener.java:157)
        at info.magnolia.init.MagnoliaServletContextListener.contextInitialized(MagnoliaServletContextListener.java:127)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5003)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5517)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
        at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1263)
        at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1948)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
java.nio.file.InvalidPathException: Illegal char <      > at index 32: C:UsersmagnoliaDocumentsmagnolia opher   estcli2light-modules
        at sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182)
        at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)
        at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
        at sun.nio.fs.WindowsPath.parse(WindowsPath.java:94)
        at sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:255)
        at java.nio.file.Paths.get(Paths.java:84)
        at info.magnolia.module.model.reader.LightModuleDefinitionReader.collectLightModuleDescriptorFiles(LightModuleDefinitionReader.java:


 Comments   
Comment by Christoph Meier [ 28/Jul/16 ]

The problem comes form backslashes at magnolia.resources.dir
We must use real slashes at the moment.

Generated at Mon Feb 12 04:45:58 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.