Skip to main content

problem in running the project?

4 replies [Last post]
nicenepal
Offline
Joined: 2006-07-02
Points: 0

Hello everybody,
I am new to glassFish. So, I am testing a new web project in glassFish-v2ur2 with NetBeans 6.1 and using JDK 1.5. I create new project and place few swing components in page1.jsp to test. After that I added listener in web.xml as:

org.apache.myfaces.webapp.StartupServletContextListener

When I build and run the project error occurs:

WebModule[/Testweb]PWC1257: Error configuring application listener of class org.apache.myfaces.webapp.StartupServletContextListener
java.lang.ClassNotFoundException: org.apache.myfaces.webapp.StartupServletContextListener
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1498)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4466)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:5184)
at com.sun.enterprise.web.WebModule.start(WebModule.java:326)
at com.sun.enterprise.web.LifecycleStarter.doRun(LifecycleStarter.java:58)
at com.sun.appserv.management.util.misc.RunnableBase.runSync(RunnableBase.java:304)
at com.sun.appserv.management.util.misc.RunnableBase._submit(RunnableBase.java:176)
at com.sun.appserv.management.util.misc.RunnableBase.submit(RunnableBase.java:192)
at com.sun.enterprise.web.VirtualServer.startChildren(VirtualServer.java:1672)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1231)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:955)
at com.sun.enterprise.web.LifecycleStarter.doRun(LifecycleStarter.java:58)
at com.sun.appserv.management.util.misc.RunnableBase.runSync(RunnableBase.java:304)
at com.sun.appserv.management.util.misc.RunnableBase._submit(RunnableBase.java:176)
at com.sun.appserv.management.util.misc.RunnableBase.submit(RunnableBase.java:192)
at com.sun.enterprise.web.EmbeddedWebContainer$WebEngine.startChildren(EmbeddedWebContainer.java:453)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1231)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:533)
at org.apache.catalina.startup.Embedded.start(Embedded.java:936)
at com.sun.enterprise.web.WebContainer.start(WebContainer.java:873)
at com.sun.enterprise.web.PEWebContainer.startInstance(PEWebContainer.java:790)
at com.sun.enterprise.web.PEWebContainerLifecycle.onStartup(PEWebContainerLifecycle.java:84)
at com.sun.enterprise.server.ApplicationServer.onStartup(ApplicationServer.java:442)
at com.sun.enterprise.server.ondemand.OnDemandServer.onStartup(OnDemandServer.java:120)
at com.sun.enterprise.server.PEMain.run(PEMain.java:411)
at com.sun.enterprise.server.PEMain.main(PEMain.java:338)
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:585)
at com.sun.enterprise.server.PELaunch.main(PELaunch.java:412)

Why is it happening ? Was I did any wrong in the code?
Can anyone suggest me to solve the problem.....
Thank you.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
nicenepal
Offline
Joined: 2006-07-02
Points: 0

Thank you all for your suggestion...

vaughnmb
Offline
Joined: 2006-02-20
Points: 0

Looks like you need the MyFaces jars in your project. You can get them from here.
http://myfaces.apache.org/

jdlee
Offline
Joined: 2006-01-25
Points: 0

That might solve the immediate error, but I think it will cause others. If you are deploying to GlassFish, you are going to use Mojarra, as GlassFish bundles that. Given that, you can remove the listener declaration, as it is not needed, and, unless you're using MyFaces-specific classes (which is a bad idea, usually, IME) you shouldn't need the MyFaces jars at all.

jkva
Offline
Joined: 2005-04-06
Points: 0

Also, if my experiences are of any value, Mojarra is IMHO much better in it's implementation than MyFaces, at least since version 1.2.

And, as jdlee says, it's generally a bad idea to use implementation specific features, except configuration parameters to tune performance or something like that. Implementations should be interchangeable.