corda / corda

Corda is an open source blockchain project, designed for business from the start. Only Corda allows you to build interoperable blockchain networks that transact in strict privacy. Corda's smart contract technology allows businesses to transact directly, with value.
https://www.corda.net
Apache License 2.0
3.99k stars 1.08k forks source link

Corda Webserver crashes when Obligation CorDapps present in plugin directory - poor CorDapps dependecy handling #1874

Closed wawrzek closed 7 years ago

wawrzek commented 7 years ago

Short Description

Obligation CorDapps depends on Fiance CorDapps. If you miss this dependency webserver crashes, but Corda node is fine.

Expected behaviour

Way to reproduce

  1. Build Obligation (version 0.1) CorDapps
  2. Download it to machine with Corda
  3. Restart Corda node and Corda webserver

Error message

Error 1

java.lang.TypeNotPresentException: Type net.corda.finance.contracts.asset.Cash$State not present
        at sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:117) ~[?:1.8.0_144]
        at sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:125) ~[?:1.8.0_144]
        at sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49) ~[?:1.8.0_144]
        at sun.reflect.generics.visitor.Reifier.reifyTypeArguments(Reifier.java:68) ~[?:1.8.0_144]
        at sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:138) ~[?:1.8.0_144]
        at sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49) ~[?:1.8.0_144]
        at sun.reflect.generics.visitor.Reifier.reifyTypeArguments(Reifier.java:68) ~[?:1.8.0_144]
        at sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:138) ~[?:1.8.0_144]
        at sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49) ~[?:1.8.0_144]
        at sun.reflect.generics.repository.MethodRepository.getReturnType(MethodRepository.java:68) ~[?:1.8.0_144]
        at java.lang.reflect.Method.getGenericReturnType(Method.java:255) ~[?:1.8.0_144]
        at org.glassfish.jersey.server.model.Invocable.<init>(Invocable.java:214) ~[jersey-server-2.25.jar:?]
        at org.glassfish.jersey.server.model.Invocable.create(Invocable.java:188) ~[jersey-server-2.25.jar:?]
        at org.glassfish.jersey.server.model.ResourceMethod$Builder.createInvocable(ResourceMethod.java:555) ~[jersey-server-2.25.jar:?]
        at org.glassfish.jersey.server.model.ResourceMethod$Builder.build(ResourceMethod.java:536) ~[jersey-server-2.25.jar:?]
        at org.glassfish.jersey.server.model.Resource$Builder.processMethodBuilders(Resource.java:663) ~[jersey-server-2.25.jar:?]
        at org.glassfish.jersey.server.model.Resource$Builder.buildResourceData(Resource.java:599) ~[jersey-server-2.25.jar:?]
        at org.glassfish.jersey.server.model.Resource$Builder.build(Resource.java:655) ~[jersey-server-2.25.jar:?]
        at org.glassfish.jersey.server.model.Resource$Builder.processChildResourceBuilders(Resource.java:671) ~[jersey-server-2.25.jar:?]
        at org.glassfish.jersey.server.model.Resource$Builder.buildResourceData(Resource.java:600) ~[jersey-server-2.25.jar:?]
        at org.glassfish.jersey.server.model.Resource$Builder.build(Resource.java:655) ~[jersey-server-2.25.jar:?]
        at org.glassfish.jersey.server.model.Resource.from(Resource.java:798) ~[jersey-server-2.25.jar:?]
        at org.glassfish.jersey.server.ApplicationHandler.initialize(ApplicationHandler.java:476) ~[jersey-server-2.25.jar:?]
        at org.glassfish.jersey.server.ApplicationHandler.access$500(ApplicationHandler.java:184) ~[jersey-server-2.25.jar:?]
        at org.glassfish.jersey.server.ApplicationHandler$3.call(ApplicationHandler.java:350) ~[jersey-server-2.25.jar:?]
        at org.glassfish.jersey.server.ApplicationHandler$3.call(ApplicationHandler.java:347) ~[jersey-server-2.25.jar:?]
        at org.glassfish.jersey.internal.Errors.process(Errors.java:315) ~[jersey-common-2.25.jar:?]
        at org.glassfish.jersey.internal.Errors.process(Errors.java:297) ~[jersey-common-2.25.jar:?]
        at org.glassfish.jersey.internal.Errors.processWithException(Errors.java:255) ~[jersey-common-2.25.jar:?]
        at org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:347) ~[jersey-server-2.25.jar:?]
        at org.glassfish.jersey.servlet.WebComponent.<init>(WebComponent.java:392) ~[jersey-container-servlet-core-2.25.jar:?]
        at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:177) ~[jersey-container-servlet-core-2.25.jar:?]
        at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:369) ~[jersey-container-servlet-core-2.25.jar:?]
        at javax.servlet.GenericServlet.init(GenericServlet.java:244) ~[javax.servlet-api-3.1.0.jar:3.1.0]
        at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:640) [jetty-servlet-9.3.9.v20160517.jar:9.3.9.v20160517]
        at org.eclipse.jetty.servlet.ServletHolder.initialize(ServletHolder.java:419) [jetty-servlet-9.3.9.v20160517.jar:9.3.9.v20160517]
        at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:875) [jetty-servlet-9.3.9.v20160517.jar:9.3.9.v20160517]
        at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:349) [jetty-servlet-9.3.9.v20160517.jar:9.3.9.v20160517]
        at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:772) [jetty-server-9.3.9.v20160517.jar:9.3.9.v20160517]
        at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:262) [jetty-servlet-9.3.9.v20160517.jar:9.3.9.v20160517]
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) [jetty-util-9.3.9.v20160517.jar:9.3.9.v20160517]
        at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132) [jetty-util-9.3.9.v20160517.jar:9.3.9.v20160517]
        at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114) [jetty-util-9.3.9.v20160517.jar:9.3.9.v20160517]
        at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61) [jetty-server-9.3.9.v20160517.jar:9.3.9.v20160517]
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) [jetty-util-9.3.9.v20160517.jar:9.3.9.v20160517]
      at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132) [jetty-util-9.3.9.v20160517.jar:9.3.9.v20160517]
        at org.eclipse.jetty.server.Server.start(Server.java:411) [jetty-server-9.3.9.v20160517.jar:9.3.9.v20160517]
        at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:106) [jetty-util-9.3.9.v20160517.jar:9.3.9.v20160517]
        at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61) [jetty-server-9.3.9.v20160517.jar:9.3.9.v20160517]
        at org.eclipse.jetty.server.Server.doStart(Server.java:378) [jetty-server-9.3.9.v20160517.jar:9.3.9.v20160517]
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) [jetty-util-9.3.9.v20160517.jar:9.3.9.v20160517]
        at net.corda.webserver.internal.NodeWebServer.initWebServer(NodeWebServer.kt:106) [corda-webserver-impl-1.0.0.jar:?]
        at net.corda.webserver.internal.NodeWebServer.start(NodeWebServer.kt:45) [corda-webserver-impl-1.0.0.jar:?]
        at net.corda.webserver.WebServer.main(WebServer.kt:64) [corda-webserver-impl-1.0.0.jar:?]
