Skip to content

When connecting to the server from the client using localhost, an error message Login successful but websocket connection failed will be displayed. #129

@tiandic

Description

@tiandic

My steps are as follows:

  1. Start the server:
PS D:\a> java --version
java 21.0.5 2024-10-15 LTS
Java(TM) SE Runtime Environment (build 21.0.5+9-LTS-239)
Java HotSpot(TM) 64-Bit Server VM (build 21.0.5+9-LTS-239, mixed mode, sharing)
PS D:\a> java -jar ClipCascade-Server-JRE_21.jar

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/

 :: Spring Boot ::                (v3.4.8)

2025-10-19T09:49:14.970+08:00  INFO 9200 --- [ClipCascade] [           main] c.a.clipcascade.ClipCascadeApplication   : Starting ClipCascadeApplication vServer-JRE_21 using Java 21.0.5 with PID 9200 (D:\a\ClipCascade-Server-JRE_21.jar started by a in D:\a)
2025-10-19T09:49:14.989+08:00  INFO 9200 --- [ClipCascade] [           main] c.a.clipcascade.ClipCascadeApplication   : No active profile set, falling back to 1 default profile: "default"
2025-10-19T09:49:18.388+08:00  INFO 9200 --- [ClipCascade] [           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2025-10-19T09:49:19.096+08:00  INFO 9200 --- [ClipCascade] [           main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 652 ms. Found 2 JPA repository interfaces.
2025-10-19T09:49:21.405+08:00  INFO 9200 --- [ClipCascade] [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port 8080 (http)
2025-10-19T09:49:21.464+08:00  INFO 9200 --- [ClipCascade] [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2025-10-19T09:49:21.472+08:00  INFO 9200 --- [ClipCascade] [           main] o.apache.catalina.core.StandardEngine    : Starting Servlet engine: [Apache Tomcat/10.1.43]
2025-10-19T09:49:21.606+08:00  INFO 9200 --- [ClipCascade] [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2025-10-19T09:49:21.608+08:00  INFO 9200 --- [ClipCascade] [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 6335 ms
2025-10-19T09:49:22.029+08:00  INFO 9200 --- [ClipCascade] [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Starting...
2025-10-19T09:49:23.614+08:00  INFO 9200 --- [ClipCascade] [           main] com.zaxxer.hikari.pool.HikariPool        : HikariPool-1 - Added connection conn0: url=jdbc:h2:file:./database/clipcascade user=CLIPCASCADE
2025-10-19T09:49:23.630+08:00  INFO 9200 --- [ClipCascade] [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Start completed.
2025-10-19T09:49:24.164+08:00  INFO 9200 --- [ClipCascade] [           main] o.hibernate.jpa.internal.util.LogHelper  : HHH000204: Processing PersistenceUnitInfo [name: default]
2025-10-19T09:49:24.614+08:00  INFO 9200 --- [ClipCascade] [           main] org.hibernate.Version                    : HHH000412: Hibernate ORM core version 6.6.22.Final
2025-10-19T09:49:24.871+08:00  INFO 9200 --- [ClipCascade] [           main] o.h.c.internal.RegionFactoryInitiator    : HHH000026: Second-level cache disabled
2025-10-19T09:49:26.795+08:00  INFO 9200 --- [ClipCascade] [           main] o.s.o.j.p.SpringPersistenceUnitInfo      : No LoadTimeWeaver setup: ignoring JPA class transformer
2025-10-19T09:49:27.034+08:00  WARN 9200 --- [ClipCascade] [           main] org.hibernate.orm.deprecation            : HHH90000025: H2Dialect does not need to be specified explicitly using 'hibernate.dialect' (remove the property setting and it will be selected by default)
2025-10-19T09:49:27.098+08:00  INFO 9200 --- [ClipCascade] [           main] org.hibernate.orm.connections.pooling    : HHH10001005: Database info:
        Database JDBC URL [Connecting through datasource 'HikariDataSource (HikariPool-1)']
        Database driver: undefined/unknown
        Database version: 2.3.232
        Autocommit mode: undefined/unknown
        Isolation level: undefined/unknown
        Minimum pool size: undefined/unknown
        Maximum pool size: undefined/unknown
2025-10-19T09:49:30.767+08:00  INFO 9200 --- [ClipCascade] [           main] o.h.e.t.j.p.i.JtaPlatformInitiator       : HHH000489: No JTA platform available (set 'hibernate.transaction.jta.platform' to enable JTA platform integration)
2025-10-19T09:49:30.968+08:00  INFO 9200 --- [ClipCascade] [           main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2025-10-19T09:49:33.142+08:00  INFO 9200 --- [ClipCascade] [           main] o.s.d.j.r.query.QueryEnhancerFactory     : Hibernate is in classpath; If applicable, HQL parser will be used.
2025-10-19T09:49:39.933+08:00  WARN 9200 --- [ClipCascade] [           main] JpaBaseConfiguration$JpaWebConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
2025-10-19T09:49:40.252+08:00  INFO 9200 --- [ClipCascade] [           main] eAuthenticationProviderManagerConfigurer : Global AuthenticationManager configured with AuthenticationProvider bean with name authenticationProvider
2025-10-19T09:49:40.254+08:00  WARN 9200 --- [ClipCascade] [           main] r$InitializeUserDetailsManagerConfigurer : Global AuthenticationManager configured with an AuthenticationProvider bean. UserDetailsService beans will not be used by Spring Security for automatically configuring username/password login. Consider removing the AuthenticationProvider bean. Alternatively, consider using the UserDetailsService in a manually instantiated DaoAuthenticationProvider. If the current configuration is intentional, to turn off this warning, increase the logging level of 'org.springframework.security.config.annotation.authentication.configuration.InitializeUserDetailsBeanManagerConfigurer' to ERROR
2025-10-19T09:49:41.268+08:00  INFO 9200 --- [ClipCascade] [           main] o.s.b.a.w.s.WelcomePageHandlerMapping    : Adding welcome page: class path resource [static/index.html]
2025-10-19T09:49:43.111+08:00  INFO 9200 --- [ClipCascade] [           main] o.s.v.b.OptionalValidatorFactoryBean     : Failed to set up a Bean Validation provider: jakarta.validation.NoProviderFoundException: Unable to create a Configuration, because no Jakarta Bean Validation provider could be found. Add a provider like Hibernate Validator (RI) to your classpath.
2025-10-19T09:49:44.240+08:00  INFO 9200 --- [ClipCascade] [           main] o.s.m.s.b.SimpleBrokerMessageHandler     : Starting...
2025-10-19T09:49:44.247+08:00  INFO 9200 --- [ClipCascade] [           main] o.s.m.s.b.SimpleBrokerMessageHandler     : BrokerAvailabilityEvent[available=true, SimpleBrokerMessageHandler [org.springframework.messaging.simp.broker.DefaultSubscriptionRegistry@2035f1f0]]
2025-10-19T09:49:44.252+08:00  INFO 9200 --- [ClipCascade] [           main] o.s.m.s.b.SimpleBrokerMessageHandler     : Started.
2025-10-19T09:49:44.474+08:00  INFO 9200 --- [ClipCascade] [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port 8080 (http) with context path '/'
2025-10-19T09:49:44.502+08:00  INFO 9200 --- [ClipCascade] [           main] o.s.s.config.TaskSchedulerRouter         : More than one TaskScheduler bean exists within the context, and none is named 'taskScheduler'. Mark one of them as primary or name it 'taskScheduler' (possibly as an alias); or implement the SchedulingConfigurer interface and call ScheduledTaskRegistrar#setScheduler explicitly within the configureTasks() callback: [messageBrokerTaskScheduler, heartbeatTaskScheduler]
2025-10-19T09:49:44.546+08:00  INFO 9200 --- [ClipCascade] [           main] c.a.clipcascade.ClipCascadeApplication   : Started ClipCascadeApplication in 31.26 seconds (process running for 32.663)
2025-10-19T09:49:48.011+08:00  INFO 9200 --- [ClipCascade] [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring DispatcherServlet 'dispatcherServlet'
2025-10-19T09:49:48.011+08:00  INFO 9200 --- [ClipCascade] [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
2025-10-19T09:49:48.017+08:00  INFO 9200 --- [ClipCascade] [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Completed initialization in 3 ms
2025-10-19T09:50:44.245+08:00  INFO 9200 --- [ClipCascade] [MessageBroker-1] o.s.w.s.c.WebSocketMessageBrokerStats    : WebSocketSession[0 current WS(0)-HttpStream(0)-HttpPoll(0), 0 total, 0 closed abnormally (0 connect failure, 0 send limit, 0 transport error)], stompSubProtocol[processed CONNECT(0)-CONNECTED(0)-DISCONNECT(0)], stompBrokerRelay[null], inboundChannel[pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0], outboundChannel[pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0], sockJsScheduler[pool size = 1, active threads = 1, queued tasks = 0, completed tasks = 0]

  1. Connect to the server using the Windows client.
Login successful but websocket connection failed. 
Please check websocket-url
Failed to connect websocket: Connection to ws://localhost:8080/clipsocket timed out

I then changed localhost to 127.0.0.1, and no error occurred.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions