Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > LinkedList NullPointerException occurs after switched from IBM JVM 1.4.0 to 1.4.1

Reply
Thread Tools

LinkedList NullPointerException occurs after switched from IBM JVM 1.4.0 to 1.4.1

 
 
Tohru Kao
Guest
Posts: n/a
 
      07-07-2003
Hi,

I encounter a NullPointerException after I switched from IBM JVM 1.4.0 to
IBM JVM 1.4.1.

The component I use is:

Linux 7.3
IBM JVM 1.4.1
freemarker 1.5.2
tomcat 4.1.18

Please give any advice about this NullPointerException which I didn't
encounter in IBM JVM 1.4.0.

Here is the stack trace:
java.lang.NullPointerException
at java.util.LinkedList$ListItr.next(LinkedList.java: 510)
at freemarker.template.expression.ExpressionBuilder.a ssociateOperators(ExpressionBuilder.java)
at freemarker.template.expression.ExpressionBuilder.b uildExpression(ExpressionBuilder.java)
at freemarker.template.expression.ExpressionBuilder.b uild(ExpressionBuilder.java)
at freemarker.template.compiler.StandardTemplateParse r.parseExpression(StandardTemplateParser.java)
at freemarker.template.compiler.StandardTemplateParse r.parseVariable(StandardTemplateParser.java)
at freemarker.template.compiler.StandardTemplateParse r.parseVariableInstruction(StandardTemplateParser. java)
at freemarker.template.compiler.StandardTemplateParse r.getNextInstruction(StandardTemplateParser.java)
at freemarker.template.compiler.LinkedListTemplateBui lder.buildLinks(LinkedListTemplateBuilder.java)
at freemarker.template.compiler.LinkedListTemplateBui lder.buildGenericBody(LinkedListTemplateBuilder.ja va)
at freemarker.template.compiler.LinkedListTemplateBui lder.buildStatement(LinkedListTemplateBuilder.java )
at freemarker.template.instruction.GenericStartInstru ction.callBuilder(GenericStartInstruction.java)
at freemarker.template.compiler.LinkedListTemplateBui lder.buildLinks(LinkedListTemplateBuilder.java)
at freemarker.template.compiler.LinkedListTemplateBui lder.buildStatement(LinkedListTemplateBuilder.java )
at freemarker.template.instruction.IfInstruction.call Builder(IfInstruction.java)
at freemarker.template.compiler.LinkedListTemplateBui lder.buildLinks(LinkedListTemplateBuilder.java)
at freemarker.template.compiler.LinkedListTemplateBui lder.build(LinkedListTemplateBuilder.java)
at freemarker.template.Template.compileText(Template. java)
at freemarker.template.Template.compileFromStream(Tem plate.java)
at freemarker.template.Template.compileFromStream(Tem plate.java)
at freemarker.template.Template.compileFromFile(Templ ate.java)
at freemarker.template.Template.(Template.java)
at freemarker.template.FileTemplateCache.loadTemplate (FileTemplateCache.java)
at freemarker.template.FileTemplateCache.getLatestTem plate(FileTemplateCache.java)
at freemarker.template.FileTemplateCache.getTemplate( FileTemplateCache.java)
at org.mytest.HtmlTemplateController.getTemplate(Html TemplateController.java:73)
at org.mytest.HtmlTemplateController.getTemplate(Html TemplateController.java:99)
at org.mytest.MyServlet.doGet(MyServlet.java:101)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:853)
at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:260)
at org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:643)
at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:643)
at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(St andardContext.java:2415)
at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:643)
at org.apache.catalina.valves.ErrorDispatcherValve.in voke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:641)
at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:641)
at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:643)
at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(Co yoteAdapter.java:223)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyo teHandler.java:261)
at org.apache.jk.common.HandlerRequest.invoke(Handler Request.java:360)
at org.apache.jk.common.ChannelSocket.invoke(ChannelS ocket.java:632)
at org.apache.jk.common.ChannelSocket.processConnecti on(ChannelSocket.java:590)
at org.apache.jk.common.SocketConnection.runIt(Channe lSocket.java:707)
at org.apache.tomcat.util.threads.ThreadPool$ControlR unnable.run(ThreadPool.java:530)
at java.lang.Thread.run(Thread.java:56


TIA
-Tohru



 
Reply With Quote
 
 
 
 
Roedy Green
Guest
Posts: n/a
 
      07-12-2003
On Mon, 07 Jul 2003 10:56:48 -0700, Tohru Kao <(E-Mail Removed)>
wrote or quoted :

> at java.util.LinkedList$ListItr.next(LinkedList.java: 510)


possibly one implementation filters out null elements from a
LinkedList and other preserves them??

--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
 
Reply With Quote
 
 
 
 
xarax
Guest
Posts: n/a
 
      07-12-2003
Tohru Kao <(E-Mail Removed)> wrote in message news:<(E-Mail Removed)>. ..
> Hi,
>
> I encounter a NullPointerException after I switched from IBM JVM 1.4.0 to
> IBM JVM 1.4.1.
>
> The component I use is:
>
> Linux 7.3
> IBM JVM 1.4.1
> freemarker 1.5.2
> tomcat 4.1.18
>
> Please give any advice about this NullPointerException which I didn't
> encounter in IBM JVM 1.4.0.
>
> Here is the stack trace:
> java.lang.NullPointerException
> at java.util.LinkedList$ListItr.next(LinkedList.java: 510)

/snip/

You'll have to look at the source for LinkedList.java near
line 510 to see what it's trying to do. Most likely, it
is advancing to its next pointer and getting a null value.

The list is probably corrupted by a concurrent modification
by another thread. Iteration doesn't guarantee that it will
detect all such modifications. The LinkedList implementation
is not synchronized.

Thus, I suspect that the application that is using the
LinkedList is broken, rather than the LinkedList implementation.
 
Reply With Quote
 
Neil Masson
Guest
Posts: n/a
 
      07-14-2003
xarax wrote:

> Tohru Kao <(E-Mail Removed)> wrote in message
> news:<(E-Mail Removed)>. ..
>> Hi,
>>
>> I encounter a NullPointerException after I switched from IBM JVM 1.4.0 to
>> IBM JVM 1.4.1.
>>
>> The component I use is:
>>
>> Linux 7.3
>> IBM JVM 1.4.1
>> freemarker 1.5.2
>> tomcat 4.1.18
>>
>> Please give any advice about this NullPointerException which I didn't
>> encounter in IBM JVM 1.4.0.
>>
>> Here is the stack trace:
>> java.lang.NullPointerException
>> at java.util.LinkedList$ListItr.next(LinkedList.java: 510)

> /snip/
>
> You'll have to look at the source for LinkedList.java near
> line 510 to see what it's trying to do. Most likely, it
> is advancing to its next pointer and getting a null value.
>
> The list is probably corrupted by a concurrent modification
> by another thread. Iteration doesn't guarantee that it will
> detect all such modifications. The LinkedList implementation
> is not synchronized.
>
> Thus, I suspect that the application that is using the
> LinkedList is broken, rather than the LinkedList implementation.


This analysis is spot on. What has changed in 1.4.1 is that the
next and prev pointers of a removed list element are set to null.
So perhaps one thread is removing an object from a list, while
another is iterating through the list. You might have got away
with this before, but now a NullPointerException will be thrown.

Neil
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Circuit-Switched vs Packet-Switched Lawrence D'Oliveiro NZ Computing 7 01-19-2009 12:40 AM
73 megabyte NullPointerException objects out of memory'ing our JVM C B Java 3 08-12-2004 04:06 AM
Percentage of switched vs. non-switched Ethernet Networks ??? Chris Cisco 8 04-15-2004 09:56 PM
Different behavior for newStringUTF() for Sun JVM and IBM Jvm Lasse Java 1 01-05-2004 07:49 PM
LinkedList NullPointerException occurs after switched from IBM JVM 1.4.0 to 1.4.1 Tohru Kao Java 1 07-08-2003 09:09 AM



Advertisments