组合视图 统一视图 树状图
讨论主题 [ 上一个 | 下一个 ]
toggle
NullPointerException UIViewRoot upon deploy Micael Ericsson 2013年9月4日 上午7:36
RE: NullPointerException UIViewRoot upon deploy Micael Ericsson 2013年9月9日 上午12:54
RE: NullPointerException UIViewRoot upon deploy Juan Gonzalez 2013年9月9日 上午6:10
RE: NullPointerException UIViewRoot upon deploy Micael Ericsson 2013年9月10日 上午6:19
RE: NullPointerException UIViewRoot upon deploy Juan Gonzalez 2013年9月10日 上午6:31
RE: NullPointerException UIViewRoot upon deploy Vernon Singleton 2013年9月10日 下午7:28
RE: NullPointerException UIViewRoot upon deploy Micael Ericsson 2013年9月10日 下午11:12
RE: NullPointerException UIViewRoot upon deploy Juan Gonzalez 2013年9月10日 下午11:17
RE: NullPointerException UIViewRoot upon deploy Micael Ericsson 2013年9月11日 上午1:14
RE: NullPointerException UIViewRoot upon deploy Juan Gonzalez 2013年9月11日 上午1:17
RE: NullPointerException UIViewRoot upon deploy Micael Ericsson 2013年9月11日 上午1:22
RE: NullPointerException UIViewRoot upon deploy Juan Gonzalez 2013年9月11日 上午1:25
RE: NullPointerException UIViewRoot upon deploy Micael Ericsson 2013年9月11日 上午2:03
RE: NullPointerException UIViewRoot upon deploy Neil Griffin 2013年9月11日 上午6:11
RE: NullPointerException UIViewRoot upon deploy Micael Ericsson 2013年9月30日 上午4:56
RE: NullPointerException UIViewRoot upon deploy Neil Griffin 2013年9月30日 下午1:54
RE: NullPointerException UIViewRoot upon deploy Micael Ericsson 2013年10月1日 上午2:31
RE: NullPointerException UIViewRoot upon deploy Neil Griffin 2013年10月1日 上午8:07
RE: NullPointerException UIViewRoot upon deploy Micael Ericsson 2013年10月1日 上午10:49
RE: NullPointerException UIViewRoot upon deploy Neil Griffin 2013年10月1日 上午11:15
RE: NullPointerException UIViewRoot upon deploy Micael Ericsson 2013年10月1日 上午11:55
RE: NullPointerException UIViewRoot upon deploy Neil Griffin 2013年10月1日 下午12:25
RE: NullPointerException UIViewRoot upon deploy Micael Ericsson 2013年10月1日 下午11:15
Micael Ericsson
NullPointerException UIViewRoot upon deploy
2013年9月4日 上午7:36
答复

Micael Ericsson

等级: Regular Member

帖子: 100

加入日期: 2012年12月11日

最近的帖子

I have several portlets with the same problem. When I deploy them I get the following in tomcat consol:
14:21:57,822 INFO [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][PortletAutoDeployListener:87] Portlets for C:\Product\Liferay\l
iferay-portal-6.1.1-ce-ga2\deploy\AktivaUppdrag-1.0-SNAPSHOT.war copied successfully. Deployment will start in a few seconds.
sep 04, 2013 2:22:04 EM org.apache.catalina.startup.HostConfig checkResources
INFO: Undeploying context [/AktivaUppdrag-1.0-SNAPSHOT]
sep 04, 2013 2:22:04 EM org.apache.catalina.core.StandardContext listenerStop
SEVERE: Exception sending context destroyed event to listener instance of class com.sun.faces.config.ConfigureListener
java.lang.NullPointerException
at javax.faces.component.UIViewRoot.getViewMap(UIViewRoot.java:1541)
at com.sun.faces.config.InitFacesContext.release(InitFacesContext.java:223)
at com.sun.faces.config.ConfigureListener.contextDestroyed(ConfigureListener.java:352)
at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4819)
at org.apache.catalina.core.StandardContext.__stop(StandardContext.java:5466)
at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:1030)
at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1219)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1454)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:295)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1379)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1537)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1547)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1526)
at java.lang.Thread.run(Thread.java:722)

