Forums de discussion

NPE at javax.servlet.http.Cookie.setDomain

antonio perez, modifié il y a 10 années.

NPE at javax.servlet.http.Cookie.setDomain

New Member Publications: 15 Date d'inscription: 07/02/13 Publications récentes
Hi,

I'm using Glassfish 3.1.2, jdk1.6.0_26, liferay-faces-bridge 3.1.1-ga2, richfaces 4.3.0 and jsf 2.1.22.

When i press the a4j:commandbutton, i receive the message Error Rendering View[/views/view.xhtml] java.lang.NullPointerException at javax.servlet.http.Cookie.setDomain(Cookie.java:222)

With jsf 2.1.16 i don't have this problem. Someone have a solution? I would like to not change the jsf version.

Thanks to all.
thumbnail
Neil Griffin, modifié il y a 10 années.

RE: NPE at javax.servlet.http.Cookie.setDomain

Liferay Legend Publications: 2655 Date d'inscription: 27/07/05 Publications récentes
Please see my comments at FACES-1538.
antonio perez, modifié il y a 10 années.

RE: NPE at javax.servlet.http.Cookie.setDomain

New Member Publications: 15 Date d'inscription: 07/02/13 Publications récentes
Hi,

With version 3.1.2-ga3 has returned to work everything perfectly.

When is the release date?

Thank you very much.
thumbnail
Bernd Prager, modifié il y a 10 années.

RE: NPE at javax.servlet.http.Cookie.setDomain

Junior Member Publications: 42 Date d'inscription: 20/12/12 Publications récentes
I am afraid it is not working for me.

I set up the installation exactly as pointed out at this link "Deploying JSF Portlets on Oracle WebLogic":

Here is a simple Primefaces test:
<!--?xml version="1.0"?-->

<f:view 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:p="http://primefaces.org/ui" xmlns:ui="http://java.sun.com/jsf/facelets">
	<h:head />
	<h:body>
		<h:form>
			<h:outputlabel for="name" value="Name:" style="font-weight:bold" />
    	   	<p:inputtext id="name" value="#{helloBean.name}"></p:inputtext>
			<p:commandbutton value="Submit" update="display" />
			<p></p> 
			<h:outputtext value="Hello #{helloBean.name}." id="display" />
    	</h:form>
	</h:body>
</f:view>


and here is the bean code:

package com.sandp.dta.bernd.helloworld;

import java.io.Serializable;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;

import com.liferay.faces.util.logging.Logger;
import com.liferay.faces.util.logging.LoggerFactory;
 
@ManagedBean
@RequestScoped
public class HelloBean implements Serializable {
	
	public HelloBean() {
		logger.debug("constructor");
		this.name = "anonymous";
	}
	private static final Logger logger = LoggerFactory.getLogger(HelloBean.class);
 
	private static final long serialVersionUID = 1L;
 
	private String name;
 
	public String getName() {
		logger.debug("getName method");
		return name;
	}
	public void setName(String name) {
		logger.debug("setName method");
		this.name = name;
	}
}


With mojarra 2.1.21 I still get:

13:39:01,021 ERROR [ExceptionHandlerAjaxImpl:62]
java.lang.NullPointerException
        at javax.servlet.http.Cookie.setDomain(Cookie.java:222)
        at com.liferay.faces.bridge.context.ExternalContextCompatImpl.addResponseCookie(ExternalContextCompatImpl.java:125)


After downgrading to mojarra 2.1.16 it is working again.
thumbnail
Neil Griffin, modifié il y a 10 années.

RE: NPE at javax.servlet.http.Cookie.setDomain

Liferay Legend Publications: 2655 Date d'inscription: 27/07/05 Publications récentes
Hi Bernd,

Because of line 125 of ExternalContextCompatImpl.java in the stacktrace, I think you might be using version 3.1.1-ga2 of Liferay Faces Bridge.

If that is the case, then when you get a chance, please upgrade to 3.1.2-ga3 and let us know if the problem goes away with Mojarra 2.1.21

Thanks,

Neil
thumbnail
Bernd Prager, modifié il y a 10 années.

RE: NPE at javax.servlet.http.Cookie.setDomain

Junior Member Publications: 42 Date d'inscription: 20/12/12 Publications récentes
You were right Neil. I didn't pay attention to the startup log:
15:10:13,323 INFO  [BridgeImpl] Initializing Liferay Faces Bridge 3.1.1-ga2 (Galatia / Dec 1, 2012 AD)

I had the new version in the war file but WebLogic still picked the old version.
I guess I have some cleanup to do here.