wearefrank / frank-runner

Run any Frank with Tomcat
Apache License 2.0
16 stars 12 forks source link

Frank2Example4 does not start - maybe ROOT.xml is invalid #30

Closed mhdirkse closed 2 years ago

mhdirkse commented 2 years ago

When I started Frank2Example4, the following exception appeared in the Tomcat window:

11-Jan-2022 16:37:16.511 SEVERE [main] org.apache.catalina.startup.HostConfig.deployDescriptor Error deploying deployment descriptor [C:\Users\martijn\frank-runner\build\apache-tomcat-9.0.50\conf\Catalina\localhost\ROOT.xml]
        java.lang.IllegalStateException: Error starting child
                at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:731)
                at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:700)
                at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:696)
                at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:690)
                at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1889)
                at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
                at java.util.concurrent.FutureTask.run(FutureTask.java:266)
                at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
                at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112)
                at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:583)
                at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:473)
                at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1618)
                at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:319)
                at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
                at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:423)
                at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:366)
                at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:948)
                at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:835)
                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
                at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)
                at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1388)
                at java.util.concurrent.FutureTask.run(FutureTask.java:266)
                at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
                at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
                at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:921)
                at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:263)
                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
                at org.apache.catalina.core.StandardService.startInternal(StandardService.java:437)
                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
                at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:934)
                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
                at org.apache.catalina.startup.Catalina.start(Catalina.java:772)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                at java.lang.reflect.Method.invoke(Method.java:498)
                at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:345)
                at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:476)
        Caused by: org.apache.catalina.LifecycleException: Failed to start component [org.apache.catalina.webresources.StandardRoot@40f08448]
                at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440)
                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198)
                at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4885)
                at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5023)
                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
                at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:728)
                ... 37 more
        Caused by: java.lang.IllegalArgumentException: The main resource set specified [C:\Users\martijn\frank-runner\build\apache-tomcat-9.0.50\webapps\ROOT] is not valid
                at org.apache.catalina.webresources.StandardRoot.createMainResourceSet(StandardRoot.java:751)
                at org.apache.catalina.webresources.StandardRoot.startInternal(StandardRoot.java:708)
                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
                ... 41 more
11-Jan-2022 16:37:16.514 INFO [main] org.apache.catalina.startup.HostConfig.deployDescriptor Deployment of deployment descriptor [C:\Users\martijn\frank-runner\build\apache-tomcat-9.0.50\conf\Catalina\localhost\ROOT.xml] has finished in [34] ms
11-Jan-2022 16:37:16.517 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-80"]
11-Jan-2022 16:37:16.666 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in [222] milliseconds

I checked the ROOT.xml file C:\Users\martijn\frank-runner\build\apache-tomcat-9.0.50\conf\Catalina\localhost\ROOT.xml. It reads:

<Context docBase="./examples/Frank2Example4/src/main/webapp">
    <Resource
        name="jdbc/frank2example4"
        type="org.h2.jdbcx.JdbcDataSource"
        factory="org.apache.naming.factory.BeanFactory"
        URL="jdbc:h2:C:\Users\martijn\frank-runner/build/h2/frank2example4"
    />
</Context>

I see that the path in the URL mixes up Windows and Linux path separators. I tried to make all path separators Windows-style and then start Tomcat using Catalina start. I got the same exception.

mhdirkse commented 2 years ago

This is on the master brach. No changes here to refer to the Frank!Doc.

jacodg commented 2 years ago

On my machine it's working. I have the same difference in separators. Let's look into it together when you have time

mhdirkse commented 2 years ago

Frank2Example4 as it is now is not so useful anymore. It is present as test input for the Frank!Flow, but Frank2Example- applications should be showcases of the Frank!Runner. This issue will be updated to demonstrate Frank configurations as Maven projects. Debugging is not relevant until this update has been done.