As far as I have read this could be a problem with the f:view tag placement but various tries gives the same answer. At current I have the following structure in my xhtml files.
<html...
<f:view...
<h:head..
<h:body...
...several jsf 2.0 tags such as ui:repeat
end tag for those above.
Liferay 6.1. JSF 2.1.16.

The portlet is deployed and runs fine. So far I have ignored above error, but we are close to production and this is not good in production log.

Suggestions?
Micael Ericsson
RE: NullPointerException UIViewRoot upon deploy
2013年9月9日 上午12:54
答复

Micael Ericsson

等级: Regular Member

帖子: 100

加入日期: 2012年12月11日

最近的帖子

No suggestions how to fix this?
Juan Gonzalez
RE: NullPointerException UIViewRoot upon deploy
2013年9月9日 上午6:10
答复

Juan Gonzalez

LIFERAY STAFF

等级: Liferay Legend

帖子: 2856

加入日期: 2008年10月28日

最近的帖子

Mmm I guess that <html> tag doesn't make sense. isn't it?

Try using :

<f:view ....>
..
..
</f:view>
Micael Ericsson
RE: NullPointerException UIViewRoot upon deploy
2013年9月10日 上午6:19
答复

Micael Ericsson

等级: Regular Member

帖子: 100

加入日期: 2012年12月11日

最近的帖子

Juan Gonzalez:
Mmm I guess that <html> tag doesn't make sense. isn't it?

Try using :

<f:view ....>
..
..
</f:view>


Current start of xhtml page is:
<?xml version="1.0"?>
<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets">
<f:view>
<f:event type="preRenderView" listener="#{aktivaUppdragController.initPage}"/>

Should I drop <html...> completely? How do I include taglibs (for JSF 2) ?
Juan Gonzalez
RE: NullPointerException UIViewRoot upon deploy
2013年9月10日 上午6:31
答复

Juan Gonzalez

LIFERAY STAFF

等级: Liferay Legend

帖子: 2856

加入日期: 2008年10月28日

最近的帖子

Simply add those schemas to f:view:

1<f:view xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core"
2    xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets">
Vernon Singleton
RE: NullPointerException UIViewRoot upon deploy
2013年9月10日 下午7:28
答复

Vernon Singleton

LIFERAY STAFF

等级: Expert

帖子: 278

加入日期: 2013年1月14日

最近的帖子

Micael Ericsson:
Should I drop <html...> completely? How do I include taglibs (for JSF 2) ?

Juan is correct. And ... let's briefly explain why ...

The html tag may not be completely ignored, but it certainly will not be rendered, and it is not necessary for a portlet.

In all of our demos, we use the f:view tag instead for the following reasons:
  1. Since <html> doesn't get rendered, it is kind of out of place in a portlet
  2. using f:view makes an explicit declaration that the xhtml file is a Facelet VIEW and not a Facelet ui:composition, and the benefit is that you can declare all the namespaces in the f:view tag.

Just my 2 cents + $5000 worth of training from my guru peers.
Micael Ericsson
RE: NullPointerException UIViewRoot upon deploy
2013年9月10日 下午11:12
答复

Micael Ericsson

等级: Regular Member

帖子: 100

加入日期: 2012年12月11日

最近的帖子

Thanks for the answers both Juan and Vernon. I'll change my code and see what happens.

Regarding demos at https://www.liferay.com/community/liferay-projects/liferay-faces/demos I only could find the java-code. I downloaded source for 6.1 but it didn't contain any xhtml-files and thus no header samples I could use. I don't have Git installed so I can't checka them out. Am I missing something? Why isn't web pages included?
Juan Gonzalez
RE: NullPointerException UIViewRoot upon deploy
2013年9月10日 下午11:17
答复

Juan Gonzalez

LIFERAY STAFF

等级: Liferay Legend

帖子: 2856

加入日期: 2008年10月28日

最近的帖子

