Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7405041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:20:36+00:00 2026-05-29T05:20:36+00:00

I am using cglib to enhance a HashMap so I can intercept method calls

  • 0

I am using cglib to enhance a HashMap so I can intercept method calls on the HashMap.

It works fine on my local computer, and when I run as a google web application within eclipse. Once deployed on the server, however, I am getting an exception “java.lang.NoClassDefFoundError: [Ljava/util/HashMap$Entry;”

The line of code that throws the exception is:

Enhancer.create(HashMap.class, new SomeInterceptor());

I am using the latest plugin for eclipse (3.7). I am using cglib version 2.2 (cglib-nodep-2.2.jar)

EDIT:
This is interesting: If I create a class that extends from HashMap, then I can enhance that class without any issues. For example, the following code works:

public class MyHashMap extends HashMap {
}
Enhancer.create(MyHashMap.class, new SomeInterceptor());

And Enhancer works for TreeMap, HashSet, and TreeSet
:ENDEDIT

The stack trace is:

java.lang.NoClassDefFoundError: [Ljava/util/HashMap$Entry;
at com.google.appengine.runtime.Request.process-02796318ce7d3a7b(Request.java)
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2444)
at java.lang.Class.getDeclaredMethod(Class.java:229)
at net.sf.cglib.proxy.Enhancer.getCallbacksSetter(Enhancer.java:630)
at net.sf.cglib.proxy.Enhancer.setCallbacksHelper(Enhancer.java:618)
at net.sf.cglib.proxy.Enhancer.setThreadCallbacks(Enhancer.java:612)
at net.sf.cglib.proxy.Enhancer.createUsingReflection(Enhancer.java:634)
at net.sf.cglib.proxy.Enhancer.firstInstance(Enhancer.java:538)
at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:225)
at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377)
at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:285)
at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:663)
at com.enhancetest.EnhanceTestServlet.doGet(EnhanceTestServlet.java:30)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:449)
at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:455)
at com.google.tracing.TraceContext.runInContext(TraceContext.java:695)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:333)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:325)
at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:453)
at java.lang.Thread.run(Thread.java:679)

Caused by: java.lang.ClassNotFoundException: java.util.HashMap$Entry
… 35 more

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T05:20:37+00:00Added an answer on May 29, 2026 at 5:20 am

    Perhaps I’m missing something, if it is I’m sorry, but from a quick search I’found this: http://grepcode.com/snapshot/repo1.maven.org/maven2/cglib/cglib/2.2

    It seems that GAE has only a Partial support to cglib… could this be the source of this issue?
    Furthermore in the official GAE docs for supported Java libraries http://code.google.com/p/googleappengine/wiki/WillItPlayInJava

    CGLIB is not even mentioned.

    EDIT:
    BTW, I’m assuming that you are importing java.util.HashMap… check you did not import other implementation (like “com.google.gwt.dev.util.collect.HashMap”)… somtimes this kind of mistake happens for nothing!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using the C# Facebook SDK 5.0.3 everything works fine whit the client.Get(/me). But when
When creating proxies in CGLib using Enhancer, you can call .setNamingPolicy(NamingPolicy n) to change
When creating proxies in CGLib using Enhancer, you can call .setNamingPolicy(NamingPolicy n) to change
Using PyObjC , you can use Python to write Cocoa applications for OS X.
Using VS2008, C#, .Net 2 and Winforms how can I make a regular Button
Using JDeveloper , I started developing a set of web pages for a project
I am creating a web application using zkoss 5.0.4, Spring 3.0.3, Hibernate 3, and
can anyone explain on this 2 properties Q1. hibernate.cglib.use_reflection_optimizer ? what is the effect
Using a library like ASM or cglib , is there a way to add
I am trying to add cglib as default byte code provider. I am using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.