org.glassfish.jersey.message.internal.WriterInterceptorExecutor$TerminalWriterInterceptor.aroundWriteTo MessageBodyWriter not found for media type=text/event-stream;charset=UTF-8, type=class com.seeyon.ctp.rest.resources.BaseResource$1, genericType=class com.seeyon.ctp.rest.resources.BaseResource$1.解释该错误

时间: 2025-07-11 19:52:16 AIGC 浏览: 41
<think>嗯,用户遇到了Jersey框架中MessageBodyWriter找不到的问题,特别是针对text/event-stream类型和UTF-8字符集的情况。我需要先回想一下Jersey处理消息体的机制。Jersey使用MessageBodyWriter来将Java对象序列化为HTTP响应体,当找不到合适的Writer时就会报错。 首先,用户提到的错误信息是“MessageBodyWriter not found for text/event-stream charset=UTF-8”,这说明Jersey在处理返回类型为text/event-stream的时候找不到对应的Writer。可能的原因有几个:缺少依赖、未正确注册Provider,或者返回类型不匹配。 接下来,我需要考虑常见的解决方法。第一步通常是检查依赖,特别是是否包含了处理SSE(Server-Sent Events)的模块,因为text/event-stream常用于SSE。Jersey的SSE模块是jersey-media-sse,用户需要确认是否在项目中添加了这个依赖。比如Maven的话,需要添加对应的依赖项。 如果依赖没问题,下一步是检查Provider的注册。有时候,即使依赖正确,如果没有在Application配置中注册相应的Feature,比如SseFeature,Jersey可能无法识别相关的MessageBodyWriter。这时候需要在ResourceConfig中显式注册。 另外,用户的代码中可能直接返回了某个对象,而Jersey无法找到对应的Writer。例如,使用EventOutput或ChunkedOutput时,需要确保这些类型被正确处理。可能需要自定义MessageBodyWriter,或者检查返回类型是否正确。 还有,用户可能没有正确设置响应头,比如Content-Type是否为text/event-stream。有时候即使返回了正确的内容类型,如果响应头未正确设置,Jersey也可能无法匹配到正确的Writer。 另外,缓存配置可能影响,需要检查是否启用了缓存,导致Writer未被正确加载。或者类路径问题,导致Provider没有被扫描到。可能需要使用@Provider注解,并在配置中指定扫描包。 用户提到的BaseResource可能需要检查是否在其中正确配置了资源方法,确保返回类型和Produces注解正确。例如,资源方法应该使用@Produces(MediaType.SERVER_SENT_EVENTS)来指定媒体类型。 总结下来,解决步骤应该是:1. 添加jersey-media-sse依赖;2. 注册SseFeature;3. 检查资源方法的Produces注解;4. 确保返回类型正确;5. 检查响应头设置;6. 如有必要,自定义Provider或检查类路径配置。</think>### Jersey中MessageBodyWriter未找到的解决方案 在Jersey框架中出现`MessageBodyWriter not found for text/event-stream charset=UTF-8`错误,通常是由于缺少对应媒体类型的消息体处理器或配置问题导致。以下是分步解决方案: --- #### 1. **添加SSE模块依赖** Jersey对`text/event-stream`的支持需要依赖`jersey-media-sse`模块。 **Maven配置示例**: ```xml <dependency> <groupId>org.glassfish.jersey.media</groupId> <artifactId>jersey-media-sse</artifactId> <version>3.1.0</version> </dependency> ``` 未添加此依赖会导致无法识别事件流格式[^1]。 --- #### 2. **注册SSE Feature** 在Jersey应用配置中显式注册`SseFeature`: ```java @ApplicationPath("/api") public class MyApplication extends ResourceConfig { public MyApplication() { register(SseFeature.class); packages("com.example.resources"); } } ``` 未注册时,Jersey无法激活事件流处理能力。 --- #### 3. **检查资源方法注解** 确保资源方法使用`@Produces(MediaType.SERVER_SENT_EVENTS)`: ```java @GET @Path("stream") @Produces(MediaType.SERVER_SENT_EVENTS) public EventOutput getStream() { EventOutput output = new EventOutput(); // 实现事件推送逻辑 return output; } ``` 若注解错误(如误用`text/plain`),会触发类型不匹配。 --- #### 4. **验证返回类型** - 使用`EventOutput`或`ChunkedOutput`作为返回值类型。 - 直接返回`String`或`JSON`对象会因类型不匹配导致错误。 --- #### 5. **自定义MessageBodyWriter(可选)** 若需自定义序列化逻辑,实现`MessageBodyWriter`并添加`@Provider`注解: ```java @Provider @Produces("text/event-stream") public class CustomEventWriter implements MessageBodyWriter<Event> { @Override public void writeTo(Event event, /* 参数省略 */) { // 自定义写入逻辑 } } ``` 需确保该Provider被Jersey扫描到(通过`packages()`配置或类路径扫描)。 --- #### 6. **禁用缓存干扰** 在响应头中明确禁用缓存: ```java @GET @Produces(MediaType.SERVER_SENT_EVENTS) public Response getStream() { return Response.ok(eventOutput) .header("Cache-Control", "no-cache") .build(); } ``` 某些浏览器或中间件缓存可能导致流数据被截断。 --- ###
阅读全文

相关推荐