Micael Ericsson
RE: NullPointerException UIViewRoot upon deploy
2013年9月11日 上午1:14
答复

Micael Ericsson

等级: Regular Member

帖子: 100

加入日期: 2012年12月11日

最近的帖子

I have updated my portlets with above suggestion but I still get error in my log.
Error:
INFO: Undeploying context [/Information-1.0-SNAPSHOT]
sep 11, 2013 7:56:10 FM org.apache.catalina.core.StandardContext listenerStop
SEVERE: Exception sending context destroyed event to listener instance of class com.sun.faces.config.ConfigureListener
java.lang.NullPointerException
at javax.faces.component.UIViewRoot.getViewMap(UIViewRoot.java:1541)
at com.sun.faces.config.InitFacesContext.release(InitFacesContext.java:223)
at com.sun.faces.config.ConfigureListener.contextDestroyed(ConfigureListener.java:352)
at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4819)
at org.apache.catalina.core.StandardContext.__stop(StandardContext.java:5466)
at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:1030)
at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1219)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1454)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:295)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1379)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1537)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1547)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1526)
at java.lang.Thread.run(Thread.java:722)

My xhtml-page:
<?xml version="1.0" encoding="UTF-8"?>
<f:view xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets">
<f:event type="preRenderView" listener="#{informationController.initPage}"/>
<h:head>
... some javascript ...
</h:head>
<h:body>
<h:messages />
<div>
... plenty of h:outputtext ...
</div>
</h:body>
</f:view>
Juan Gonzalez
RE: NullPointerException UIViewRoot upon deploy
2013年9月11日 上午1:17
答复

Juan Gonzalez

LIFERAY STAFF

等级: Liferay Legend

帖子: 2856

加入日期: 2008年10月28日

最近的帖子

Please can you attach your portlet so we can investigate?

What Liferay Portal version are you using?

Thanks.
Micael Ericsson
RE: NullPointerException UIViewRoot upon deploy
2013年9月11日 上午1:22
答复

Micael Ericsson

等级: Regular Member

帖子: 100

加入日期: 2012年12月11日

最近的帖子

Juan Gonzalez:
Please can you attach your portlet so we can investigate?

What Liferay Portal version are you using?

Thanks.


Information Portlet attached. Netbeans Maven project.
Liferay portal version 3.1.1.
附件: Information.zip (12.8k)
Juan Gonzalez
RE: NullPointerException UIViewRoot upon deploy
2013年9月11日 上午1:25
答复

Juan Gonzalez

LIFERAY STAFF

等级: Liferay Legend

帖子: 2856

加入日期: 2008年10月28日

最近的帖子

Micael Ericsson:

Liferay portal version 3.1.1.


I guess you said Liferay Faces version.

Please can you post your Liferay Portal version?
Micael Ericsson
RE: NullPointerException UIViewRoot upon deploy
2013年9月11日 上午2:03
答复

Micael Ericsson

等级: Regular Member

帖子: 100

加入日期: 2012年12月11日

最近的帖子

Juan Gonzalez:
Micael Ericsson:

Liferay portal version 3.1.1.


I guess you said Liferay Faces version.

Please can you post your Liferay Portal version?


Yes. liferay-faces-portal jar is 3.1.1.
Running plattform Liferay is liferay-portal-6.1.1-ce-ga2.
Neil Griffin
RE: NullPointerException UIViewRoot upon deploy
2013年9月11日 上午6:11
答复

Neil Griffin

LIFERAY STAFF

等级: Liferay Legend

帖子: 2351

加入日期: 2005年7月26日

最近的帖子

I looked at the portlet project you attached, but the versions of all the dependencies are declared in the parent pom, which was not included.

When you get a chance, please make sure that you are using version 3.1.3-ga4 of all the Liferay Faces JARs, and also version 2.1.21 of Mojarra. My best guess it that the stacktrace you reported will go away if you use those versions.
Micael Ericsson
RE: NullPointerException UIViewRoot upon deploy
2013年9月30日 上午4:56
答复

Micael Ericsson

