Olá,
estou usando :
TOmCAT 6
EClipse Version: 3.4.1
Struts 2.0.14
e um exemplo Struts 2 (usava Strutsstruts2-core-2.0.7.jar )para conhecer como funciona com Jasper e está pedindo pra add
Spring ???
Não entendi ???
o que fazer ???
11/02/2009 12:55:01 org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:reportStruts2' did not find a matching property.
11/02/2009 12:55:01 org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Arquivos de programas\Java\jre1.5.0_16\bin;.;C:\WINDOWS\system32;C:\WINDOWS;C:/Arquivos de programas/Java/jre1.5.0_16/bin/client;C:/Arquivos de programas/Java/jre1.5.0_16/bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Arquivos de programas\Arquivos comuns\Aladdin Shared\eToken\PKIClient\x32;C:\Arquivos de programas\TortoiseSVN\bin;C:\Arquivos de programas\Java\jdk1.5.0_16\bin;C:\Arquivos de programas\SlikSvn\bin\
11/02/2009 12:55:01 org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
11/02/2009 12:55:01 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1627 ms
11/02/2009 12:55:01 org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
11/02/2009 12:55:01 org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.18
11/02/2009 12:55:03 com.opensymphony.xwork2.config.providers.XmlConfigurationProvider register
INFO: Parsing configuration file [struts-default.xml]
11/02/2009 12:55:04 com.opensymphony.xwork2.config.providers.XmlConfigurationProvider register
INFO: Parsing configuration file [struts-plugin.xml]
11/02/2009 12:55:04 com.opensymphony.xwork2.config.providers.XmlConfigurationProvider register
INFO: Parsing configuration file [struts.xml]
11/02/2009 12:55:04 org.apache.struts2.config.Settings getLocale
WARNING: Settings: Could not parse struts.locale setting, substituting default VM locale
11/02/2009 12:55:04 org.apache.struts2.spring.StrutsSpringObjectFactory <init>
INFO: Initializing Struts-Spring integration...
11/02/2009 12:55:04 org.apache.struts2.spring.StrutsSpringObjectFactory <init>
SEVERE: ********** FATAL ERROR STARTING UP STRUTS-SPRING INTEGRATION **********
Looks like the Spring listener was not configured for your web app!
Nothing will work until WebApplicationContextUtils returns a valid ApplicationContext.
You might need to add the following to web.xml:
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
11/02/2009 12:55:05 org.apache.catalina.core.StandardContext filterStart
SEVERE: Exception starting filter filtroStruts
java.lang.NullPointerException
at com.opensymphony.xwork2.spring.SpringObjectFactory.getClassInstance(SpringObjectFactory.java:189)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.verifyResultType(XmlConfigurationProvider.java:479)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addResultTypes(XmlConfigurationProvider.java:450)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:407)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages(XmlConfigurationProvider.java:239)
at org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:111)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reload(DefaultConfiguration.java:152)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:52)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:395)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:452)
at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:205)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:108)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3709)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4363)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
11/02/2009 12:55:05 org.apache.catalina.core.StandardContext start
SEVERE: Error filterStart
11/02/2009 12:55:05 org.apache.catalina.core.StandardContext start
SEVERE: Context [/reportStruts2] startup failed due to previous errors
11/02/2009 12:55:06 org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
11/02/2009 12:55:06 org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
11/02/2009 12:55:06 org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/187 config=null
11/02/2009 12:55:06 org.apache.catalina.startup.Catalina start
INFO: Server startup in 4971 ms
--web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
<display-name>reportStruts2</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<filter>
<filter-name>filtroStruts</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>
<filter-mapping>
<filter-name>filtroStruts</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>
--struts.xml
<struts>
<include file="struts-default.xml" />
<include file="jasperreports-default.xml" />
<package name="jasper" extends="jasperreports-default">
<action name="myJasperTestPDF" class="br.com.devmedia.actions.JasperAction">
<result name="success" type="jasper" >
<param name="location">reports/product/listProducts.jasper</param>
<param name="dataSource">myList</param>
<param name="format">PDF</param>
<param name="documentName">listProducts</param>
</result>
</action>
</package>
</struts>