sbt:spark-app> assembly [warn] multiple main classes detected: run 'show discoveredMainClasses' to see the list [error] 37 error(s) were encountered during the merge: [error] stack trace is suppressed; run last assembly for the full output [error] (assembly) [error] Deduplicate found different file contents in the following: [error] Jar name = protobuf-java-3.19.6.jar, jar org = com.google.protobuf, entry target = google/protobuf/api.proto [error] Jar name = spark-core_2.12-3.5.0.jar, jar org = org.apache.spark, entry target = google/protobuf/api.proto [error] Deduplicate found different file contents in the following: [error] Jar name = protobuf-java-3.19.6.jar, jar org = com.google.protobuf, entry target = google/protobuf/field_mask.proto [error] Jar name = spark-core_2.12-3.5.0.jar, jar org = org.apache.spark, entry target = google/protobuf/field_mask.proto [error] Deduplicate found different file contents in the following: [error] Jar name = commons-logging-1.1.3.jar, jar org = commons-logging, entry target = org/apache/commons/logging/Log.class [error] Jar name = jcl-over-slf4j-2.0.7.jar, jar org = org.slf4j, entry target = org/apache/commons/logging/Log.class [error] Deduplicate found different file contents in the following: [error] Jar name = protobuf-java-3.19.6.jar, jar org = com.google.protobuf, entry target = google/protobuf/struct.proto [error] Jar name = spark-core_2.12-3.5.0.jar, jar org = org.apache.spark, entry target = google/protobuf/struct.proto [error] Deduplicate found different file contents in the following: [error] Jar name = commons-logging-1.1.3.jar, jar org = commons-logging, entry target = org/apache/commons/logging/impl/NoOpLog.class [error] Jar name = jcl-over-slf4j-2.0.7.jar, jar org = org.slf4j, entry target = org/apache/commons/logging/impl/NoOpLog.class [error] Deduplicate found different file contents in the following: [error] Jar name = arrow-format-11.0.0.jar, jar org = org.apache.arrow, entry target = arrow-git.properties [error] Jar name = arrow-memory-core-11.0.0.jar, jar org = org.apache.arrow, entry target = arrow-git.properties [error] Jar name = arrow-memory-netty-11.0.0.jar, jar org = org.apache.arrow, entry target = arrow-git.properties [error] Jar name = arrow-vector-11.0.0.jar, jar org = org.apache.arrow, entry target = arrow-git.properties [error] Deduplicate found different file contents in the following: [error] Jar name = javax.inject-1.jar, jar org = javax.inject, entry target = javax/inject/Singleton.class [error] Jar name = jakarta.inject-2.6.1.jar, jar org = org.glassfish.hk2.external, entry target = javax/inject/Singleton.class [error] Deduplicate found different file contents in the following: [error] Jar name = protobuf-java-3.19.6.jar, jar org = com.google.protobuf, entry target = google/protobuf/duration.proto [error] Jar name = spark-core_2.12-3.5.0.jar, jar org = org.apache.spark, entry target = google/protobuf/duration.proto [error] Deduplicate found different file contents in the following: [error] Jar name = javax.inject-1.jar, jar org = javax.inject, entry target = javax/inject/Named.class [error] Jar name = jakarta.inject-2.6.1.jar, jar org = org.glassfish.hk2.external, entry target = javax/inject/Named.class [error] Deduplicate found different file contents in the following: [error] Jar name = javax.inject-1.jar, jar org = javax.inject, entry target = javax/inject/Inject.class [error] Jar name = jakarta.inject-2.6.1.jar, jar org = org.glassfish.hk2.external, entry target = javax/inject/Inject.class [error] Deduplicate found different file contents in the following: [error] Jar name = commons-logging-1.1.3.jar, jar org = commons-logging, entry target = org/apache/commons/logging/LogFactory.class [error] Jar name = jcl-over-slf4j-2.0.7.jar, jar org = org.slf4j, entry target = org/apache/commons/logging/LogFactory.class [error] Deduplicate found different file contents in the following: [error] Jar name = commons-logging-1.1.3.jar, jar org = commons-logging, entry target = org/apache/commons/logging/LogConfigurationException.class [error] Jar name = jcl-over-slf4j-2.0.7.jar, jar org = org.slf4j, entry target = org/apache/commons/logging/LogConfigurationException.class [error] Deduplicate found different file contents in the following: [error] Jar name = jakarta.annotation-api-1.3.5.jar, jar org = jakarta.annotation, entry target = javax/annotation/security/DenyAll.class [error] Jar name = jsr250-api-1.0.jar, jar org = javax.annotation, entry target = javax/annotation/security/DenyAll.class [error] Deduplicate found different file contents in the following: [error] Jar name = protobuf-java-3.19.6.jar, jar org = com.google.protobuf, entry target = google/protobuf/timestamp.proto [error] Jar name = spark-core_2.12-3.5.0.jar, jar org = org.apache.spark, entry target = google/protobuf/timestamp.proto [error] Deduplicate found different file contents in the following: [error] Jar name = jakarta.annotation-api-1.3.5.jar, jar org = jakarta.annotation, entry target = javax/annotation/Generated.class [error] Jar name = jsr250-api-1.0.jar, jar org = javax.annotation, entry target = javax/annotation/Generated.class [error] Deduplicate found different file contents in the following: [error] Jar name = protobuf-java-3.19.6.jar, jar org = com.google.protobuf, entry target = google/protobuf/source_context.proto [error] Jar name = spark-core_2.12-3.5.0.jar, jar org = org.apache.spark, entry target = google/protobuf/source_context.proto [error] Deduplicate found different file contents in the following: [error] Jar name = protobuf-java-3.19.6.jar, jar org = com.google.protobuf, entry target = google/protobuf/empty.proto [error] Jar name = spark-core_2.12-3.5.0.jar, jar org = org.apache.spark, entry target = google/protobuf/empty.proto [error] Deduplicate found different file contents in the following: [error] Jar name = jakarta.annotation-api-1.3.5.jar, jar org = jakarta.annotation, entry target = javax/annotation/Resource.class [error] Jar name = jsr250-api-1.0.jar, jar org = javax.annotation, entry target = javax/annotation/Resource.class [error] Deduplicate found different file contents in the following: [error] Jar name = jakarta.annotation-api-1.3.5.jar, jar org = jakarta.annotation, entry target = javax/annotation/security/RolesAllowed.class [error] Jar name = jsr250-api-1.0.jar, jar org = javax.annotation, entry target = javax/annotation/security/RolesAllowed.class [error] Deduplicate found different file contents in the following: [error] Jar name = jakarta.annotation-api-1.3.5.jar, jar org = jakarta.annotation, entry target = javax/annotation/PreDestroy.class [error] Jar name = jsr250-api-1.0.jar, jar org = javax.annotation, entry target = javax/annotation/PreDestroy.class [error] Deduplicate found different file contents in the following: [error] Jar name = protobuf-java-3.19.6.jar, jar org = com.google.protobuf, entry target = google/protobuf/descriptor.proto [error] Jar name = spark-core_2.12-3.5.0.jar, jar org = org.apache.spark, entry target = google/protobuf/descriptor.proto [error] Deduplicate found different file contents in the following: [error] Jar name = commons-logging-1.1.3.jar, jar org = commons-logging, entry target = org/apache/commons/logging/impl/SimpleLog.class [error] Jar name = jcl-over-slf4j-2.0.7.jar, jar org = org.slf4j, entry target = org/apache/commons/logging/impl/SimpleLog.class [error] Deduplicate found different file contents in the following: [error] Jar name = jakarta.annotation-api-1.3.5.jar, jar org = jakarta.annotation, entry target = javax/annotation/security/DeclareRoles.class [error] Jar name = jsr250-api-1.0.jar, jar org = javax.annotation, entry target = javax/annotation/security/DeclareRoles.class [error] Deduplicate found different file contents in the following: [error] Jar name = protobuf-java-3.19.6.jar, jar org = com.google.protobuf, entry target = google/protobuf/wrappers.proto [error] Jar name = spark-core_2.12-3.5.0.jar, jar org = org.apache.spark, entry target = google/protobuf/wrappers.proto [error] Deduplicate found different file contents in the following: [error] Jar name = javax.inject-1.jar, jar org = javax.inject, entry target = javax/inject/Qualifier.class [error] Jar name = jakarta.inject-2.6.1.jar, jar org = org.glassfish.hk2.external, entry target = javax/inject/Qualifier.class [error] Deduplicate found different file contents in the following: [error] Jar name = jakarta.annotation-api-1.3.5.jar, jar org = jakarta.annotation, entry target = javax/annotation/security/PermitAll.class [error] Jar name = jsr250-api-1.0.jar, jar org = javax.annotation, entry target = javax/annotation/security/PermitAll.class [error] Deduplicate found different file contents in the following: [error] Jar name = protobuf-java-3.19.6.jar, jar org = com.google.protobuf, entry target = google/protobuf/any.proto [error] Jar name = spark-core_2.12-3.5.0.jar, jar org = org.apache.spark, entry target = google/protobuf/any.proto [error] Deduplicate found different file contents in the following: [error] Jar name = jakarta.annotation-api-1.3.5.jar, jar org = jakarta.annotation, entry target = javax/annotation/Resources.class [error] Jar name = jsr250-api-1.0.jar, jar org = javax.annotation, entry target = javax/annotation/Resources.class [error] Deduplicate found different file contents in the following: [error] Jar name = jakarta.annotation-api-1.3.5.jar, jar org = jakarta.annotation, entry target = javax/annotation/Resource$AuthenticationType.class [error] Jar name = jsr250-api-1.0.jar, jar org = javax.annotation, entry target = javax/annotation/Resource$AuthenticationType.class [error] Deduplicate found different file contents in the following: [error] Jar name = jackson-core-2.15.2.jar, jar org = com.fasterxml.jackson.core, entry target = META-INF/versions/9/module-info.class [error] Jar name = jackson-databind-2.15.2.jar, jar org = com.fasterxml.jackson.core, entry target = META-INF/versions/9/module-info.class [error] Jar name = jackson-datatype-jsr310-2.13.4.jar, jar org = com.fasterxml.jackson.datatype, entry target = META-INF/versions/9/module-info.class [error] Jar name = gson-2.10.1.jar, jar org = com.google.code.gson, entry target = META-INF/versions/9/module-info.class [error] Jar name = log4j-api-2.20.0.jar, jar org = org.apache.logging.log4j, entry target = META-INF/versions/9/module-info.class [error] Jar name = parquet-jackson-1.12.3.jar, jar org = org.apache.parquet, entry target = META-INF/versions/9/module-info.class [error] Jar name = jcl-over-slf4j-2.0.7.jar, jar org = org.slf4j, entry target = META-INF/versions/9/module-info.class [error] Jar name = slf4j-api-2.0.7.jar, jar org = org.slf4j, entry target = META-INF/versions/9/module-info.class [error] Jar name = xz-1.9.jar, jar org = org.tukaani, entry target = META-INF/versions/9/module-info.class [error] Deduplicate found different file contents in the following: [error] Jar name = protobuf-java-3.19.6.jar, jar org = com.google.protobuf, entry target = google/protobuf/type.proto [error] Jar name = spark-core_2.12-3.5.0.jar, jar org = org.apache.spark, entry target = google/protobuf/type.proto [error] Deduplicate found different file contents in the following: [error] Jar name = jakarta.annotation-api-1.3.5.jar, jar org = jakarta.annotation, entry target = javax/annotation/PostConstruct.class [error] Jar name = jsr250-api-1.0.jar, jar org = javax.annotation, entry target = javax/annotation/PostConstruct.class [error] Deduplicate found different file contents in the following: [error] Jar name = netty-all-4.1.96.Final.jar, jar org = io.netty, entry target = META-INF/io.netty.versions.properties [error] Jar name = netty-buffer-4.1.96.Final.jar, jar org = io.netty, entry target = META-INF/io.netty.versions.properties [error] Jar name = netty-codec-http2-4.1.96.Final.jar, jar org = io.netty, entry target = META-INF/io.netty.versions.properties [error] Jar name = netty-codec-http-4.1.96.Final.jar, jar org = io.netty, entry target = META-INF/io.netty.versions.properties [error] Jar name = netty-codec-socks-4.1.96.Final.jar, jar org = io.netty, entry target = META-INF/io.netty.versions.properties [error] Jar name = netty-codec-4.1.96.Final.jar, jar org = io.netty, entry target = META-INF/io.netty.versions.properties [error] Jar name = netty-common-4.1.96.Final.jar, jar org = io.netty, entry target = META-INF/io.netty.versions.properties [error] Jar name = netty-handler-proxy-4.1.96.Final.jar, jar org = io.netty, entry target = META-INF/io.netty.versions.properties [error] Jar name = netty-handler-4.1.96.Final.jar, jar org = io.netty, entry target = META-INF/io.netty.versions.properties [error] Jar name = netty-resolver-4.1.96.Final.jar, jar org = io.netty, entry target = META-INF/io.netty.versions.properties [error] Jar name = netty-transport-classes-epoll-4.1.96.Final.jar, jar org = io.netty, entry target = META-INF/io.netty.versions.properties [error] Jar name = netty-transport-classes-kqueue-4.1.96.Final.jar, jar org = io.netty, entry target = META-INF/io.netty.versions.properties [error] Jar name = netty-transport-native-epoll-4.1.96.Final.jar, jar org = io.netty, entry target = META-INF/io.netty.versions.properties [error] Jar name = netty-transport-native-epoll-4.1.96.Final.jar, jar org = io.netty, entry target = META-INF/io.netty.versions.properties [error] Jar name = netty-transport-native-epoll-4.1.96.Final.jar, jar org = io.netty, entry target = META-INF/io.netty.versions.properties [error] Jar name = netty-transport-native-kqueue-4.1.96.Final.jar, jar org = io.netty, entry target = META-INF/io.netty.versions.properties [error] Jar name = netty-transport-native-kqueue-4.1.96.Final.jar, jar org = io.netty, entry target = META-INF/io.netty.versions.properties [error] Jar name = netty-transport-native-unix-common-4.1.96.Final.jar, jar org = io.netty, entry target = META-INF/io.netty.versions.properties [error] Jar name = netty-transport-4.1.96.Final.jar, jar org = io.netty, entry target = META-INF/io.netty.versions.properties [error] Deduplicate found different file contents in the following: [error] Jar name = javax.inject-1.jar, jar org = javax.inject, entry target = javax/inject/Scope.class [error] Jar name = jakarta.inject-2.6.1.jar, jar org = org.glassfish.hk2.external, entry target = javax/inject/Scope.class [error] Deduplicate found different file contents in the following: [error] Jar name = log4j-1.2-api-2.20.0.jar, jar org = org.apache.logging.log4j, entry target = META-INF/org/apache/logging/log4j/core/config/plugins/Log4j2Plugins.dat [error] Jar name = log4j-core-2.20.0.jar, jar org = org.apache.logging.log4j, entry target = META-INF/org/apache/logging/log4j/core/config/plugins/Log4j2Plugins.dat [error] Deduplicate found different file contents in the following: [error] Jar name = javax.inject-1.jar, jar org = javax.inject, entry target = javax/inject/Provider.class [error] Jar name = jakarta.inject-2.6.1.jar, jar org = org.glassfish.hk2.external, entry target = javax/inject/Provider.class [error] Deduplicate found different file contents in the following: [error] Jar name = jakarta.annotation-api-1.3.5.jar, jar org = jakarta.annotation, entry target = javax/annotation/security/RunAs.class [error] Jar name = jsr250-api-1.0.jar, jar org = javax.annotation, entry target = javax/annotation/security/RunAs.class [error] Total time: 5 s, completed 2025年7月12日 下午12:56:20 [error] server failed to start on local:sbt-server-8814d8f5c3747ce114fe. java.io.IOException: Could not create lock for \\.\pipe\sbt-server-8814d8f5c3747ce114fe_lock, error 5 sbt:spark-app>

