JSF 2 and Richfaces 4 - fileUpload

H

Hollow Quincy

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

Frank Langelage

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

Hollow Quincy

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
 
F

Frank Langelage

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

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

Hollow Quincy

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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top