将应用程序迁移到glassfish 4

时间:2013-12-05 15:51:42

标签: java jsf-2 glassfish glassfish-4

我在glassfish 3.1.2.2中运行了一个应用程序,并决定试用glassfish 4.0,但看起来很简单的任务很快就会陷入配置噩梦。事情就像预期的那样不起作用。 简而言之,在部署应用程序并在浏览器中打开它之后,我看到的只是一个空白屏幕,在server.log中,这个惊人的异常并没有向我展示任何开始挖掘的地方:

java.lang.NullPointerException: null
at com.sun.faces.facelets.tag.TagAttributeImpl.getBoolean(TagAttributeImpl.java:150) ~[javax.faces.jar:2.2.0]
at com.sun.faces.facelets.tag.jstl.core.IfHandler.apply(IfHandler.java:91) ~[javax.faces.jar:2.2.0]
at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95) ~[javax.faces.jar:2.2.0]
at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137) ~[javax.faces.jar:2.2.0]
at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:190) ~[javax.faces.jar:2.2.0]
at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120) ~[javax.faces.jar:2.2.0]
at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95) ~[javax.faces.jar:2.2.0]
at com.sun.faces.facelets.tag.jsf.core.ViewHandler.apply(ViewHandler.java:212) ~[javax.faces.jar:2.2.0]
at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95) ~[javax.faces.jar:2.2.0]
at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93) ~[javax.faces.jar:2.2.0]
at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:87) ~[javax.faces.jar:2.2.0]
at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:312) ~[javax.faces.jar:2.2.0]
at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:371) ~[javax.faces.jar:2.2.0]
at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:350) ~[javax.faces.jar:2.2.0]
at com.sun.faces.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:199) ~[javax.faces.jar:2.2.0]
at com.sun.faces.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:169) ~[javax.faces.jar:2.2.0]
at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93) ~[javax.faces.jar:2.2.0]
at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:87) ~[javax.faces.jar:2.2.0]
at com.sun.faces.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:161) ~[javax.faces.jar:2.2.0]
at com.sun.faces.application.view.FaceletViewHandlingStrategy.buildView(FaceletViewHandlingStrategy.java:972) ~[javax.faces.jar:2.2.0]
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:99) ~[javax.faces.jar:2.2.0]
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) ~[javax.faces.jar:2.2.0]
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219) ~[javax.faces.jar:2.2.0]
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:647) ~[javax.faces.jar:2.2.0]
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682) ~[web-core.jar:na]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:344) ~[web-core.jar:na]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) ~[web-core.jar:na]
at sibs.security.JsfFilter.doFilter(JsfFilter.java:41) ~[JsfFilter.class:na]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256) ~[web-core.jar:na]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) ~[web-core.jar:na]
at sibs.security.SecurityFilter.doFilter(SecurityFilter.java:37) ~[SecurityFilter.class:na]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256) ~[web-core.jar:na]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) ~[web-core.jar:na]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:316) ~[web-core.jar:na]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160) ~[web-core.jar:na]
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734) ~[web-core.jar:na]
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673) ~[web-core.jar:na]
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99) ~[web-glue.jar:na]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174) ~[web-core.jar:na]
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:357) ~[web-core.jar:na]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:260) ~[web-core.jar:na]
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:188) ~[kernel.jar:na]
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191) ~[nucleus-grizzly-all.jar:na]
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168) ~[nucleus-grizzly-all.jar:na]
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189) ~[nucleus-grizzly-all.jar:na]
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119) ~[nucleus-grizzly-all.jar:na]
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288) ~[nucleus-grizzly-all.jar:na]
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206) ~[nucleus-grizzly-all.jar:na]
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136) ~[nucleus-grizzly-all.jar:na]
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114) ~[nucleus-grizzly-all.jar:na]
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77) ~[nucleus-grizzly-all.jar:na]
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838) ~[nucleus-grizzly-all.jar:na]
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113) ~[nucleus-grizzly-all.jar:na]
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115) ~[nucleus-grizzly-all.jar:na]
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55) ~[nucleus-grizzly-all.jar:na]
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135) ~[nucleus-grizzly-all.jar:na]
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564) ~[nucleus-grizzly-all.jar:na]
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544) ~[nucleus-grizzly-all.jar:na]
at java.lang.Thread.run(Thread.java:724) ~[na:1.7.0_25]

有人可以帮帮我吗?

亲切的问候,

Carlos Ferreira

2 个答案:

答案 0 :(得分:3)

你见过this answer吗?如果您可以更改默认的强制行为,则可以避免更改任何代码。

  

对非基本类型(String除外)的空值的默认强制返回空值。例如,强制为Boolean的null现在返回null,而强制为boolean的null返回false。

答案 1 :(得分:0)

我们将应用程序从Glassfish 3迁移到Glassfish 4时遇到了类似的问题。问题的根本原因是Glassfish 4软件包中存在的表达式语言库不支持默认的强制行为。所以我们必须包含以下EL版本

    <dependency>
        <groupId>org.glassfish.web</groupId>
        <artifactId>javax.el</artifactId>
        <version>2.2.6</version>
    </dependency>

并对glassfish-web.xml文件进行其他更改,以更改Web应用程序类加载器的行为,以便在委派给其父级之前查看本地类加载器。

    <class-loader delegate="false"/>