[ 
https://issues.apache.org/jira/browse/TOMEE-2106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16118200#comment-16118200
 ] 

Kaloyan Spiridonov commented on TOMEE-2106:
-------------------------------------------

Encoding of the uri here :
https://github.com/apache/tomee/blob/master/container/openejb-core/src/main/java/org/apache/openejb/util/URLs.java#L96
https://github.com/apache/tomee/blob/master/container/openejb-core/src/main/java/org/apache/openejb/util/LinkResolver.java#L59
works fine for me, but i am not sure if it can break something else.
What do you think?

> Tomee does not encode '%' in war filename
> -----------------------------------------
>
>                 Key: TOMEE-2106
>                 URL: https://issues.apache.org/jira/browse/TOMEE-2106
>             Project: TomEE
>          Issue Type: Bug
>            Reporter: Kaloyan Spiridonov
>
> Tomee does not encode '%' in war filename.
> Steps to reproduce:
> 1. Create sample application
> 2. Build war file, which contains % in its name. For example: test%test.war
> 3. Deploy it
> Exception:
> {code}
> 04-Aug-2017 13:09:03.125 SEVERE [localhost-startStop-1] 
> org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal Unable to deploy 
> collapsed ear in war 
> StandardEngine[Catalina].StandardHost[localhost].StandardContext[/test%test]
>  java.lang.IllegalArgumentException: Malformed escape pair at index 4: 
> test%test
>         at java.net.URI.create(URI.java:852)
>         at org.apache.openejb.util.URLs.uri(URLs.java:96)
>         at 
> org.apache.openejb.config.AutoConfig.resolveDestinationLinks(AutoConfig.java:614)
>         at org.apache.openejb.config.AutoConfig.deploy(AutoConfig.java:196)
>         at 
> org.apache.openejb.config.ConfigurationFactory$Chain.deploy(ConfigurationFactory.java:420)
>         at 
> org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:1037)
>         at 
> org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:1276)
>         at 
> org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(TomcatWebAppBuilder.java:1124)
>         at 
> org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:133)
>         at 
> org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:94)
>         at 
> org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5087)
>         at 
> org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
>         at 
> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:752)
>         at 
> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:728)
>         at 
> org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
>         at 
> org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:952)
>         at 
> org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1823)
>         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)
> Caused by: java.net.URISyntaxException: Malformed escape pair at index 4: 
> test%test
>         at java.net.URI$Parser.fail(URI.java:2848)
>         at java.net.URI$Parser.scanEscape(URI.java:2978)
>         at java.net.URI$Parser.scan(URI.java:3001)
>         at java.net.URI$Parser.checkChars(URI.java:3019)
>         at java.net.URI$Parser.parseHierarchical(URI.java:3105)
>         at java.net.URI$Parser.parse(URI.java:3063)
>         at java.net.URI.<init>(URI.java:588)
>         at java.net.URI.create(URI.java:850)
>         ... 21 more
> 04-Aug-2017 13:09:03.125 SEVERE [localhost-startStop-1] 
> sun.reflect.NativeMethodAccessorImpl.invoke ContainerBase.removeChild: 
> destroy:
>  org.apache.catalina.LifecycleException: An invalid Lifecycle transition was 
> attempted ([before_destroy]) for component 
> [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/test%test]]
>  in state [STARTING_PREP]
>         at 
> org.apache.catalina.util.LifecycleBase.invalidTransition(LifecycleBase.java:402)
>         at 
> org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:292)
>         at 
> org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:854)
>         at 
> org.apache.tomee.catalina.TomcatWebAppBuilder.undeploy(TomcatWebAppBuilder.java:1627)
>         at 
> org.apache.tomee.catalina.TomcatWebAppBuilder.undeploy(TomcatWebAppBuilder.java:1607)
>         at 
> org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:1307)
>         at 
> org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(TomcatWebAppBuilder.java:1124)
>         at 
> org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:133)
>         at 
> org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:94)
>         at 
> org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5087)
>         at 
> org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
>         at 
> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:752)
>         at 
> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:728)
>         at 
> org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
>         at 
> org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:952)
>         at 
> org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1823)
>         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)
> 04-Aug-2017 13:09:03.126 SEVERE [localhost-startStop-1] 
> sun.reflect.NativeMethodAccessorImpl.invoke ContainerBase.addChild: start:
>  org.apache.catalina.LifecycleException: Failed to start component 
> [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/test%test]]
>         at 
> org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
>         at 
> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:752)
>         at 
> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:728)
>         at 
> org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
>         at 
> org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:952)
>         at 
> org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1823)
>         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)
> Caused by: org.apache.tomee.catalina.TomEERuntimeException: 
> java.lang.IllegalArgumentException: Malformed escape pair at index 4: 
> test%test
>         at 
> org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:1310)
>         at 
> org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(TomcatWebAppBuilder.java:1124)
>         at 
> org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:133)
>         at 
> org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:94)
>         at 
> org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5087)
>         at 
> org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
>         ... 10 more
> Caused by: java.lang.IllegalArgumentException: Malformed escape pair at index 
> 4: test%test
>         at java.net.URI.create(URI.java:852)
>         at org.apache.openejb.util.URLs.uri(URLs.java:96)
>         at 
> org.apache.openejb.config.AutoConfig.resolveDestinationLinks(AutoConfig.java:614)
>         at org.apache.openejb.config.AutoConfig.deploy(AutoConfig.java:196)
>         at 
> org.apache.openejb.config.ConfigurationFactory$Chain.deploy(ConfigurationFactory.java:420)
>         at 
> org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:1037)
>         at 
> org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:1276)
>         ... 15 more
> Caused by: java.net.URISyntaxException: Malformed escape pair at index 4: 
> test%test
>         at java.net.URI$Parser.fail(URI.java:2848)
>         at java.net.URI$Parser.scanEscape(URI.java:2978)
>         at java.net.URI$Parser.scan(URI.java:3001)
>         at java.net.URI$Parser.checkChars(URI.java:3019)
>         at java.net.URI$Parser.parseHierarchical(URI.java:3105)
>         at java.net.URI$Parser.parse(URI.java:3063)
>         at java.net.URI.<init>(URI.java:588)
>         at java.net.URI.create(URI.java:850)
>         ... 21 more
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to