0 Replies Latest reply on Nov 6, 2011 11:27 AM by sirip

    java.lang.NoClassDefFoundError: jxl/write/WriteException

    sirip

      Hi,

       

      I am trying to export a datatable into excel.

       

      my components.xml is like below:

       

      <?xml version="1.0" encoding="UTF-8"?>

      <components xmlns="http://jboss.com/products/seam/components"

                xmlns:drools="http://jboss.com/products/seam/drools" xmlns:framework="http://jboss.com/products/seam/framework"

                xmlns:async="http://jboss.com/products/seam/async" xmlns:pdf="http://jboss.com/products/seam/pdf"

                xmlns:document="http://jboss.com/products/seam/document"

                xmlns:excel="http://jboss.com/products/seam/excel"

                xsi:schemaLocation="http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.0.xsd

                  http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.0.xsd

                  http://jboss.com/products/seam/drools http://jboss.com/products/seam/drools-2.0.xsd

                  http://jboss.com/products/seam/framework http://jboss.com/products/seam/framework-2.0.xsd

                  http://jboss.com/products/seam/bpm http://jboss.com/products/seam/bpm-2.0.xsd

                  http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.0.xsd

                  http://jboss.com/products/seam/mail http://jboss.com/products/seam/mail-2.0.xsd

                  http://jboss.com/products/seam/async http://jboss.com/products/seam/async-2.0.xsd

                  http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.0.xsd

                  http://jboss.com/products/seam/excel http://jboss.com/products/seam/excel-2.1.xsd">

                <core:init debug="true" jndi-pattern="@jndiPattern@" />

       

                 <document:document-store use-extensions="true"></document:document-store>

      </components>

       

      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"

      version="2.5">

      <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>

      <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>

      <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>

      <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>

      <context-param>

      <param-name>facelets.DEVELOPMENT</param-name>

      <param-value>true</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>

      </web-app>

       

      and my JSF tags goes like below:

       

       







      <a4j:commandButton id="sacb" value="Export" rendered="#{list.available}"






      action="#{org.jboss.seam.excel.exporter.excelExporter.export('form:tbl')}">






      </a4j:commandButton>

       

      I am using Seam 2.0 and 2.1 version of jboss-seam-excel.jar and I tried 2.6.6 and 2.4.2 versions of jxl.jar.

      i dont what's wrong i am seeing below exception:

      Caused by: java.lang.NoClassDefFoundError: jxl/write/WriteException

              at java.lang.Class.getDeclaredConstructors0(Native Method)

              at java.lang.Class.privateGetDeclaredConstructors(Class.java:2357)

              at java.lang.Class.getConstructor0(Class.java:2671)

              at java.lang.Class.newInstance0(Class.java:321)

              at java.lang.Class.newInstance(Class.java:303)

              at org.jboss.seam.excel.ExcelFactory.getExcelWorkbook(ExcelFactory.java:72)

              at org.jboss.seam.excel.exporter.ExcelExporter.export(ExcelExporter.java:75)

              at org.jboss.seam.excel.exporter.ExcelExporter.export(ExcelExporter.java:62)

              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:585)

              at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:335)

              at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:280)

              at org.jboss.el.parser.AstMethodSuffix.getValue(AstMethodSuffix.java:59)

              at org.jboss.el.parser.AstMethodSuffix.invoke(AstMethodSuffix.java:65)

              at org.jboss.el.parser.AstValue.invoke(AstValue.java:96)

              at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)

              at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)

              at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:77).

       

      I am new to Seam. Can some one please help me in solving this problem.

       

      Thanks

      Siri