NPE in glassfish 3.1

Splash Forums PrettyFaces Users NPE in glassfish 3.1

Tagged: ,

This topic contains 5 replies, has 3 voices, and was last updated by  Lincoln Baxter III 6 years, 3 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #17979

    goutham.rao
    Participant

    Hello There,

    I have been using prettyfaces for a while now and it worked perfectly fine. Few days ago i updated my server(Glassfish) from 3.0 to 3.1 and from then on prettyfaces has stopped working.

    I even tried it with the latest version and still the exception did not go.

    My dev environment consists of the following:

    jsf : version 2.0

    mojaarr version: 2.0.3

    glassfish version:3.1

    Please can you have a look into this. The error stack trace is as below:

    Error invoking requestInitialized method on ServletRequestListener com.ocpsoft.pretty.faces.config.PrettyConfigListener

    java.lang.NullPointerException

    at com.sun.faces.application.ServletContextSensitiveSingletonStore.<init>(ServletContextSensitiveSingletonStore.java:83)

    at com.sun.faces.application.ApplicationFactoryImpl.getApplication(ApplicationFactoryImpl.java:92)

    at com.ocpsoft.pretty.faces.util.FacesFactory.getApplication(FacesFactory.java:31)

    at com.ocpsoft.pretty.faces.config.PrettyConfigListener.requestInitialized(PrettyConfigListener.java:47)

    at org.apache.catalina.core.StandardContext.fireRequestInitializedEvent(StandardContext.java:4551)

    at org.apache.catalina.core.StandardHostValve.preInvoke(StandardHostValve.java:626)

    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:154)

    at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:326)

    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:227)

    at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:170)

    at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:822)

    at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:719)

    at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1013)

    at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)

    at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)

    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)

    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)

    at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)

    at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)

    at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)

    at com.sun.grizzly.ContextTask.run(ContextTask.java:71)

    at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)

    at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)

    at java.lang.Thread.run(Thread.java:619)

    And the logs show this.

    2011-07-01 16:46:23 WebXmlParser.parse()- Completed parsing web.xml

    2011-07-01 16:46:23 PrettyConfigurator.configure()- Setting config into ServletContext

    2011-07-01 16:46:23 PrettyFilter.init()- PrettyFilter initialized.

    2011-07-01 16:46:57 PrettyContext.<init>()- Initialized PrettyContext

    2011-07-01 16:46:57 PrettyContext.<init>()- Initialized PrettyContext

    2011-07-01 16:46:57 PrettyContext.getCurrentInstance()- PrettyContext not found in Request – building new instance

    2011-07-01 16:46:57 PrettyFilter.doFilter()- Request is not mapped using PrettyFaces. Continue.

    2011-07-01 16:47:00 PrettyContext.<init>()- Initialized PrettyContext

    2011-07-01 16:47:00 PrettyFilter.doFilter()- Request is not mapped using PrettyFaces. Continue.

    2011-07-01 16:47:00 PrettyContext.getCurrentInstance()- Retrieved PrettyContext from Request

    2011-07-01 16:47:00 ParameterInjector.validateParameters()- Validating parameters.

    2011-07-01 16:47:00 PrettyContext.getCurrentInstance()- Retrieved PrettyContext from Request

    2011-07-01 16:47:00 ParameterInjector.injectParameters()- Injecting parameters

    2011-07-01 16:47:00 PrettyContext.getCurrentInstance()- Retrieved PrettyContext from Request

    2011-07-01 16:47:00 PrettyContext.getCurrentInstance()- Retrieved PrettyContext from Request

    2011-07-01 16:47:00 PrettyContext.getCurrentInstance()- Retrieved PrettyContext from Request

    2011-07-01 16:47:00 PrettyContext.getCurrentInstance()- Retrieved PrettyContext from Request

    If you need more information , please do let me know. I haven’t had time to build a sample app and replicate the error. I will try to make one over the weekend.

    Thanks,

    Goutham Rao

    #21106

    Very strange. Can you perhaps create a simple example app for us that re-produces the problem? Also, please let us know exactly which GlassFish version/build you are using. (You’ll probably need to look at the version/build number when GlassFish boots up.)

    Thanks!

    #21107

    This looks exactly like an issues that was recently reported here on the forum. It is caused by a bug of the Mojarra version shipped with Glassfish 3.1.

    See here:

    http://ocpsoft.com/support/topic/null-pointer-exception

    http://ocpsoft.com/support/topic/configuration-error

    A user reported that updating Mojarra to version 2.1.1 fixes the problem. See this comment on the corresponding issue report:

    http://code.google.com/p/prettyfaces/issues/detail?id=90#c11

    I hope this helps! :)

    Christian

    #21108

    goutham.rao
    Participant

    Brilliant guys. Downloading the 2.1.2 release of Mojarra and replacing the ones within the glassfish modules seems to have solved the startup issue.

    I will test if the pretty urls are working tomorrow ( am having issues with container managed security , did some stupid db change :-) )

    Thanks for the tip Christian.

    I have pasted the download link below for future reference.

    PS: http://javaserverfaces.java.net/download.html

    Cheers,

    Goutham

    #21109

    You’re welcome! :)

    It’s really bad that PrettyFaces doesn’t work with Glassfish 3.1 out of the box but unfortunately there is nothing we can do on our side to fix this because it is caused by this Mojarra bug. Perhaps we should create some kind of “Common Problems” page in wiki or something like this.

    But I’m glad to hear that everything is working for you now. Feel free to post on the forum again if you have any other issues or new ideas for PrettyFaces! :)

    Christian

    #21110

    Yeah, this makes me wonder if there’s any at all kind of workaround we can put in place for this :(

    Really a bummer.

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.

Comments are closed.