Caused by: java.lang.ClassNotFoundException: net.corda.finance.contracts.asset.Cash$State
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[?:1.8.0_144]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_144]
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335) ~[?:1.8.0_144]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_144]
        at java.lang.Class.forName0(Native Method) ~[?:1.8.0_144]
        at java.lang.Class.forName(Class.java:348) ~[?:1.8.0_144]
        at sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:114) ~[?:1.8.0_144]
        ... 53 more

Error 2

[ERROR] 2017-10-12T07:30:05,037Z [main] Main.main - Exception during node startup
javax.servlet.ServletException: org.glassfish.jersey.servlet.ServletContainer-1e7cfd49@fd6700b1==org.glassfish.jersey.servlet.ServletContainer,0,false
        at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:661) ~[jetty-servlet-9.3.9.v20160517.jar:9.3.9.v20160517]
        at org.eclipse.jetty.servlet.ServletHolder.initialize(ServletHolder.java:419) ~[jetty-servlet-9.3.9.v20160517.jar:9.3.9.v20160517]
        at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:875) ~[jetty-servlet-9.3.9.v20160517.jar:9.3.9.v20160517]
        at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:349) ~[jetty-servlet-9.3.9.v20160517.jar:9.3.9.v20160517]
        at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:772) ~[jetty-server-9.3.9.v20160517.jar:9.3.9.v20160517]
        at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:262) ~[jetty-servlet-9.3.9.v20160517.jar:9.3.9.v20160517]
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) ~[jetty-util-9.3.9.v20160517.jar:9.3.9.v20160517]
        at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132) ~[jetty-util-9.3.9.v20160517.jar:9.3.9.v20160517]
        at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114) ~[jetty-util-9.3.9.v20160517.jar:9.3.9.v20160517]
        at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61) ~[jetty-server-9.3.9.v20160517.jar:9.3.9.v20160517]
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) ~[jetty-util-9.3.9.v20160517.jar:9.3.9.v20160517]
        at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132) ~[jetty-util-9.3.9.v20160517.jar:9.3.9.v20160517]
        at org.eclipse.jetty.server.Server.start(Server.java:411) ~[jetty-server-9.3.9.v20160517.jar:9.3.9.v20160517]
        at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:106) ~[jetty-util-9.3.9.v20160517.jar:9.3.9.v20160517]
        at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61) ~[jetty-server-9.3.9.v20160517.jar:9.3.9.v20160517]
        at org.eclipse.jetty.server.Server.doStart(Server.java:378) ~[jetty-server-9.3.9.v20160517.jar:9.3.9.v20160517]
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) ~[jetty-util-9.3.9.v20160517.jar:9.3.9.v20160517]
        at net.corda.webserver.internal.NodeWebServer.initWebServer(NodeWebServer.kt:106) ~[corda-webserver-impl-1.0.0.jar:?]
        at net.corda.webserver.internal.NodeWebServer.start(NodeWebServer.kt:45) ~[corda-webserver-impl-1.0.0.jar:?]
        at net.corda.webserver.WebServer.main(WebServer.kt:64) [corda-webserver-impl-1.0.0.jar:?]
