Create separate war using gradlew BuildWar , websocket service global event socket 404

Hi,

Just like my topic’s title

create separate war using gradlew BuildWar , websocket service global event socket 404

It seems like spring web socket fail to start so how to solve this problem?

Hi,
Please provide more details.

Ok,before I jump into conclusion regarding cause of spring websocket with following error messages

Initial SockJS “Info” request to server failed, url=http://localhost:8080/app-core/cubaglevt-ws/handler

Can you show me how to build cuba project in separate war when there is global event add on on it ?

For the case of utilizing global event add on, can I deploy those separate war in 2 differences tomcat instance but in a same server ?

@knstvk, Hi sorry but do you still need another more detail?

Hi,

There is obviously something wrong the cuba ports or access URLs configuration.
Based on your first explanation:

  • you are using global-events addon, right?

  • you are also using spring-websocket library in your project, aren’t you?

  • you have two Tomcat instances on the same machine. So which main http port is used by the “web tier” tomcat and which port is used by the “core tier” tomcat?

  • have you specified any application properties that should be specified when you deploy web tier and core tier separately?
    Like described here:
    Setting up Connection to the Middleware Cluster - CUBA Platform. Developer’s Manual

  • can you specify the full exception stack trace?

Hi @AlexBudarov

thanks for reply

  1. you are using global-events addon, right? Yes

  2. you are also using spring-websocket library in your project, aren’t you? No , I just using global-events addon in separate war and tomcat instance which I believe it utilizing spring websocket

  3. you have two Tomcat instances on the same machine. So which main http port is used by the “web tier” tomcat and which port is used by the “core tier” tomcat? web tier http port is 8080 and core tier is 8070

  4. Oh I miss this part , because I think since it in same server not necessary to put this in config
    cuba.webHostName = host1
    cuba.webPort = 8080
    cuba.webContextName = app

5. Sure I will

Properties: cuba.webHostName, cuba.webPort and cuba.webContextName are not the most important in your case. I mean, you better should set them but it is not critical for server startup.

The critical part is to let “web tier” know where “core tier” lives, how to access it.
So in the local app properties for the “web tier” you should specify:

cuba.useLocalServiceInvocation = false

# localhost is faster than myhostname
cuba.connectionUrlList = http://localhost:8070/app-core

cuba.webHostName = myhostname
cuba.webPort = 8080
cuba.webContextName = app

And for “core tier”:

cuba.webHostName = myhostname
cuba.webPort = 8070
cuba.webContextName = app-core