java导出异常NotOfficeXmlFileException

导出时
执行 XSSFWorkbook workBook=new XSSFWorkbook(fis);

报错org.apache.poi.openxml4j.exceptions.NotOfficeXmlFileException: No valid entries or contents found, this is not

a valid OOXML (Office Open XML) file
请问如何解决

2个回答

其实是文档在SVN下下来加密了。。。。

weixin_41416684
weixin_41416684 我也遇到了呀,不知道如何处理
3 个月之前 回复
wanxiaoyue123
wanxiaoyue123 请问最后是怎么解决的呢?我也遇到了同样的问题
9 个月之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
JAVA导出Excel时,可以正常导出,但是后端控制台报错JsonMappingException
JAVA导出Excel时,可以正常导出,但是后端控制台报错JsonMappingException 具体报错代码如下 ``` 2019-11-29 10:24:49.693 ERROR [http-nio-9040-exec-3] [CommonResponseWrappedMsgFormater.java : 104] - 请求服务响应数据序列化输出异常: com.fasterxml.jackson.databind.JsonMappingException: No serializer found for class java.io.ByteArrayInputStream and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: com.xmcares.framework.common.response.CommonResponse["data"]->org.apache.poi.xssf.usermodel.XSSFWorkbook["packagePart"]->org.apache.poi.openxml4j.opc.ZipPackagePart["zipArchive"]->org.apache.poi.openxml4j.util.ZipInputStreamZipEntrySource$FakeZipEntry["inputStream"]) at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:284) ~[jackson-databind-2.8.8.jar:2.8.8] at com.fasterxml.jackson.databind.SerializerProvider.mappingException(SerializerProvider.java:1110) ~[jackson-databind-2.8.8.jar:2.8.8] at com.fasterxml.jackson.databind.SerializerProvider.reportMappingProblem(SerializerProvider.java:1135) ~[jackson-databind-2.8.8.jar:2.8.8] at com.fasterxml.jackson.databind.ser.impl.UnknownSerializer.failForEmpty(UnknownSerializer.java:69) ~[jackson-databind-2.8.8.jar:2.8.8] at com.fasterxml.jackson.databind.ser.impl.UnknownSerializer.serialize(UnknownSerializer.java:32) ~[jackson-databind-2.8.8.jar:2.8.8] at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:704) ~[jackson-databind-2.8.8.jar:2.8.8] at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:690) ~[jackson-databind-2.8.8.jar:2.8.8] at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:155) ~[jackson-databind-2.8.8.jar:2.8.8] at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:704) ~[jackson-databind-2.8.8.jar:2.8.8] at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:690) ~[jackson-databind-2.8.8.jar:2.8.8] at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:155) ~[jackson-databind-2.8.8.jar:2.8.8] at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:704) ~[jackson-databind-2.8.8.jar:2.8.8] at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:690) ~[jackson-databind-2.8.8.jar:2.8.8] at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:155) ~[jackson-databind-2.8.8.jar:2.8.8] at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:704) ~[jackson-databind-2.8.8.jar:2.8.8] at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:690) ~[jackson-databind-2.8.8.jar:2.8.8] at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:155) ~[jackson-databind-2.8.8.jar:2.8.8] at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:292) ~[jackson-databind-2.8.8.jar:2.8.8] at com.fasterxml.jackson.databind.ObjectMapper._configAndWriteValue(ObjectMapper.java:3681) ~[jackson-databind-2.8.8.jar:2.8.8] at com.fasterxml.jackson.databind.ObjectMapper.writeValue(ObjectMapper.java:3014) ~[jackson-databind-2.8.8.jar:2.8.8] at com.xmcares.framework.serviceful.servlet.fomater.CommonResponseWrappedMsgFormater.formatMsgInternal(CommonResponseWrappedMsgFormater.java:102) [xcf-foundation-security-2.7.0.7-20191111.084436-3.jar:2.7.0.7-SNAPSHOT] at com.xmcares.framework.serviceful.servlet.fomater.CommonResponseWrappedMsgFormater.formatMsg(CommonResponseWrappedMsgFormater.java:69) [xcf-foundation-security-2.7.0.7-20191111.084436-3.jar:2.7.0.7-SNAPSHOT] at com.xmcares.framework.serviceful.servlet.ServletServiceResponseMarshaller.marshaller(ServletServiceResponseMarshaller.java:34) [xcf-foundation-security-2.7.0.7-20191111.084436-3.jar:2.7.0.7-SNAPSHOT] at com.xmcares.framework.serviceful.servlet.ServletServiceResponseMarshaller.marshaller(ServletServiceResponseMarshaller.java:24) [xcf-foundation-security-2.7.0.7-20191111.084436-3.jar:2.7.0.7-SNAPSHOT] at com.xmcares.framework.serviceful.ServicefulRouterAdapter.marshallerServiceResponse(ServicefulRouterAdapter.java:204) [xcf-foundation-security-2.7.0.7-20191111.084436-3.jar:2.7.0.7-SNAPSHOT] at com.xmcares.framework.serviceful.ServicefulRouterAdapter.route(ServicefulRouterAdapter.java:110) [xcf-foundation-security-2.7.0.7-20191111.084436-3.jar:2.7.0.7-SNAPSHOT] at com.xmcares.framework.serviceful.servlet.ServletServicefulRouter.route(ServletServicefulRouter.java:42) [xcf-foundation-security-2.7.0.7-20191111.084436-3.jar:2.7.0.7-SNAPSHOT] at com.xmcares.framework.serviceful.servlet.ServicefulServlet.doService(ServicefulServlet.java:112) [xcf-foundation-security-2.7.0.7-20191111.084436-3.jar:2.7.0.7-SNAPSHOT] at com.xmcares.framework.serviceful.servlet.AbstractHttpServlet.doPost(AbstractHttpServlet.java:55) [xcf-foundation-security-2.7.0.7-20191111.084436-3.jar:2.7.0.7-SNAPSHOT] at javax.servlet.http.HttpServlet.service(HttpServlet.java:661) [tomcat-embed-core-8.5.13.jar:8.5.13] at javax.servlet.http.HttpServlet.service(HttpServlet.java:742) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) [tomcat-embed-websocket-8.5.13.jar:8.5.13] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.springframework.boot.web.filter.ApplicationContextHeaderFilter.doFilterInternal(ApplicationContextHeaderFilter.java:55) [spring-boot-1.4.6.RELEASE.jar:1.4.6.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.8.RELEASE.jar:4.3.8.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:101) [spring-web-4.3.8.RELEASE.jar:4.3.8.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [tomcat-embed-core-8.5.13.jar:8.5.13] at com.xmcares.framework.security.author.UserContextHolderFilter.doFilter(UserContextHolderFilter.java:43) [xcf-foundation-security-2.7.0.7-20191111.084436-3.jar:2.7.0.7-SNAPSHOT] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [tomcat-embed-core-8.5.13.jar:8.5.13] at com.xmcares.framework.security.authen.AuthenticationPageFilter.doFilter(AuthenticationPageFilter.java:54) [xcf-foundation-security-2.7.0.7-20191111.084436-3.jar:2.7.0.7-SNAPSHOT] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:200) [spring-security-web-4.2.0.RELEASE.jar:4.2.0.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:101) [spring-web-4.3.8.RELEASE.jar:4.3.8.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.springframework.boot.actuate.trace.WebRequestTraceFilter.doFilterInternal(WebRequestTraceFilter.java:105) [spring-boot-actuator-1.4.6.RELEASE.jar:1.4.6.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.8.RELEASE.jar:4.3.8.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:317) [spring-security-web-4.2.0.RELEASE.jar:4.2.0.RELEASE] at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:127) [spring-security-web-4.2.0.RELEASE.jar:4.2.0.RELEASE] at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:91) [spring-security-web-4.2.0.RELEASE.jar:4.2.0.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) [spring-security-web-4.2.0.RELEASE.jar:4.2.0.RELEASE] at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:114) [spring-security-web-4.2.0.RELEASE.jar:4.2.0.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) [spring-security-web-4.2.0.RELEASE.jar:4.2.0.RELEASE] at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:137) [spring-security-web-4.2.0.RELEASE.jar:4.2.0.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) [spring-security-web-4.2.0.RELEASE.jar:4.2.0.RELEASE] at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111) [spring-security-web-4.2.0.RELEASE.jar:4.2.0.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) [spring-security-web-4.2.0.RELEASE.jar:4.2.0.RELEASE] at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:170) [spring-security-web-4.2.0.RELEASE.jar:4.2.0.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) [spring-security-web-4.2.0.RELEASE.jar:4.2.0.RELEASE] at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63) [spring-security-web-4.2.0.RELEASE.jar:4.2.0.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) [spring-security-web-4.2.0.RELEASE.jar:4.2.0.RELEASE] at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:200) [spring-security-web-4.2.0.RELEASE.jar:4.2.0.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) [spring-security-web-4.2.0.RELEASE.jar:4.2.0.RELEASE] at com.xmcares.framework.security.authen.AuthenticationPageFilter.doFilter(AuthenticationPageFilter.java:54) [xcf-foundation-security-2.7.0.7-20191111.084436-3.jar:2.7.0.7-SNAPSHOT] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) [spring-security-web-4.2.0.RELEASE.jar:4.2.0.RELEASE] at com.xmcares.framework.security.authen.CaptchaRequestFilter.doFilter(CaptchaRequestFilter.java:50) [xcf-foundation-security-2.7.0.7-20191111.084436-3.jar:2.7.0.7-SNAPSHOT] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) [spring-security-web-4.2.0.RELEASE.jar:4.2.0.RELEASE] at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:116) [spring-security-web-4.2.0.RELEASE.jar:4.2.0.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) [spring-security-web-4.2.0.RELEASE.jar:4.2.0.RELEASE] at org.springframework.web.filter.CorsFilter.doFilterInternal(CorsFilter.java:96) [spring-web-4.3.8.RELEASE.jar:4.3.8.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.8.RELEASE.jar:4.3.8.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) [spring-security-web-4.2.0.RELEASE.jar:4.2.0.RELEASE] at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:64) [spring-security-web-4.2.0.RELEASE.jar:4.2.0.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.8.RELEASE.jar:4.3.8.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) [spring-security-web-4.2.0.RELEASE.jar:4.2.0.RELEASE] at com.xmcares.framework.security.author.UserContextHolderFilter.doFilter(UserContextHolderFilter.java:57) [xcf-foundation-security-2.7.0.7-20191111.084436-3.jar:2.7.0.7-SNAPSHOT] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) [spring-security-web-4.2.0.RELEASE.jar:4.2.0.RELEASE] at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) [spring-web-4.3.8.RELEASE.jar:4.3.8.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.8.RELEASE.jar:4.3.8.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) [spring-security-web-4.2.0.RELEASE.jar:4.2.0.RELEASE] at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105) [spring-security-web-4.2.0.RELEASE.jar:4.2.0.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) [spring-security-web-4.2.0.RELEASE.jar:4.2.0.RELEASE] at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56) [spring-security-web-4.2.0.RELEASE.jar:4.2.0.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.8.RELEASE.jar:4.3.8.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) [spring-security-web-4.2.0.RELEASE.jar:4.2.0.RELEASE] at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:214) [spring-security-web-4.2.0.RELEASE.jar:4.2.0.RELEASE] at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:177) [spring-security-web-4.2.0.RELEASE.jar:4.2.0.RELEASE] at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346) [spring-web-4.3.8.RELEASE.jar:4.3.8.RELEASE] at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262) [spring-web-4.3.8.RELEASE.jar:4.3.8.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:105) [spring-web-4.3.8.RELEASE.jar:4.3.8.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.8.RELEASE.jar:4.3.8.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:81) [spring-web-4.3.8.RELEASE.jar:4.3.8.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.8.RELEASE.jar:4.3.8.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.springframework.session.web.http.SessionRepositoryFilter.doFilterInternal(SessionRepositoryFilter.java:167) [spring-session-1.3.1.RELEASE.jar:na] at org.springframework.session.web.http.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:80) [spring-session-1.3.1.RELEASE.jar:na] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197) [spring-web-4.3.8.RELEASE.jar:4.3.8.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.8.RELEASE.jar:4.3.8.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.springframework.boot.actuate.autoconfigure.MetricsFilter.doFilterInternal(MetricsFilter.java:106) [spring-boot-actuator-1.4.6.RELEASE.jar:1.4.6.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.8.RELEASE.jar:4.3.8.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:341) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:799) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:861) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1455) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-8.5.13.jar:8.5.13] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_191] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_191] at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-8.5.13.jar:8.5.13] at java.lang.Thread.run(Thread.java:748) [na:1.8.0_191] 2019-11-29 10:24:49.703 ERROR [http-nio-9040-exec-3] [ServicefulServlet.java : 114] - 服务化路由器执行请求/sysUser/downloadTemplate异常 com.xmcares.framework.serviceful.error.ServicefulException: 请求服务响应数据序列化输出异常 at com.xmcares.framework.serviceful.servlet.fomater.CommonResponseWrappedMsgFormater.formatMsgInternal(CommonResponseWrappedMsgFormater.java:105) ~[xcf-foundation-security-2.7.0.7-20191111.084436-3.jar:2.7.0.7-SNAPSHOT] at com.xmcares.framework.serviceful.servlet.fomater.CommonResponseWrappedMsgFormater.formatMsg(CommonResponseWrappedMsgFormater.java:69) ~[xcf-foundation-security-2.7.0.7-20191111.084436-3.jar:2.7.0.7-SNAPSHOT] at com.xmcares.framework.serviceful.servlet.ServletServiceResponseMarshaller.marshaller(ServletServiceResponseMarshaller.java:34) ~[xcf-foundation-security-2.7.0.7-20191111.084436-3.jar:2.7.0.7-SNAPSHOT] at com.xmcares.framework.serviceful.servlet.ServletServiceResponseMarshaller.marshaller(ServletServiceResponseMarshaller.java:24) ~[xcf-foundation-security-2.7.0.7-20191111.084436-3.jar:2.7.0.7-SNAPSHOT] at com.xmcares.framework.serviceful.ServicefulRouterAdapter.marshallerServiceResponse(ServicefulRouterAdapter.java:204) ~[xcf-foundation-security-2.7.0.7-20191111.084436-3.jar:2.7.0.7-SNAPSHOT] at com.xmcares.framework.serviceful.ServicefulRouterAdapter.route(ServicefulRouterAdapter.java:110) ~[xcf-foundation-security-2.7.0.7-20191111.084436-3.jar:2.7.0.7-SNAPSHOT] at com.xmcares.framework.serviceful.servlet.ServletServicefulRouter.route(ServletServicefulRouter.java:42) ~[xcf-foundation-security-2.7.0.7-20191111.084436-3.jar:2.7.0.7-SNAPSHOT] at com.xmcares.framework.serviceful.servlet.ServicefulServlet.doService(ServicefulServlet.java:112) ~[xcf-foundation-security-2.7.0.7-20191111.084436-3.jar:2.7.0.7-SNAPSHOT] at com.xmcares.framework.serviceful.servlet.AbstractHttpServlet.doPost(AbstractHttpServlet.java:55) [xcf-foundation-security-2.7.0.7-20191111.084436-3.jar:2.7.0.7-SNAPSHOT] at javax.servlet.http.HttpServlet.service(HttpServlet.java:661) [tomcat-embed-core-8.5.13.jar:8.5.13] at javax.servlet.http.HttpServlet.service(HttpServlet.java:742) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) [tomcat-embed-websocket-8.5.13.jar:8.5.13] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.springframework.boot.web.filter.ApplicationContextHeaderFilter.doFilterInternal(ApplicationContextHeaderFilter.java:55) [spring-boot-1.4.6.RELEASE.jar:1.4.6.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.8.RELEASE.jar:4.3.8.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:101) [spring-web-4.3.8.RELEASE.jar:4.3.8.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [tomcat-embed-core-8.5.13.jar:8.5.13] at com.xmcares.framework.security.author.UserContextHolderFilter.doFilter(UserContextHolderFilter.java:43) [xcf-foundation-security-2.7.0.7-20191111.084436-3.jar:2.7.0.7-SNAPSHOT] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [tomcat-embed-core-8.5.13.jar:8.5.13] at com.xmcares.framework.security.authen.AuthenticationPageFilter.doFilter(AuthenticationPageFilter.java:54) [xcf-foundation-security-2.7.0.7-20191111.084436-3.jar:2.7.0.7-SNAPSHOT] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:200) [spring-security-web-4.2.0.RELEASE.jar:4.2.0.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:101) [spring-web-4.3.8.RELEASE.jar:4.3.8.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.springframework.boot.actuate.trace.WebRequestTraceFilter.doFilterInternal(WebRequestTraceFilter.java:105) [spring-boot-actuator-1.4.6.RELEASE.jar:1.4.6.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.8.RELEASE.jar:4.3.8.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:317) [spring-security-web-4.2.0.RELEASE.jar:4.2.0.RELEASE] at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:127) [spring-security-web-4.2.0.RELEASE.jar:4.2.0.RELEASE] at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:91) [spring-security-web-4.2.0.RELEASE.jar:4.2.0.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) [spring-security-web-4.2.0.RELEASE.jar:4.2.0.RELEASE] at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:114) [spring-security-web-4.2.0.RELEASE.jar:4.2.0.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) [spring-security-web-4.2.0.RELEASE.jar:4.2.0.RELEASE] at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:137) [spring-security-web-4.2.0.RELEASE.jar:4.2.0.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) [spring-security-web-4.2.0.RELEASE.jar:4.2.0.RELEASE] at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111) [spring-security-web-4.2.0.RELEASE.jar:4.2.0.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) [spring-security-web-4.2.0.RELEASE.jar:4.2.0.RELEASE] at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:170) [spring-security-web-4.2.0.RELEASE.jar:4.2.0.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) [spring-security-web-4.2.0.RELEASE.jar:4.2.0.RELEASE] at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63) [spring-security-web-4.2.0.RELEASE.jar:4.2.0.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) [spring-security-web-4.2.0.RELEASE.jar:4.2.0.RELEASE] at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:200) [spring-security-web-4.2.0.RELEASE.jar:4.2.0.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) [spring-security-web-4.2.0.RELEASE.jar:4.2.0.RELEASE] at com.xmcares.framework.security.authen.AuthenticationPageFilter.doFilter(AuthenticationPageFilter.java:54) [xcf-foundation-security-2.7.0.7-20191111.084436-3.jar:2.7.0.7-SNAPSHOT] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) [spring-security-web-4.2.0.RELEASE.jar:4.2.0.RELEASE] at com.xmcares.framework.security.authen.CaptchaRequestFilter.doFilter(CaptchaRequestFilter.java:50) [xcf-foundation-security-2.7.0.7-20191111.084436-3.jar:2.7.0.7-SNAPSHOT] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) [spring-security-web-4.2.0.RELEASE.jar:4.2.0.RELEASE] at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:116) [spring-security-web-4.2.0.RELEASE.jar:4.2.0.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) [spring-security-web-4.2.0.RELEASE.jar:4.2.0.RELEASE] at org.springframework.web.filter.CorsFilter.doFilterInternal(CorsFilter.java:96) [spring-web-4.3.8.RELEASE.jar:4.3.8.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.8.RELEASE.jar:4.3.8.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) [spring-security-web-4.2.0.RELEASE.jar:4.2.0.RELEASE] at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:64) [spring-security-web-4.2.0.RELEASE.jar:4.2.0.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.8.RELEASE.jar:4.3.8.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) [spring-security-web-4.2.0.RELEASE.jar:4.2.0.RELEASE] at com.xmcares.framework.security.author.UserContextHolderFilter.doFilter(UserContextHolderFilter.java:57) [xcf-foundation-security-2.7.0.7-20191111.084436-3.jar:2.7.0.7-SNAPSHOT] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) [spring-security-web-4.2.0.RELEASE.jar:4.2.0.RELEASE] at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) [spring-web-4.3.8.RELEASE.jar:4.3.8.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.8.RELEASE.jar:4.3.8.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) [spring-security-web-4.2.0.RELEASE.jar:4.2.0.RELEASE] at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105) [spring-security-web-4.2.0.RELEASE.jar:4.2.0.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) [spring-security-web-4.2.0.RELEASE.jar:4.2.0.RELEASE] at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56) [spring-security-web-4.2.0.RELEASE.jar:4.2.0.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.8.RELEASE.jar:4.3.8.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) [spring-security-web-4.2.0.RELEASE.jar:4.2.0.RELEASE] at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:214) [spring-security-web-4.2.0.RELEASE.jar:4.2.0.RELEASE] at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:177) [spring-security-web-4.2.0.RELEASE.jar:4.2.0.RELEASE] at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346) [spring-web-4.3.8.RELEASE.jar:4.3.8.RELEASE] at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262) [spring-web-4.3.8.RELEASE.jar:4.3.8.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:105) [spring-web-4.3.8.RELEASE.jar:4.3.8.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.8.RELEASE.jar:4.3.8.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:81) [spring-web-4.3.8.RELEASE.jar:4.3.8.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.8.RELEASE.jar:4.3.8.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.springframework.session.web.http.SessionRepositoryFilter.doFilterInternal(SessionRepositoryFilter.java:167) [spring-session-1.3.1.RELEASE.jar:na] at org.springframework.session.web.http.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:80) [spring-session-1.3.1.RELEASE.jar:na] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197) [spring-web-4.3.8.RELEASE.jar:4.3.8.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.8.RELEASE.jar:4.3.8.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.springframework.boot.actuate.autoconfigure.MetricsFilter.doFilterInternal(MetricsFilter.java:106) [spring-boot-actuator-1.4.6.RELEASE.jar:1.4.6.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.8.RELEASE.jar:4.3.8.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:341) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:799) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:861) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1455) [tomcat-embed-core-8.5.13.jar:8.5.13] at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-8.5.13.jar:8.5.13] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_191] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_191] at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-8.5.13.jar:8.5.13] at java.lang.Thread.run(Thread.java:748) [na:1.8.0_191] Caused by: com.fasterxml.jackson.databind.JsonMappingException: No serializer found for class java.io.ByteArrayInputStream and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: com.xmcares.framework.common.response.CommonResponse["data"]->org.apache.poi.xssf.usermodel.XSSFWorkbook["packagePart"]->org.apache.poi.openxml4j.opc.ZipPackagePart["zipArchive"]->org.apache.poi.openxml4j.util.ZipInputStreamZipEntrySource$FakeZipEntry["inputStream"]) at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:284) ~[jackson-databind-2.8.8.jar:2.8.8] at com.fasterxml.jackson.databind.SerializerProvider.mappingException(SerializerProvider.java:1110) ~[jackson-databind-2.8.8.jar:2.8.8] at com.fasterxml.jackson.databind.SerializerProvider.reportMappingProblem(SerializerProvider.java:1135) ~[jackson-databind-2.8.8.jar:2.8.8] at com.fasterxml.jackson.databind.ser.impl.UnknownSerializer.failForEmpty(UnknownSerializer.java:69) ~[jackson-databind-2.8.8.jar:2.8.8] at com.fasterxml.jackson.databind.ser.impl.UnknownSerializer.serialize(UnknownSerializer.java:32) ~[jackson-databind-2.8.8.jar:2.8.8] at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:704) ~[jackson-databind-2.8.8.jar:2.8.8] at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:690) ~[jackson-databind-2.8.8.jar:2.8.8] at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:155) ~[jackson-databind-2.8.8.jar:2.8.8] at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:704) ~[jackson-databind-2.8.8.jar:2.8.8] at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:690) ~[jackson-databind-2.8.8.jar:2.8.8] at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:155) ~[jackson-databind-2.8.8.jar:2.8.8] at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:704) ~[jackson-databind-2.8.8.jar:2.8.8] at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:690) ~[jackson-databind-2.8.8.jar:2.8.8] at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:155) ~[jackson-databind-2.8.8.jar:2.8.8] at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:704) ~[jackson-databind-2.8.8.jar:2.8.8] at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:690) ~[jackson-databind-2.8.8.jar:2.8.8] at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:155) ~[jackson-databind-2.8.8.jar:2.8.8] at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:292) ~[jackson-databind-2.8.8.jar:2.8.8] at com.fasterxml.jackson.databind.ObjectMapper._configAndWriteValue(ObjectMapper.java:3681) ~[jackson-databind-2.8.8.jar:2.8.8] at com.fasterxml.jackson.databind.ObjectMapper.writeValue(ObjectMapper.java:3014) ~[jackson-databind-2.8.8.jar:2.8.8] at com.xmcares.framework.serviceful.servlet.fomater.CommonResponseWrappedMsgFormater.formatMsgInternal(CommonResponseWrappedMsgFormater.java:102) ~[xcf-foundation-security-2.7.0.7-20191111.084436-3.jar:2.7.0.7-SNAPSHOT] ... 118 common frames omitted ```
Java导出excel时怎么将文本格式转换为数字
Java导出excel时,它默认是文本格式,不能直接二做函数处理,怎么在代码中将他转为数值
java导出Excel时异常原因
org.apache.xmlbeans.SchemaTypeLoaderException: XML-BEANS compiled schema: Incompatible minor version - expecting up to 23, got 24 (schemaorg_apache_xmlbeans.system.sE130CAA0A01A7CDE5A2B4FEB8B311707.index) - code 3 at org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl$XsbReader.<init>(SchemaTypeSystemImpl.java:1522) at org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.initFromHeader(SchemaTypeSystemImpl.java:260) at org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.<init>(SchemaTypeSystemImpl.java:183) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at schemaorg_apache_xmlbeans.system.sE130CAA0A01A7CDE5A2B4FEB8B311707.TypeSystemHolder.loadTypeSystem(Unknown Source) at schemaorg_apache_xmlbeans.system.sE130CAA0A01A7CDE5A2B4FEB8B311707.TypeSystemHolder.<clinit>(Unknown Source) at sun.misc.Unsafe.ensureClassInitialized(Native Method) at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(UnsafeFieldAccessorFactory.java:25) at sun.reflect.ReflectionFactory.newFieldAccessor(ReflectionFactory.java:122) at java.lang.reflect.Field.acquireFieldAccessor(Field.java:918) at java.lang.reflect.Field.getFieldAccessor(Field.java:899) at java.lang.reflect.Field.get(Field.java:358) at org.apache.xmlbeans.XmlBeans.typeSystemForClassLoader(XmlBeans.java:770) at org.openxmlformats.schemas.spreadsheetml.x2006.main.CTWorkbook.<clinit>(Unknown Source) at org.openxmlformats.schemas.spreadsheetml.x2006.main.CTWorkbook$Factory.newInstance(Unknown Source) at org.apache.poi.xssf.usermodel.XSSFWorkbook.onWorkbookCreate(XSSFWorkbook.java:321) at org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:181) at com.zlkj.ywgl.action.VioSurveilAction.outVioSurveilOrMidExcel(VioSurveilAction.java:712) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.web.servlet.mvc.multiaction.MultiActionController.invokeNamedMethod(MultiActionController.java:471) at org.springframework.web.servlet.mvc.multiaction.MultiActionController.handleRequestInternal(MultiActionController.java:408) at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153) at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:771) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:716) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560) at javax.servlet.http.HttpServlet.service(HttpServlet.java:650) at javax.servlet.http.HttpServlet.service(HttpServlet.java:731) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1079) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:619)
java导出word导出的word报错
显示这个错误:元素结束标记中的名称必须与开始标记中的元素类型相匹配。 但文件用代码的形式打开后数据没有问题 求大神解决![图片说明](https://img-ask.csdn.net/upload/201912/11/1576030920_500568.png)报的错误在ftl模板里面是这个的错误
Java导出excel并且可以对导出数据实现三级联动?
现在有一个数据库表,问一下大家怎么用Java导出到excel,然后,表格中可以对数据进行下拉选择,下拉选择还可以实现三级联动?
java 导出excel,直接打开,而不要提示 保存/打开,怎么实现
java 导出excel,直接打开,而不要提示 保存/打开,怎么实现
java poi导出excel文档 后台报下标越界 但文档正常导出且损坏
public static SXSSFWorkbook createCSVUtil2(int startRow, String sheetName, SXSSFWorkbook wb, Map<String, List<CellModel>> cellListMap, Integer cellRowNum, List<LinkedHashMap> exportData, int[] columnWidth, int totalcolumn, GgreportingtemplateDto ggreportingtemplateDto, int countRow) throws Exception { // 设置表格名称 SXSSFSheet sheet = (SXSSFSheet) wb.createSheet(sheetName); sheet.trackAllColumnsForAutoSizing(); // 设置表格标题 一般都是第一行第一个格子 // 标题样式 if (ggreportingtemplateDto.getTitle() != null) { XSSFCellStyle cellStyleTitle = (XSSFCellStyle) wb.createCellStyle(); cellStyleTitle.setWrapText(true); SXSSFRow rowTitle = (SXSSFRow) sheet.createRow(0); XSSFFont fontTitle = (XSSFFont) wb.createFont(); fontTitle.setFontHeightInPoints((short) 16); cellStyleTitle.setFont(fontTitle); // 合并标题单元格 sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, totalcolumn - 1)); for (int i = 0; i < totalcolumn; i++) { if (i == 0) { SXSSFCell cell = (SXSSFCell) rowTitle.createCell(0); cell.setCellValue(ggreportingtemplateDto.getTitle()); cell.setCellStyle(cellStyleTitle); } else { SXSSFCell cell = (SXSSFCell) rowTitle.createCell(i); cell.setCellStyle(cellStyleTitle); } } } if (ggreportingtemplateDto.getCondition() != null) { // 设置筛选条件格子 一般是第二行第一列 // 条件样式 XSSFCellStyle cellStyleCondition = (XSSFCellStyle) wb.createCellStyle(); cellStyleCondition.setWrapText(true); SXSSFRow rowCondition = (SXSSFRow) sheet.createRow(1); XSSFFont fontCondition = (XSSFFont) wb.createFont(); fontCondition.setFontHeightInPoints((short) 16); cellStyleCondition.setFont(fontCondition); // 合并条件单元格 sheet.addMergedRegion(new CellRangeAddress(1, 1, 0, 4)); for (int i = 0; i < 4; i++) { if (i == 0) { SXSSFCell cell = (SXSSFCell) rowCondition.createCell(0); cell.setCellValue(ggreportingtemplateDto.getCondition()); cell.setCellStyle(cellStyleCondition); } else { SXSSFCell cell = (SXSSFCell) rowCondition.createCell(i); cell.setCellStyle(cellStyleCondition); } } } // 设置表格通用样式 XSSFCellStyle cellStyle = (XSSFCellStyle) wb.createCellStyle(); // 设置边框 // 设置单元格内容水平对齐 cellStyle.setAlignment(XSSFCellStyle.ALIGN_CENTER); // 设置单元格内容垂直对齐 cellStyle.setVerticalAlignment(XSSFCellStyle.VERTICAL_CENTER); // 设置自动换行 cellStyle.setWrapText(true); // 设置双边框 XSSFCellStyle cellStyleDouble = (XSSFCellStyle) wb.createCellStyle(); // 设置边框 // 设置单元格内容水平对齐 cellStyleDouble.setAlignment(XSSFCellStyle.ALIGN_CENTER); // 设置单元格内容垂直对齐 cellStyleDouble.setVerticalAlignment(XSSFCellStyle.VERTICAL_CENTER); // 设置自动换行 cellStyleDouble.setWrapText(true); // 合并单元格 for (int t = 0; t < cellRowNum; t++) { SXSSFRow row = (SXSSFRow) sheet.createRow(t + startRow); List<CellModel> cellNameList = cellListMap.get(String.valueOf(t)); for (CellModel cellModel : cellNameList) { // 如果被合并的元素只占用了一个单元格则不进行合并 if (cellModel.getStartColumn() == cellModel.getEndColumn() && cellModel.getEndRow() == cellModel.getStartRow()) { continue; } sheet.addMergedRegion(new CellRangeAddress(cellModel.getStartRow(), cellModel.getEndRow(), cellModel.getStartColumn(), cellModel.getEndColumn())); } // create的cell Set<Integer> create = new HashSet<Integer>(); for (int i = 0; i < cellNameList.size(); i++) { CellModel cellModel = cellNameList.get(i); // 遍历插入表头 SXSSFCell cell = (SXSSFCell) row.createCell(cellModel.getStartColumn()); // 设置字体 XSSFFont font = (XSSFFont) wb.createFont(); font.setFontName("Times New Roman"); font.setFontHeightInPoints((short) 8); // 设置行高 if (i == 1) { row.setHeight((short) 500); } cellStyle.setFont(font); cell.setCellValue(cellModel.getCellName()); cell.setCellStyle(cellStyle); create.add(cellModel.getStartColumn()); } // 把所有没有create的cell都create for (int i = 0; i < totalcolumn; i++) { if (!(create.contains(i))) { // 设置字体 XSSFFont font = (XSSFFont) wb.createFont(); font.setFontName("Times New Roman"); font.setFontHeightInPoints((short) 8); cellStyle.setFont(font); SXSSFCell cell = (SXSSFCell) row.createCell(i); cell.setCellStyle(cellStyle); } } } for (LinkedHashMap hashMap : exportData) { SXSSFRow rowValue = (SXSSFRow) sheet.createRow(cellRowNum + startRow); Iterator<Map.Entry> iteratorRow = hashMap.entrySet().iterator(); while (iteratorRow.hasNext()) { Map.Entry entryRow = iteratorRow.next(); Integer key = Integer.valueOf(entryRow.getKey().toString()); String value = ""; if (entryRow.getValue() != null) { value = entryRow.getValue().toString(); } else { value = ""; } SXSSFCell cellValue = (SXSSFCell) rowValue.createCell(key - 1); // 设置字体 XSSFFont font = (XSSFFont) wb.createFont(); font.setFontName("Times New Roman"); font.setFontHeightInPoints((short) 8); cellValue.setCellValue(value); cellStyle.setFont(font); cellValue.setCellStyle(cellStyle); } cellRowNum++; } // 设置备注栏 List<String> reMarkList = ggreportingtemplateDto.getRemake(); if (reMarkList != null) { for (int i = 0; i < reMarkList.size() + 1; i++) { int rowNum = i + startRow + cellRowNum + 1; XSSFCellStyle cellStyleRemake = (XSSFCellStyle) wb.createCellStyle(); SXSSFRow rowRemake = (SXSSFRow) sheet.createRow(rowNum); XSSFFont fontRemake = (XSSFFont) wb.createFont(); fontRemake.setFontHeightInPoints((short) 8); cellStyleRemake.setFont(fontRemake); String cellValue = "Notes:"; // 合并条件单元格 if (i != 0) { sheet.addMergedRegion(new CellRangeAddress(rowNum, rowNum, 0, 4)); cellValue = reMarkList.get(i - 1); SXSSFCell cell = (SXSSFCell) rowRemake.createCell(0); cell.setCellValue(cellValue); cell.setCellStyle(cellStyleRemake); } else { SXSSFCell cell = (SXSSFCell) rowRemake.createCell(0); cell.setCellValue(cellValue); cell.setCellStyle(cellStyleRemake); } } } // 设置列宽 if (columnWidth != null) { for (int i = 0; i < columnWidth.length; i++) { sheet.setColumnWidth(i, columnWidth[i]); } } return wb; } 以上是我生成sheet表的内容 //exceptional Rpt public SXSSFWorkbook exceptionalRpt (GgreportingtemplateDto ggreportingtemplateDto, String startInputDate,String endInputDate) throws Exception { // 设置最大数据行数 SXSSFWorkbook wb = new SXSSFWorkbook(5050);//这里之前看到是说能设置这个表格最多能含有多少数据 Map<String, List<CellModel>> map = new HashMap<String, List<CellModel>>(); // 设置数据 // 第一级表头 List<CellModel> firstRow = new ArrayList<CellModel>(); CellModel cellModel1 = new CellModel(); // 总占用1行 Integer cellRow = 1; cellModel1.setCellName("Member English Name"); cellModel1.setStartRow(0); cellModel1.setEndRow(0); cellModel1.setStartColumn(0); cellModel1.setEndColumn(0); CellModel cellModel2 = new CellModel(); cellModel2.setCellName("Member Chinese Name"); cellModel2.setStartRow(0); cellModel2.setEndRow(0); cellModel2.setStartColumn(1); cellModel2.setEndColumn(1); CellModel cellModel3 = new CellModel(); cellModel3.setCellName("Staff No."); cellModel3.setStartRow(0); cellModel3.setEndRow(0); cellModel3.setStartColumn(2); cellModel3.setEndColumn(2); CellModel cellModel4 = new CellModel(); cellModel4.setCellName("HKID/Passport No."); cellModel4.setStartRow(0); cellModel4.setEndRow(0); cellModel4.setStartColumn(3); cellModel4.setEndColumn(3); CellModel cellModel5 = new CellModel(); cellModel5.setCellName("Sex"); cellModel5.setStartRow(0); cellModel5.setEndRow(0); cellModel5.setStartColumn(4); cellModel5.setEndColumn(4); CellModel cellModel6 = new CellModel(); cellModel6.setCellName("Plan Code"); cellModel6.setStartRow(0); cellModel6.setEndRow(0); cellModel6.setStartColumn(5); cellModel6.setEndColumn(5); CellModel cellModel7 = new CellModel(); cellModel7.setCellName("Plan Description"); cellModel7.setStartRow(0); cellModel7.setEndRow(0); cellModel7.setStartColumn(6); cellModel7.setEndColumn(6); CellModel cellModel8 = new CellModel(); cellModel8.setCellName("Effective Date"); cellModel8.setStartRow(0); cellModel8.setEndRow(0); cellModel8.setStartColumn(7); cellModel8.setEndColumn(7); CellModel cellModel9 = new CellModel(); cellModel9.setCellName("Status"); cellModel9.setStartRow(0); cellModel9.setEndRow(0); cellModel9.setStartColumn(8); cellModel9.setEndColumn(8); firstRow.add(cellModel1); firstRow.add(cellModel2); firstRow.add(cellModel3); firstRow.add(cellModel4); firstRow.add(cellModel5); firstRow.add(cellModel6); firstRow.add(cellModel7); firstRow.add(cellModel8); firstRow.add(cellModel9); map.put("0", firstRow); // 业务数据 List<LinkedHashMap> exportData = new ArrayList<LinkedHashMap>(); GuPolicyCopyItemMedgMembDto guPolicyCopyItemMedgMembDto = new GuPolicyCopyItemMedgMembDto(); List<GuPolicyCopyItemMedgMembDto> list = ServiceManager.prpall.getGuPolicyCopyItemMedgMembService().findALL(guPolicyCopyItemMedgMembDto, null);//这里查询出来是295条 //增加数据 用这端代码增加5000条数据 /*for (int i = 0; i < 5000; i++) { list.add((GuPolicyCopyItemMedgMembDto)list.get(0)); }*/ int countRow = 0; for (int i = 0; i < list.size(); i++) { GuPolicyCopyItemMedgMembDto data = (GuPolicyCopyItemMedgMembDto) list.get(i); LinkedHashMap<String,String> row = new LinkedHashMap<String,String>(); String struts = ""; String ename = ""; String cname = ""; String idno = ""; String staffno = ""; String sex = ""; String rationType = ""; String rationName = ""; String entryDate = ""; String chineseName = ""; String hKIDandPassportNo = ""; if(data.getFlag()==null||data.getFlag().equals("I")) { struts = "Add"; }else if(data.getFlag().equals("U")){ struts = "Amendment"; }else if(data.getFlag().equals("D")){ struts = "Deletion"; }else if(data.getFlag().equals("B")){ struts = "Cancellation"; } if(data.getClientEName() != null&&!(data.getClientEName().equals(""))) { ename = data.getClientEName(); } if(data.getClientCName() != null&&!(data.getClientCName().equals(""))) { cname = data.getClientCName(); } if(data.getIdNo() != null&&!(data.getIdNo().equals(""))) { idno = data.getIdNo(); } if(data.getStaffNo() != null&&!(data.getStaffNo().equals(""))) { staffno = data.getStaffNo(); } if(data.getSex() != null&&!(data.getSex().equals(""))) { sex = data.getSex(); } if(data.getRationType() != null&&!(data.getRationType().equals(""))) { rationType = data.getRationType(); } if(data.getRationName() != null&&!(data.getRationName().equals(""))) { rationName = data.getRationName(); } if(data.getEntryDate() != null) { entryDate = sim.format(data.getEntryDate()); } /*row.put("1", ""+ename+""); row.put("2", ""+cname+""); row.put("3", ""+staffno+""); row.put("4", ""+idno+""); row.put("5", ""+sex+""); row.put("6", ""+rationType+""); row.put("7", ""+rationName+""); row.put("8", ""+entryDate+""); row.put("9", ""+struts+"");*/ row.put("1", "1"); row.put("2", "2"); row.put("3", "3"); row.put("4", "4"); row.put("5", "5"); row.put("6", "6"); row.put("7", "7"); row.put("8", "8"); row.put("9", "9"); exportData.add(row); countRow++; } // 用于写入文件 // 列宽数组 int[] columnWidth = { 10000, 7500, 5000, 7500, 5000, 7500, 10000, 5000, 5000 }; // 报表标题 ggreportingtemplateDto.setTitle(null); List<String> remakeList = null; // 报表备注 ggreportingtemplateDto.setRemake(remakeList); ggreportingtemplateDto.setCondition(null); //数据分页 if(exportData.size()>5000) { double size = exportData.size(); double divisor = size/5000; int forNumber = (new Double(Math.ceil(divisor))).intValue(); for (int i = 0; i < forNumber; i++) { if((i+1)==forNumber) { List<LinkedHashMap> exportDataTemp = exportData.subList(0+(i*5000), exportData.size()-1); wb = this.createCSVUtil2(0, "Exceptional Rpt"+(i+1), wb, map, cellRow, exportDataTemp, columnWidth, columnWidth.length, ggreportingtemplateDto, 0); }else { List<LinkedHashMap> exportDataTemp = exportData.subList(0+(i*5000), 5000+(i*5000 )); wb = this.createCSVUtil2(0, "Exceptional Rpt"+(i+1), wb, map, cellRow, exportDataTemp, columnWidth, columnWidth.length, ggreportingtemplateDto, 0); } } }else { wb = this.createCSVUtil2(0, "Exceptional Rpt", wb, map, cellRow, exportData, columnWidth, columnWidth.length, ggreportingtemplateDto, 0); } /*wb = this.createCSVUtil2(0, "Exceptional Rpt", wb, map, cellRow, exportData, columnWidth, columnWidth.length, ggreportingtemplateDto, 0);*/ return wb; } 一开始SXSSFWorkbook wb = new SXSSFWorkbook(5050)这里的值给的5000 ,然后当数据量大于5000时直接报错,文件不能正常导出,然后我把5000改成7000,会报错但是文件能导出,是损坏文件,一条数据都没有,后来修改成分页导出,自己测试的时候任然报了数组下标越界,且越界的下标为负值,文件能正常导出,但导出的文件显示已损坏,看不到数据。报错代码图片以上传,求大神解答,解答有效我微信转账请大神喝奶茶 java.lang.ArrayIndexOutOfBoundsException: -20527 at java.util.ArrayList.elementData(ArrayList.java:418) at java.util.ArrayList.get(ArrayList.java:431) at org.apache.poi.xssf.model.StylesTable.getFontAt(StylesTable.java:386) at org.apache.poi.xssf.usermodel.XSSFWorkbook.getFontAt(XSSFWorkbook.java:954) at org.apache.poi.xssf.streaming.SXSSFWorkbook.getFontAt(SXSSFWorkbook.java:857) at org.apache.poi.ss.util.SheetUtil.getCellWidth(SheetUtil.java:148) at org.apache.poi.xssf.streaming.AutoSizeColumnTracker.updateColumnWidth(AutoSizeColumnTracker.java:367) at org.apache.poi.xssf.streaming.AutoSizeColumnTracker.updateColumnWidths(AutoSizeColumnTracker.java:333) at org.apache.poi.xssf.streaming.SXSSFSheet.flushOneRow(SXSSFSheet.java:1892) at org.apache.poi.xssf.streaming.SXSSFSheet.flushRows(SXSSFSheet.java:1871) at org.apache.poi.xssf.streaming.SXSSFSheet.flushRows(SXSSFSheet.java:1882) at org.apache.poi.xssf.streaming.SXSSFWorkbook.write(SXSSFWorkbook.java:931) at com.sinosoft.application.platform.web.action.GgReportingTemplateAction.download(GgReportingTemplateAction.java:267) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.sinosoft.application.common.BaseProcessAction.execute(BaseProcessAction.java:213) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:216) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:117) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432) at javax.servlet.http.HttpServlet.service(HttpServlet.java:661) at javax.servlet.http.HttpServlet.service(HttpServlet.java:742) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:198) at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:176) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:265) at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107) at org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:124) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) at org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:81) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) at org.acegisecurity.ui.logout.LogoutFilter.doFilter(LogoutFilter.java:110) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:149) at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at com.sinosoft.application.common.CAS_LANGUATE.doFilter(CAS_LANGUATE.java:35) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at com.sinosoft.sysframework.web.control.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:99) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at com.sinosoft.application.common.CompatibleFilter.doFilter(CompatibleFilter.java:29) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at com.sinosoft.application.common.ValidateSalt.doFilter(ValidateSalt.java:56) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:160) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at com.sinosoft.application.common.LoadSalt.doFilter(LoadSalt.java:41) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:660) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:798) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:808) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) 此问题已解决,导致报错的原因是sheet.trackAllColumnsForAutoSizing();poi自动设置列宽的代码,注释这行之后问题解决。
java导出Excel使用的XSSF
java导出Excel怎么设置样式使用的是XSSF // 声明一个工作薄 XSSFWorkbook workbook = new XSSFWorkbook(); // 生成一个表格 XSSFSheet sheet = workbook.createSheet(fileName); // 设置表格默认列宽度为15个字节 sheet.setDefaultColumnWidth((short) 15);
java导出excel时数据如何自动生成透视图
java导出excel时数据如何自动生成透视图:向execl模板中添加数据,怎么自动生成透视图和雷达图?
java导出的word文档怎么拼接上另一个word文件的内容
现在项目中,java导出word的方式是利用freemarket的template.poccess方式,以xml格式的doc文件作为模板来导出, 可最近有个新的需求,要在导出的word文件第一页加上首页内容,首页内容是另一个word文件的内容。我试过该word 转为xml,然后用变量来接收<w:body>节点里面的内容,在模板<w:body>位置中使用该变量,可是不起作用。不知道这种 需求有没有哪位大神帮给个思想。
Java导出excel表格直接使用脚本打开不使用转存应该怎么做呢
Java导出excel表格不使用转存的有哪些方法呢,不使用转存,直接打开脚本
JAVA中导出excel的公用类的方法怎么调用?
1.我想导出前端查询后的数据,然后将数据导出到excel中,在网上查到有一个公用的方法,我创建了,但是我不会调用。请各位大神帮助下,谢谢了。刚开始学习java的小白。 2.疑问:controller(这个不会写)怎么调用这个方法呢? 3.环境:Java后端+vue前端(前端过滤后的数据进行导出) 如下为controller,这个确实不会写,请各位大神帮助下。谢谢。 ``` @RequestMapping("/exportExcel") //@ApiOperation("数据导出excel") @ResponseBody public R download(@RequestParam Map<String, Object> params){ //exportSsExcel(String tempPath, String path, HttpServletResponse response, List<T> list, int count) //获取日期类型根据类型分发业务 String energy_name = MapUtil.getStr(map,"tempPath"); String to_build = MapUtil.getStr(map,"path"); } ``` 如下为共用类ExcelUtils中的导出方法。 ``` public void exportSsExcel(String tempPath, String path, HttpServletResponse response, List<T> list, int count) { File newFile = createNewFile(tempPath, path); InputStream is = null; HSSFWorkbook workbook = null; HSSFSheet sheet = null; try { is = new FileInputStream(newFile);// 将excel文件转为输入流 workbook = new HSSFWorkbook(is);// 创建个workbook, // 获取第一个sheet sheet = workbook.getSheetAt(0); } catch (Exception e1) { e1.printStackTrace(); } if (sheet != null) { try { // 写数据 FileOutputStream fos = new FileOutputStream(newFile); HSSFRow row = sheet.getRow(0); if (row == null) { row = sheet.createRow(0); } HSSFCell cell = row.getCell(0); if (cell == null) { cell = row.createCell(0); } //cell.setCellValue("我是标题"); for (int i = 0; i < list.size(); i++) { T vo1 = list.get(i); row = sheet.createRow(i+count); //从第count行开始 //这里就可以使用sysUserMapper,做相应的操作 Field[] fields=vo1.getClass().getDeclaredFields(); for(int j=0;j<fields.length;j++){ String firstLetter = fields[j].getName().substring(0, 1).toUpperCase(); String getter = "get" + firstLetter + fields[j].getName().substring(1); Method method = vo1.getClass().getMethod(getter, new Class[] {}); if(fields[j].getGenericType().toString().equals("class java.util.Date")){ Object value =method.invoke(vo1, new Object[] {}); if(value!=null){ Date date =(Date)value; createRowAndCell(format.format(date), row, cell, j); }else { createRowAndCell(value, row, cell, j); } }else { createRowAndCell(method.invoke(vo1, new Object[] {}), row, cell, j); } } } workbook.write(fos); fos.flush(); fos.close(); // 下载 InputStream fis = new BufferedInputStream(new FileInputStream( newFile)); byte[] buffer = new byte[fis.available()]; fis.read(buffer); fis.close(); response.reset(); response.setContentType("text/html;charset=UTF-8"); OutputStream toClient = new BufferedOutputStream( response.getOutputStream()); response.setContentType("application/x-msdownload"); String newName = URLEncoder.encode( "防火漏电" + System.currentTimeMillis() + ".xls", "UTF-8"); response.addHeader("Content-Disposition", "attachment;filename=\"" + newName + "\""); response.addHeader("Content-Length", "" + newFile.length()); toClient.write(buffer); toClient.flush(); } catch (Exception e) { e.printStackTrace(); } finally { try { if (null != is) { is.close(); } } catch (Exception e) { e.printStackTrace(); } } } // 删除创建的新文件 this.deleteFile(newFile); } ```
java导出excel时的数据换行问题
java中做页面中表单的excel导出功能(表单数据通过sql查询),表单的其中一列是通过字符串的拼接形成的,为了页面的美观,在sql中拼接该字符串时,根据分隔号拼接<br/>标签,使其可以在页面上显示出多条记录分行的效果。但是由于excel导出用的sql和页面展示用的sql是同一句,因此在导出的excel中该列的显示会出现xxxx<br/>xxx的情况。 目前是处理方式是通过同样的方法拼接一个字段,但是不拼接<br/>,在页面显示中使用拼接了<br/>的,在导出时取的数据来自于不拼接<br/>的。但是这样的话,在导出的excel中就显示成同一行了,请问有没有办法在sql中添加excel导出换行的功能?另外希望可以直接通过修改拼接<br/>的那个字段就行,毕竟同样的字段写两个,是挺影响性能的,谢谢! 初来乍到,还木有c币,只能表达谢意了!再次感谢!
java导出jar,如何让jar文件不管放在那个文件夹下都能获取它自己的绝对路径
在写一个调用其他exe的小程序,java导出jar,如何让jar文件不管放在那个文件夹下都能获取它自己的绝对路径,小白一枚,求大神解答
java导出的PDF和ireport预览时生成的PD字体的样式大小都不一样
我在用ireport做报表,报表是PDF格式的,报表已经做好了,而且预览的时候没有问题,但是用java导出PDF的时候,导出的PDF和我设计的字体的大小和样式,还有格式都不一样,和预览的效果也不一样,求大神指点
java执行EXP导出Oracle数据库并没有导出的文件生成
#### java执行EXP导出Oracle数据库并没有导出的文件生成 在网上搜了很多方法都没有解决 ```java public static boolean EXP() { Runtime rt = Runtime.getRuntime(); try { Process p = rt.exec("cmd.exe EXP u/p@db..com:1521/ORCL FILE =D:\\ORACLE\\daochu.dmp tables=(AS_14)"); InputStream inputStream = p.getInputStream(); InputStream errorStream = p.getErrorStream(); writeToLocal("D:\\ORACLE\\zhengque.txt", inputStream); inputStream.close(); writeToLocal("D:\\ORACLE\\cuowu.txt", errorStream); errorStream.close(); } catch (IOException e) { e.printStackTrace(); } return false; } private static void writeToLocal(String destination, InputStream input) throws IOException { int index; byte[] bytes = new byte[1024]; FileOutputStream downloadFile = new FileOutputStream(destination); while ((index = input.read(bytes)) != -1) { downloadFile.write(bytes, 0, index); downloadFile.flush(); } downloadFile.close(); input.close(); return; } ```
java Excel导出 怎么设置某一列靠左对齐 其它靠右对齐啊?
java Excel导出 怎么设置某一列靠左对齐 其它靠右对齐啊?还要自动换行 "\r\n" 没用
java导出Excel表到服务器指定目录
目前已支持导出到本地客户端,如何改动让他可以导出到服务器端?
java导出EXCEL模板列属性设置
java导出一个EXCEL模板。 (使用Jxl或POI) 用户拿到这个模板后使用,其中有一列是“身份证号码” 输入340121198501111111,结果显示3.40121E+17。 查明应把格式设置为文本格式, 我想将导出的模板的“身份证号码”整个一列设置成文本类型怎么做? [b]问题补充:[/b] 有没有能用Jxl能实现的啊..... [b]问题补充:[/b] 有没有能用Jxl能实现的啊.....
爬虫福利二 之 妹子图网MM批量下载
爬虫福利一:27报网MM批量下载    点击 看了本文,相信大家对爬虫一定会产生强烈的兴趣,激励自己去学习爬虫,在这里提前祝:大家学有所成! 目标网站:妹子图网 环境:Python3.x 相关第三方模块:requests、beautifulsoup4 Re:各位在测试时只需要将代码里的变量 path 指定为你当前系统要保存的路径,使用 python xxx.py 或IDE运行即可。
Java学习的正确打开方式
在博主认为,对于入门级学习java的最佳学习方法莫过于视频+博客+书籍+总结,前三者博主将淋漓尽致地挥毫于这篇博客文章中,至于总结在于个人,实际上越到后面你会发现学习的最好方式就是阅读参考官方文档其次就是国内的书籍,博客次之,这又是一个层次了,这里暂时不提后面再谈。博主将为各位入门java保驾护航,各位只管冲鸭!!!上天是公平的,只要不辜负时间,时间自然不会辜负你。 何谓学习?博主所理解的学习,它
程序员必须掌握的核心算法有哪些?
由于我之前一直强调数据结构以及算法学习的重要性,所以就有一些读者经常问我,数据结构与算法应该要学习到哪个程度呢?,说实话,这个问题我不知道要怎么回答你,主要取决于你想学习到哪些程度,不过针对这个问题,我稍微总结一下我学过的算法知识点,以及我觉得值得学习的算法。这些算法与数据结构的学习大多数是零散的,并没有一本把他们全部覆盖的书籍。下面是我觉得值得学习的一些算法以及数据结构,当然,我也会整理一些看过
大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了
大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、PDF搜索网站推荐 对于大部
linux系列之常用运维命令整理笔录
本博客记录工作中需要的linux运维命令,大学时候开始接触linux,会一些基本操作,可是都没有整理起来,加上是做开发,不做运维,有些命令忘记了,所以现在整理成博客,当然vi,文件操作等就不介绍了,慢慢积累一些其它拓展的命令,博客不定时更新 顺便拉下票,我在参加csdn博客之星竞选,欢迎投票支持,每个QQ或者微信每天都可以投5票,扫二维码即可,http://m234140.nofollow.ax.
Vue + Spring Boot 项目实战(十四):用户认证方案与完善的访问拦截
本篇文章主要讲解 token、session 等用户认证方案的区别并分析常见误区,以及如何通过前后端的配合实现完善的访问拦截,为下一步权限控制的实现打下基础。
比特币原理详解
一、什么是比特币 比特币是一种电子货币,是一种基于密码学的货币,在2008年11月1日由中本聪发表比特币白皮书,文中提出了一种去中心化的电子记账系统,我们平时的电子现金是银行来记账,因为银行的背后是国家信用。去中心化电子记账系统是参与者共同记账。比特币可以防止主权危机、信用风险。其好处不多做赘述,这一层面介绍的文章很多,本文主要从更深层的技术原理角度进行介绍。 二、问题引入  假设现有4个人
程序员接私活怎样防止做完了不给钱?
首先跟大家说明一点,我们做 IT 类的外包开发,是非标品开发,所以很有可能在开发过程中会有这样那样的需求修改,而这种需求修改很容易造成扯皮,进而影响到费用支付,甚至出现做完了项目收不到钱的情况。 那么,怎么保证自己的薪酬安全呢? 我们在开工前,一定要做好一些证据方面的准备(也就是“讨薪”的理论依据),这其中最重要的就是需求文档和验收标准。一定要让需求方提供这两个文档资料作为开发的基础。之后开发
网页实现一个简单的音乐播放器(大佬别看。(⊙﹏⊙))
今天闲着无事,就想写点东西。然后听了下歌,就打算写个播放器。 于是乎用h5 audio的加上js简单的播放器完工了。 欢迎 改进 留言。 演示地点跳到演示地点 html代码如下`&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;music&lt;/title&gt; &lt;meta charset="utf-8"&gt
Python十大装B语法
Python 是一种代表简单思想的语言,其语法相对简单,很容易上手。不过,如果就此小视 Python 语法的精妙和深邃,那就大错特错了。本文精心筛选了最能展现 Python 语法之精妙的十个知识点,并附上详细的实例代码。如能在实战中融会贯通、灵活使用,必将使代码更为精炼、高效,同时也会极大提升代码B格,使之看上去更老练,读起来更优雅。 1. for - else 什么?不是 if 和 else 才
数据库优化 - SQL优化
前面一篇文章从实例的角度进行数据库优化,通过配置一些参数让数据库性能达到最优。但是一些“不好”的SQL也会导致数据库查询变慢,影响业务流程。本文从SQL角度进行数据库优化,提升SQL运行效率。 判断问题SQL 判断SQL是否有问题时可以通过两个表象进行判断: 系统级别表象 CPU消耗严重 IO等待严重 页面响应时间过长
2019年11月中国大陆编程语言排行榜
2019年11月2日,我统计了某招聘网站,获得有效程序员招聘数据9万条。针对招聘信息,提取编程语言关键字,并统计如下: 编程语言比例 rank pl_ percentage 1 java 33.62% 2 c/c++ 16.42% 3 c_sharp 12.82% 4 javascript 12.31% 5 python 7.93% 6 go 7.25% 7
通俗易懂地给女朋友讲:线程池的内部原理
餐厅的约会 餐盘在灯光的照耀下格外晶莹洁白,女朋友拿起红酒杯轻轻地抿了一小口,对我说:“经常听你说线程池,到底线程池到底是个什么原理?”我楞了一下,心里想女朋友今天是怎么了,怎么突然问出这么专业的问题,但做为一个专业人士在女朋友面前也不能露怯啊,想了一下便说:“我先给你讲讲我前同事老王的故事吧!” 大龄程序员老王 老王是一个已经北漂十多年的程序员,岁数大了,加班加不动了,升迁也无望,于是拿着手里
经典算法(5)杨辉三角
写在前面: 我是 扬帆向海,这个昵称来源于我的名字以及女朋友的名字。我热爱技术、热爱开源、热爱编程。技术是开源的、知识是共享的。 这博客是对自己学习的一点点总结及记录,如果您对 Java、算法 感兴趣,可以关注我的动态,我们一起学习。 用知识改变命运,让我们的家人过上更好的生活。 目录一、杨辉三角的介绍二、杨辉三角的算法思想三、代码实现1.第一种写法2.第二种写法 一、杨辉三角的介绍 百度
腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹?
昨天,有网友私信我,说去阿里面试,彻底的被打击到了。问了为什么网上大量使用ThreadLocal的源码都会加上private static?他被难住了,因为他从来都没有考虑过这个问题。无独有偶,今天笔者又发现有网友吐槽了一道腾讯的面试题,我们一起来看看。 腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹? 在互联网职场论坛,一名程序员发帖求助到。二面腾讯,其中一个算法题:64匹
面试官:你连RESTful都不知道我怎么敢要你?
面试官:了解RESTful吗? 我:听说过。 面试官:那什么是RESTful? 我:就是用起来很规范,挺好的 面试官:是RESTful挺好的,还是自我感觉挺好的 我:都挺好的。 面试官:… 把门关上。 我:… 要干嘛?先关上再说。 面试官:我说出去把门关上。 我:what ?,夺门而去 文章目录01 前言02 RESTful的来源03 RESTful6大原则1. C-S架构2. 无状态3.统一的接
为啥国人偏爱Mybatis,而老外喜欢Hibernate/JPA呢?
关于SQL和ORM的争论,永远都不会终止,我也一直在思考这个问题。昨天又跟群里的小伙伴进行了一番讨论,感触还是有一些,于是就有了今天这篇文。 声明:本文不会下关于Mybatis和JPA两个持久层框架哪个更好这样的结论。只是摆事实,讲道理,所以,请各位看官勿喷。 一、事件起因 关于Mybatis和JPA孰优孰劣的问题,争论已经很多年了。一直也没有结论,毕竟每个人的喜好和习惯是大不相同的。我也看
SQL-小白最佳入门sql查询一
一 说明 如果是初学者,建议去网上寻找安装Mysql的文章安装,以及使用navicat连接数据库,以后的示例基本是使用mysql数据库管理系统; 二 准备前提 需要建立一张学生表,列分别是id,名称,年龄,学生信息;本示例中文章篇幅原因SQL注释略; 建表语句: CREATE TABLE `student` ( `id` int(11) NOT NULL AUTO_INCREMENT, `
项目中的if else太多了,该怎么重构?
介绍 最近跟着公司的大佬开发了一款IM系统,类似QQ和微信哈,就是聊天软件。我们有一部分业务逻辑是这样的 if (msgType = "文本") { // dosomething } else if(msgType = "图片") { // doshomething } else if(msgType = "视频") { // doshomething } else { // dosho
“狗屁不通文章生成器”登顶GitHub热榜,分分钟写出万字形式主义大作
一、垃圾文字生成器介绍 最近在浏览GitHub的时候,发现了这样一个骨骼清奇的雷人项目,而且热度还特别高。 项目中文名:狗屁不通文章生成器 项目英文名:BullshitGenerator 根据作者的介绍,他是偶尔需要一些中文文字用于GUI开发时测试文本渲染,因此开发了这个废话生成器。但由于生成的废话实在是太过富于哲理,所以最近已经被小伙伴们给玩坏了。 他的文风可能是这样的: 你发现,
程序员:我终于知道post和get的区别
IT界知名的程序员曾说:对于那些月薪三万以下,自称IT工程师的码农们,其实我们从来没有把他们归为我们IT工程师的队伍。他们虽然总是以IT工程师自居,但只是他们一厢情愿罢了。 此话一出,不知激起了多少(码农)程序员的愤怒,却又无可奈何,于是码农问程序员。 码农:你知道get和post请求到底有什么区别? 程序员:你看这篇就知道了。 码农:你月薪三万了? 程序员:嗯。 码农:你是怎么做到的? 程序员:
《程序人生》系列-这个程序员只用了20行代码就拿了冠军
你知道的越多,你不知道的越多 点赞再看,养成习惯GitHub上已经开源https://github.com/JavaFamily,有一线大厂面试点脑图,欢迎Star和完善 前言 这一期不算《吊打面试官》系列的,所有没前言我直接开始。 絮叨 本来应该是没有这期的,看过我上期的小伙伴应该是知道的嘛,双十一比较忙嘛,要值班又要去帮忙拍摄年会的视频素材,还得搞个程序员一天的Vlog,还要写BU
加快推动区块链技术和产业创新发展,2019可信区块链峰会在京召开
      11月8日,由中国信息通信研究院、中国通信标准化协会、中国互联网协会、可信区块链推进计划联合主办,科技行者协办的2019可信区块链峰会将在北京悠唐皇冠假日酒店开幕。   区块链技术被认为是继蒸汽机、电力、互联网之后,下一代颠覆性的核心技术。如果说蒸汽机释放了人类的生产力,电力解决了人类基本的生活需求,互联网彻底改变了信息传递的方式,区块链作为构造信任的技术有重要的价值。   1
程序员把地府后台管理系统做出来了,还有3.0版本!12月7号最新消息:已在开发中有github地址
第一幕:缘起 听说阎王爷要做个生死簿后台管理系统,我们派去了一个程序员…… 996程序员做的梦: 第一场:团队招募 为了应对地府管理危机,阎王打算找“人”开发一套地府后台管理系统,于是就在地府总经办群中发了项目需求。 话说还是中国电信的信号好,地府都是满格,哈哈!!! 经常会有外行朋友问:看某网站做的不错,功能也简单,你帮忙做一下? 而这次,面对这样的需求,这个程序员
Android 9.0系统新特性,对刘海屏设备进行适配
其实Android 9.0系统已经是去年推出的“老”系统了,这个系统中新增了一个比较重要的特性,就是对刘海屏设备进行了支持。一直以来我也都有打算针对这个新特性好好地写一篇文章,但是为什么直到拖到了Android 10.0系统都发布了才开始写这篇文章呢?当然,一是因为我这段时间确实比较忙,今年几乎绝大部分的业余时间都放到写新书上了。但是最主要的原因并不是这个,而是因为刘海屏设备的适配存在一定的特殊性
网易云6亿用户音乐推荐算法
网易云音乐是音乐爱好者的集聚地,云音乐推荐系统致力于通过 AI 算法的落地,实现用户千人千面的个性化推荐,为用户带来不一样的听歌体验。 本次分享重点介绍 AI 算法在音乐推荐中的应用实践,以及在算法落地过程中遇到的挑战和解决方案。 将从如下两个部分展开: AI 算法在音乐推荐中的应用 音乐场景下的 AI 思考 从 2013 年 4 月正式上线至今,网易云音乐平台持续提供着:乐屏社区、UGC
【技巧总结】位运算装逼指南
位算法的效率有多快我就不说,不信你可以去用 10 亿个数据模拟一下,今天给大家讲一讲位运算的一些经典例子。不过,最重要的不是看懂了这些例子就好,而是要在以后多去运用位运算这些技巧,当然,采用位运算,也是可以装逼的,不信,你往下看。我会从最简单的讲起,一道比一道难度递增,不过居然是讲技巧,那么也不会太难,相信你分分钟看懂。 判断奇偶数 判断一个数是基于还是偶数,相信很多人都做过,一般的做法的代码如下
日均350000亿接入量,腾讯TubeMQ性能超过Kafka
整理 | 夕颜出品 | AI科技大本营(ID:rgznai100) 【导读】近日,腾讯开源动作不断,相继开源了分布式消息中间件TubeMQ,基于最主流的 OpenJDK8开发的
8年经验面试官详解 Java 面试秘诀
    作者 | 胡书敏 责编 | 刘静 出品 | CSDN(ID:CSDNnews) 本人目前在一家知名外企担任架构师,而且最近八年来,在多家外企和互联网公司担任Java技术面试官,前后累计面试了有两三百位候选人。在本文里,就将结合本人的面试经验,针对Java初学者、Java初级开发和Java开发,给出若干准备简历和准备面试的建议。   Java程序员准备和投递简历的实
面试官如何考察你的思维方式?
1.两种思维方式在求职面试中,经常会考察这种问题:北京有多少量特斯拉汽车? 某胡同口的煎饼摊一年能卖出多少个煎饼? 深圳有多少个产品经理? 一辆公交车里能装下多少个乒乓球? 一
相关热词 c# clr dll c# 如何orm c# 固定大小的字符数组 c#框架设计 c# 删除数据库 c# 中文文字 图片转 c# 成员属性 接口 c#如何将程序封装 16进制负数转换 c# c#练手项目
立即提问