Caused by: java.lang.TypeNotPresentException: Type net.corda.finance.contracts.asset.Cash$State not present
        at sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:117) ~[?:1.8.0_144]
        at sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:125) ~[?:1.8.0_144]
        at sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49) ~[?:1.8.0_144]
        at sun.reflect.generics.visitor.Reifier.reifyTypeArguments(Reifier.java:68) ~[?:1.8.0_144]
        at sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:138) ~[?:1.8.0_144]
        at sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49) ~[?:1.8.0_144]
        at sun.reflect.generics.visitor.Reifier.reifyTypeArguments(Reifier.java:68) ~[?:1.8.0_144]
        at sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:138) ~[?:1.8.0_144]
        at sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49) ~[?:1.8.0_144]
        at sun.reflect.generics.repository.MethodRepository.getReturnType(MethodRepository.java:68) ~[?:1.8.0_144]
        at java.lang.reflect.Method.getGenericReturnType(Method.java:255) ~[?:1.8.0_144]
        at org.glassfish.jersey.server.model.Invocable.<init>(Invocable.java:214) ~[jersey-server-2.25.jar:?]
        at org.glassfish.jersey.server.model.Invocable.create(Invocable.java:188) ~[jersey-server-2.25.jar:?]
        at org.glassfish.jersey.server.model.ResourceMethod$Builder.createInvocable(ResourceMethod.java:555) ~[jersey-server-2.25.jar:?]
        at org.glassfish.jersey.server.model.ResourceMethod$Builder.build(ResourceMethod.java:536) ~[jersey-server-2.25.jar:?]
        at org.glassfish.jersey.server.model.Resource$Builder.processMethodBuilders(Resource.java:663) ~[jersey-server-2.25.jar:?]
        at org.glassfish.jersey.server.model.Resource$Builder.buildResourceData(Resource.java:599) ~[jersey-server-2.25.jar:?]
        at org.glassfish.jersey.server.model.Resource$Builder.build(Resource.java:655) ~[jersey-server-2.25.jar:?]
        at org.glassfish.jersey.server.model.Resource$Builder.processChildResourceBuilders(Resource.java:671) ~[jersey-server-2.25.jar:?]
        at org.glassfish.jersey.server.model.Resource$Builder.buildResourceData(Resource.java:600) ~[jersey-server-2.25.jar:?]
        at org.glassfish.jersey.server.model.Resource$Builder.build(Resource.java:655) ~[jersey-server-2.25.jar:?]
        at org.glassfish.jersey.server.model.Resource.from(Resource.java:798) ~[jersey-server-2.25.jar:?]
        at org.glassfish.jersey.server.ApplicationHandler.initialize(ApplicationHandler.java:476) ~[jersey-server-2.25.jar:?]
        at org.glassfish.jersey.server.ApplicationHandler.access$500(ApplicationHandler.java:184) ~[jersey-server-2.25.jar:?]
        at org.glassfish.jersey.server.ApplicationHandler$3.call(ApplicationHandler.java:350) ~[jersey-server-2.25.jar:?]
        at org.glassfish.jersey.server.ApplicationHandler$3.call(ApplicationHandler.java:347) ~[jersey-server-2.25.jar:?]
        at org.glassfish.jersey.internal.Errors.process(Errors.java:315) ~[jersey-common-2.25.jar:?]
        at org.glassfish.jersey.internal.Errors.process(Errors.java:297) ~[jersey-common-2.25.jar:?]
        at org.glassfish.jersey.internal.Errors.processWithException(Errors.java:255) ~[jersey-common-2.25.jar:?]
        at org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:347) ~[jersey-server-2.25.jar:?]
        at org.glassfish.jersey.servlet.WebComponent.<init>(WebComponent.java:392) ~[jersey-container-servlet-core-2.25.jar:?]
        at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:177) ~[jersey-container-servlet-core-2.25.jar:?]
        at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:369) ~[jersey-container-servlet-core-2.25.jar:?]
        at javax.servlet.GenericServlet.init(GenericServlet.java:244) ~[javax.servlet-api-3.1.0.jar:3.1.0]
        at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:640) ~[jetty-servlet-9.3.9.v20160517.jar:9.3.9.v20160517]
        ... 19 more
