I have discovered the problem.  I had not put jcommon.jar in lib directory. 
It was there for me when using webwork quickstart and I had not realized its
necessity.  Thanks for all your help - I don't know if and when I would have
discovered the problem without it.



swaddee wrote:
> 
> It seems more times than not the war does not load if the
> viewModerationChart action is in struts.xml.  It doesn't matter what the
> namespace is.  This is the catalina.out log with namespace="mychart".
> 
> Oct 31, 2007 11:27:10 AM org.apache.catalina.startup.HostConfig deployWAR     
>                                                                               
>                         
> INFO: Deploying web application archive userAgent.war                         
>                                                                               
>                         
> Oct 31, 2007 11:27:11 AM
> com.opensymphony.xwork2.config.providers.XmlConfigurationProvider register    
>                                                                              
> INFO: Parsing configuration file [struts-default.xml]                         
>                                                                               
>                         
> Oct 31, 2007 11:27:11 AM
> com.opensymphony.xwork2.config.providers.XmlConfigurationProvider register    
>                                                                              
> INFO: Parsing configuration file [struts-plugin.xml]                          
>                                                                               
>                         
> Oct 31, 2007 11:27:11 AM
> com.opensymphony.xwork2.config.providers.XmlConfigurationProvider register    
>                                                                              
> INFO: Parsing configuration file [struts.xml]                                 
>                                                                               
>                         
> Oct 31, 2007 11:27:11 AM org.apache.struts2.config.Settings getLocale         
>                                                                               
>                         
> WARNING: Settings: Could not parse struts.locale setting, substituting
> default VM locale                                                             
>                                
> Oct 31, 2007 11:27:11 AM
> com.opensymphony.xwork2.config.impl.DefaultConfiguration$ContainerProperties
> setProperty                                                                   
> INFO: Overriding property struts.i18n.reload - old value: false new value:
> true                                                                          
>                            
> Oct 31, 2007 11:27:11 AM
> com.opensymphony.xwork2.config.impl.DefaultConfiguration$ContainerProperties
> setProperty                                                                   
> INFO: Overriding property struts.configuration.xml.reload - old value:
> false new value: true                                                         
>                                
> Oct 31, 2007 11:27:12 AM org.apache.catalina.core.StandardContext start       
>                                                                               
>                         
> SEVERE: Error filterStart                                                     
>                                                                               
>                         
> Oct 31, 2007 11:27:12 AM org.apache.catalina.core.StandardContext start       
>                                                                               
>                         
> SEVERE: Context [/userAgent] startup failed due to previous errors   
> 
> Do I need another filter in web.xml?  Here is the file:
> 
>  <?xml version="1.0" encoding="UTF-8"?>                                       
>                                                                               
>                          
> <web-app id="WebApp_9" version="2.4"
> xmlns="http://java.sun.com/xml/ns/j2ee";
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
> http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";>                             
>                                                                               
>                      
>                                                                               
>                                                                               
>                         
>     <display-name>Struts Blank</display-name>                                 
>                                                                               
>                         
>                                                                               
>                                                                               
>                         
>     <filter>                                                                  
>                                                                               
>                         
>         <filter-name>struts2</filter-name>                                    
>                                                                               
>                         
>        
> <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>   
>                                                                               
>                 
>     </filter>                                                                 
>                                                                               
>                         
>                                                                               
>                                                                               
>                         
>     <filter-mapping>                                                          
>                                                                               
>                         
>         <filter-name>struts2</filter-name>                                    
>                                                                               
>                         
>         <url-pattern>/*</url-pattern>                                         
>                                                                               
>                         
>     </filter-mapping>                                                         
>                                                                               
>                         
>                                                                               
>                                                                               
>                         
>     <welcome-file-list>                                                       
>                                                                               
>                         
>         <welcome-file>index.html</welcome-file>                               
>                                                                               
>                         
>     </welcome-file-list>                                                      
>                                                                               
>                         
>                                                                               
>                                                                               
>                         
> </web-app>                
> 
> 
> Thanks  for the  help so far.                                                 
>                                                                               
>                             
> ~                                                                         
> 
> swaddee wrote:
>> 
>> I recently started using struts 2 by experimenting with webwork and then
>> moving to struts 2. I want to produce some charts using jfreechart. 
>> After getting the example
>> (http://wiki.opensymphony.com/display/WW/JFreeChartResult) to work using
>> the webwork framework I tried it with struts
>> 2(http://struts.apache.org/2.x/docs/jfreechart-plugin.html).  I have not
>> had any success.
>> 
>> I'd really appreciate it if someone could help get me past this obstacle.
>> (the first action is working correctly)
>> 
>> Thanks in advance!
>> 
>> 
>> =========================================================================
>> Here is my struts.xml
>> 
>> <?xml version="1.0" encoding="UTF-8" ?>                                      
>>                                                                              
>>                           
>> <!DOCTYPE struts PUBLIC                                                      
>>                                                                              
>>                           
>> "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"            
>>                                                                              
>>                           
>> "http://struts.apache.org/dtds/struts-2.0.dtd";>                              
>>                                                                              
>>                           
>>                                                                              
>>                                                                              
>>                           
>> <struts>                                                                     
>>                                                                              
>>                           
>>                                                                              
>>                                                                              
>>                           
>> <constant name="struts.enable.DynamicMethodInvocation" value="false" />      
>>                                                                              
>>                           
>> <constant name="struts.devMode" value="true" />                              
>>                                                                              
>>                           
>>                                                                              
>>                                                                              
>>                           
>> <package name="ccbill" namespace="/ccbill" extends="struts-default">         
>>                                                                              
>>                           
>>                                                                              
>>                                                                              
>>                           
>>     <action name="UserAgentForm" class="com.ccbill.IncludeTag">              
>>                                                                              
>>                           
>>         <result>/pages/UserAgentStringForm.jsp</result>                      
>>                                                                              
>>                           
>>     </action>                                                                
>>                                                                              
>>                           
>>                                                                              
>>                                                                              
>>                           
>>     <!-- Add actions here -->                                                
>>                                                                              
>>                           
>>     <!--                                                                     
>>                                                                              
>>                           
>>     <action name="viewModerationChart"
>> class="charts.ViewModerationChartAction">                                    
>>                                                                 
>>         <result name="success" type="chart">                                 
>>                                                                              
>>                           
>>             400                                                              
>>                                                                            
>>             300                                                              
>>                                                                           
>>         </result>                                                            
>>                                                                              
>>                           
>>     </action>                                                                
>>                                                                              
>>                           
>>     -->                                                                      
>>                                                                              
>>                           
>>                                                                              
>>                                                                              
>>                           
>> </package>                                                                   
>>                                                                              
>>                           
>>                                                                              
>>                                                                              
>>                           
>> <!-- Add packages here -->                                                   
>>                                                                              
>>                           
>> <package name="charts" namespace="/ccbill" extends="jfreechart-default">     
>>                                                                              
>>                           
>>     <action name="viewModerationChart"
>> class="charts.ViewModerationChartAction">                                    
>>                                                                 
>>         <result name="success" type="chart">                                 
>>                                                                              
>>                           
>>             400                                                              
>>                                                                            
>>             300                                                              
>>                                                                           
>>         </result>                                                            
>>                                                                              
>>                           
>>     </action>                                                                
>>                                                                              
>>                           
>> </package>                                                                   
>>                                                                              
>>                           
>>                                                                              
>>                                                                              
>>                           
>> </struts>                                                                    
>>                             
>> 
>> Here is my ViewModerationChartAction.java file
>> 
>> package charts;                                                              
>>                                                                              
>>                           
>>                                                                              
>>                                                                              
>>                           
>> import com.opensymphony.xwork2.ActionSupport;                                
>>                                                                              
>>                           
>> import org.jfree.chart.JFreeChart;                                           
>>                                                                              
>>                           
>> import org.jfree.chart.plot.XYPlot;                                          
>>                                                                              
>>                           
>> import org.jfree.data.xy.XYSeries;                                           
>>                                                                              
>>                           
>> import org.jfree.chart.renderer.xy.StandardXYItemRenderer;                   
>>                                                                              
>>                           
>> import org.jfree.chart.axis.NumberAxis;                                      
>>                                                                              
>>                           
>> import org.jfree.chart.axis.ValueAxis;                                       
>>                                                                              
>>                           
>> import org.jfree.data.xy.XYSeriesCollection;                                 
>>                                                                              
>>                           
>>                                                                              
>>                                                                              
>>                           
>> public class ViewModerationChartAction extends ActionSupport {               
>>                                                                              
>>                           
>>                                                                              
>>                                                                              
>>                           
>>     private JFreeChart chart;                                                
>>                                                                              
>>                           
>>                                                                              
>>                                                                              
>>                           
>>     public String execute() throws Exception {                               
>>                                                                              
>>                           
>>         // chart creation logic...                                           
>>                                                                              
>>                           
>>         XYSeries dataSeries = new XYSeries(new Integer(1)); //pass a key
>> for this series                                                              
>>                               
>>         for (int i = 0; i <= 100; i++) {                                     
>>                                                                              
>>                           
>>             // dataSeries.add(i, RandomUtils.nextInt());                     
>>                                                                              
>>                           
>>             dataSeries.add(i, Math.random() * 100);                          
>>                                                                              
>>                           
>>         }                                                                    
>>                                                                              
>>                           
>>         XYSeriesCollection xyDataset = new
>> XYSeriesCollection(dataSeries);                                              
>>                                                             
>>                                                                              
>>                                                                              
>>                           
>>         ValueAxis xAxis = new NumberAxis("Raw Marks");                       
>>                                                                              
>>                           
>>         ValueAxis yAxis = new NumberAxis("Moderated Marks");                 
>>                                                                              
>>                           
>>                                                                              
>>                                                                              
>>                           
>>         // set my chart variable                                             
>>                                                                              
>>                           
>>         chart =                                                              
>>                                                                              
>>                           
>>             new JFreeChart(                                                  
>>                                                                              
>>                           
>>                 "Moderation Function",                                       
>>                                                                              
>>                           
>>                 JFreeChart.DEFAULT_TITLE_FONT,                               
>>                                                                              
>>                           
>>                 new XYPlot(                                                  
>>                                                                              
>>                           
>>                     xyDataset,                                               
>>                                                                              
>>                           
>>                     xAxis,                                                   
>>                                                                              
>>                           
>>                     yAxis,                                                   
>>                                                                              
>>                           
>>                     new
>> StandardXYItemRenderer(StandardXYItemRenderer.LINES)),                       
>>                                                                              
>>   
>>                 false);                                                      
>>                                                                              
>>                           
>>         chart.setBackgroundPaint(java.awt.Color.white);                      
>>                                                                              
>>                           
>>                                                                              
>>                                                                              
>>                           
>>         return super.SUCCESS;                                                
>>                                                                              
>>                           
>>     }                                                                        
>>                                                                              
>>                           
>>                                                                              
>>                                                                              
>>                           
>>     public JFreeChart getChart() {                                           
>>                                                                              
>>                           
>>         return chart;                                                        
>>                                                                              
>>                           
>>     }                                                                        
>>                                                                              
>>                           
>>                                                                              
>>                                                                              
>>                           
>> }                                                                        
>> 
>> What follows is the stack trace:
>> Struts Problem Report
>> 
>> Struts has detected an unhandled exception:
>> # Messages:  There is no Action mapped for namespace /ccbill and action
>> name viewModerationChart.
>> Stacktraces
>> There is no Action mapped for namespace /ccbill and action name
>> viewModerationChart. - [unknown location]
>> 
>>    
>> com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:186)
>>    
>> org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:41)
>>    
>> org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:494)
>>    
>> org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419)
>>    
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
>>    
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
>>    
>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
>>    
>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
>>    
>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
>>    
>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
>>    
>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
>>    
>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
>>    
>> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
>>    
>> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
>>    
>> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
>>    
>> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
>>    
>> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
>>     java.lang.Thread.run(Thread.java:595)
>>     
>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/help-with-struts-2-%2B-jfreechart-plugin-example-tf4726334.html#a13517086
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to