Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

JSF 2 and Richfaces 4 - fileUpload

153 views
Skip to first unread message

Hollow Quincy

unread,
Dec 23, 2011, 7:09:41 AM12/23/11
to
Hi,

I am trying to create application with EJB3.1, JSF2.0 and RichFaces
4.1.0 Final.

Generally I managed to run ajax action on web page. I would like to
use rich:fileupload.
When I write:
public void listener(FileUploadEvent event) throws Exception {
UploadedFile item = event.getUploadedFile();
and run maven 3 I have error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-
plugin:2.3.1:compile (default-compile) on project xxx: Compilation
failure
[ERROR] class file for javax.faces.event.FacesEvent not found

I can see that
public class FileUploadEvent extends FacesEvent
but it is true, that I cannot find class:
javax.faces.event.FacesEvent

Is it a bug ? what should I do ?

Thanks for help !

Frank Langelage

unread,
Dec 23, 2011, 8:14:46 AM12/23/11
to
On 23.12.11 13:09, Hollow Quincy wrote:
> Hi,
>
> I am trying to create application with EJB3.1, JSF2.0 and RichFaces
> 4.1.0 Final.

> and run maven 3 I have error:
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-
> plugin:2.3.1:compile (default-compile) on project xxx: Compilation
> failure
> [ERROR] class file for javax.faces.event.FacesEvent not found

> I can see that
> public class FileUploadEvent extends FacesEvent
> but it is true, that I cannot find class:
> javax.faces.event.FacesEvent
>
> Is it a bug ? what should I do ?

This class is in jsf-api.jar, seems that it's not in your classpath
during compilation.

Hollow Quincy

unread,
Dec 27, 2011, 3:47:57 AM12/27/11
to
On 23 Gru, 14:14, Frank Langelage <fr...@lafr.de> wrote:
> On 23.12.11 13:09, Hollow Quincy wrote:
[...]
> > [ERROR] class file for javax.faces.event.FacesEvent not found
> > I can see that
> > public class FileUploadEvent extends FacesEvent
> > but it is true, that I cannot find class:
> > javax.faces.event.FacesEvent
[...]
> This class is in jsf-api.jar, seems that it's not in your classpath
> during compilation.

Probably you are right, but when I checked where can I find this jar
in findJar.com page:
http://www.findjar.com/index.x?query=jsf-api
I could see that JSF 1.2 contains this jar, but I am using JSF 2 !
Should I really use "jsf-api-1.2.jar in javax/faces/jsf-api/1.2" ?

Thanks for help

Frank Langelage

unread,
Dec 27, 2011, 6:42:40 AM12/27/11
to
How can you say you're using JSF 2.0?

Anyhow, look at http://javaserverfaces.java.net/download.html to
download the required jars or for the maven integration.

You should use the same version for compilation and runtime.

Hollow Quincy

unread,
Dec 27, 2011, 8:47:41 AM12/27/11
to
On 27 Gru, 12:42, Frank Langelage <fr...@lafr.de> wrote:
[...]
> How can you say you're using JSF 2.0?
>
> Anyhow, look athttp://javaserverfaces.java.net/download.htmlto
> download the required jars or for the maven integration.
>
> You should use the same version for compilation and runtime.

You have right, when I added to my maven dependency like above, it
works fine.

<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>6.0</version>
<scope>provided</scope>
</dependency>

Thank you for help!
0 new messages