等级: Regular Member

帖子: 100

加入日期: 2012年12月11日

最近的帖子

Neil Griffin:
I looked at the portlet project you attached, but the versions of all the dependencies are declared in the parent pom, which was not included.

When you get a chance, please make sure that you are using version 3.1.3-ga4 of all the Liferay Faces JARs, and also version 2.1.21 of Mojarra. My best guess it that the stacktrace you reported will go away if you use those versions.

I upgraded following jars from 3.1.1-ga2 to 3.1.3-ga4:
- liferay-faces-api
- liferay-faces-impl
- liferay-faces-portal
- liferay-faces-util

Rebuilt and deployed (cleaning cache) all my portlets gives following below error for each portlet.
Current Liferay version is 6.1.1-ce-ga2 and we can't upgrade at the moment.

As far as I can see we are not using any mojarra jar in our portlets.

Each portlets is a Maven project in NetBeans. WIth maven dependencies I am unable to find recommended mojarra version. api-2.0 and impl-2.0 is found.

Which jars and what version do I need? Are they possible to run on our Liferay version?

Stack trace from console:
13:45:42,143 INFO Initializing Liferay Faces Bridge 3.1.3-ga4 (Galatia / Sep 5, 2013 AD)
13:45:42,197 ERROR [BridgeFlashFactory:85] Classloader unable to find either the Mojarra or MyFaces Flash implementations
2013-09-30 13:45:42 JRebel: Listening 'file:/C:/Project/Web/webapp/MittNastaSteg/src/main/webapp/WEB-INF/liferay-display.xml' for changes on
class com.liferay.portal.deploy.hot.PortletHotDeployListener in MittNastaSteg-1.0-SNAPSHOT
13:45:42,253 INFO [BridgeSessionListener:87] Context initialized for contextPath=[/MittNastaSteg-1.0-SNAPSHOT]
13:45:42,253 INFO [StartupListener:50] Context initialized for contextPath=[/MittNastaSteg-1.0-SNAPSHOT]
13:45:42,293 INFO [StartupListener:77] Copied input-editor.jsp from LiferayFaces JAR to context path file=[C:\Project\Web\webapp\MittNastaS
teg\src\main\webapp\resources\liferay-ui\jsp\input-editor.jsp]
sep 30, 2013 1:45:42 EM org.apache.catalina.core.ApplicationContext log
SEVERE: StandardWrapper.Throwable
java.lang.IllegalStateException: Could not find backup for factory javax.faces.context.FacesContextFactory.
at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:1010)
at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:342)
at javax.faces.webapp.FacesServlet.init(FacesServlet.java:302)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1266)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1185)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1080)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5015)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5302)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:895)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1099)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1621)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
Neil Griffin
RE: NullPointerException UIViewRoot upon deploy
2013年9月30日 下午1:54
答复

Neil Griffin

LIFERAY STAFF

等级: Liferay Legend

帖子: 2351

加入日期: 2005年7月26日

最近的帖子

Looks like you need to add the following to your pom.xml descriptor:

 1<dependency>
 2    <groupId>com.sun.faces</groupId>
 3    <artifactId>jsf-api</artifactId>
 4    <version>2.1.21</version>
 5</dependency>
 6<dependency>
 7    <groupId>com.sun.faces</groupId>
 8    <artifactId>jsf-impl</artifactId>
 9    <version>2.1.21</version>
10</dependency>
Micael Ericsson
RE: NullPointerException UIViewRoot upon deploy
2013年10月1日 上午2:31
答复

Micael Ericsson

等级: Regular Member

帖子: 100

加入日期: 2012年12月11日

最近的帖子

Neil Griffin:
Looks like you need to add the following to your pom.xml descriptor:

 1<dependency>
 2    <groupId>com.sun.faces</groupId>
 3    <artifactId>jsf-api</artifactId>
 4    <version>2.1.21</version>
 5</dependency>
 6<dependency>
 7    <groupId>com.sun.faces</groupId>
 8    <artifactId>jsf-impl</artifactId>
 9    <version>2.1.21</version>
