DataExporter does not work in my IDE

UI Components for JSF
Post Reply
User avatar
mediterran81
Posts: 29
Joined: 22 Mar 2011, 12:14
Location: France
Contact:

22 Mar 2011, 13:01

Please HELP! Mayday! :oops:
Data Exporter Does not work at all.

I am using:
- Netbeans 6.9.1 IDE
- Glassfish 3.1 (Mojarra 2.1)
- JSF 2.0
- MySQL 5.1.49
- Linux Debian (

I get this error for PDF export (while I am using itext 1.4.8) (nb: I added itext library to my project classpath but I did not change anything in web.xml, should I?)
How can I tell primeFaces in my project to use added libraries like commons-io, commons-poi, commons-fileupload, etc?

Code: Select all

SEVERE: java.lang.NoClassDefFoundError: com/lowagie/text/Phrase
        at org.primefaces.component.export.ExporterFactory.getExporterForType(ExporterFactory.java:24)
        at org.primefaces.component.export.DataExporter.processAction(DataExporter.java:86)
        at javax.faces.event.ActionEvent.processListener(ActionEvent.java:88)
        at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:769)
        at javax.faces.component.UICommand.broadcast(UICommand.java:300)
        at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794)
        at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259)
        at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
        at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
        at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:409)
        at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1534)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
        at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98)
        at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162)
        at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:326)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:227)
        at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:170)
        at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:822)
        at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:719)
        at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1013)
        at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
        at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
        at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
        at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
        at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
        at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
        at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
        at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
        at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.ClassNotFoundException: com.lowagie.text.Phrase
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
        ... 36 more

mattharr
Posts: 20
Joined: 01 Feb 2011, 04:49

22 Mar 2011, 21:07

The manual says the tested version of iText is 2.1.7.

Could the class structures have changed since the version you are using?

Cheers,

Matt

User avatar
mediterran81
Posts: 29
Joined: 22 Mar 2011, 12:14
Location: France
Contact:

23 Mar 2011, 00:09

Thanks!

I used 1.4.8 the first time and when read the manual changed to 2.1.7.
Actually, I am using 2.1.7 but the problem remains.
:oops:

User avatar
mediterran81
Posts: 29
Joined: 22 Mar 2011, 12:14
Location: France
Contact:

23 Mar 2011, 13:04

UPDATE:

I finally could resolve my issue.

- The first mistake (maybe abonormality), was that I used <p:commandLink> instead of <h:commandLink>. When I read the FAQ, the p:commandButton and p:commandLink do not operate like

Code: Select all

h:commandLink
and

Code: Select all

 h:commandButton 
(Should use redirect option to make them work instead of setting ajax attribute to false, but I still do not know how)!
When I replaced

Code: Select all

<p:commandLink>
by

Code: Select all

<h:commandLink>
, CSV and XML export worked fine with no error output. But XLS and PDF Exports produced the same errors.

- The second thing I did was to follow the last advice and change the server to test (I changed from Glassfish 3.0.1 to Glassfish 3.1) and removed the libraries from my classpath and recreate them using the original names (for itext: iText-2.17 and for commons-poi : poi-3.2-FINAL)! The first time I added libraries to my IDE I used custom names (apache-commons-poi and itext).

Same thing with ARisto Theme. It works fine now:
I added the library to the classpath (aristo-1.0.0.jar -same name-) and added this to web.xml:

Code: Select all

<context-param>
        <description>Aristo Theme from Primefaces (library added in the classpath)</description>
        <param-name>primefaces.THEME</param-name>
        <param-value>aristo</param-value>
    </context-param>
Now all exports work fine.
But I still am wondering what was up with Glassfish 3.0.1! Mojarra version? JSF runtime? was it - as said above - that GF 3.0.1 was building my project's classpath the wrong way.

Thank you everybody for your help. It is fully appreciated.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 29 guests