aspose file tools*
The moose likes JSF and the fly likes deploying a jsf application to tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "deploying a jsf application to tomcat" Watch "deploying a jsf application to tomcat" New topic
Author

deploying a jsf application to tomcat

sonia pandit
Ranch Hand

Joined: Apr 19, 2008
Posts: 137
How do I deploy a jsf application to tomcat?

Thanks,

Sonia
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16058
    
  21

Same way as any other webapp. Build a WAR and deploy it.

The biggest difference is that as of Tomcat 6, you don't have JEE compliance, only J2EE. So you have to explicitly include a jsf-impl library in the WAR along with the jsf-api library. A JEE-compliant server would only require the jsf-api library, since the jsf-impl is part of the server itself.


Customer surveys are for companies who didn't pay proper attention to begin with.
sonia pandit
Ranch Hand

Joined: Apr 19, 2008
Posts: 137
I took this code out of O'Reilly's book posted online at:

http://onjava.com/pub/a/onjava/2005/07/13/jsfupload.html?page=1;

I created a war file and I put it in the WebApps directory. (Is that correct?)
I still get a 404.

Thanks in advance,

Sonia
Smitha H Rao
Ranch Hand

Joined: Oct 20, 2007
Posts: 50
Refer this tutorial. It explains you how you can do it with the screenshots

http://www.skill-guru.com/blog/2009/08/10/319/


Free Mock tests Interview questions
sonia pandit
Ranch Hand

Joined: Apr 19, 2008
Posts: 137
http://onjava.com/pub/a/onjava/2005/07/13/jsfupload.html?page=1

Is similar to your posting of Upload Files with JSF and MyFaces.
http://www.skill-guru.com/blog/2009/09/10/upload-files-with-jsf-and-myfaces/
And I am getting the following
Oct 1, 2009 1:24:51 PM org.apache.jasper.runtime.JspFactoryImpl internalGetPageContext
SEVERE: Exception initializing page context
java.lang.StackOverflowError and this:

Oct 1, 2009 12:53:09 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet jsp threw exception
java.lang.NoClassDefFoundError: Could not initialize class org.apache.myfaces.shared_tomahawk.config.MyfacesConfig

Thanks,

Sonia
Smitha H Rao
Ranch Hand

Joined: Oct 20, 2007
Posts: 50
It looks like you are not having tomahawk.jar in your WebApp/WEB-INF/lib directory.

Please check it.
sonia pandit
Ranch Hand

Joined: Apr 19, 2008
Posts: 137
I have in in the lib directory.
Smitha H Rao
Ranch Hand

Joined: Oct 20, 2007
Posts: 50
can you please send full exception stack trace to smitha.h.rao@gmail.com
sonia pandit
Ranch Hand

Joined: Apr 19, 2008
Posts: 137
Smitha,

http://www.skill-guru.com/blog/2009/08/10/319/
Do you have the sample code I can import into eclipse? Can you send it to me at

v.kris21@gmail.com?

Thanks,

Sonia
Smitha H Rao
Ranch Hand

Joined: Oct 20, 2007
Posts: 50
Looking at your code which you had sent me.. I found that the major mistake in your project is the web.xml file.

The step you should follow is when following skill-guru tutorial for fileupload are:
1. First deply the sample jsf application from the jsf beginner's tutorial
http://www.skill-guru.com/blog/2009/08/10/319/

2. Then you have to integrate the myfaces into it. (combining the web.xml entiores and jars also)
http://www.skill-guru.com/blog/2009/09/10/upload-files-with-jsf-and-myfaces/

In your application you didn't had jsf configuration itself.
Also you also missed commons-io jar, which is clearly mentioned in the tutorial.

Also you had the whole myfaces downloaded directory inside your lib, which also includes unnecessary jars twice..

Hope this helps
sonia pandit
Ranch Hand

Joined: Apr 19, 2008
Posts: 137
Hi,

Thanks for your help. That is working for me

Can you elaborate on what was wrong with the web.xml? and how do you make an application jsf enabled.

Thanks,

Sonia
sonia pandit
Ranch Hand

Joined: Apr 19, 2008
Posts: 137
Hi Smitha,

I am trying to follow the tutorial at the link you provided:

http://www.skill-guru.com/blog/2009/08/10/319/

But even though Tomcat has been added as a server to eclipse,
when I right click on the project it does not give me the option
to run on Tomcat. How can I fix that?

Thanks,

Sonia
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: deploying a jsf application to tomcat