我已经创建了这个控制器
package org.seguritech.cp.web.controller;
import net.bytebuddy.asm.Advice;
import org.seguritech.cp.service.ConsultaPlacaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.view.jasperreports.JasperReportsMultiFormatView;
import org.springframework.web.servlet.view.jasperreports.JasperReportsPdfView;
import javax.sql.DataSource;
import java.util.HashMap;
import java.util.Map;
@Controller
public class ReportController {
@Autowired
private DataSource dataSource;
@Autowired
private ConsultaPlacaService consultaPlacaService;
@RequestMapping(path = "/pdf", method = RequestMethod.GET)
public ModelAndView report() {
JasperReportsMultiFormatView view = new JasperReportsMultiFormatView();
view.setUrl("classpath:Consultas.jrxml");
//view.setJdbcDataSource(dataSource);
Map<String, Object> params = new HashMap<>();
params.put("datasource", consultaPlacaService.findAll());
return new ModelAndView(view, params);
}
}
报告consultas.jrxml位于folded resources上
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.5.0.final using JasperReports Library version 6.5.0 -->
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="Coffee_Landscape" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="df013db5-f76e-44d3-b0df-bcbc46d93160">
<property name="com.jaspersoft.studio.data.sql.tables">
<![CDATA[YENvbnN1bHRhUGxhY2FzYC5jb3Jwb3JhY2lvbiBBUyAsMjQ5LDIxOSw5ZWVkNGZmOC00YjBkLTQ3
OGItODVjNi01OTBkOGI4YzdlNDc7YENvbnN1bHRhUGxhY2FzYC5tdW5pY2lwaW8gQVMgLDIzMCwx
NTMsZmRjZGQ3NTctNDk1ZS00NWEyLTljYTEtMDIxMWI4NWQyYTJkO2BDb25zdWx0YVBsYWNhc2Au
Y29uc3VsdGFfcGxhY2EgLDE1LDE1LDRmNzZkNDFlLTM0MGEtNGVlNy04YTNiLWI0MzAwYjY0ZjAy
ODs=]]>
</property>
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="New Data Adapter (2)"/>
<style name="Title" fontName="Times New Roman" fontSize="50" isBold="true"/>
<style name="SubTitle" forecolor="#736343" fontName="Arial" fontSize="18"/>
<style name="Column header" forecolor="#666666" fontName="Arial" fontSize="12" isBold="true"/>
<style name="Detail" fontName="Arial" fontSize="12"/>
<style name="Row" mode="Transparent">
<conditionalStyle>
<conditionExpression><![CDATA[$V{REPORT_COUNT}%2 == 0]]></conditionExpression>
<style backcolor="#E6DAC3"/>
</conditionalStyle>
</style>
<queryString>
<![CDATA[]]>
</queryString>
<field name="issi" class="java.lang.String">
<property name="com.jaspersoft.studio.field.label" value="issi"/>
<property name="com.jaspersoft.studio.field.tree.path" value="consulta_placa"/>
</field>
<field name="responsable" class="java.lang.String">
<property name="com.jaspersoft.studio.field.label" value="responsable"/>
<property name="com.jaspersoft.studio.field.tree.path" value="consulta_placa"/>
</field>
<field name="municipio" class="java.lang.String">
<property name="com.jaspersoft.studio.field.label" value="municipio"/>
<property name="com.jaspersoft.studio.field.tree.path" value="municipio"/>
</field>
<field name="corporacion" class="java.lang.String">
<property name="com.jaspersoft.studio.field.label" value="corporacion"/>
<property name="com.jaspersoft.studio.field.tree.path" value="corporacion"/>
</field>
<field name="fecha" class="java.sql.Date">
<property name="com.jaspersoft.studio.field.label" value="fecha"/>
<property name="com.jaspersoft.studio.field.tree.path" value="consulta_placa"/>
</field>
<field name="consulta" class="java.lang.String">
<property name="com.jaspersoft.studio.field.label" value="consulta"/>
<property name="com.jaspersoft.studio.field.tree.path" value="consulta_placa"/>
</field>
<field name="metodo" class="java.lang.String">
<property name="com.jaspersoft.studio.field.label" value="metodo"/>
<property name="com.jaspersoft.studio.field.tree.path" value="consulta_placa"/>
</field>
<field name="estado" class="java.lang.Boolean">
<property name="com.jaspersoft.studio.field.label" value="estado"/>
<property name="com.jaspersoft.studio.field.tree.path" value="consulta_placa"/>
</field>
<field name="resultado" class="java.lang.String">
<property name="com.jaspersoft.studio.field.label" value="resultado"/>
<property name="com.jaspersoft.studio.field.tree.path" value="consulta_placa"/>
</field>
<field name="coordenadas" class="java.lang.String">
<property name="com.jaspersoft.studio.field.label" value="coordenadas"/>
<property name="com.jaspersoft.studio.field.tree.path" value="consulta_placa"/>
</field>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="136" splitType="Stretch">
<image>
<reportElement x="0" y="0" width="164" height="126" uuid="1c003177-754c-448f-8ce1-16868856f545"/>
<imageExpression><![CDATA["coffee.jpg"]]></imageExpression>
</image>
<staticText>
<reportElement style="Title" x="270" y="0" width="263" height="62" uuid="bc1ce1da-8232-46ea-be55-cec4abb986dd"/>
<textElement verticalAlignment="Middle"/>
<text><![CDATA[Coffee Title]]></text>
</staticText>
<staticText>
<reportElement style="SubTitle" x="303" y="62" width="196" height="22" uuid="f6a78448-8260-4445-a9e0-e3fb53b080d9"/>
<textElement>
<font fontName="Times New Roman"/>
</textElement>
<text><![CDATA[Coffee SubTitle]]></text>
</staticText>
<staticText>
<reportElement x="172" y="94" width="383" height="42" uuid="8240065e-64b6-4170-b5d9-6341598e7b35"/>
<textElement textAlignment="Right">
<font size="10"/>
</textElement>
<text><![CDATA[Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce auctor purus gravida arcu aliquam mattis. Donec et nulla libero, ut varius massa. Nulla sed turpis elit. Etiam aliquet mauris a ligula hendrerit in auctor leo lobortis.]]></text>
</staticText>
<image>
<reportElement x="633" y="-73" width="219" height="209" uuid="4aa6f4d1-27dc-4b34-9227-59e19ce2c959"/>
<imageExpression><![CDATA["coffee_stain.png"]]></imageExpression>
</image>
</band>
</title>
<pageHeader>
<band splitType="Stretch"/>
</pageHeader>
<columnHeader>
<band height="16" splitType="Stretch">
<line>
<reportElement positionType="FixRelativeToBottom" x="0" y="15" width="802" height="1" uuid="e9d2002a-c8ee-4649-a258-640dad29110c"/>
<graphicElement>
<pen lineWidth="0.5" lineColor="#999999"/>
</graphicElement>
</line>
<staticText>
<reportElement style="Column header" x="0" y="0" width="80" height="15" forecolor="#736343" uuid="b483fb52-d297-4ad2-a666-7ff8397b4498">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="1ad24f79-738d-458c-a8dd-a8632476a94c"/>
</reportElement>
<text><![CDATA[issi]]></text>
</staticText>
<staticText>
<reportElement style="Column header" x="80" y="0" width="80" height="15" forecolor="#736343" uuid="f2213c2a-8b6d-4200-ac48-80b460f6b7ce">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="87e84b26-e9e5-4fa9-8c11-b5c8a7547733"/>
</reportElement>
<text><![CDATA[responsable]]></text>
</staticText>
<staticText>
<reportElement style="Column header" x="160" y="0" width="80" height="15" forecolor="#736343" uuid="94d65a5a-bd9d-4963-a5b2-14fb1bc386ca">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="eee60cc9-c6ce-4954-bdf1-a99fad4c37c4"/>
</reportElement>
<text><![CDATA[municipio]]></text>
</staticText>
<staticText>
<reportElement style="Column header" x="240" y="0" width="80" height="15" forecolor="#736343" uuid="064aff57-e44c-484d-8a7a-d080827d4df0">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="a8534a72-7d2d-442c-bca8-a1be84ea7c98"/>
</reportElement>
<text><![CDATA[corporacion]]></text>
</staticText>
<staticText>
<reportElement style="Column header" x="320" y="0" width="80" height="15" forecolor="#736343" uuid="9a28366e-c502-49f4-a4ae-a38b54482edf">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="af83d51b-b462-4cd9-be4f-655707a431b2"/>
</reportElement>
<text><![CDATA[fecha]]></text>
</staticText>
<staticText>
<reportElement style="Column header" x="400" y="0" width="80" height="15" forecolor="#736343" uuid="2df3aaa4-7325-4f36-9df8-d83fc8ef3862">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="790dbc78-02e3-494e-8129-01c1cafc31fd"/>
</reportElement>
<text><![CDATA[consulta]]></text>
</staticText>
<staticText>
<reportElement style="Column header" x="480" y="0" width="80" height="15" forecolor="#736343" uuid="e31b2973-1b6b-4337-8dfc-ade0e0fde046">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="caf7673e-361d-46a9-a67e-223c401e9af3"/>
</reportElement>
<text><![CDATA[metodo]]></text>
</staticText>
<staticText>
<reportElement style="Column header" x="560" y="0" width="80" height="15" forecolor="#736343" uuid="cd19d3dc-cf4f-4c28-9700-a7c251c5a009">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="70c3384c-5238-4d9c-a01d-7f423d68c706"/>
</reportElement>
<text><![CDATA[estado]]></text>
</staticText>
<staticText>
<reportElement style="Column header" x="640" y="0" width="80" height="15" forecolor="#736343" uuid="cc71ac98-2fac-4268-bd2c-9ec0f7879405">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="38786f27-fcda-4173-b256-baac3354ca3a"/>
</reportElement>
<text><![CDATA[resultado]]></text>
</staticText>
<staticText>
<reportElement style="Column header" x="720" y="0" width="80" height="15" forecolor="#736343" uuid="cc5e28f9-80b1-4ff1-9840-a32dc3dacc46">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="649685c6-f235-4e9f-a05b-72fd94020aa9"/>
</reportElement>
<text><![CDATA[coordenadas]]></text>
</staticText>
</band>
</columnHeader>
<detail>
<band height="15" splitType="Stretch">
<frame>
<reportElement style="Row" mode="Opaque" x="0" y="0" width="802" height="15" uuid="fa7cec56-4ec1-48e6-a26e-7266a995d174"/>
<textField isStretchWithOverflow="true">
<reportElement style="Detail" x="0" y="0" width="80" height="15" uuid="e36b1316-7025-4a62-884e-e5abf532890f">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="1ad24f79-738d-458c-a8dd-a8632476a94c"/>
</reportElement>
<textFieldExpression><![CDATA[$F{issi}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement style="Detail" x="80" y="0" width="80" height="15" uuid="a998d292-a88c-4c61-ad8b-98e8e93a9bd8">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="87e84b26-e9e5-4fa9-8c11-b5c8a7547733"/>
</reportElement>
<textFieldExpression><![CDATA[$F{responsable}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement style="Detail" x="160" y="0" width="80" height="15" uuid="afc29e65-01ed-45e5-a281-cb05010f03ea">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="eee60cc9-c6ce-4954-bdf1-a99fad4c37c4"/>
</reportElement>
<textFieldExpression><![CDATA[$F{municipio}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement style="Detail" x="240" y="0" width="80" height="15" uuid="ab93e51a-940f-45e8-b812-bd1e2b895cbe">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="a8534a72-7d2d-442c-bca8-a1be84ea7c98"/>
</reportElement>
<textFieldExpression><![CDATA[$F{corporacion}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement style="Detail" x="320" y="0" width="80" height="15" uuid="a46008a5-0b23-43b2-82be-65cca02f9d62">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="af83d51b-b462-4cd9-be4f-655707a431b2"/>
</reportElement>
<textFieldExpression><![CDATA[$F{fecha}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement style="Detail" x="400" y="0" width="80" height="15" uuid="39f65bb4-b241-4317-aaae-28313712f683">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="790dbc78-02e3-494e-8129-01c1cafc31fd"/>
</reportElement>
<textFieldExpression><![CDATA[$F{consulta}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement style="Detail" x="480" y="0" width="80" height="15" uuid="43e57583-6de8-4e18-8552-f554c58a29cc">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="caf7673e-361d-46a9-a67e-223c401e9af3"/>
</reportElement>
<textFieldExpression><![CDATA[$F{metodo}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement style="Detail" x="560" y="0" width="80" height="15" uuid="ac2aea71-e862-425d-a7bb-cb146559a591">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="70c3384c-5238-4d9c-a01d-7f423d68c706"/>
</reportElement>
<textFieldExpression><![CDATA[$F{estado}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement style="Detail" x="640" y="0" width="80" height="15" uuid="8eec39e6-35f3-4055-b246-316d59c85252">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="38786f27-fcda-4173-b256-baac3354ca3a"/>
</reportElement>
<textFieldExpression><![CDATA[$F{resultado}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement style="Detail" x="720" y="0" width="80" height="15" uuid="d7e67806-09d3-48ed-84f3-0a99635e0a84">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="649685c6-f235-4e9f-a05b-72fd94020aa9"/>
</reportElement>
<textFieldExpression><![CDATA[$F{coordenadas}]]></textFieldExpression>
</textField>
</frame>
</band>
</detail>
<columnFooter>
<band height="6" splitType="Stretch">
<line>
<reportElement positionType="FixRelativeToBottom" x="0" y="3" width="802" height="1" uuid="fa5e88d5-a011-4e32-8f12-ce923f903111"/>
<graphicElement>
<pen lineWidth="0.5" lineColor="#999999"/>
</graphicElement>
</line>
</band>
</columnFooter>
<pageFooter>
<band height="25" splitType="Stretch">
<frame>
<reportElement mode="Opaque" x="-21" y="1" width="843" height="24" forecolor="#D0B48E" backcolor="#F2EBDF" uuid="5d8169bd-4a75-48c8-8a68-6d3ad5ba9402"/>
<textField evaluationTime="Report">
<reportElement style="Column header" x="783" y="1" width="40" height="20" forecolor="#736343" uuid="e5e27efa-b599-499b-9ca3-848cb511cb7b"/>
<textElement verticalAlignment="Middle">
<font size="10" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[" " + $V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="Column header" x="703" y="1" width="80" height="20" forecolor="#736343" uuid="18cfe1ca-f7d6-48b0-9827-28578b42a5e0"/>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font size="10" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA["Page "+$V{PAGE_NUMBER}+" of"]]></textFieldExpression>
</textField>
<textField pattern="EEEEE dd MMMMM yyyy">
<reportElement style="Column header" x="22" y="1" width="197" height="20" forecolor="#736343" uuid="fbce24bb-3cb1-44a3-8eec-8c067ddbe5b5"/>
<textElement verticalAlignment="Middle">
<font size="10" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
</textField>
</frame>
</band>
</pageFooter>
<summary>
<band splitType="Stretch"/>
</summary>
</jasperReport>
当我运行te应用程序并运行endpoint时,我会出现以下错误:
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.IllegalStateException: ApplicationObjectSupport instance [org.springframework.web.servlet.view.jasperreports.JasperReportsMultiFormatView: unnamed; URL [classpath:Consultas.jrxml]] does not run in an ApplicationContext
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:982)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129)
at com.codahale.metrics.servlet.AbstractInstrumentedFilter.doFilter(AbstractInstrumentedFilter.java:111)
at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
at org.springframework.boot.web.filter.ApplicationContextHeaderFilter.doFilterInternal(ApplicationContextHeaderFilter.java:55)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:101)
at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
at org.springframework.boot.actuate.trace.WebRequestTraceFilter.doFilterInternal(WebRequestTraceFilter.java:110)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:317)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:127)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:91)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:114)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:137)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:170)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.seguritech.cp.security.jwt.JWTFilter.doFilter(JWTFilter.java:36)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.springframework.web.filter.CorsFilter.doFilterInternal(CorsFilter.java:96)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:116)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:64)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:214)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:177)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262)
at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:108)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:81)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)
at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
at io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:64)
at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)
at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)
at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272)
at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)
at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104)
at io.undertow.server.Connectors.executeRootHandler(Connectors.java:332)
at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:812)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalStateException: ApplicationObjectSupport instance [org.springframework.web.servlet.view.jasperreports.JasperReportsMultiFormatView: unnamed; URL [classpath:Consultas.jrxml]] does not run in an ApplicationContext
at org.springframework.context.support.ApplicationObjectSupport.getApplicationContext(ApplicationObjectSupport.java:141)
at org.springframework.web.context.support.WebApplicationObjectSupport.getWebApplicationContext(WebApplicationObjectSupport.java:107)
at org.springframework.web.context.support.WebApplicationObjectSupport.getServletContext(WebApplicationObjectSupport.java:128)
at oorg.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1286)
at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1041)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:984)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
... 99 common frames omitted
你能帮我吗?
@Autowired
private ApplicationContext context;
@Autowired
private ConsultaPlacaService consultaPlacaService;
@RequestMapping(path = "/pdf", method = RequestMethod.GET)
public ModelAndView report() {
JasperReportsPdfView view = new JasperReportsPdfView();
view.setUrl("classpath:reporte_consulta_placas.jrxml");
view.setApplicationContext(context);
Map<String, Object> params = new HashMap<>();
params.put("datasource", consultaPlacaService.findAll());
return new ModelAndView(view, params);
}
我正在我的项目中使用Sikuli来处理一些flash按钮。当在本地运行脚本时,它工作得很好。问题是,当我需要运行build.gradle时,我需要在build.gradle中有Sikuli依赖项。我就是这么写的。运行构建时,会出现以下错误: > 错误:无法解析配置“:Compile”的所有依赖项。 找不到com.googlecode.javacpp:javacpp:0.1.要求::new_qa_a
我正在构建我的第一个Android应用程序,我在github上发现了一个java项目,我想和我的应用程序集成在一起。我是否可以手动将java文件添加到我的android项目目录 app->java->com.example.appname java客户机的src->main目录有一个嵌套的文件结构,所以我不确定这是否会引起问题。 我已经尝试了本文中的解决方案,但我没有看到步骤2中提供的选项如何将现
我觉得通过API调用显示报告不是最佳实践,所以我做了一些研究,遇到了TIBCO Jasper报告,到目前为止它看起来很好。 我到现在所做的是 在本地计算机中安装了Jaspersoft Studio。 将其连接到我的数据库并生成JRXML文件。 将JRXML文件上传到jasper服务器,并从DB生成报告。 我需要做的是 我看到我可以从jasper服务器生成各种格式的报告,如pdf、excel等。如何
请容忍我,我不是编码专家。 我使用ANTRWorks 2在ANTLR4中构建了一个语法。我用各种测试字符串测试了语法,它在其中运行良好。现在我遇到的问题是在我自己的代码中使用生成的lexer和解析器。作为代码生成目标,我使用Java。 以下是我正在尝试的代码: 它的输出就是“查询”,这是我的起始规则。我希望类似AntlWorks的输出:“(查询(quant_expr query((match st
关于将Abaqus特定的python库集成到中托管的项目中,也存在类似的问题。但不幸的是,答案与我手头的问题不符。 我正在使用版本6.11-2和的社区版。Abaqus python解释器位于我的windows ows7(64)机器上的以下位置。: 我需要 PyCharm 解析以使其代码完成魔法的库驻留在这里 - 至少我相信它们是这样。 这是我正在尝试编写的脚本的第一行代码。 PyCharm用红色下