camunda-community-hub/camunda-platform-7-graphql

How to use 0.1.0-alpha1?

ThorbenLindhauer opened this issue · 6 comments

Hi guys,

I just wanted to try out the 0.1.0-alpha1 war, but am not sure how get it working. I tried deploying it on Tomcat and Wildfly 10 (both the Camunda 7.7.0 distributions) and failed both times.

On Tomcat, the deployment is successful, but accessing http://localhost:8080/camunda-bpm-graphql-0.1.0-alpha1/?query={tasks{name}} returns 404.

Deploying to Wildfly 10 fails with the following exception:

2017-08-23 09:37:30,964 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 63) MSC000001: Failed to start service jboss.undertow.deployment.default-server.default-host./graphql: org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./graphql: java.lang.RuntimeException: java.lang.ClassCastException: org.apache.tomcat.websocket.server.WsServerContainer cannot be cast to io.undertow.websockets.jsr.ServerWebSocketContainer
	at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:85)
	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)
	at org.jboss.threads.JBossThread.run(JBossThread.java:320)
Caused by: java.lang.RuntimeException: java.lang.ClassCastException: org.apache.tomcat.websocket.server.WsServerContainer cannot be cast to io.undertow.websockets.jsr.ServerWebSocketContainer
	at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:236)
	at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:100)
	at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:82)
	... 6 more
Caused by: java.lang.ClassCastException: org.apache.tomcat.websocket.server.WsServerContainer cannot be cast to io.undertow.websockets.jsr.ServerWebSocketContainer
	at io.undertow.websockets.jsr.Bootstrap$WebSocketListener.contextInitialized(Bootstrap.java:116)
	at io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:187)
	at io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:200)
	at io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:171)
	at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:42)
	at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
	at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
	at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
	at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
	at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
	at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
	at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:234)
	... 8 more

2017-08-23 09:37:39,186 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "camunda-bpm-graphql-0.1.0-alpha1.war")]) - failure description: {
    "WFLYCTL0080: Failed services" => {"jboss.undertow.deployment.default-server.default-host./graphql" => "org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./graphql: java.lang.RuntimeException: java.lang.ClassCastException: org.apache.tomcat.websocket.server.WsServerContainer cannot be cast to io.undertow.websockets.jsr.ServerWebSocketContainer
    Caused by: java.lang.RuntimeException: java.lang.ClassCastException: org.apache.tomcat.websocket.server.WsServerContainer cannot be cast to io.undertow.websockets.jsr.ServerWebSocketContainer
    Caused by: java.lang.ClassCastException: org.apache.tomcat.websocket.server.WsServerContainer cannot be cast to io.undertow.websockets.jsr.ServerWebSocketContainer"},
    "WFLYCTL0412: Required services that are not installed:" => ["jboss.undertow.deployment.default-server.default-host./graphql"],
    "WFLYCTL0180: Services with missing/unavailable dependencies" => undefined
}

So my question is: Could you please clarify how to deploy and access the web application?

Cheers,
Thorben

Hi Thorben,
thanks for feedback.
Hmm, at least for the Tomcat-deployment I do not see any problem.
For Wildfly I must admit I didn't have time to test it yet. Maybe @zerounix can help us here?

So, here are the steps I did for Tomcat:

With GraphiQL you'll see this for example (querying the process instances on that server):
image
When using GraphiQL on this server you have to setup Basic Authentication - so use this Authorization-Header in GraphiQL:
Authorization Basic ZGVtbzpkZW1v

Let me know if that works for you.

Harald

Hi Harald,

Since we have a release now, I tried to deploy the released artifact (accessible here: https://app.camunda.com/nexus/content/groups/public/org/camunda/bpm/extension/graphql/camunda-bpm-graphql/0.1.0-alpha1/camunda-bpm-graphql-0.1.0-alpha1.war), so I wouldn't have to build it from the sources. Could you please check if this runs on your Tomcat installation? If not, then I'll go with the build-from-source option :)

Cheers,
Thorben

Hi Thorben,

just cloned the current repo

  • build with mvn clean package -Pwildfly

  • copied the war file to a fresh camunda 7.7.0 wildfly

works as expected.

Maybe one thing is different in my case (or the jboss case) the URI is http://localhost:8080/graphql/schema.json and contains no -SNAPSHOT or -alpha.

Your actual ClassCastException seems strange to me, as i just changed the maven build a little, nothing wild or fancy. What kind of wildfly did you use?

If you could give me more insight, i might be able to help.

Hi Thorben,
I checked with the released artifact from https://app.camunda.com/nexus/content/groups/public/org/camunda/bpm/extension/graphql/camunda-bpm-graphql/0.1.0-alpha1/camunda-bpm-graphql-0.1.0-alpha1.war
Yes, it runs on the Tomcat installation as expected.

Thanks guys. I'll try harder then :)

@zerounix I guess the alpha1 artifact wasn't built with the wildfly profile resulting in the exception.

FYI: The solution was using Java 8, in particular setting the JRE_HOME variable to a Java 8 jre :)