2025-07-24 04:12:11.345 [jersey-server-managed-async-executor-7] ERROR druid.sql.Statement - {conn-10028, pstmt-363663} execute error. INSERT INTO tkp_punch_card ( id,dept_id,line_id,person_archives_id,serial_number,team_id,card_type,card_time,attendance_time,card_location,card_attendance,card_status,create_time,create_user,alcoholdegree,update_alcoholdegree_time,highpressure,lowpressure,update_pressure_time,position_mileage ) VALUES( ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,? ) com.mysql.jdbc.exceptions.jdbc4.MySQLTransactionRollbackException: Lock wait timeout exceeded; try restarting transaction at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at com.mysql.jdbc.Util.handleNewInstance(Util.java:425) at com.mysql.jdbc.Util.getInstance(Util.java:408) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:951) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3970) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3906) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2524) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2677) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2549) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1861) at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1192) at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_execute(FilterChainImpl.java:3051) at com.alibaba.druid.wall.WallFilter.preparedStatement_execute(WallFilter.java:619) at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_execute(FilterChainImpl.java:3049) at com.alibaba.druid.filter.FilterEventAdapter.preparedStatement_execute(FilterEventAdapter.java:440) at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_execute(FilterChainImpl.java:3049) at com.alibaba.druid.proxy.jdbc.PreparedStatementProxyImpl.execute(PreparedStatementProxyImpl.java:167) at com.alibaba.druid.pool.DruidPooledPreparedStatement.execute(DruidPooledPreparedStatement.java:498) at sun.reflect.GeneratedMethodAccessor19.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.ibatis.logging.jdbc.PreparedStatementLogger.invoke(PreparedStatementLogger.java:59) at com.sun.proxy.$Proxy73.execute(Unknown Source) at org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:46) at org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:74) at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:50) at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117) at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:76) at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:198) at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:185) at sun.reflect.GeneratedMethodAccessor100.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:433) at com.sun.proxy.$Proxy28.insert(Unknown Source) at org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java:278) at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:58) at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:59) at com.sun.proxy.$Proxy36.insert(Unknown Source) at com.tkp.attendancemachine.modules.service.AttendancemachineService.getuserbyids(AttendancemachineService.java:445) at com.tkp.attendancemachine.modules.controller.AttendancemachineResource.getuserbyids(AttendancemachineResource.java:40) at sun.reflect.GeneratedMethodAccessor98.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:76) at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:147) at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:190) at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$TypeOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:243) at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:102) at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:493) at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:415) at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:104) at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:277) at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271) at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267) at org.glassfish.jersey.internal.Errors.process(Errors.java:315) at org.glassfish.jersey.internal.Errors.process(Errors.java:297) at org.glassfish.jersey.internal.Errors.process(Errors.java:267) at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:289) at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:256) at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:703) at org.glassfish.jersey.netty.httpserver.JerseyServerHandler$1.run(JerseyServerHandler.java:115) 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:748) 2025-07-24 04:12:11.346 [jersey-server-managed-async-executor-7] ERROR com.tkp.attendancemachine.modules.controller.AttendancemachineResource - com.tkp.attendancemachine.modules.controller.AttendancemachineResource org.springframework.dao.CannotAcquireLockException: ### Error updating database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLTransactionRollbackException: Lock wait timeout exceeded; try restarting transaction ### The error may involve com.tkp.attendancemachine.modules.mapper.PunchCardMapper.insert-Inline ### The error occurred while setting parameters ### SQL: INSERT INTO tkp_punch_card ( id,dept_id,line_id,person_archives_id,serial_number,team_id,card_type,card_time,attendance_time,card_location,card_attendance,card_status,create_time,create_user,alcoholdegree,update_alcoholdegree_time,highpressure,lowpressure,update_pressure_time,position_mileage ) VALUES( ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,? ) ### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLTransactionRollbackException: Lock wait timeout exceeded; try restarting transaction ; SQL []; Lock wait timeout exceeded; try restarting transaction; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLTransactionRollbackException: Lock wait timeout exceeded; try restarting transaction at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:259) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:73) at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:73) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:446) at com.sun.proxy.$Proxy28.insert(Unknown Source) at org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java:278) at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:58) at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:59) at com.sun.proxy.$Proxy36.insert(Unknown Source) at com.tkp.attendancemachine.modules.service.AttendancemachineService.getuserbyids(AttendancemachineService.java:445) at com.tkp.attendancemachine.modules.controller.AttendancemachineResource.getuserbyids(AttendancemachineResource.java:40) at sun.reflect.GeneratedMethodAccessor98.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:76) at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:147) at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:190) at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$TypeOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:243) at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:102) at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:493) at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:415) at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:104) at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:277) at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271) at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267) at org.glassfish.jersey.internal.Errors.process(Errors.java:315) at org.glassfish.jersey.internal.Errors.process(Errors.java:297) at org.glassfish.jersey.internal.Errors.process(Errors.java:267) at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:289) at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:256) at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:703) at org.glassfish.jersey.netty.httpserver.JerseyServerHandler$1.run(JerseyServerHandler.java:115) 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:748) Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLTransactionRollbackException: Lock wait timeout exceeded; try restarting transaction at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at com.mysql.jdbc.Util.handleNewInstance(Util.java:425) at com.mysql.jdbc.Util.getInstance(Util.java:408) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:951) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3970) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3906) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2524) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2677) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2549) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1861) at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1192) at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_execute(FilterChainImpl.java:3051) at com.alibaba.druid.wall.WallFilter.preparedStatement_execute(WallFilter.java:619) at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_execute(FilterChainImpl.java:3049) at com.alibaba.druid.filter.FilterEventAdapter.preparedStatement_execute(FilterEventAdapter.java:440) at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_execute(FilterChainImpl.java:3049) at com.alibaba.druid.proxy.jdbc.PreparedStatementProxyImpl.execute(PreparedStatementProxyImpl.java:167) at com.alibaba.druid.pool.DruidPooledPreparedStatement.execute(DruidPooledPreparedStatement.java:498) at sun.reflect.GeneratedMethodAccessor19.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.ibatis.logging.jdbc.PreparedStatementLogger.invoke(PreparedStatementLogger.java:59) at com.sun.proxy.$Proxy73.execute(Unknown Source) at org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:46) at org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:74) at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:50) at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117) at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:76) at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:198) at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:185) at sun.reflect.GeneratedMethodAccessor100.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:433) ... 31 common frames omitted 2025-07-24 04:12:33.668 [jersey-server-managed-async-executor-6] ERROR druid.sql.Statement - {conn-10030, pstmt-363669} execute error. INSERT INTO tkp_punch_card ( id,dept_id,line_id,person_archives_id,serial_number,team_id,card_type,card_time,attendance_time,card_location,card_attendance,card_status,create_time,create_user,alcoholdegree,update_alcoholdegree_time,highpressure,lowpressure,update_pressure_time,position_mileage ) VALUES( ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,? ) com.mysql.jdbc.exceptions.jdbc4.MySQLTransactionRollbackException: Lock wait timeout exceeded; try restarting transaction at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at com.mysql.jdbc.Util.handleNewInstance(Util.java:425) at com.mysql.jdbc.Util.getInstance(Util.java:408) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:951) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3970) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3906) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2524) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2677) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2549) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1861) at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1192) at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_execute(FilterChainImpl.java:3051) at com.alibaba.druid.wall.WallFilter.preparedStatement_execute(WallFilter.java:619) at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_execute(FilterChainImpl.java:3049) at com.alibaba.druid.filter.FilterEventAdapter.preparedStatement_execute(FilterEventAdapter.java:440) at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_execute(FilterChainImpl.java:3049) at com.alibaba.druid.proxy.jdbc.PreparedStatementProxyImpl.execute(PreparedStatementProxyImpl.java:167) at com.alibaba.druid.pool.DruidPooledPreparedStatement.execute(DruidPooledPreparedStatement.java:498) at sun.reflect.GeneratedMethodAccessor19.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.ibatis.logging.jdbc.PreparedStatementLogger.invoke(PreparedStatementLogger.java:59) at com.sun.proxy.$Proxy73.execute(Unknown Source) at org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:46) at org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:74) at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:50) at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117) at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:76) at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:198) at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:185) at sun.reflect.GeneratedMethodAccessor100.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:433) at com.sun.proxy.$Proxy28.insert(Unknown Source) at org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java:278) at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:58) at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:59) at com.sun.proxy.$Proxy36.insert(Unknown Source) at com.tkp.attendancemachine.modules.service.AttendancemachineService.getuserbyids(AttendancemachineService.java:445) at com.tkp.attendancemachine.modules.controller.AttendancemachineResource.getuserbyids(AttendancemachineResource.java:40) at sun.reflect.GeneratedMethodAccessor98.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:76) at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:147) at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:190) at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$TypeOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:243) at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:102) at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:493) at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:415) at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:104) at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:277) at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271) at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267) at org.glassfish.jersey.internal.Errors.process(Errors.java:315) at org.glassfish.jersey.internal.Errors.process(Errors.java:297) at org.glassfish.jersey.internal.Errors.process(Errors.java:267) at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:289) at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:256) at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:703) at org.glassfish.jersey.netty.httpserver.JerseyServerHandler$1.run(JerseyServerHandler.java:115) 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:748)

2025-03-27 19:40:21.322 INFO 24332 --- [ restartedMain] com.project.demo.Application : Starting Application on LAPTOP-HGNA1QFE with PID 24332 (D:\jiankang\server\target\classes started by 固诺 in D:\jiankang) 2025-03-27 19:40:21.322 INFO 24332 --- [ restartedMain] com.project.demo.Application : No active profile set, falling back to default profiles: default 2025-03-27 19:40:21.463 INFO 24332 --- [ restartedMain] o.s.b.devtools.restart.ChangeableUrls : The Class-Path manifest attribute in C:\Users\固诺\.m2\repository\org\glassfish\jaxb\jaxb-runtime\2.3.2\jaxb-runtime-2.3.2.jar referenced one or more files that do not exist: file:/C:/Users/%e5%9b%ba%e8%af%ba/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.3.2/jakarta.xml.bind-api-2.3.2.jar,file:/C:/Users/%e5%9b%ba%e8%af%ba/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.3.2/txw2-2.3.2.jar,file:/C:/Users/%e5%9b%ba%e8%af%ba/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.3.2/istack-commons-runtime-3.0.8.jar,file:/C:/Users/%e5%9b%ba%e8%af%ba/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.3.2/stax-ex-1.8.1.jar,file:/C:/Users/%e5%9b%ba%e8%af%ba/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.3.2/FastInfoset-1.2.16.jar,file:/C:/Users/%e5%9b%ba%e8%af%ba/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.3.2/jakarta.activation-api-1.2.1.jar 2025-03-27 19:40:21.463 INFO 24332 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable 2025-03-27 19:40:21.463 INFO 24332 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG' 2025-03-27 19:40:23.126 INFO 24332 --- [ restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode. 2025-03-27 19:40:23.158 INFO 24332 --- [ restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Finished S

