Comments (10)
I don't see any reason there could possible be an NPE on that line. What is the original value and the new value? If you look at that line of code it seems impossible to come up with a way that you could get an NPE. At least, assuming it isn't getting thrown by and equals()
implementation or something like that.
from tomcat-redis-session-manager.
original value is null, new value is an instance of MenuItem. I have no idea either. Pretty weird.
from tomcat-redis-session-manager.
Could you step through in a debugger by any chance and see exactly what
expression is triggering the NPE?
On Fri, Oct 12, 2012 at 10:56 AM, ajstokar [email protected] wrote:
original value is null, new value is an instance of MenuItem. I have no
idea either. Pretty weird.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/13#issuecomment-9379106.
from tomcat-redis-session-manager.
if ( value == null && oldValue != null
|| oldValue == null && value != null
|| !value.getClass().isInstance(oldValue)
|| !value.equals(oldValue) )
So if value AND oldValue are both null, the 3rd or statement will run and throw the exception. I think you need one more check if both of these are null, then just skip the if statement.
from tomcat-redis-session-manager.
Ah yes, something didn't feel entirely right about that, but somehow I
missed that.
On Fri, Oct 12, 2012 at 11:21 AM, ajstokar [email protected] wrote:
if ( value == null && oldValue != null
|| oldValue == null && value != null
|| !value.getClass().isInstance(oldValue)
|| !value.equals(oldValue) )So if value AND oldValue are both null, the 3rd or statement will run and
throw the exception. I think you need one more check if both of these are
null, then just skip the if statement.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/13#issuecomment-9379879.
from tomcat-redis-session-manager.
Actually, you should probably still update the changeAttributes hash in this case. If I do setAttribute(key,null), I would expect it to behave the same as removeAttribute(key), right?
from tomcat-redis-session-manager.
If the old value is null as well, then nothing's changed right? Presumable
someone could argue about whether or not there's a difference between not
having the key and having the key be null, but I don't think we need to
worry about that unless someone has a reason to do so.
On Fri, Oct 12, 2012 at 11:25 AM, ajstokar [email protected] wrote:
Actually, you should probably still update the changeAttributes hash in
this case. If I do setAttribute(key,null), I would expect it to behave the
same as removeAttribute(key), right?—
Reply to this email directly or view it on GitHubhttps://github.com//issues/13#issuecomment-9379994.
from tomcat-redis-session-manager.
BTW, I have a new build, but could you test it and ensure it works for you
before I release it? (I'm not set up right now to run Tomcat)
JAR: http://cl.ly/0K1L2E2i3u0Z
On Fri, Oct 12, 2012 at 11:27 AM, James Coleman [email protected] wrote:
If the old value is null as well, then nothing's changed right? Presumable
someone could argue about whether or not there's a difference between not
having the key and having the key be null, but I don't think we need to
worry about that unless someone has a reason to do so.On Fri, Oct 12, 2012 at 11:25 AM, ajstokar [email protected]:
Actually, you should probably still update the changeAttributes hash in
this case. If I do setAttribute(key,null), I would expect it to behave the
same as removeAttribute(key), right?—
Reply to this email directly or view it on GitHubhttps://github.com//issues/13#issuecomment-9379994.
from tomcat-redis-session-manager.
Works! Thanks for the quick fix.
from tomcat-redis-session-manager.
All right. I'll release the official fix sometime this weekend.
On Fri, Oct 12, 2012 at 11:32 AM, ajstokar [email protected] wrote:
Works! Thanks for the quick fix.
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/13#issuecomment-9380213.
from tomcat-redis-session-manager.
Related Issues (20)
- how to config the password of redis? HOT 1
- java.lang.ClassNotFoundException: com.radiadesign.catalina.session.RedisSessionHandlerValve HOT 6
- SessionDestroyed is not triggered when session fails
- redissessions.RedisSessionManager- Encountered serialized session D78F6CDB3490927F0E6BD9EBF35B0FD7 with data equal to NULL_SESSION. This is a bug. HOT 1
- This CreateSession() will create a key that never expires
- 28-Apr-2018 07:48:06.108 [catalina-exec-3] com.orangefunction.tomcat.redissessions.RedisSessionManager.sessionFromSerializedData Encountered serialized session AAF53A145EB70ACE15733EF5CA0E3B9E with data equal to NULL_SESSION. This is a bug.
- redis-session-manager with java 8 and tomcat 8 HOT 2
- Support for OpenJDK
- Session Persistence Policy Not Working
- HOW CONFIG WEB.XML IN MY ITERM ?
- jdk 1.6 tomcat-redis session clustering Error
- Support of Session Manager on Weblogic
- Add more tips when saving session exception HOT 2
- how to custom the redis key HOT 2
- SSL HOT 2
- <async-supported>true</async-supported>
- Session Error with data equal to NULL_SESSION. This is a bug. HOT 2
- does tomcat-redis-session-manager-1.2-tomcat-7 Compatible java6? HOT 1
- Does support Embedded tomcat and how to confiugre? Thank you
- JedisConnectionException if Redis is down HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tomcat-redis-session-manager.