• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Cookies are creating problem when deploying forum on Linux

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have deployed forum application of Linux and windows environment. It works fine on Windows environment.
For Linux, Forum page is not shown, appears blank, if I delete cookies, then it works but when I opens a new browser window, forum page is not accessed again.

Tomcat version used: 5.5.17.

It throws the follwing exception when blank page appears

org.xml.sax.SAXParseException: Premature end of file.
Continuing ...
java.util.NoSuchElementException
at java.util.Vector.lastElement(Vector.java:461)
at com.sun.beans.ObjectHandler.lastExp(ObjectHandler.java:132)
at com.sun.beans.ObjectHandler.dequeueResult(ObjectHandler.java:136)
at java.beans.XMLDecoder.readObject(XMLDecoder.java:218)
at net.jforum.JForum.checkCookies(JForum.java:360)
at net.jforum.JForum.service(JForum.java:453)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:199)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:282)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:754)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:684)
at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:876)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
java.util.NoSuchElementException
at java.util.Vector.lastElement(Vector.java:461)
at com.sun.beans.ObjectHandler.lastExp(ObjectHandler.java:132)
at com.sun.beans.ObjectHandler.dequeueResult(ObjectHandler.java:136)
at java.beans.XMLDecoder.readObject(XMLDecoder.java:218)
at net.jforum.JForum.checkCookies(JForum.java:360)
at net.jforum.JForum.service(JForum.java:453)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:199)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:282)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:754)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:684)
at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:876)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)

[originally posted on jforum.net by shahbaz]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello,

what browser are you using? Try to access the first page with another browser.

Regards,
Andrew Stepanenko
[originally posted on jforum.net by andrew.stepanenko]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have tested this issue on IE 5+ as well as firefox. Browser is not the issue.
[originally posted on jforum.net by shahbaz]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is the version of JForum you're using?
I went to the source code to track your exception, but the source is a CVS snapshot dated on Jul 31. Some methods changed and I cannot find your checkCookies() method in JForum.java .

Andrew.
[originally posted on jforum.net by andrew.stepanenko]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using older version 1.x
Here is some code where exception is thrown


private void checkCookies() throws IOException
{
// If userData is not, then must probably the user is entering right
// now in the website
if (SessionFacade.getUserSession() == null) {
UserSession userSession = new UserSession();

Cookie cookie = JForum.getCookie(SystemGlobals.getValue("cookieName").toString());

// If we don't have any cookie yet, then we should set it with the default values
if (cookie == null) {
userSession.setStartTime(System.currentTimeMillis());
userSession.setLastVisit(System.currentTimeMillis());
userSession.setUserId(Integer.parseInt(SystemGlobals.getValue("anonymousUserId").toString()));
userSession.setSessionId(JForum.getRequest().getSession().getId());

JForum.addSerializedCookie(SystemGlobals.getValue("cookieName").toString(), userSession);
}
else {
// Ok, we have a cookie. Time to get it from the oven
ByteArrayInputStream in = new ByteArrayInputStream(cookie.getValue().getBytes());
XMLDecoder decoder = new XMLDecoder(in);

userSession = (UserSession)decoder.readObject();

// Update last visit and session start time
userSession.setLastVisit(userSession.getStartTime() + userSession.getSessionTime());
userSession.setStartTime(System.currentTimeMillis());

decoder.close();
}

if (userSession.getAutoLogin()) {
SessionFacade.setAttribute("logged", "1");
}
else {
userSession.setUserId(Integer.parseInt(SystemGlobals.getValue("anonymousUserId").toString()));
}

userSession.setSessionId(JForum.getRequest().getSession().getId());
SessionFacade.add(userSession);
SessionFacade.setAttribute("topics_tracking", new HashMap());
}
else {
UserSession userSession = SessionFacade.getUserSession();
userSession.updateSessionTime();

JForum.addSerializedCookie(SystemGlobals.getValue("cookieName").toString(), userSession);
}
}

[originally posted on jforum.net by shahbaz]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

shahbaz wrote:I am using older version 1.x ...



Is there a reason you don't upgrade to a newer version? That will probably be the recommendation ... probably not too many people (if any) supporting the older versions.
[originally posted on jforum.net by GatorBait3]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's right.. older versions are not supported.

Rafael
[originally posted on jforum.net by Rafael Steil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By installing latest version of jforum, I got rid of this issue.
[originally posted on jforum.net by shahbaz]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's good to know!

Rafael
[originally posted on jforum.net by Rafael Steil]
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!