3
votes

I want to upload a file to my glassfish v3.0, but when i use richfaces and prime faces, i get problems. Is there any compatibility issue with file uploading in glassfishV3.0? Can files be uploaded to glassfish from a JSF page?

How can is do a very simple file upload to my server from a JSF? What tools should i use? What is the most common and easy approach to file uploading ussing JSF?

Update

Here is the problem i have with rich faces:

What i do first is add the info found at http://docs.jboss.org/richfaces/latest_3_3_X/en/devguide/html/GettingStarted.html#SimpleJSFapplicationwithRichFaces to mi web.xml(Also the richfaces jars inside the classpath in lib folder)

When i start the glassfish server from eclipse i get this message in the console:

WARNING: java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory

I have no idea what that means

2
@sfrk I don't think your problem is glassfish, so what are the problems you get? What does your code look like? This will all help you get answers. Also checkout this (albeit) different, but similar question stackoverflow.com/questions/1605758/file-upload-using-richfaces.Jacob Schoen

2 Answers

1
votes

java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory

It just means that the mentioned class is missing in the classpath. As the package name hints, that class is part of Apache Commons Logging and that its homepage is at http://commons.apache.org/logging where you can download the JAR. Drop it in /WEB-INF/lib folder (which is part of webapp's default classpath) and this exception should disappear.

0
votes

This post might be little too late but have you tried adding the following dependency to your project.

<dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>jcl-over-slf4j</artifactId>
    <version>1.7.2</version>
</dependency>

You can read more about the dependency here: http://www.slf4j.org/legacy.html