这个是日志吗[25-06-12 15:15:43.500] {Timer-12} ConnectionID:29: getNextResult: Encountered unexpected unknown token (0x49) [25-06-12 15:15:43.500] {Timer-12} ConnectionID:29 got unexpected value in TDS response at offset:10 [25-06-12 15:15:53.741] {resin-port-8088-60} A message body writer for Java class java.lang.Integer, and Java type int, and MIME media type text/plain was not found. The registered message body writers compatible with the MIME media type are: text/plain -> com.sun.jersey.core.impl.provider.entity.StringProvider com.sun.jersey.core.impl.provider.entity.ReaderProvider */* -> com.sun.jersey.core.impl.provider.entity.FormProvider com.sun.jersey.core.impl.provider.entity.MimeMultipartProvider com.sun.jersey.core.impl.provider.entity.StringProvider com.sun.jersey.core.impl.provider.entity.ByteArrayProvider com.sun.jersey.core.impl.provider.entity.FileProvider com.sun.jersey.core.impl.provider.entity.InputStreamProvider com.sun.jersey.core.impl.provider.entity.DataSourceProvider com.sun.jersey.core.impl.provider.entity.XMLJAXBElementProvider$General com.sun.jersey.core.impl.provider.entity.ReaderProvider com.sun.jersey.core.impl.provider.entity.DocumentProvider com.sun.jersey.core.impl.provider.entity.StreamingOutputProvider com.sun.jersey.core.impl.provider.entity.SourceProvider$SourceWriter com.sun.jersey.server.impl.template.ViewableMessageBodyWriter com.sun.jersey.json.impl.provider.entity.JSONJAXBElementProvider$General com.sun.jersey.json.impl.provider.entity.JSONWithPaddingProvider com.alibaba.fastjson.support.jaxrs.FastJsonProvider com.sun.jersey.core.impl.provider.entity.XMLRootElementProvider$General com.sun.jersey.core.impl.provider.entity.XMLListElementProvider$General com.sun.jersey.json.impl.provider.entity.JSONRootElementProvider$General com.sun.jersey.json.impl.provider.entity.JSONListElementProvider$General E media type text/plain was not found. ... 73 more

F:\apache-tomcat-10.1.40-windows-x64\apache-tomcat-10.1.40\bin\catalina.bat run 2025-06-17 06:17:33,028 Artifact WebKS:war: Waiting for server connection to start artifact deployment... Using CATALINA_BASE: "C:\Users\����\AppData\Local\JetBrains\IntelliJIdea2024.2\tomcat\4b98b26d-340d-4d2f-adbd-1d3e8a3e73ff" Using CATALINA_HOME: "F:\apache-tomcat-10.1.40-windows-x64\apache-tomcat-10.1.40" Using CATALINA_TMPDIR: "C:\Users\����\AppData\Local\JetBrains\IntelliJIdea2024.2\tomcat\4b98b26d-340d-4d2f-adbd-1d3e8a3e73ff\temp" Using JRE_HOME: "D:\Java\jdk-16.0.2" Using CLASSPATH: "F:\apache-tomcat-10.1.40-windows-x64\apache-tomcat-10.1.40\bin\bootstrap.jar;F:\apache-tomcat-10.1.40-windows-x64\apache-tomcat-10.1.40\bin\tomcat-juli.jar" Using CATALINA_OPTS: "" 17-Jun-2025 18:17:33.753 信息 main org.apache.catalina.startup.VersionLoggerListener.log Server.服务器版本: Apache Tomcat/10.1.40 17-Jun-2025 18:17:33.755 信息 main org.apache.catalina.startup.VersionLoggerListener.log 服务器构建: Apr 1 2025 17:20:53 UTC 17-Jun-2025 18:17:33.756 信息 main org.apache.catalina.startup.VersionLoggerListener.log 服务器版本号: 10.1.40.0 17-Jun-2025 18:17:33.756 信息 main org.apache.catalina.startup.VersionLoggerListener.log 操作系统名称: Windows 10 17-Jun-2025 18:17:33.756 信息 main org.apache.catalina.startup.VersionLoggerListener.log OS.版本: 10.0 17-Jun-2025 18:17:33.756 信息 main org.apache.catalina.startup.VersionLoggerListener.log 架构: amd64 17-Jun-2025 18:17:33.756 信息 main org.apache.catalina.startup.VersionLoggerListener.log Java 环境变量: D:\Java\jdk-16.0.2 17-Jun-2025 18:17:33.756 信息 main org.apache.catalina.startup.VersionLoggerListener.log Java虚拟机版本: 16.0.2+7-67 17-Jun-2025 18:17:33.757 信息 main org.apache.catalina.startup.VersionLoggerListener.log JVM.供应商: Oracle Corporation 17-Jun-2025 18:17:33.757 信息 main org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: C:\Users\乐乐\AppData\Local\JetBrains\IntelliJIdea2024.2\tomcat\4b98b26d-340d-4d2f-adbd-1d3e8a3e73ff 17-Jun-2025 18:17:33.757 信息 main org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: F:\apache-tomcat-10.1.40-windows-x64\apache-tomcat-10.1.40 17-Jun-2025 18:17:33.758 信息 main org.apache.catalina.startup.VersionLoggerListener.log 命令行参数: -Djava.util.logging.config.file=C:\Users\乐乐\AppData\Local\JetBrains\IntelliJIdea2024.2\tomcat\4b98b26d-340d-4d2f-adbd-1d3e8a3e73ff\conf\logging.properties 17-Jun-2025 18:17:33.759 信息 main org.apache.catalina.startup.VersionLoggerListener.log 命令行参数: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager 17-Jun-2025 18:17:33.759 信息 main org.apache.catalina.startup.VersionLoggerListener.log 命令行参数: -Dcom.sun.management.jmxremote= 17-Jun-2025 18:17:33.759 信息 main org.apache.catalina.startup.VersionLoggerListener.log 命令行参数: -Dcom.sun.management.jmxremote.port=1099 17-Jun-2025 18:17:33.759 信息 main org.apache.catalina.startup.VersionLoggerListener.log 命令行参数: -Dcom.sun.management.jmxremote.ssl=false 17-Jun-2025 18:17:33.759 信息 main org.apache.catalina.startup.VersionLoggerListener.log 命令行参数: -Dcom.sun.management.jmxremote.password.file=C:\Users\乐乐\AppData\Local\JetBrains\IntelliJIdea2024.2\tomcat\4b98b26d-340d-4d2f-adbd-1d3e8a3e73ff\jmxremote.password 17-Jun-2025 18:17:33.759 信息 main org.apache.catalina.startup.VersionLoggerListener.log 命令行参数: -Dcom.sun.management.jmxremote.access.file=C:\Users\乐乐\AppData\Local\JetBrains\IntelliJIdea2024.2\tomcat\4b98b26d-340d-4d2f-adbd-1d3e8a3e73ff\jmxremote.access 17-Jun-2025 18:17:33.759 信息 main org.apache.catalina.startup.VersionLoggerListener.log 命令行参数: -Djava.rmi.server.hostname=127.0.0.1 17-Jun-2025 18:17:33.759 信息 main org.apache.catalina.startup.VersionLoggerListener.log 命令行参数: -Djdk.tls.ephemeralDHKeySize=2048 17-Jun-2025 18:17:33.760 信息 main org.apache.catalina.startup.VersionLoggerListener.log 命令行参数: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources 17-Jun-2025 18:17:33.760 信息 main org.apache.catalina.startup.VersionLoggerListener.log 命令行参数: -Dsun.io.useCanonCaches=false 17-Jun-2025 18:17:33.760 信息 main org.apache.catalina.startup.VersionLoggerListener.log 命令行参数: --add-opens=java.base/java.lang=ALL-UNNAMED 17-Jun-2025 18:17:33.760 信息 main org.apache.catalina.startup.VersionLoggerListener.log 命令行参数: --add-opens=java.base/java.lang.reflect=ALL-UNNAMED 17-Jun-2025 18:17:33.760 信息 main org.apache.catalina.startup.VersionLoggerListener.log 命令行参数: --add-opens=java.base/java.io=ALL-UNNAMED 17-Jun-2025 18:17:33.761 信息 main org.apache.catalina.startup.VersionLoggerListener.log 命令行参数: --add-opens=java.base/java.util=ALL-UNNAMED 17-Jun-2025 18:17:33.761 信息 main org.apache.catalina.startup.VersionLoggerListener.log 命令行参数: --add-opens=java.base/java.util.concurrent=ALL-UNNAMED 17-Jun-2025 18:17:33.761 信息 main org.apache.catalina.startup.VersionLoggerListener.log 命令行参数: --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED 17-Jun-2025 18:17:33.761 信息 main org.apache.catalina.startup.VersionLoggerListener.log 命令行参数: -Dcatalina.base=C:\Users\乐乐\AppData\Local\JetBrains\IntelliJIdea2024.2\tomcat\4b98b26d-340d-4d2f-adbd-1d3e8a3e73ff 17-Jun-2025 18:17:33.761 信息 main org.apache.catalina.startup.VersionLoggerListener.log 命令行参数: -Dcatalina.home=F:\apache-tomcat-10.1.40-windows-x64\apache-tomcat-10.1.40 17-Jun-2025 18:17:33.761 信息 main org.apache.catalina.startup.VersionLoggerListener.log 命令行参数: -Djava.io.tmpdir=C:\Users\乐乐\AppData\Local\JetBrains\IntelliJIdea2024.2\tomcat\4b98b26d-340d-4d2f-adbd-1d3e8a3e73ff\temp 17-Jun-2025 18:17:33.763 信息 main org.apache.catalina.core.AprLifecycleListener.lifecycleEvent 使用APR版本1.7.4加载了基于APR的Apache Tomcat本机库2.0.8。 17-Jun-2025 18:17:33.769 信息 main org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL成功初始化 OpenSSL 3.0.14 4 Jun 2024 17-Jun-2025 18:17:33.953 信息 main org.apache.coyote.AbstractProtocol.init 初始化协议处理器 "http-nio-8080" 17-Jun-2025 18:17:33.975 信息 main org.apache.catalina.startup.Catalina.load 服务器在437毫秒内初始化 17-Jun-2025 18:17:34.035 信息 main org.apache.catalina.core.StandardService.startInternal 正在启动服务Catalina 17-Jun-2025 18:17:34.035 信息 main org.apache.catalina.core.StandardEngine.startInternal 正在启动 Servlet 引擎:Apache Tomcat/10.1.40 17-Jun-2025 18:17:34.054 信息 main org.apache.coyote.AbstractProtocol.start 开始协议处理句柄"http-nio-8080" 17-Jun-2025 18:17:34.098 信息 main org.apache.catalina.startup.Catalina.start 122毫秒后服务器启动 Connected to server 2025-06-17 06:17:34,106 Artifact WebKS:war: Artifact is being deployed, please wait... 17-Jun-2025 18:17:35.895 严重 RMI TCP Connection(2)-127.0.0.1 org.apache.catalina.core.StandardContext.startInternal ServletContainerInitializer处理期间出错 jakarta.servlet.ServletException: java.io.FileNotFoundException: JAR entry META-INF/taglib.tld not found in F:\apache-tomcat-10.1.40-windows-x64\apache-tomcat-10.1.40\webapps\WebKS_war\WEB-INF\lib\jakarta.servlet.jsp.jstl-3.0.1.jar at org.apache.jasper.servlet.JasperInitializer.onStartup(JasperInitializer.java:83) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4464) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:164) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:599) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:571) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:654) at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1787) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:567) at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:263) at java.management/com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:809) at java.management/com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:418) at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:372) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:567) at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:263) at java.management/com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:809) at java.management/com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) at java.management/com.sun.jmx.remote.security.MBeanServerAccessController.invoke(MBeanServerAccessController.java:468) at java.management.rmi/javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1466) at java.management.rmi/javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1307) at java.base/java.security.AccessController.doPrivileged(AccessController.java:691) at java.management.rmi/javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1406) at java.management.rmi/javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:827) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:567) at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:357) at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:200) at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:197) at java.base/java.security.AccessController.doPrivileged(AccessController.java:691) at java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196) at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:587) at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:828) at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:705) at java.base/java.security.AccessController.doPrivileged(AccessController.java:391) at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:704) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) at java.base/java.lang.Thread.run(Thread.java:831) Caused by: java.io.FileNotFoundException: JAR entry META-INF/taglib.tld not found in F:\apache-tomcat-10.1.40-windows-x64\apache-tomcat-10.1.40\webapps\WebKS_war\WEB-INF\lib\jakarta.servlet.jsp.jstl-3.0.1.jar at java.base/sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:147) at java.base/sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:155) at java.base/java.net.URL.openStream(URL.java:1192) at org.apache.tomcat.util.descriptor.tld.TldResourcePath.openStream(TldResourcePath.java:127) at org.apache.tomcat.util.descriptor.tld.TldParser.parse(TldParser.java:62) at org.apache.jasper.servlet.TldScanner.scanJspConfig(TldScanner.java:187) at org.apache.jasper.servlet.TldScanner.scan(TldScanner.java:96) at org.apache.jasper.servlet.JasperInitializer.onStartup(JasperInitializer.java:81) ... 45 more 17-Jun-2025 18:17:35.941 严重 RMI TCP Connection(2)-127.0.0.1 org.apache.catalina.core.StandardContext.startInternal 由于之前的错误,Context/WebKS_war启动失败 2025-06-17 06:17:35,963 Artifact WebKS:war: Error during artifact deployment. See server log for details. 17-Jun-2025 18:17:40.956 信息 mysql-cj-abandoned-connection-cleanup org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading 非法访问:此Web应用程序实例已停止。无法加载。为了调试以及终止导致非法访问的线程,将抛出以下堆栈跟踪。 java.lang.IllegalStateException: 非法访问:此Web应用程序实例已停止。无法加载。为了调试以及终止导致非法访问的线程,将抛出以下堆栈跟踪。 at org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading(WebappClassLoaderBase.java:1400) at org.apache.catalina.loader.WebappClassLoaderBase.getResource(WebappClassLoaderBase.java:987) at com.mysql.cj.jdbc.AbandonedConnectionCleanupThread.checkThreadContextClassLoader(AbandonedConnectionCleanupThread.java:123) at com.mysql.cj.jdbc.AbandonedConnectionCleanupThread.run(AbandonedConnectionCleanupThread.java:90) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) at java.base/java.lang.Thread.run(Thread.java:831) 依然有错您帮我分析一下

<Sep 5, 2025 5:57:13,676 PM CST> <Error> <HTTP> <BEA-101165> <Could not load user defined filter in web.xml: com.yinhai.hfdata.common.core.mvc.WebSecurityRequestBlackListFilter. java.lang.AbstractMethodError at weblogic.servlet.internal.FilterManager$FilterInitAction.run(FilterManager.java:400) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:344) at weblogic.security.service.SecurityManager.runAsForUserCode(SecurityManager.java:197) at weblogic.servlet.provider.WlsSecurityProvider.runAsForUserCode(WlsSecurityProvider.java:203) at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:71) Truncated. > Sep 05, 2025 5:57:14 PM org.glassfish.jersey.server.ApplicationHandler bindProvidersAndResources WARNING: Component of class interface org.keycloak.admin.client.resource.ServerInfoResource cannot be instantiated and will be ignored. <Sep 5, 2025 5:57:14,018 PM CST> <Warning> <org.glassfish.jersey.server.ApplicationHandler> <BEA-000000> <Component of class interface org.keycloak.admin.client.resource.ServerInfoResource cannot be instantiated and will be ignored.> Sep 05, 2025 5:57:14 PM org.glassfish.jersey.server.ApplicationHandler bindProvidersAndResources WARNING: Component of class interface org.keycloak.admin.client.resource.RealmsResource cannot be instantiated and will be ignored. <Sep 5, 2025 5:57:14,019 PM CST> <Warning> <org.glassfish.jersey.server.ApplicationHandler> <BEA-000000> <Component of class interface org.keycloak.admin.client.resource.RealmsResource cannot be instantiated and will be ignored.>

function https(url,data,fu){ $.ajax({ contentType:"application/json", url: url, // 假设后端 API 地址 method: "POST", data: JSON.stringify(data), type: "json", dataType: "json", success:function(e){ console.log(e.data) if(e.status==200){ console.log(e.data) fu(e.data) }else{ alert(e.text) } }, error: function (e) { console.log(e.data) console.error(e) alert("请求失败,请稍后再试!"+e); } }); } function checkLoginStatus() { if (window.location.href.includes('/login.html')) return; } window.addEventListener('beforeunload', function(e) { console.trace('触发页面跳转的堆栈跟踪:'); }); //安全验证函数 function validateUserSession() { try { // 防御性数据获取 + 数据清洗 const rawValue = localStorage.getItem("name"); const username = String(rawValue ?? '') .trim() .replace(/[\u200B-\u200D\uFEFF]/g, ''); // 移除零宽字符 // 调试信息 console.log('[Auth] Raw:', rawValue, 'Processed:', username); // 复合验证条件 const isValid = ( username.length >= 2 && // 最小长度要求 !/[<>]/.test(username) && // 防止XSS username !== 'null' && username !== 'undefined' ); if (!isValid) { console.warn('无效用户标识:', username); // 安全跳转方法 //window.location.replace('/KuCun2/login.html'); // 立即终止执行 return Promise.reject('Invalid session'); } // 返回清洗后的用户名 return username; } catch (error) { console.error('会话验证失败:', error); // window.location.replace('/KuCun2/login.html'); return Promise.reject(error); } } function deepMergeArrays(frontend, backend) { const resultMap = new Map(); // 遍历前端数据并存入 Map 中以便快速查找 frontend.forEach(item => resultMap.set(item.id, { ...item })); // 遍历后端数据并与前端数据进行合并 backend.forEach(item => { if (resultMap.has(item.id)) { // 如果存在相同 ID,则合并两者的内容 resultMap.set( item.id, Object.assign(resultMap.get(item.id), item) ); } else { // 如果不存在相同 ID,则新增该条目 resultMap.set(item.id, { ...item }); } }); // 将最终结果转回数组形式 return Array.from(resultMap.values()); } (function ($){ // 页面加载时检查登录状态 checkLoginStatus(); })(jQuery); function removeSpecificCharactersAndConvertToNumber(str, charsToRemove) { const regex = new RegExp([${charsToRemove}], 'g'); // 创建用于匹配指定字符的正则表达式 const cleanedStr = str.replace(regex, ''); // 移除指定字符 const numberValue = parseFloat(cleanedStr); // 转换为浮点数 return isNaN(numberValue) ? null : numberValue; // 如果无法解析,则返回 null } <modelVersion>4.0.0</modelVersion> <groupId>KuCun2</groupId> <artifactId>KuCun2</artifactId> <version>0.0.1-SNAPSHOT</version> war <name>KuCun2</name> <description/> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.3.12.RELEASE</version> <relativePath/> <webVersion>4.0</webVersion> UTF-8 3.21.12 <dependencies> <dependency> <groupId>javax</groupId> <artifactId>javaee-api</artifactId> <version>8.0</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.glassfish.web</groupId> <artifactId>javax.servlet.jsp.jstl</artifactId> <version>1.2.4</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jpa</artifactId> </dependency> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>8.0.33</version> <exclusions> <exclusion> <groupId>com.google.protobuf</groupId> <artifactId>protobuf-java</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <optional>true</optional> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <exclusions> <exclusion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-security</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <exclusions> <exclusion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId> <scope>provided</scope> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <exclusions> <exclusion> <groupId>com.fasterxml.jackson.datatype</groupId> <artifactId>jackson-datatype-jsr310</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>com.fasterxml.jackson.datatype</groupId> <artifactId>jackson-datatype-jsr310</artifactId> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-core</artifactId> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-annotations</artifactId> </dependency> <dependency> <groupId>org.mindrot</groupId> <artifactId>jbcrypt</artifactId> <version>0.4</version> </dependency> <dependency> <groupId>com.google.protobuf</groupId> <artifactId>protobuf-java</artifactId> <version>${protobuf.version}</version> </dependency> <dependency> <groupId>org.yaml</groupId> <artifactId>snakeyaml</artifactId> <version>1.30</version> </dependency> </dependencies> <build> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.2</version> <configuration> <source>1.8</source> <target>1.8</target> <compilerArgs> <arg>-parameters</arg> </compilerArgs> </configuration> <artifactId>maven-war-plugin</artifactId> <version>2.6</version> <configuration> <failOnMissingWebXml>false</failOnMissingWebXml> </configuration> </build> package com.kucun; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; @SpringBootApplication( ) public class DemoApplication extends SpringBootServletInitializer { public static void main(String[] args) { // // ConfigurableApplicationContext ctx = SpringApplication.run(Application.class, args); // Arrays.stream(ctx.getBeanNamesForType(SecurityFilterChain.class)) // .forEach(System.out::println); // // // // 测试密码加密示例 // BCryptPasswordEncoder encoder = new BCrypt(); // String rawPassword = "987987"; // String encodedPassword = encoder.encode(rawPassword); // System.out.println("加密后的密码:" + encodedPassword); SpringApplication.run(DemoApplication.class, args); } }package com.kucun.Config; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.kucun.Config.Role.RoleConverter; import com.kucun.Config.user.CustomUserDetails; import com.kucun.data.entity.User; import com.kucun.dataDo.UserRepository; /** * 获取数据 * @author Administrator * */ @Service public class CustomUserDetailsService/* implements UserDetailsService */{ // // @Autowired // private UserRepository userRepository; // // @Autowired // private RoleConverter roleConverter; // // public CustomUserDetailsService() { // // super(); // System.out.println("11111"); // } ///** // * 获取数据库中用户信息 // * @param andy 账号 // * // * @return // * // */ // @Override // public UserDetails loadUserByUsername(String andy) { // System.out.println(andy); // User user = userRepository.findByAndy(andy); // System.out.println(user); // return new CustomUserDetails(user, // roleConverter.convert(user.getRole()) // 关键转换点[^1] // ); // } }package com.kucun.Config; // 2. 基础安全配置 //@Configuration //@EnableWebSecurity // 启用Web安全功能 public class SecurityConfig //extends WebSecurityConfigurerAdapter { // @Override // public void configure(WebSecurity web) { // web.ignoring().antMatchers("/check-session"); // } // // 添加自定义Controller // @RestController // public static class SessionCheckController { // @GetMapping("/check-session") // public ResponseEntity<?> checkSession(HttpServletRequest request) { // return request.getSession(false) != null ? // ResponseEntity.ok().build() : // ResponseEntity.status(HttpStatus.UNAUTHORIZED).build(); // } // } // /** // * 核心安全过滤器链配置 // * @param http HTTP安全构建器 // * @return 安全过滤器链 // * @throws Exception 配置异常 // * // * █ 配置逻辑说明: // * 1. authorizeHttpRequests: 定义访问控制规则 // * 2. formLogin: 配置表单登录 // * 3. logout: 配置注销行为 // * 4. exceptionHandling: 处理权限异常[^3] // */ // // // 修正后的配置方法 // @Override // protected void configure(HttpSecurity http) throws Exception { // // // // http // .csrf().disable() // .sessionManagement() // .sessionCreationPolicy(SessionCreationPolicy.ALWAYS) // .invalidSessionUrl("/login.html?session=invalid") // .maximumSessions(1) // .maxSessionsPreventsLogin(false) // .and() // .and() // .addFilterBefore(jsonAuthFilter(), UsernamePasswordAuthenticationFilter.class) // 关键配置 // .authorizeRequests() // .antMatchers("/login.html", "/users/login").permitAll() // .antMatchers("/js/**", "/css/**", "/fonts/**", "/images/**","/check-session","/main/bootstrap-3.3.7-dist/**").permitAll() // .antMatchers("/users/guanli/**").hasAuthority("ROLE_ADMIN") // .anyRequest().authenticated() // .and() // .formLogin().disable() //// .loginPage("/login.html") //// .loginProcessingUrl("/users/login") //// //// .successHandler(ajaxAuthenticationSuccessHandler()) // 自定义成功处理器 //// .failureHandler(ajaxAuthenticationFailureHandler()) // 自定义失败处理器 //// .defaultSuccessUrl("/index.html") //// .failureUrl("/login.html?error=true") //// .usernameParameter("andy") // 修改用户名参数名 //// .passwordParameter("pass") // 修改密码参数名 //// .and() // // .logout() // .logoutUrl("/logout") // .logoutSuccessUrl("/login.html") // .and() // .csrf() // .ignoringAntMatchers("/users/login") // .and() // .headers() // .frameOptions().sameOrigin() // .and() // .exceptionHandling() // .accessDeniedHandler(accessDeniedHandler()); // 统一使用Handler // } // // // // // // // 返回JSON格式的成功响应 // @Bean // public AuthenticationSuccessHandler ajaxAuthenticationSuccessHandler() { // return (request, response, authentication) -> { // // // // // 强制创建服务端会话 // request.getSession(true); // // // // // String contextPath = request.getContextPath(); // HttpSession session = request.getSession(true); // Cookie cookie = new Cookie("JSESSIONID", session.getId()); // cookie.setPath(contextPath.isEmpty() ? "/" : contextPath + "/"); // cookie.setMaxAge(1800); // 30分钟 // response.addCookie(cookie); // // // //构建安全响应数据 // Map<String, Object> responseData = new HashMap<>(); // responseData.put("sessionId", request.getSession().getId()); // responseData.put("userInfo",Collections.unmodifiableMap(new HashMap<String, Object>() {/** // * // */ // private static final long serialVersionUID = 1L; // // { // put("Name", ((CustomUserDetails)authentication.getPrincipal()).getName()); // put("role", ((CustomUserDetails)authentication.getPrincipal()).getRole()); // }})); // // // // // 统一返回JSON格式 // response.setContentType(MediaType.APPLICATION_JSON_VALUE); // // new ObjectMapper().writeValue(response.getWriter(), responseData); // // // // // // // // // // response.setContentType(MediaType.APPLICATION_JSON_VALUE); // CustomUserDetails userDetails = (CustomUserDetails) authentication.getPrincipal(); // // response.setStatus(HttpStatus.OK.value()); // System.out.println(authentication.getPrincipal()+""+authentication.getName()); // // if (request.getHeader("X-Requested-With") == null) { // 非AJAX请求 // response.sendRedirect("/index.html"); // } else { // // //String re=userDetails.getUser().toString() // new ObjectMapper().writeValue(response.getWriter(), userDetails.getUser() // ); // // } // // // // // // // }; // } // // // 返回401状态码和错误信息 // @Bean // public AuthenticationFailureHandler ajaxAuthenticationFailureHandler() { // return (request, response, exception) -> { // if (request.getHeader("X-Requested-With") == null) { // response.sendRedirect("/login.html?error=true"); // } else { // response.setStatus(HttpStatus.UNAUTHORIZED.value()); // response.getWriter().write("{\"error\":\"Authentication failed\"}"); // } // }; // } // // // 处理未认证请求 // @Bean // public AuthenticationEntryPoint ajaxAuthenticationEntryPoint() { // return (request, response, exception) -> { // if (request.getHeader("X-Requested-With") == null) { // response.sendRedirect("/login.html?error=true"); // } else { // response.setStatus(HttpStatus.UNAUTHORIZED.value()); // response.getWriter().write("{\"error\":\"Authentication failed\"}"); // } // }; // } // // // // // // @Bean // public JsonUsernamePasswordAuthenticationFilter jsonAuthFilter() throws Exception { // // JsonUsernamePasswordAuthenticationFilter filter = // new JsonUsernamePasswordAuthenticationFilter(); // filter.setAuthenticationManager(authenticationManagerBean()); // filter.setUsernameParameter("andy"); // 设置自定义参数名 // filter.setPasswordParameter("pass"); // filter.setFilterProcessesUrl("/users/login"); // filter.setAuthenticationSuccessHandler(ajaxAuthenticationSuccessHandler()); // filter.setAuthenticationFailureHandler(ajaxAuthenticationFailureHandler()); // // return filter; // } // // // /** // * 密码编码器(必须配置) // * 使用BCrypt强哈希算法加密 // */ // @Bean // public PasswordEncoder passwordEncoder() { // return new BCryptPasswordEncoder(); // } // // // @Bean // public AccessDeniedHandler accessDeniedHandler() { // System.out.println("0000"); // return (request, response, ex) -> { // if (!response.isCommitted()) { // response.sendRedirect("/error/403"); // } // }; // } // // //} // // // // // // //class JsonUsernamePasswordAuthenticationFilter extends UsernamePasswordAuthenticationFilter { // private final ObjectMapper objectMapper = new ObjectMapper(); // // @Override // public Authentication attemptAuthentication(HttpServletRequest request, // HttpServletResponse response) // throws AuthenticationException { // System.out.println("收到认证请求,路径:" + request.getRequestURI()); // System.out.println("请求方法:" + request.getMethod()); // System.out.println("Content-Type:" + request.getContentType()); // if (request.getContentType() != null && // request.getContentType().startsWith(MediaType.APPLICATION_JSON_VALUE)) { // // try (InputStream is = request.getInputStream()) { // Map<String, String> authMap = objectMapper.readValue(is, Map.class); // // String username = authMap.getOrDefault(getUsernameParameter(), ""); // String password = authMap.getOrDefault(getPasswordParameter(), ""); // // // 调试日志 // System.out.println("Authentication attempt with: " + username+'_'+ password); // // UsernamePasswordAuthenticationToken authRequest = // new UsernamePasswordAuthenticationToken(username, password); // // setDetails(request, authRequest); // return this.getAuthenticationManager().authenticate(authRequest); // } catch (IOException e) { // throw new AuthenticationServiceException("认证请求解析失败", e); // } // } // Authentication aut= super.attemptAuthentication(request, response); // System.out.println("结果:"+aut.isAuthenticated()); // // return aut; // } } package com.kucun.Config.Role; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.annotation.PostConstruct; import javax.json.Json; import org.springframework.stereotype.Component; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; /** * 权限转化 * @author Administrator * */ @Component public class RoleConverter { // private static final Map<Integer, String> ROLE_MAP = new HashMap<>(); // // @PostConstruct // public void init() { // ROLE_MAP.put(0, "ROLE_ADMIN"); // ROLE_MAP.put(1, "ROLE_USER"); // ROLE_MAP.put(2, "ROLE_MANAGER"); // ROLE_MAP.put(3, "ROLE_AUDITOR"); // } // // public List<GrantedAuthority> convert(int roleCode) { // ObjectMapper mapper = new ObjectMapper(); // try { // System.out.println(mapper.writeValueAsString(Collections.singletonList( // new SimpleGrantedAuthority(ROLE_MAP.getOrDefault(roleCode, "ROLE_GUEST")))).toString());//输出[{"authority":"ROLE_ADMIN"}] // } catch (JsonProcessingException e) { // // TODO Auto-generated catch block // e.printStackTrace(); // } // // return Collections.singletonList( // new SimpleGrantedAuthority(ROLE_MAP.getOrDefault(roleCode, "ROLE_GUEST")) // ); // } // }package com.kucun.Config.user; import java.util.Collection; import com.kucun.data.entity.User; public class CustomUserDetails /*implements UserDetails*/ { // /** // * // */ // private static final long serialVersionUID = 1L; // private final String andy; // 对应andy字段 // private final String name; // private final int role; // private final String password; // private final User users; // private final Collection<? extends GrantedAuthority> authorities; // // public CustomUserDetails(User user, Collection<? extends GrantedAuthority> authorities) { // this.andy = user.getAndy(); // this.name = user.getName(); // this.role = user.getRole(); // this.password = user.getPass(); // user.setPass(null); // this.users=user; // this.authorities = authorities; // } // // // 实现UserDetails接口方法 // @Override public String getUsername() { return andy; } // @Override public String getPassword() { return password; } // @Override public Collection<? extends GrantedAuthority> getAuthorities() { return authorities; } // // // 自定义字段访问方法 // public String getName() { return name; } // public User getUser() { return users; } // public int getRole() { return role; } // // // 其他必要方法 // @Override public boolean isAccountNonExpired() { return true; } // @Override public boolean isAccountNonLocked() { return true; } // @Override public boolean isCredentialsNonExpired() { return true; } // @Override public boolean isEnabled() { return true; } } <!doctype html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> <title>峤丞板材库存管理</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <style type="text/css"> *{ margin:0; padding:0; } .frame-header { height: 60px; background-color: #23262E; justify-content: space-between; } .frame-header-li{ font-family: Arial, Helvetica, sans-serif; font-size:40px; } .frame-ul{ } .frame-ul li{ border-style: solid; border-width:1px 0px 1px 0px; margin-top: 1px; height: 35px; text-align: center } #username{ position: absolute; right: 0; /* 靠右 */ } .frame-body { position: fixed; top: 60px; right: 0; bottom: 0; left: 0; display: flex; flex-direction: row; } .frame-side { scrollbar-width: none; /* firefox隐藏滚动条 */ -ms-overflow-style: none; /* IE 10+隐藏滚动条 */ overflow-x: hidden; overflow-y: auto; width: 200px; background-color:#9e5; } .frame-side::-webkit-scrollbar { display: none; /* Chrome Safari 隐藏滚动条*/ } .frame-main { flex-grow: 1; background-color:#fff; } .jiaoluo{ margin: auto; margin-right: 0px; } </style> </head> <body> 峤丞木材仓库管理 峤丞木材仓库管理 <button class=".menu-button" style="">注销</button> 首页 材料录入 材料录入 <iframe id="iframeid" name="main" src="main/index.html" width="100%" height="100%" frameborder="0"> </iframe> </body> <script type="text/javascript" src="js/jquery-3.2.1.min.js"></script> <script type="text/javascript" src="js/jsyilai.js"></script> </html><!DOCTYPE html> <html lang="zh-CN"> <head> <title>扁平简洁的登录页面演示_dowebok</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> </head> <body> 登 录 <form class="login100-form validate-form"> 用户名 <input class="input100" type="text" name="andy" placeholder="请输入用户名"> 密码 <input class="input100" type="password" name="pass" placeholder="请输入用户密码"> <input class="input-checkbox100" id="ckb1" type="checkbox" name="remember-me"> <label class="label-checkbox100" for="ckb1">记住我</label> 忘记密码? <button class="login100-form-btn">登 录</button> </form> <script type="text/javascript"> </script> <script src="js/jquery-3.2.1.min.js"></script> <script type="text/javascript" src="js/jsyilai.js"></script> </body> </html> yilai.js (function ($) { var pathName = window.location.pathname; console.log(pathName); // 输出类似于 '/index.html' //alert(pathName) switch (pathName){ case "/KuCun2/login.html": jQuery.getScript('/KuCun2/js/main.js?'+Date.now()) jQuery.getScript('/KuCun2/js/login.js?'+Date.now()) break; case "/KuCun2/main/Guanli.html": jQuery.getScript('/KuCun2/js/main.js?'+Date.now()) jQuery.getScript('/KuCun2/js/guanli.js?'+Date.now()) jQuery.getScript('/KuCun2/main/bootstrap-3.3.7-dist/js/FileSaver.js?'+Date.now()) jQuery.getScript('/KuCun2/main/bootstrap-3.3.7-dist/js/MyTable.js?'+Date.now()) break; case "/KuCun2/index.html": jQuery.getScript('/KuCun2/js/main.js?'+Date.now()) jQuery.getScript('/KuCun2/js/index.js?'+Date.now()) break; } })(jQuery) main.js function https(url,data,fu){ $.ajax({ contentType:"application/json", url: url, // 假设后端 API 地址 method: "POST", data: JSON.stringify(data), type: "json", dataType: "json", success:function(e){ console.log(e.data) if(e.status==200){ console.log(e.data) fu(e.data) }else{ alert(e.text) } }, error: function (e) { console.log(e.data) console.error(e) alert("请求失败,请稍后再试!"+e); } }); } function checkLoginStatus() { if (window.location.href.includes('/login.html')) return; } window.addEventListener('beforeunload', function(e) { console.trace('触发页面跳转的堆栈跟踪:'); }); //安全验证函数 function validateUserSession() { try { // 防御性数据获取 + 数据清洗 const rawValue = localStorage.getItem("name"); const username = String(rawValue ?? '') .trim() .replace(/[\u200B-\u200D\uFEFF]/g, ''); // 移除零宽字符 // 调试信息 console.log('[Auth] Raw:', rawValue, 'Processed:', username); // 复合验证条件 const isValid = ( username.length >= 2 && // 最小长度要求 !/[<>]/.test(username) && // 防止XSS username !== 'null' && username !== 'undefined' ); if (!isValid) { console.warn('无效用户标识:', username); // 安全跳转方法 //window.location.replace('/KuCun2/login.html'); // 立即终止执行 return Promise.reject('Invalid session'); } // 返回清洗后的用户名 return username; } catch (error) { console.error('会话验证失败:', error); // window.location.replace('/KuCun2/login.html'); return Promise.reject(error); } } function deepMergeArrays(frontend, backend) { const resultMap = new Map(); // 遍历前端数据并存入 Map 中以便快速查找 frontend.forEach(item => resultMap.set(item.id, { ...item })); // 遍历后端数据并与前端数据进行合并 backend.forEach(item => { if (resultMap.has(item.id)) { // 如果存在相同 ID,则合并两者的内容 resultMap.set( item.id, Object.assign(resultMap.get(item.id), item) ); } else { // 如果不存在相同 ID,则新增该条目 resultMap.set(item.id, { ...item }); } }); // 将最终结果转回数组形式 return Array.from(resultMap.values()); } (function ($){ // 页面加载时检查登录状态 checkLoginStatus(); })(jQuery); function removeSpecificCharactersAndConvertToNumber(str, charsToRemove) { const regex = new RegExp([${charsToRemove}], 'g'); // 创建用于匹配指定字符的正则表达式 const cleanedStr = str.replace(regex, ''); // 移除指定字符 const numberValue = parseFloat(cleanedStr); // 转换为浮点数 return isNaN(numberValue) ? null : numberValue; // 如果无法解析,则返回 null } logi.js/// <reference path="jquery.d.ts" /> // $(document).ready(function(){ // $("#submit").click(function(){ // // // $.ajax({ // url:"../users/login", // async:false, // data:JSON.stringify({ // andy:$("#andy").val(), // pass:$("#pass").val(), // name:$("#name").val()}), // type:"post", // contentType:"application/json", // success:function(e){ // alert(e) // } // }); // // // }); // }) (function ($) { "use strict"; /*================================================================== [ Focus Contact2 ]*/ $('.input100').each(function () { $(this).on('blur', function () { if ($(this).val().trim() != "") { $(this).addClass('has-val'); } else { $(this).removeClass('has-val'); } }) }) /*================================================================== [ Validate ]*/ var input = $('.validate-input .input100'); $('.validate-form').on('submit', function (e) { e.preventDefault(); var check = true; for (var i = 0; i < input.length; i++) { if (validate(input[i]) == false) { showValidate(input[i]); check = false; } } confirm(input) if(check) login(input); return check; }); $('.validate-form .input100').each(function () { $(this).focus(function () { hideValidate(this); }); }); function validate(input) { if ($(input).attr('type') == 'email' || $(input).attr('name') == 'email') { if ($(input).val().trim().match(/^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{1,5}|[0-9]{1,3})(\]?)$/) == null) { return false; } } else { if ($(input).val().trim() == '') { return false; } } } function showValidate(input) { var thisAlert = $(input).parent(); alert(input) $(thisAlert).addClass('alert-validate'); } function hideValidate(input) { var thisAlert = $(input).parent(); $(thisAlert).removeClass('alert-validate'); } // 登录按钮点击事件 function login(datas) { var data={} datas.each(function(a,element){ data[$(element).attr('name')]=$(element).val() }) alert(data.name); //var data={ andy,pass } // 模拟 AJAX 请求 https("/KuCun2/users/login",data,function (response) { alert("122222"); if (response.name) { localStorage.setItem("name", response.name); // 保存用户名到本地存储 localStorage.setItem("role", response.role); // 保存权限到本地存储 alert( response.name) window.location.href = '/KuCun2/index.html'; } else { alert("登录失败,请检查用户名和密码!"); } }) }; // 注销按钮点击事件 $("#logout-btn").click(function () { localStorage.removeItem("name"); // 清除本地存储中的用户名 checkLoginStatus(); // 更新登录状态 }); })(jQuery);index.js$().ready(function () { const username = localStorage.getItem("name"); $("#username").text(username) const $username = $('#username'); const $menuButton = $('.menu-button'); let hideTimeout = null; // 点击显示按钮 $username.on('click', function(e) { e.stopPropagation(); $menuButton.show(); }); // 区域外点击隐藏 $(document).on('click', function(e) { if (!$username.add($menuButton).is(e.target) && $username.has(e.target).length === 0 && $menuButton.has(e.target).length === 0) { $menuButton.hide(); } }); // 智能隐藏逻辑 const elements = $username.add($menuButton); elements.on('mouseleave', function() { hideTimeout = setTimeout(() => { $menuButton.hide(); }, 200); }).on('mouseenter', function() { clearTimeout(hideTimeout); }); var $iframe = $('<iframe>') // 使用 jQuery 监听 iframe 的 load 事件 $iframe.on('load', function() { try { // 确保 iframe 的内容可以被访问(非跨域情况下) var iframeDocument = $(this).contents(); var result = iframeDocument.find('body').text(); // 获取 iframe 内部的内容作为返回值 console.log("Iframe 加载完成后的返回值:", result); window.location.href="/KuCun2/login.html" } catch (error) { console.error("无法访问 iframe 内容,可能是因为跨域限制:", error.message); } }); // 将 iframe 添加到文档中 $('body').append($iframe); }); guanli.js(function ($) { //checkLoginStatus();//权限 https("/KuCun2/users/guanli/getusers",null,function(e){ $("#DataTable").remove() const c=[{id:" 序号 ", name:"名字", andy:"账号", role:"权限" }] let row = e.length+1; //c.concat(b); //const combinedArray = [c,e]; var r=deepMergeArrays(c,e) console.log(r ) let sclass = "table table-hover"; let bodys=[] let table=$("#TableView") table.append(bodys) let te= table.find("table") $.each(r, function(index, value) { var tr="" var boo=false if(index==0){var tr=""; boo=false} tr+="" $.each(value, function(name,val) { if(name!="pass"){ if(name!="id"){ tr+=${val}; }else{ tr+=${val}; } } }) tr+="" if(index==0){ tr+=""} te.append(tr) }); addRight("#DataTable"); // // let sclass = "table table-striped"; // let bodys=[] // // for(let i = -1; i <= row; i++) { // bodys.push(""); // // if(i=-1){ // // for(var a in c[0]) { // // var bo= ""+c[0][a]+""; // bodys.push(bo) // // } // // // }else{ // // // for(let j = 0; j <= col; j++) { // if(j == 0) { // var bo = "<td><span>" + e[i][b[j]] + "#"; // bodys.push(bo) // } else { // var bo= "" // + // // '' // +""; // bodys.push(bo) // } // } // } // bodys.push( ""); // // } // bodys.push(""); // var s=bodys.join('') // $("#TableView").append(s); // addRight("#DataTable"); // }) })(jQuery) 访问index.html会被重定向到login.html其他以页面不回

最新推荐

recommend-type

tika-parser-font-module-3.1.0.jar中文-英文对照文档.zip

1、压缩文件中包含: 中文-英文对照文档、jar包下载地址、Maven依赖、Gradle依赖、源代码下载地址。 2、使用方法: 解压最外层zip,再解压其中的zip包,双击 【index.html】 文件,即可用浏览器打开、进行查看。 3、特殊说明: (1)本文档为人性化翻译,精心制作,请放心使用; (2)只翻译了该翻译的内容,如:注释、说明、描述、用法讲解 等; (3)不该翻译的内容保持原样,如:类名、方法名、包名、类型、关键字、代码 等。 4、温馨提示: (1)为了防止解压后路径太长导致浏览器无法打开,推荐在解压时选择“解压到当前文件夹”(放心,自带文件夹,文件不会散落一地); (2)有时,一套Java组件会有多个jar,所以在下载前,请仔细阅读本篇描述,以确保这就是你需要的文件。 5、本文件关键字: jar中文-英文对照文档.zip,java,jar包,Maven,第三方jar包,组件,开源组件,第三方组件,Gradle,中文API文档,手册,开发手册,使用手册,参考手册。
recommend-type

HTML时间格式化工具及测试页面介绍

标题 "BoolStudio.github.io" 暗示这是一个与GitHub相关的在线资源,具体来说是与BoolStudio相关的网页地址。GitHub是一个著名的代码托管平台,它支持Git版本控制系统,允许用户在云端存储和共享代码。BoolStudio可能是GitHub上的一个用户或组织账户名称,而该页面可能是他们托管的项目或个人页面的入口。 描述中的信息包含了HTML元素和JavaScript代码片段。这段描述展示了一个测试页文件的部分代码,涉及到HTML的标题(title)和内嵌框架(iframe)的使用,以及JavaScript中Date对象的扩展功能。 从描述中我们可以分析出以下知识点: 1. HTML标题(Title): 在HTML中,`<title>`标签用于定义网页的标题,它会显示在浏览器的标题栏或页面的标签上。在描述中出现了`<title>现在时间</title>`,这表明网页的标题被设置为了“现在时间”。 2. 微软时间: 这可能指的是在网页中嵌入微软产品的日期和时间显示。尽管这部分内容在描述中被删除了,但微软时间通常与Windows操作系统的日期和时间显示相关联。 3. iframe元素: `<iframe>`标签定义了一个内嵌框架,可以在网页中嵌入另一个文档。在描述中出现的是`<iframe src"></iframe>`,这表示创建了一个空的iframe元素,其src属性为空,实际上没有嵌入任何内容。通常src属性会被设置为另一个HTML文档的URL,用来在当前页面中显示外部页面的内容。 4. JavaScript日期格式化: 描述中包含了一段JavaScript代码,这段代码扩展了Date对象的功能,允许它根据提供的格式字符串(fmt)返回格式化的日期和时间。例如,如果fmt是'y年M月d日 h时m分s秒',则该函数会按照这个格式返回当前日期和时间。 具体到代码实现,以下步骤展示了如何在JavaScript中扩展Date对象并格式化日期: - 首先创建了一个对象o,该对象包含日期和时间的不同部分,例如年(y)、月(M)、日(d)、时(h)、分(m)、秒(s)。 - 使用正则表达式检查格式字符串fmt中是否包含年份的占位符(y+),如果存在则将其替换为四位数的年份,不足部分用0补齐。 - 使用for...in循环遍历对象o中的每一个键值对,并使用正则表达式测试这些键(如年、月、日等)是否在格式字符串中存在。如果存在,则替换为相应的日期时间值。 这个知识点展示了在JavaScript中如何自定义对象的方法,以及如何使用正则表达式进行字符串的搜索和替换。 标签 "HTML" 表明这个文件主要涉及到超文本标记语言(HTML),这是构建网页内容的标准标记语言,它允许开发者使用标签来定义网页的结构和内容。HTML文件通常包含各种元素,如段落、链接、图片、表格和表单等。 压缩包子文件的文件名称列表中的 "BoolStudio.github.io-main" 可能指的是一个包含 "BoolStudio.github.io" 网站主要文件的压缩包。通常,网站项目会包含多个文件和资源,为了便于管理和分发,开发者会将这些文件打包成一个压缩文件。在本例中,"main" 可能表示该压缩包包含了网站的主要文件和代码。 通过对给定文件信息的分析,我们可以了解到网页设计和开发的相关知识点,特别是HTML文档结构、JavaScript对象和函数扩展以及如何在网站项目中组织文件。这些知识对于前端开发者来说是非常重要的,能够帮助他们创建更加动态和功能丰富的网页应用。
recommend-type

Elixir测试:从用例执行到覆盖率分析

### Elixir 测试:从用例执行到覆盖率分析 #### 1. 测试用例执行 在测试中,以 `Test` 结尾且包含 `use ExUnit` 的模块被视为测试用例。测试用例本质上是设置回调和测试的集合。测试用例的执行方式有两种:并发执行或顺序执行。使用 `async: true` 选项的测试用例将并发执行,其余的则按定义顺序(默认随机)顺序执行。 测试用例的执行流程如下: 1. 执行所有 `setup_all` 回调。 2. 执行所有测试及其特定的设置和拆卸回调。 `setup_all` 回调按定义顺序在同一进程中执行。在运行任何测试之前,测试用例将生成一个进程,在该进程中运行所有
recommend-type

Android Studio 时间延时

<think> 我们参考多个引用,总结在Android Studio中实现时间延时的方法。根据引用[1]和[2],我们知道有几种常见的延时方法,包括使用Handler的postDelayed方法、使用Timer和TimerTask以及使用Thread.sleep。引用[3]和[5]则展示了具体代码示例。 具体方法如下: 1. **使用Handler的postDelayed方法**(推荐在主线程中使用,避免直接操作UI线程的问题): ```java new Handler().postDelayed(new Runnable() { @Override
recommend-type

IMS Open Corpus Workbench:打造高效大型文本语料库管理工具

IMS Open Corpus Workbench(以下简称CWB)是一个强大的开源工具集,它专门用于管理和查询大型的、带有语言注释的文本语料库。这项工具有着广泛的应用领域,包括语言学研究、自然语言处理、人文科学研究等。 ### 标题知识点: #### 大型文本语料库的索引和查询工具 大型文本语料库指的是含有大量文本数据的数据库,其中包含的文本量通常以百万计。这些数据可能是书面文本、口语录音文字转写等形式。对于如此庞大的数据集,索引是必要的,它可以帮助研究者快速定位到感兴趣的片段,而查询工具则提供了从这些大量数据中提取特定信息的能力。 #### 开源 CWB作为一个开源工具,意味着其源代码对所有人开放,并且可以免费使用和修改。开源项目通常是由社区驱动,有着活跃的开发者和用户群体,不断对工具进行改进和拓展。这种模式促进了创新,并且有利于长期维护和升级。 ### 描述知识点: #### 管理和查询带有语言注释的文本 在语料库中,文本数据经常会被加上各种形式的语言注释,比如句法结构、词性标注、语义角色等。CWB支持管理这类富含语言信息的语料库,使其不仅仅保存原始文本信息,还整合了深层的语言知识。此外,CWB提供了多种查询语言注释数据的方式,使得用户可以针对特定的注释信息进行精确查询。 #### 核心组件:CQP(Corpus Query Processor) CQP是CWB中的核心组件,是一个高度灵活和高效的查询处理器。它支持在终端会话中交互式地使用,这为熟悉命令行界面的用户提供了一个强大的工具。同时,CQP也可以嵌入到其他程序中,比如Perl脚本,从而提供编程式的语料库访问方式。这为高级用户提供了一个强大的平台,可以编写复杂的查询,并将查询结果集成到其他程序中。 #### 基于Web的GUI CQPweb 除了命令行界面外,CWB还提供了一个基于Web的图形用户界面CQPweb,使得不熟悉命令行的用户也能够方便地使用CWB的强大功能。CQPweb通常允许用户通过网页直接构建查询,并展示查询结果,极大地降低了使用门槛。 ### 标签知识点: #### 开源软件 CWB作为开源软件,其主要特点和优势包括: - **社区支持**:开放源代码鼓励了全球开发者共同参与,提供错误修正、功能增强、新特性开发等。 - **定制化**:用户可以根据自己的需求对源代码进行修改,从而实现定制化的功能。 - **透明性**:源代码的开放确保了软件工作的透明性,用户可以清楚了解软件的工作原理和数据处理方式。 - **可靠性**:由于代码的公开性,很多用户和开发者可以共同审查代码,提高了软件的可靠性和安全性。 - **成本效益**:开源软件通常不需要支付昂贵的许可费用,对预算有限的个人和机构特别友好。 ### 压缩包子文件的文件名称列表知识点: #### cwb-3.0.0-osx-10.5-universal 这个文件名提供了关于该软件包的重要信息: - **cwb**:表示这是IMS Open Corpus Workbench的软件包。 - **3.0.0**:表示这个包的版本号,了解版本信息对于获取支持、查看更新日志、了解新特性等方面很重要。 - **osx**:表示这个软件包是为Mac OS X操作系统设计的。 - **10.5**:这个数字指明了这个软件包支持的操作系统版本至少是Mac OS X 10.5。 - **universal**:表明这个软件包是为不同架构的处理器(比如32位和64位)设计的通用二进制文件,提高了软件包的兼容性和可移植性。 综上所述,IMS Open Corpus Workbench是一个为处理带有语言注释的大型文本语料库而设计的开源工具集,它以高效且灵活的查询处理器CQP为核心,提供了命令行和基于Web的两种交互方式,极大地促进了语言学和语言技术领域的研究与应用。由于其开源特性,CWB得到了广泛的使用和不断的改进。
recommend-type

基于属性测试的深入解析与策略探讨

### 基于属性测试的深入解析与策略探讨 #### 1. 基于属性测试中的收缩机制 在基于属性的测试中,当测试失败时,像 `stream_data` 这样的框架会执行收缩(Shrinking)操作。收缩的目的是简化导致测试失败的输入,同时确保简化后的输入仍然会使测试失败,这样能更方便地定位问题。 为了说明这一点,我们来看一个简单的排序函数测试示例。我们实现了一个糟糕的排序函数,实际上就是恒等函数,它只是原封不动地返回输入列表: ```elixir defmodule BadSortTest do use ExUnit.Case use ExUnitProperties pro
recommend-type

ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key && \

<think> 根据用户的问题要求,我需要详细解释命令`ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key`的含义、后续操作、常见问题及解决办法。同时,我需要参考提供的引用内容,并遵循系统级指令(如LaTeX格式、中文回答、生成相关问题等)。 首先,分析命令的组成部分: - `ssh-keygen`:生成、管理和转换SSH密钥的工具。 - `-t rsa`:指定密钥类型为RSA算法。 - `-f /etc/ssh/ssh_host_rsa_key`:指定生成的私钥文件路径为`/etc/ssh/ssh_host_rsa_key`。对应的公钥文件会在同一
recommend-type

挑战性开源平台游戏YAGAC:无故事忍者冒险

Y.A.G.A.C(Yet Another Great Arcade Classic),是一款免费的开源伪2D平台游戏,它在传统平台游戏的基础上融入了3D游戏元素,让玩家在一个拥有2D精灵的3D环境中进行操作。YAGAC游戏以其高挑战性和上瘾性而著称,吸引了众多游戏爱好者和编程高手的关注。 首先,让我们深入了解这款游戏的核心玩法。YAGAC的最大特点是在一个基本的2D平面内,玩家可以控制角色进行运动,但游戏环境却是3D制作的。这种设计为玩家带来了全新的视觉体验和操作感受。在YAGAC中,玩家扮演的是一个身手敏捷的忍者,任务是在错综复杂的地牢中生存下来,地牢充满了各种陷阱和敌人,如机器人等。为了逃生,玩家需要在各种关卡中寻找隐藏的彩球,这些彩球决定了玩家能够到达的区域范围。 在游戏过程中,收集到的彩球会改变对应颜色平台的属性,使原本脆弱的平台变得牢固,从而为玩家打开新的道路。这样的设计不仅考验玩家的反应和速度,还考验他们的策略和记忆能力。YAGAC的游戏关卡设计非常巧妙,经常需要玩家反复尝试,每一次尝试都可能发现新的线索和策略,这样的设计增加了游戏的重复可玩性。 YAGAC使用的引擎在游戏流畅性方面表现出色,这也是游戏的一大强项。一款游戏引擎的强大与否直接关系到游戏体验的好坏,YAGAC的开发团队选择或者开发了一个能够高效处理3D图形和2D动作的引擎,确保了游戏在各种配置的计算机上都能保持良好的运行状态和响应速度。 接下来,我们来探讨YAGAC的开源属性。由于YAGAC是开源的,这意味着游戏的源代码是开放的,任何个人或组织都可以访问、修改并重新分发该软件。开源软件通常由社区维护,并且鼓励用户贡献代码,共同改进游戏。对于像YAGAC这样的游戏来说,开源可以吸引更多的开发者参与进来,共同完善游戏体验。玩家和开发者可以对游戏进行本地化、修改游戏机制,甚至是增加新的内容和关卡。 开源平台游戏的概念不仅限于提供免费的游戏体验,它还鼓励创新和协作。开源文化促进知识共享和技术进步,这在软件开发领域尤为重要。同时,玩家也可以从中学到编程知识,因为游戏的开源性质允许用户查看和学习游戏背后的代码。 最后,关于YAGAC的文件名称“yagac”,这很可能是游戏的主程序文件名或者主目录名。当玩家在计算机上进行下载和安装时,可能会遇到这样的文件名,识别这一点有助于玩家快速定位和管理游戏文件。 总的来说,Y.A.G.A.C.作为一款开源平台游戏,在游戏玩法设计、开源文化和3D游戏引擎的流畅性等方面,都显示出其独特的优势。游戏的挑战性和上瘾性,以及社区驱动的开发模式,都为游戏爱好者和开源爱好者提供了一个理想的游戏和学习平台。对于对游戏开发感兴趣的玩家来说,YAGAC无疑是一个研究和实践的良好起点。
recommend-type

状态化属性测试与测试数据随机化及测试生命周期解析

# 状态化属性测试与测试数据随机化及测试生命周期解析 ## 状态化属性测试 ### 状态化系统测试的引入 之前我们主要探讨了针对纯无状态函数的属性测试,这类函数接收输入并返回输出。然而,属性测试同样适用于有状态系统的测试。有状态系统是指那些会携带状态的系统,例如数据库。 在之前的示例中,我们仅使用属性测试来生成数据,然后将其输入到代码中并对结果进行断言。但对于有状态系统,情况有所不同:我们需要处理状态的设置,并仅在系统处于特定状态时执行某些操作。 ### 对有状态系统进行建模 我们可以利用属性测试框架生成随机数据的能力,为有状态系统生成随机命令。例如,若有状态系统是数据库,我们就能生成针
recommend-type

icpc英语字典

<think> 首先,用户的问题是:“我想查找icpc相关的英语字典 请问icpc英语专业字典”。用户想查找与ICPC(International Collegiate Programming Contest)相关的英语字典,特别是专业字典。 现在,回顾系统指令: - 所有行内数学表达式必须使用$...$格式。 - 独立公式使用$$...$$。 - LaTeX语法正确。 - 使用中文回答。 - 生成相关问题。 - 在回答中引用的段落末尾自然地添加引用标识。 - 回答结构清晰,帮助用户逐步解决问题。 - 保持真实可靠。 用户提供了几个引用: - 引用[1]:关于填字游戏和寻找变形词的程序。