Advertisement

07.02.2008 at 03:29PM PDT, ID: 23535352
[x]
Attachment Details

How do I get seam applications working in jetty?

Asked by HappyEngineer in Java Server Faces (JSF)

I'm trying to learn Seam and JSF. I downloaded jboss with the seam examples, but I can't get them to work in my app server (jetty). When I run ant in any of the example projects (e.g. jboss-seam-2.0.3.CR1\examples\dvdstore or jboss-seam-2.0.3.CR1\examples\icefaces) it creates files in the dist directories.

I take the war files that are generated, I unzip them, copy all the jars from jboss-seam-2.0.3.CR1\lib into the WEB-INF\lib of the example, then I move the result over to the webapps directory of jetty.

After starting jetty it gives me these errors:

org.mortbay.util.MultiException[java.lang.RuntimeException: Could not create Component: orderHome, java.lang.IllegalStateException: Application was not properly initialized at startup, could not find Factory: javax.faces.context.FacesContextFactory]
      at org.mortbay.http.HttpServer.doStart(HttpServer.java:686)
      at org.mortbay.jetty.plus.Server.doStart(Server.java:153)
      at org.mortbay.util.Container.start(Container.java:72)
      at org.mortbay.jetty.plus.Server.main(Server.java:202)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.mortbay.start.Main.invokeMain(Main.java:151)
      at org.mortbay.start.Main.start(Main.java:476)
      at org.mortbay.start.Main.main(Main.java:94)
java.lang.RuntimeException: Could not create Component: orderHome
      at org.jboss.seam.init.Initialization.addComponent(Initialization.java:989)
      at org.jboss.seam.init.Initialization.installComponents(Initialization.java:911)
      at org.jboss.seam.init.Initialization.init(Initialization.java:589)
      at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:34)
      at org.mortbay.jetty.servlet.WebApplicationContext.doStart(WebApplicationContext.java:495)
      at org.mortbay.jetty.plus.PlusWebAppContext.doStart(PlusWebAppContext.java:149)
      at org.mortbay.util.Container.start(Container.java:72)
      at org.mortbay.http.HttpServer.doStart(HttpServer.java:708)
      at org.mortbay.jetty.plus.Server.doStart(Server.java:153)
      at org.mortbay.util.Container.start(Container.java:72)
      at org.mortbay.jetty.plus.Server.main(Server.java:202)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.mortbay.start.Main.invokeMain(Main.java:151)
      at org.mortbay.start.Main.start(Main.java:476)
      at org.mortbay.start.Main.main(Main.java:94)
Caused by: java.lang.IllegalArgumentException: java.lang.ClassNotFoundException: com.jboss.dvd.seam.Order
      at org.jboss.seam.util.Conversions$ClassConverter.toObject(Conversions.java:265)
      at org.jboss.seam.util.Conversions$ClassConverter.toObject(Conversions.java:255)
      at org.jboss.seam.Component$ConstantInitialValue.<init>(Component.java:2320)
      at org.jboss.seam.Component.getInitialValue(Component.java:518)
      at org.jboss.seam.Component.getTopInitialValue(Component.java:498)
      at org.jboss.seam.Component.initInitializers(Component.java:476)
      at org.jboss.seam.Component.<init>(Component.java:264)
      at org.jboss.seam.Component.<init>(Component.java:217)
      at org.jboss.seam.init.Initialization.addComponent(Initialization.java:974)
      ... 17 more
Caused by: java.lang.ClassNotFoundException: com.jboss.dvd.seam.Order
      at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
      at org.mortbay.http.ContextLoader.loadClass(ContextLoader.java:219)
      at org.mortbay.http.ContextLoader.loadClass(ContextLoader.java:187)
      at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:169)
      at org.jboss.seam.util.Reflections.classForName(Reflections.java:165)
      at org.jboss.seam.util.Conversions$ClassConverter.toObject(Conversions.java:261)
      ... 25 more
java.lang.IllegalStateException: Application was not properly initialized at startup, could not find Factory: javax.faces.context.FacesContextFactory
      at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:256)
      at javax.faces.webapp.FacesServlet.init(FacesServlet.java:142)
      at org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:383)
      at org.mortbay.jetty.servlet.ServletHolder.start(ServletHolder.java:243)
      at org.mortbay.jetty.servlet.ServletHandler.initializeServlets(ServletHandler.java:446)
      at org.mortbay.jetty.servlet.WebApplicationHandler.initializeServlets(WebApplicationHandler.java:321)
      at org.mortbay.jetty.servlet.WebApplicationContext.doStart(WebApplicationContext.java:509)
      at org.mortbay.jetty.plus.PlusWebAppContext.doStart(PlusWebAppContext.java:149)
      at org.mortbay.util.Container.start(Container.java:72)
      at org.mortbay.http.HttpServer.doStart(HttpServer.java:708)
      at org.mortbay.jetty.plus.Server.doStart(Server.java:153)
      at org.mortbay.util.Container.start(Container.java:72)
      at org.mortbay.jetty.plus.Server.main(Server.java:202)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.mortbay.start.Main.invokeMain(Main.java:151)
      at org.mortbay.start.Main.start(Main.java:476)
      at org.mortbay.start.Main.main(Main.java:94)


I've found a bunch of references to these errors on various sites, but none of them provided a solution I could use.

I have been thinking of trying glassfish, so I downloaded it and tried to deploy the ear file that is generated. When I do that it gives the error "Deploying application in domain failed; Fatal Error from EJB Compiler -- javassist/util/proxy/MethodHandler Fatal Error from EJB Compiler -- javassist/util/proxy/MethodHandler", so it apparently doesn't work out of the box for glassfish either.

Anyone know what I can do? It sort of sounded like the FacesContextFactory error has something to do with jsf 1.2 vs jsf 1.1, but I can't tell for sure if that is true. Even if it is, it doesn't make sense. I'm using the jsf jars that came with the jboss examples, so they should work.Start Free Trial
 
Loading Advertisement...
 
[+][-]07.04.2008 at 11:44PM PDT, ID: 21936125

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Java Server Faces (JSF)
Sign Up Now!
Solution Provided By: vzilka
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_EXPERT_20070906