Error trying to send messages between two different processes

179 views
Skip to first unread message

Omar Hanif

unread,
Jan 10, 2023, 8:13:50 AM1/10/23
to Kogito development mailing list
Hi,
We are launching two processes, in two separate quarkus projects, that send messages to each other via kafka. The problem we encounter is that the message is sent, so the waiting process can resume its execution, but the process in charge of sending the message produces the following error: 

java.util.concurrent.CompletionException: io.vertx.core.VertxException: java.net.MalformedURLException: unknown protocol: localhost
        at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:314)
        at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:319)
        at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1702)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: io.vertx.core.VertxException: java.net.MalformedURLException: unknown protocol: localhost
        at io.vertx.ext.web.client.impl.WebClientBase.requestAbs(WebClientBase.java:135)
        at io.vertx.ext.web.client.WebClient.requestAbs(WebClient.java:250)
        at io.vertx.ext.web.client.WebClient.postAbs(WebClient.java:430)
        at org.kie.kogito.quarkus.processes.devservices.DataIndexEventPublisher.publish(DataIndexEventPublisher.java:64)
        at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
        at org.kie.kogito.quarkus.processes.devservices.DataIndexEventPublisher.publish(DataIndexEventPublisher.java:92)
        at org.kie.kogito.quarkus.processes.devservices.DataIndexEventPublisher_ClientProxy.publish(Unknown Source)
        at org.kie.kogito.event.impl.BaseEventManager.lambda$publish$0(BaseEventManager.java:47)
        at java.base/java.lang.Iterable.forEach(Iterable.java:75)
        at org.kie.kogito.event.impl.BaseEventManager.publish(BaseEventManager.java:47)
        at org.kie.kogito.services.uow.CollectingUnitOfWork.end(CollectingUnitOfWork.java:65)
        at org.kie.kogito.services.uow.ManagedUnitOfWork.end(ManagedUnitOfWork.java:51)
        at org.kie.kogito.services.uow.UnitOfWorkExecutor.executeInUnitOfWork(UnitOfWorkExecutor.java:38)
        at org.kie.kogito.process.impl.ProcessServiceImpl.createProcessInstance(ProcessServiceImpl.java:82)
        at org.kie.kogito.event.impl.ProcessEventDispatcher.lambda$startNewInstance$5(ProcessEventDispatcher.java:131)
        at java.base/java.util.Optional.map(Optional.java:265)
        at org.kie.kogito.event.impl.ProcessEventDispatcher.startNewInstance(ProcessEventDispatcher.java:129)
        at org.kie.kogito.event.impl.ProcessEventDispatcher.lambda$dispatch$1(ProcessEventDispatcher.java:77)
        at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
        ... 3 more
Caused by: java.net.MalformedURLException: unknown protocol: localhost
        at java.base/java.net.URL.<init>(URL.java:652)
        at java.base/java.net.URL.<init>(URL.java:541)
        at java.base/java.net.URL.<init>(URL.java:488)
        at io.vertx.ext.web.client.impl.ClientUri.parse(ClientUri.java:38)
        at io.vertx.ext.web.client.impl.WebClientBase.requestAbs(WebClientBase.java:133)
        ... 21 more

Both projects are running in development mode (mvn clean compile quarkus:dev). The java and maven versions are 11 and 3.8.6 respectively.

Thanks,
Omar

Tristan Radisson

unread,
Jan 10, 2023, 11:13:58 AM1/10/23
to kogito-de...@googlegroups.com
Hi Omar,

We would need a reproducer to investigate.

Regards,

Tristan Radisson

Principal Software Quality Engineer

Business Automation Cloud

Red Hat France

trad...@redhat.com   

+33 (1) 41912322



--
You received this message because you are subscribed to the Google Groups "Kogito development mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kogito-developm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kogito-development/725bff43-3501-4bab-a5a7-c3a6cc963f1dn%40googlegroups.com.

Jakub Grabowski

unread,
Jan 10, 2023, 11:16:17 AM1/10/23
to kogito-de...@googlegroups.com
Could you share content of config files from your projects? Looks like some obvious misconfiguration (localhost as port not a hostname).

Regards,
Jakub Grabowski.

--

Omar Hanif

unread,
Jan 10, 2023, 11:36:02 AM1/10/23
to Kogito development mailing list
Of course, I attach in this message the application.properties file used in each of the projects.

Thanks for your help
Omar

application (1).properties
application.properties

Sivasankari Gnanasekaran

unread,
Sep 28, 2023, 6:24:53 AM9/28/23
to Kogito development mailing list

is there any update on this issue ? I have a similar issue. 
I am using the exact same code without any change. 
the unknow protocol issue occurs when I run the POST cmd , GET is working fine. 


    <div id="reversed-stacktrace" class="trace hidden">

<p><em>The stacktrace below has been reversed to show the root cause first. <a href="" onClick="toggleStackTraceOrder(); return false;">Click Here</a> to see the original stacktrace</em></p>        <pre>java.net.MalformedURLException: unknown protocol: localhost

at java.base/java.net.URL.&lt;init&gt;(URL.java:652)

at java.base/java.net.URL.&lt;init&gt;(URL.java:541)

at java.base/java.net.URL.&lt;init&gt;(URL.java:488)

at io.vertx.ext.web.client.impl.ClientUri.parse(ClientUri.java:38)