10</dependency>

Thanks!! This solved my problem. I had an older version of jsf-api and jsf-impl was not included at all.

But this gave me another problem.
I am using "xmlns:aui="http://liferay.com/faces/aui" for layout management in forms, like: <aui:layout cssClass="aui-rm-layout"> and <aui:column columnWidth="33" first="true" last="false">.

This doesn't work at all - each input field gets a new row instead of three in each row. I also receive "Warning: This page calls for XML namespace http://liferay.com/faces/aui declared with prefix aui but no taglibrary exists for that namespace.". Has this been excluded/changed?

This only thing I changed in my portlets was version number for faces and jsf jars.
Neil Griffin
RE: NullPointerException UIViewRoot upon deploy
2013年10月1日 上午8:07
答复

Neil Griffin

LIFERAY STAFF

等级: Liferay Legend

帖子: 2351

加入日期: 2005年7月26日

最近的帖子

The error message indicates that you need this one too:

1<dependency>
2    <groupId>com.liferay.faces</groupId>
3    <artifactId>liferay-faces-alloy</artifactId>
4    <version>3.1.3-ga4</version>
5</dependency>
Micael Ericsson
RE: NullPointerException UIViewRoot upon deploy
2013年10月1日 上午10:49
答复

Micael Ericsson

等级: Regular Member

帖子: 100

加入日期: 2012年12月11日

最近的帖子

Neil Griffin:
The error message indicates that you need this one too:

1<dependency>
2    <groupId>com.liferay.faces</groupId>
3    <artifactId>liferay-faces-alloy</artifactId>
4    <version>3.1.3-ga4</version>
5</dependency>


Thanks again! Now all forms looks ok again.

A little question. After adding liferay-faces-alloy Netbeans/Maven generated resources/liferay-ui/jsp/input-editor.jsp. Is this file needed? What does it do?
Neil Griffin
RE: NullPointerException UIViewRoot upon deploy
2013年10月1日 上午11:15
答复

Neil Griffin

LIFERAY STAFF

等级: Liferay Legend

帖子: 2351

加入日期: 2005年7月26日

最近的帖子

Before I answer, are you using JRebel?
Micael Ericsson
RE: NullPointerException UIViewRoot upon deploy
2013年10月1日 上午11:55
答复

Micael Ericsson

等级: Regular Member

帖子: 100

加入日期: 2012年12月11日

最近的帖子

Neil Griffin:
Before I answer, are you using JRebel?


That is correct. Is it a problem?
Neil Griffin
RE: NullPointerException UIViewRoot upon deploy
2013年10月1日 下午12:25
答复

Neil Griffin

LIFERAY STAFF

等级: Liferay Legend

帖子: 2351

加入日期: 2005年7月26日

最近的帖子

No, using JRebel is fine -- it is not a problem. But it will help me answer your question:

Netbeans/Maven generated resources/liferay-ui/jsp/input-editor.jsp. Is this file needed? What does it do?


JRebel is actually the reason why the input-editor.jsp file is appearing in your project. When your project WAR is deployed to Liferay, the com.liferay.faces.portal.listener.StartupListener class inside of liferay-faces-portal.jar will extract the input-editor.jsp file from itself so that it the servlet container will be able to issue a request dispatcher to it. Since you have JRebel installed, JRebel tricks the StartupListener into thinking that the servlet context is actually your project folder, and so it gets copied there instead. You can delete it from your project if you want to, but JRebel will cause it to be copied back there again the next time the server is started or the next time the portlet is re-deployed. It is just an unfortunate side-effect of using JRebel in conjunction with the Liferay Faces Portal project.

The purpose of the input-editor.jsp file is to support the Facelet version of the liferay-ui:input-editor tag.
Micael Ericsson
RE: NullPointerException UIViewRoot upon deploy
2013年10月1日 下午11:15
答复

Micael Ericsson

等级: Regular Member

帖子: 100

加入日期: 2012年12月11日

最近的帖子

Thanks for all the help. I think we can close this issue.

I can live with input-editor.jsp.