Caused by: java.lang.ClassNotFoundException: net.corda.finance.contracts.asset.Cash$State
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[?:1.8.0_144]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_144]
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335) ~[?:1.8.0_144]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_144]
        at java.lang.Class.forName0(Native Method) ~[?:1.8.0_144]
        at java.lang.Class.forName(Class.java:348) ~[?:1.8.0_144]
        at sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:114) ~[?:1.8.0_144]
        at sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:125) ~[?:1.8.0_144]
        at sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49) ~[?:1.8.0_144]
        at sun.reflect.generics.visitor.Reifier.reifyTypeArguments(Reifier.java:68) ~[?:1.8.0_144]
        at sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:138) ~[?:1.8.0_144]
        at sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49) ~[?:1.8.0_144]
        at sun.reflect.generics.visitor.Reifier.reifyTypeArguments(Reifier.java:68) ~[?:1.8.0_144]
        at sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:138) ~[?:1.8.0_144]
        at sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49) ~[?:1.8.0_144]
        at sun.reflect.generics.repository.MethodRepository.getReturnType(MethodRepository.java:68) ~[?:1.8.0_144]
        at java.lang.reflect.Method.getGenericReturnType(Method.java:255) ~[?:1.8.0_144]
        at org.glassfish.jersey.server.model.Invocable.<init>(Invocable.java:214) ~[jersey-server-2.25.jar:?]
        at org.glassfish.jersey.server.model.Invocable.create(Invocable.java:188) ~[jersey-server-2.25.jar:?]
        at org.glassfish.jersey.server.model.ResourceMethod$Builder.createInvocable(ResourceMethod.java:555) ~[jersey-server-2.25.jar:?]
        at org.glassfish.jersey.server.model.ResourceMethod$Builder.build(ResourceMethod.java:536) ~[jersey-server-2.25.jar:?]
        at org.glassfish.jersey.server.model.Resource$Builder.processMethodBuilders(Resource.java:663) ~[jersey-server-2.25.jar:?]
        at org.glassfish.jersey.server.model.Resource$Builder.buildResourceData(Resource.java:599) ~[jersey-server-2.25.jar:?]
        at org.glassfish.jersey.server.model.Resource$Builder.build(Resource.java:655) ~[jersey-server-2.25.jar:?]
        at org.glassfish.jersey.server.model.Resource$Builder.processChildResourceBuilders(Resource.java:671) ~[jersey-server-2.25.jar:?]
        at org.glassfish.jersey.server.model.Resource$Builder.buildResourceData(Resource.java:600) ~[jersey-server-2.25.jar:?]
        at org.glassfish.jersey.server.model.Resource$Builder.build(Resource.java:655) ~[jersey-server-2.25.jar:?]
        at org.glassfish.jersey.server.model.Resource.from(Resource.java:798) ~[jersey-server-2.25.jar:?]
        at org.glassfish.jersey.server.ApplicationHandler.initialize(ApplicationHandler.java:476) ~[jersey-server-2.25.jar:?]
        at org.glassfish.jersey.server.ApplicationHandler.access$500(ApplicationHandler.java:184) ~[jersey-server-2.25.jar:?]
        at org.glassfish.jersey.server.ApplicationHandler$3.call(ApplicationHandler.java:350) ~[jersey-server-2.25.jar:?]
        at org.glassfish.jersey.server.ApplicationHandler$3.call(ApplicationHandler.java:347) ~[jersey-server-2.25.jar:?]
        at org.glassfish.jersey.internal.Errors.process(Errors.java:315) ~[jersey-common-2.25.jar:?]
        at org.glassfish.jersey.internal.Errors.process(Errors.java:297) ~[jersey-common-2.25.jar:?]
        at org.glassfish.jersey.internal.Errors.processWithException(Errors.java:255) ~[jersey-common-2.25.jar:?]
        at org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:347) ~[jersey-server-2.25.jar:?]
        at org.glassfish.jersey.servlet.WebComponent.<init>(WebComponent.java:392) ~[jersey-container-servlet-core-2.25.jar:?]
        at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:177) ~[jersey-container-servlet-core-2.25.jar:?]
        at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:369) ~[jersey-container-servlet-core-2.25.jar:?]
        at javax.servlet.GenericServlet.init(GenericServlet.java:244) ~[javax.servlet-api-3.1.0.jar:3.1.0]
        at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:640) ~[jetty-servlet-9.3.9.v20160517.jar:9.3.9.v20160517]
        ... 19 more
mikehearn commented 7 years ago

That sounds like a regression that may have occurred due to contract constraints.

mikehearn commented 7 years ago

Scratch that, I'm wrong. Ignore me.

mikehearn commented 7 years ago

The Corda web server is deprecated and not going to be supported in future. The same issue may re-occur with other web frameworks, but it's not different to any other missing dependency. So I'm not sure there's any issue to fix here (I think we bundle the finance app with the node for now, that's why it works there).