日志:
java.lang.reflect.UndeclaredThrowableException: null at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:769) ~[na:na] at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:703) ~[na:na] at com.zaxxer.hikari.HikariDataSource$$SpringCGLIB$$0.getConnection() ~[test-compatibility-springboot3-seata.exe:na] at org.springframework.jdbc.datasource.DataSourceUtils.fetchConnection(DataSourceUtils.java:159) ~[na:na] at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:117) ~[na:na] at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:80) ~[na:na] at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:376) ~[test-compatibility-springboot3-seata.exe:6.0.3] at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:431) ~[test-compatibility-springboot3-seata.exe:6.0.3] at cn.wangliang181230.seata.TestService.test(TestService.java:45) ~[test-compatibility-springboot3-seata.exe:na] at java.base@17.0.5/java.lang.reflect.Method.invoke(Method.java:568) ~[test-compatibility-springboot3-seata.exe:na] at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343) ~[na:na] at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:196) ~[test-compatibility-springboot3-seata.exe:6.0.3] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[test-compatibility-springboot3-seata.exe:6.0.3] at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:752) ~[na:na] at io.seata.spring.annotation.GlobalTransactionalInterceptor$2.execute(GlobalTransactionalInterceptor.java:204) ~[na:na] at io.seata.tm.api.TransactionalTemplate.execute(TransactionalTemplate.java:130) ~[na:na] at io.seata.spring.annotation.GlobalTransactionalInterceptor.handleGlobalTransaction(GlobalTransactionalInterceptor.java:201) ~[na:na] at io.seata.spring.annotation.GlobalTransactionalInterceptor.invoke(GlobalTransactionalInterceptor.java:171) ~[na:na] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184) ~[test-compatibility-springboot3-seata.exe:6.0.3] at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:752) ~[na:na] at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:703) ~[na:na] at cn.wangliang181230.seata.TestService$$SpringCGLIB$$0.test() ~[test-compatibility-springboot3-seata.exe:na] at cn.wangliang181230.seata.TestController.test(TestController.java:22) ~[test-compatibility-springboot3-seata.exe:na] at java.base@17.0.5/java.lang.reflect.Method.invoke(Method.java:568) ~[test-compatibility-springboot3-seata.exe:na] at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:207) ~[test-compatibility-springboot3-seata.exe:6.0.3] at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:152) ~[test-compatibility-springboot3-seata.exe:6.0.3] at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117) ~[test-compatibility-springboot3-seata.exe:6.0.3] at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:884) ~[test-compatibility-springboot3-seata.exe:6.0.3] at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:797) ~[test-compatibility-springboot3-seata.exe:6.0.3] at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[test-compatibility-springboot3-seata.exe:6.0.3] at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1080) ~[test-compatibility-springboot3-seata.exe:6.0.3] at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:973) ~[test-compatibility-springboot3-seata.exe:6.0.3] at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1010) ~[test-compatibility-springboot3-seata.exe:6.0.3] at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:902) ~[test-compatibility-springboot3-seata.exe:6.0.3] at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:705) ~[test-compatibility-springboot3-seata.exe:6.0] at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:884) ~[test-compatibility-springboot3-seata.exe:6.0.3] at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:814) ~[test-compatibility-springboot3-seata.exe:6.0] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:223) ~[na:na] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:158) ~[na:na] at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) ~[test-compatibility-springboot3-seata.exe:10.1.4] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:185) ~[na:na] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:158) ~[na:na] at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[test-compatibility-springboot3-seata.exe:6.0.3] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[test-compatibility-springboot3-seata.exe:6.0.3] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:185) ~[na:na] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:158) ~[na:na] at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[test-compatibility-springboot3-seata.exe:6.0.3] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[test-compatibility-springboot3-seata.exe:6.0.3] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:185) ~[na:na] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:158) ~[na:na] at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[test-compatibility-springboot3-seata.exe:6.0.3] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[test-compatibility-springboot3-seata.exe:6.0.3] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:185) ~[na:na] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:158) ~[na:na] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:177) ~[na:na] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97) ~[na:na] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:542) ~[test-compatibility-springboot3-seata.exe:10.1.4] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:119) ~[na:na] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) ~[test-compatibility-springboot3-seata.exe:10.1.4] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78) ~[na:na] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:357) ~[na:na] at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:400) ~[na:na] at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) ~[test-compatibility-springboot3-seata.exe:10.1.4] at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:859) ~[na:na] at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1734) ~[na:na] at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) ~[test-compatibility-springboot3-seata.exe:10.1.4] at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) ~[na:na] at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) ~[na:na] at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[na:na] at java.base@17.0.5/java.lang.Thread.run(Thread.java:833) ~[test-compatibility-springboot3-seata.exe:na] at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:775) ~[test-compatibility-springboot3-seata.exe:na] at org.graalvm.nativeimage.builder/com.oracle.svm.core.windows.WindowsPlatformThreads.osThreadStartRoutine(WindowsPlatformThreads.java:178) ~[na:na] Caused by: java.lang.reflect.InvocationTargetException: null at java.base@17.0.5/java.lang.reflect.Method.invoke(Method.java:568) ~[test-compatibility-springboot3-seata.exe:na] at io.seata.spring.annotation.datasource.SeataAutoDataSourceProxyAdvice.invoke(SeataAutoDataSourceProxyAdvice.java:68) ~[na:na] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184) ~[test-compatibility-springboot3-seata.exe:6.0.3] at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:752) ~[na:na] ... 71 common frames omitted Caused by: java.lang.ExceptionInInitializerError: null at io.seata.rm.datasource.util.XAUtils.createXAConnection(XAUtils.java:48) ~[na:na] at io.seata.rm.datasource.util.XAUtils.createXAConnection(XAUtils.java:43) ~[na:na] at io.seata.rm.datasource.xa.DataSourceProxyXA.getConnectionProxyXA(DataSourceProxyXA.java:112) ~[na:na] at io.seata.rm.datasource.xa.DataSourceProxyXA.getConnectionProxy(DataSourceProxyXA.java:101) ~[na:na] at io.seata.rm.datasource.xa.DataSourceProxyXA.getConnection(DataSourceProxyXA.java:88) ~[na:na] ... 75 common frames omitted Caused by: java.nio.charset.UnsupportedCharsetException: BIG5 at java.base@17.0.5/java.nio.charset.Charset.forName(Charset.java:528) ~[test-compatibility-springboot3-seata.exe:na] at com.alibaba.druid.util.MySqlUtils.(MySqlUtils.java:519) ~[na:na] ... 80 common frames omitted
截图:
原提问者GitHub用户wangliang181230
MSE 网关不仅可以对接 Spring Cloud 微服务,还可以对接其他类型的后端服务,如静态资源服务、API 服务等。同时,MSE 网关也可以在 Kubernetes 等容器化平台上部署,提供稳定和高效的服务治理和流量控制能力。
如果您需要将静态资源服务接入 MSE 网关,并将其部署在 Kubernetes 上,可以按照以下步骤操作:
配置静态资源服务:在部署静态资源服务时,需要将静态资源文件放置于一个可访问的路径下,并配置相应的访问 URL。例如,可以将静态资源文件放置于 /usr/share/nginx/html 目录下,并将 URL 配置为 /static。
配置 MSE 网关:在配置 MSE 网关时,需要将静态资源服务的 URL 添加到服务注册表中,并配置相应的路由规则。例如,可以将静态资源服务的 URL 添加到 MSE 网关的服务注册表中,并将路由规则配置为将 /static 的请求转发到静态资源服务的 URL。
部署 MSE 网关:在部署 MSE 网关时,可以将其部署在 Kubernetes 等容器化平台上,并配置相应的容器资源、网络和存储等参数。同时,需要配置 MSE 网关的服务注册中心和路由规则,以确保静态资源服务能够正确地被访问和路由。
这个日志显示了一个Java应用程序中的异常堆栈跟踪。根据日志信息,可以看出有几个问题:
test()
方法时出现了java.lang.reflect.UndeclaredThrowableException
异常。UndeclaredThrowableException
的原因是InvocationTargetException
,该异常被抛出在通过反射调用方法时遇到异常。InvocationTargetException
的原因是ExceptionInInitializerError
,该异常指示静态初始化期间发生错误。ExceptionInInitializerError
的原因是UnsupportedCharsetException
,即不支持字符集"Big5"。从日志中可以推断出以下一些信息:
UnsupportedCharsetException
异常。XAUtils.createXAConnection
方法中创建XA连接时出现了问题。要解决此问题,你可以尝试以下几个步骤:
如果问题仍然存在,请提供更多上下文信息和配置细节,以便可以更好地帮助你解决问题。
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。