WLS 9.2 with Kodo 3.4 - ClassNotFoundException due to ClassFormatError in which LVTT entry does not match LVT entry (Doc ID 1147603.1)

Last updated on DECEMBER 01, 2016

Applies to:

Oracle Weblogic Server - Version 9.2 and later
Information in this document applies to any platform.
***Checked for relevance on 23-Aug-2013***

Symptoms

Environment:  Weblogic 9.2 with Java 1.5 and Kodo JDO 3.4.

When implementing the clone method, and on adding a java.util.Set local variable to the clone method, the following error is thrown at runtime:

27698 WARN [[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] kodo.Runtime - java.lang.ClassNotFoundException: Class bytes found but defineClass()failed for: 'com.myco.MyUser'
java.lang.ClassNotFoundException: Class bytes found but defineClass()failed for: 'com.myco.MyUser'
at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:268)
at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:54)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:161)
at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAwareClassLoader.java:35)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:242)
at kodo.runtime.PersistenceManagerFactoryImpl.loadPersistentClasses(PersistenceManagerFactoryImpl.java:219)
at kodo.runtime.PersistenceManagerFactoryImpl.getPersistenceManager(PersistenceManagerFactoryImpl.java:156)
at kodo.runtime.PersistenceManagerFactoryImpl.getPersistenceManager(PersistenceManagerFactoryImpl.java:109)
at kodo.runtime.PersistenceManagerFactoryImpl.getPersistenceManager(PersistenceManagerFactoryImpl.java:102)
at com.myco.persistence.MyPersistenceManager.setManagerInLocal(MyPersistenceManager.java:33)
at com.myco.ui.filter.AuthorizationFilter.doFilter(AuthorizationFilter.java:72)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3229)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2002)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1908)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1362)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
Caused by: java.lang.ClassFormatError: LVTT entry for 'ents' in class file com/myco/MyUser does not match any LVT entry
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at weblogic.utils.classloaders.GenericClassLoader.defineClass(GenericClassLoader.java:355)
at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:294)
at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:262)
... 23 more


Code snippets of the clone method:

public Object clone() throws CloneNotSupportedException
{
  MyUser clone = (MyUser)super.clone();
  Set<Entitlement> ents = new HashSet<Entitlement>();
  ents.addAll(getEntitlements());
  clone.setEntitlements(ents);
  Set<System> adms = new HashSet<System>();
  ...
  return clone;
}


Workaround:

Changes

N/A

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms