java.lang.IllegalArgumentException: java.lang.ClassCastException@da7659

1,274 views
Skip to first unread message

Alex Black

unread,
Sep 11, 2010, 7:29:40 PM9/11/10
to Lift
Hi, I'm grasping at straws here, but today and yesterday our Lift app
started throwing exceptions on most pages of our site, a simple
restart of jetty would resolve it, this happened 4 times within 48
hours, and we haven't seen anything like this over the last 9 months.

- Once the exception starts happening, it happens every time on most
pages on the site, the web server returns a 500 error
- Jetty logs a stack trace for each error
- I've got a stack trace snippet below, and the next line that I've
trimmed is in our code, and its the SAME line every time, the line is
pointing to a value in a list initialization, e.g. our method looks
like this:

class Foo {
def getList: List[Bar] = {
List(
A,
B,
C,
D
)
}
}

and the line of code is one of the items in the list, say B in this
example.

Stack trace snippet:

2010-09-10 13:04:20,659 [32389375@qtp-22743805-199] ERROR lift -
Exception being returned to browser when processing Req(List(), Map(),
ParsePath(List(comparison),,true,false), , GetRequest, Empty)
java.lang.IllegalArgumentException:
java.lang.ClassCastException@da7659
at sun.reflect.GeneratedMethodAccessor20.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)

Any ideas?
- how do I interpret the error? Is it saying a ClassCast exception
occurred and that caused an IllegalArgument exception? and perhaps
we've lost the details on the original ClassCast exception?
- does this look familiar to anyone?
- I've found people with similar stack traces on the net, with no
resoultion in site, e.g. http://hi.baidu.com/aiqi13/blog/item/22b854092a6ebfa52eddd4de.html

thx

- Alex

David Pollak

unread,
Sep 11, 2010, 7:53:46 PM9/11/10
to lif...@googlegroups.com
Alex,

If you don't mind going private (off list), I'll be happy to look at your source code and your configuration and see if anything looks out of whack.

I have seen issues where the temporary directory that jetty puts its stuff in (which is in /tmp) will get house-cleaned and cause apps to behave unexpectedly.  But this is looking to me like a class loader issue.

Anyway, I'll be glad to help out as I can to discover the root cause of the issue and help you address it.

Thanks,

David


--
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.




--
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Blog: http://goodstuff.im
Surf the harmonics

Christoph Henkelmann

unread,
Sep 12, 2010, 5:01:47 AM9/12/10
to lif...@googlegroups.com
Hi,

I don't know if this also applies to Jetty, but we had similar issues with
tomcat once when classes where loaded twice by different classloaders in
tomcat because jars where in the lib directory of the webapp and the global
lib directory of tomcat.

Even if they are the same class, being loaded by different classloaders made
them incompatible, so we had a class cast exception (if I remember correctly)

Removing duplicate jar files resolved the issue in our case.

-Chris

Alex Black

unread,
Sep 12, 2010, 8:31:33 AM9/12/10
to Lift
Hi David, thanks for the generous offer, that sounds great. Lets talk
Monday.

On Sep 11, 7:53 pm, David Pollak <feeder.of.the.be...@gmail.com>
wrote:
> > liftweb+u...@googlegroups.com<liftweb%2Bunsu...@googlegroups.com >
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/liftweb?hl=en.
>
> --
> Lift, the simply functional web frameworkhttp://liftweb.net
> Beginning Scalahttp://www.apress.com/book/view/1430219890

Alex Black

unread,
Sep 12, 2010, 8:32:30 AM9/12/10
to Lift
Thanks Chris, we'll look around for duplicate JAR files, what you
describe does seem to line up with the symptoms. It does seem like
Jetty is loading a new class (or classes), but I'm not yet sure what
is triggering/causing that.

On Sep 12, 5:01 am, Christoph Henkelmann <blog...@henkelmann.eu>
wrote:

Karl Ivar Dahl

unread,
Aug 14, 2013, 3:39:32 AM8/14/13
to lif...@googlegroups.com
Hi Alex, did you find the reason for this error?
Please share for the benefit of the Googling late-comers :)

I'm looking at the exact same thing in my Tomcat logs.

Thanks,
Karl Ivar

Alex Black

unread,
Aug 14, 2013, 11:01:38 AM8/14/13
to lif...@googlegroups.com
Hi Karl, I'm afraid I don't remember at this point.

I did a few searches through my email and from what I can tell the issue went away.  Internally our only theory at the time was that we had a misconfiguration in our deployment servers that was deploying when we weren't expecting  and possibly deploying from some other branch.


--
--
Lift, the simply functional web framework: http://liftweb.net
Code: http://github.com/lift
Discussion: http://groups.google.com/group/liftweb
Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code
 
---
You received this message because you are subscribed to a topic in the Google Groups "Lift" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/liftweb/DolFwwvjQIM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to liftweb+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Diego Medina

unread,
Aug 14, 2013, 10:10:12 PM8/14/13
to Lift
Maybe starting a new thread will let us help you better.
Some questions that come to mind:
1- did you check if you have duplicate jars in your war file?
2- Is this something that started happening all of the sudden, with no code change from your side?
3- did you upgrade scala and or lift before this started happening?


Thanks

  Diego




On Wed, Aug 14, 2013 at 3:39 AM, Karl Ivar Dahl <kid...@gmail.com> wrote:

--
--
Lift, the simply functional web framework: http://liftweb.net
Code: http://github.com/lift
Discussion: http://groups.google.com/group/liftweb
Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code
 
---
You received this message because you are subscribed to the Google Groups "Lift" group.
To unsubscribe from this group and stop receiving emails from it, send an email to liftweb+u...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Diego Medina
Lift/Scala Developer
di...@fmpwizard.com
http://fmpwizard.telegr.am
Reply all
Reply to author
Forward
0 new messages