Хочу рисовать диаграммы в Seam-приложении.
Работаю на Jboss 5.1.0.GA, Seam-2.2.2-Final
Изменил соответственно web.xml и components.xml, а также добавил библиотеки в lib в WEB-INF. И получил ошибку
1.
javax.faces.FacesException: Cant instantiate class: org.jboss.seam.pdf.ui.UIBarChart.
Может кто поможет разобраться.
Вот мой web.xml
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.
85.
86.
87.
88.
89.
90.
91.
92.
93.
94.
95.
96.
97.
98.
99.
100.
101.
102.
103.
104.
105.
106.
107.
108.
109.
110.
111.
112.
113.
114.
115.
116.
117.
118.
119.
120.
121.
122.
123.
124.
125.
126.
127.
128.
129.
130.
131.
132.
133.
134.
135.
136.
137.
138.
139.
140.
141.
142.
143.
144.
145.
146.
147.
148.
149.
150.
151.
152.
153.
<?xml version="1.0" ?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">
<!-- RichFaces -->
<context-param>
<param-name>org.richfaces.SKIN</param-name>
<param-value>glassX</param-value>
</context-param>
<!-- Suppress spurious stylesheets -->
<context-param>
<param-name>org.richfaces.CONTROL_SKINNING</param-name>
<param-value>disable</param-value>
</context-param>
<context-param>
<param-name>org.richfaces.CONTROL_SKINNING_CLASSES</param-name>
<param-value>disable</param-value>
</context-param>
<!-- Change load strategy to DEFAULT to disable sending scripts/styles as packs -->
<context-param>
<param-name>org.richfaces.LoadStyleStrategy</param-name>
<param-value>ALL</param-value>
</context-param>
<context-param>
<param-name>org.richfaces.LoadScriptStrategy</param-name>
<param-value>ALL</param-value>
</context-param>
<!-- Seam -->
<listener>
<listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
</listener>
<filter>
<filter-name>Seam Filter</filter-name>
<filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>Seam Filter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<servlet>
<servlet-name>Seam Resource Servlet</servlet-name>
<servlet-class>org.jboss.seam.servlet.SeamResourceServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Seam Resource Servlet</servlet-name>
<url-pattern>/seam/resource/*</url-pattern>
</servlet-mapping>
<!-- Facelets development mode (disable in production) -->
<context-param>
<param-name>facelets.DEVELOPMENT</param-name>
<param-value>@debug@</param-value>
</context-param>
<!-- JSF -->
<servlet>
<servlet-name>Document Store Servlet</servlet-name>
<servlet-class>org.jboss.seam.document.DocumentStoreServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Document Store Servlet</servlet-name>
<url-pattern>*.csv</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Document Store Servlet</servlet-name>
<url-pattern>*.xls</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Document Store Servlet</servlet-name>
<url-pattern>*.pdf</url-pattern>
</servlet-mapping>
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</context-param>
<context-param>
<param-name>webAppRootKey</param-name>
<param-value>seam-excel</param-value>
</context-param>
<!-- JSF2 requires to set this parameter, otherwise embedded text UI component won't be rendered -->
<context-param>
<param-name>com.sun.faces.allowTextChildren</param-name>
<param-value>true</param-value>
</context-param>
<session-config>
<session-timeout>10</session-timeout>
</session-config>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.seam</url-pattern>
</servlet-mapping>
<security-constraint>
<display-name>Restrict raw XHTML Documents</display-name>
<web-resource-collection>
<web-resource-name>XHTML</web-resource-name>
<url-pattern>*.xhtml</url-pattern>
</web-resource-collection>
<auth-constraint/>
</security-constraint>
<!-- uncomment <ejb-local-ref> entries when deploying to GlassFish and (optionally) JBoss AS 5 -->
<!--
<ejb-local-ref>
<ejb-ref-name>myproject/AuthenticatorBean/local</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home/>
<local>com.mydomain.myproject.action.Authenticator</local>
</ejb-local-ref>
-->
<!-- Add entries for each EJB session bean which is also a Seam component (not required on JBoss AS) -->
<persistence-unit-ref>
<persistence-unit-ref-name>myproject/pu</persistence-unit-ref-name>
<persistence-unit-name>../myproject.jar#myproject</persistence-unit-name>
<!-- The relative reference doesn't work on GlassFish. Instead, set the <persistence-unit-name> to "myproject",
package persistence.xml in the WAR, and add a <jar-file> element in persistence.xml with value "../../myproject.jar".
<persistence-unit-name>myproject</persistence-unit-name>
-->
</persistence-unit-ref>
</web-app>
Вот мой components.xml
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.
85.
86.
87.
88.
89.
90.
91.
92.
<?xml version="1.0" encoding="UTF-8"?>
<components xmlns="http://jboss.com/products/seam/components"
xmlns:core="http://jboss.com/products/seam/core"
xmlns:persistence="http://jboss.com/products/seam/persistence"
xmlns:drools="http://jboss.com/products/seam/drools"
xmlns:bpm="http://jboss.com/products/seam/bpm"
xmlns:security="http://jboss.com/products/seam/security"
xmlns:mail="http://jboss.com/products/seam/mail"
xmlns:web="http://jboss.com/products/seam/web"
xmlns:pdf="http://jboss.com/products/seam/pdf"
xmlns:excel="http://jboss.com/products/seam/excel"
xmlns:framework="http://jboss.com/products/seam/framework"
xmlns:document="http://jboss.com/products/seam/document"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.2.xsd
http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.2.xsd
http://jboss.com/products/seam/drools http://jboss.com/products/seam/drools-2.2.xsd
http://jboss.com/products/seam/bpm http://jboss.com/products/seam/bpm-2.2.xsd
http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.2.xsd
http://jboss.com/products/seam/mail http://jboss.com/products/seam/mail-2.2.xsd
http://jboss.com/products/seam/web http://jboss.com/products/seam/web-2.2.xsd
http://jboss.com/products/seam/pdf http://jboss.com/products/seam/pdf-2.2.xsd
http://jboss.com/products/seam/framework http://jboss.com/products/seam/framework-2.2.xsd
http://jboss.com/products/seam/document http://jboss.com/products/seam/document-2.2.xsd
http://jboss.com/products/seam/excel http://jboss.com/products/seam/excel-2.2.xsd
http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.2.xsd">
<core:init debug="@debug@" jndi-pattern="@jndiPattern@"/>
<document:document-store use-extensions="true"></document:document-store>
<!-- Добавлено для pdf-->
<component name="org.jboss.seam.document.documentStore">
<property name="useExtensions">true</property>
<property name="errorPage">/pdfMissing.seam</property>
</component>
<pdf:key-store-config key-store="pdf.keystore"
key-store-password="storepass"
key-password="keypass"
key-alias="pdfKey" />
<!--End Добавлено для pdf-->
<!-- A sample on how a POI implementation could be added.
<excel:excelFactory>
<property name="implementations">
<key>poi</key>
<value>org.jboss.seam.excel.poi.POIExcelWorkbook</value>
</property>
</excel:excelFactory>
-->
<core:manager concurrent-request-timeout="500"
conversation-timeout="12000000"
conversation-id-parameter="cid"
parent-conversation-id-parameter="pid"/>
<!-- Make sure this URL pattern is the same as that used by the Faces Servlet -->
<web:hot-deploy-filter url-pattern="*.seam"/>
<persistence:managed-persistence-context name="entityManager" auto-create="true"
persistence-unit-jndi-name="@puJndiName@"/>
<drools:rule-base name="securityRules">
<drools:rule-files>
<value>/security.drl</value>
</drools:rule-files>
</drools:rule-base>
<security:rule-based-permission-resolver security-rules="#{securityRules}"/>
<security:identity authenticate-method="#{authenticator.authenticate}" remember-me="true"/>
<event type="org.jboss.seam.security.notLoggedIn">
<action execute="#{redirect.captureCurrentView}"/>
</event>
<event type="org.jboss.seam.security.loginSuccessful">
<action execute="#{redirect.returnToCapturedView}"/>
</event>
<mail:mail-session host="localhost" port="25"/>
<!-- For use with jBPM pageflow or process management -->
<!--
<bpm:jbpm>
<bpm:process-definitions></bpm:process-definitions>
<bpm:pageflow-definitions></bpm:pageflow-definitions>
</bpm:jbpm>
-->
</components>
Вот мой deployed-jars-war.list
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
commons-digester.jar
jboss-seam-debug.jar
jboss-seam-excel.jar
jboss-seam-ioc.jar
jboss-seam-mail.jar
jboss-seam-pdf.jar
jboss-seam-rss.jar
jboss-seam-ui.jar
jsf-facelets.jar
jxl.jar
richfaces-impl.jar
richfaces-ui.jar
jstl.jar
darkX.jar
glassX.jar
laguana.jar
jfreechart.jar
itext-rtf.jar
iText.jar
jcommon.jar
На странице jsf пытаюсь нарисовать простенькую диаграмму
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
<p:barchart title="Title" orientation="vertical"
is3D="false" legend="true"
width="400" height="300"
domainAxisLabel="domain"
domainGridlinesVisible="true"
rangeAxisLabel="Range"
rangeGridlinesVisible="true"
borderVisible="true"
borderPaint="black"
borderBackgroundPaint="white"
borderStroke="solid-thick"
plotOutlinePaint="black"
plotOutlineStroke="solid-thin"
plotBackgroundPaint="white">
<p:series key="partsrcvd">
<p:data columnKey="0" key="success" value="#{excelBackBean.statExcelRecord.successCallCount}" />
<p:data columnKey="1" key="unreachable" value="#{excelBackBean.statExcelRecord.unreachableCallCount}" />
<p:data columnKey="2" key="fax" value="#{excelBackBean.statExcelRecord.faxCallCount}" />
<p:data columnKey="3" key="denial" value="#{excelBackBean.statExcelRecord.denialCallCount}" />
</p:series>
</p:barchart>
Что я делаю не так. подскажите пожалуйста.