at io.vertx.ext.web.client.impl.WebClientBase.requestAbs(WebClientBase.java:133)

at io.vertx.ext.web.client.WebClient.requestAbs(WebClient.java:250)

at io.vertx.ext.web.client.WebClient.postAbs(WebClient.java:430)

at org.kie.kogito.quarkus.workflow.devservices.DataIndexEventPublisher.publish(DataIndexEventPublisher.java:62)

at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)

at org.kie.kogito.quarkus.workflow.devservices.DataIndexEventPublisher.publish(DataIndexEventPublisher.java:90)

at org.kie.kogito.event.impl.BaseEventManager.lambda$publish$0(BaseEventManager.java:47)

at java.base/java.lang.Iterable.forEach(Iterable.java:75)

at org.kie.kogito.event.impl.BaseEventManager.publish(BaseEventManager.java:47)

at org.kie.kogito.services.uow.CollectingUnitOfWork.end(CollectingUnitOfWork.java:65)

at org.kie.kogito.services.uow.ManagedUnitOfWork.end(ManagedUnitOfWork.java:51)

at org.kie.kogito.services.uow.UnitOfWorkExecutor.executeInUnitOfWork(UnitOfWorkExecutor.java:38)

at org.kie.kogito.process.impl.ProcessServiceImpl.createProcessInstance(ProcessServiceImpl.java:67)

at org.kie.kogito.serverless.Hello_worldResource.createResource_hello_world(Hello_worldResource.java:79)

at org.kie.kogito.serverless.Hello_worldResource_ClientProxy.createResource_hello_world(Unknown Source)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.base/java.lang.reflect.Method.invoke(Method.java:566)

at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:170)

at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:130)

at org.jboss.resteasy.core.ResourceMethodInvoker.internalInvokeOnTarget(ResourceMethodInvoker.java:660)

at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTargetAfterFilter(ResourceMethodInvoker.java:524)

at org.jboss.resteasy.core.ResourceMethodInvoker.lambda$invokeOnTarget$2(ResourceMethodInvoker.java:474)

at org.jboss.resteasy.core.interception.jaxrs.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:364)

at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:476)

at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:434)

at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:408)

at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:69)

at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:492)

at org.jboss.resteasy.core.SynchronousDispatcher.lambda$invoke$4(SynchronousDispatcher.java:261)

at org.jboss.resteasy.core.SynchronousDispatcher.lambda$preprocess$0(SynchronousDispatcher.java:161)

at org.jboss.resteasy.core.interception.jaxrs.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:364)

at org.jboss.resteasy.core.SynchronousDispatcher.preprocess(SynchronousDispatcher.java:164)

at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:247)

at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:249)

at io.quarkus.resteasy.runtime.ResteasyFilter.doFilter(ResteasyFilter.java:35)

at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)

at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)

at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)

at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:63)

at io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68)

at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)

at io.undertow.servlet.handlers.RedirectDirHandler.handleRequest(RedirectDirHandler.java:67)

at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:133)

at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)

at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)

at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:65)

at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)

at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)

at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)

at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)

at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:247)

at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:56)

at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:111)

at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:108)

at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)

at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)

at io.quarkus.undertow.runtime.UndertowDeploymentRecorder$9$1.call(UndertowDeploymentRecorder.java:602)

at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:227)

at io.undertow.servlet.handlers.ServletInitialHandler.handleRequest(ServletInitialHandler.java:152)

at io.quarkus.undertow.runtime.UndertowDeploymentRecorder$1.handleRequest(UndertowDeploymentRecorder.java:120)

at io.undertow.server.Connectors.executeRootHandler(Connectors.java:284)

at io.undertow.server.DefaultExchangeHandler.handle(DefaultExchangeHandler.java:18)

at io.quarkus.undertow.runtime.UndertowDeploymentRecorder$5$1.run(UndertowDeploymentRecorder.java:417)

at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)

at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)

at io.quarkus.vertx.core.runtime.VertxCoreRecorder$14.runWith(VertxCoreRecorder.java:576)

at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)

at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)

at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:29)

at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:29)

at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)

at java.base/java.lang.Thread.run(Thread.java:829)

Resulted in: io.vertx.core.VertxException: java.net.MalformedURLException: unknown protocol: localhost

at io.vertx.ext.web.client.impl.WebClientBase.requestAbs(WebClientBase.java:135)

... 76 more

Resulted in: org.jboss.resteasy.spi.UnhandledException: io.vertx.core.VertxException: java.net.MalformedURLException: unknown protocol: localhost

at org.jboss.resteasy.core.ExceptionHandler.handleApplicationException(ExceptionHandler.java:105)

at org.jboss.resteasy.core.ExceptionHandler.handleException(ExceptionHandler.java:359)

at org.jboss.resteasy.core.SynchronousDispatcher.writeException(SynchronousDispatcher.java:218)

at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:519)

... 47 more</pre>

    </div>

<div id="stacktrace"></div></div></body>

</html>

Ricardo Zanini

unread,
Oct 10, 2023, 9:42:44 AM10/10/23
to kogito-de...@googlegroups.com
Hi!

Not sure what you're trying to do? You should POST to `http://localhost`. Looks like your HTTP message is wrongly formed somehow. Can you share how are you making these requests?

Cheers!
--
Zanini


Reply all
Reply to author
Forward
0 new messages