users@glassfish.java.net

Absent Code attribute in method that is not native or abstract?

From: Jason Lee <lee_at_iecokc.com>
Date: Mon, 9 Apr 2007 15:46:55 -0500

When running my unit tests, I'm getting this really odd error. Can
anyone shed some light on it? For the record, I'm using jdk
1.5.0_11-b03 and TLE v 2.0-40
(https://maven-repository.dev.java.net/repository/toplink.essentials/jar
s/toplink-essentials-2.0-40.jar). Thanks!

Here's the stack trace:

    [junit] Running
com.iecokc.worklist.engineering.test.service.EngineeringWorkListServiceT
est
    [junit] java.lang.reflect.InvocationTargetException
    [junit] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
    [junit] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
    [junit] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
    [junit] at java.lang.reflect.Method.invoke(Method.java:585)
    [junit] at
sun.instrument.InstrumentationImpl.loadClassAndCallPremain(Instrumentati
onImpl.java:141)
    [junit] Caused by: java.lang.reflect.InvocationTargetException
    [junit] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
    [junit] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
    [junit] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
    [junit] at java.lang.reflect.Method.invoke(Method.java:585)
    [junit] at
oracle.toplink.essentials.internal.ejb.cmp3.JavaSECMPInitializerAgent.in
itializeFromAgent(JavaSECMPInitializerAgent.java:54)
    [junit] at
oracle.toplink.essentials.internal.ejb.cmp3.JavaSECMPInitializerAgent.pr
emain(JavaSECMPInitializerAgent.java:47)
    [junit] ... 5 more
    [junit] Caused by: java.lang.ClassFormatError: Absent Code attribute
in method that is not native or abstract in class file
javax/persistence/spi/PersistenceUnitTransactionType
    [junit] at java.lang.ClassLoader.defineClass1(Native Method)
    [junit] at
java.lang.ClassLoader.defineClass(ClassLoader.java:620)
    [junit] at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
    [junit] at
java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
    [junit] at
java.net.URLClassLoader.access$100(URLClassLoader.java:56)
    [junit] at
java.net.URLClassLoader$1.run(URLClassLoader.java:195)
    [junit] at java.security.AccessController.doPrivileged(Native
Method)
    [junit] at
java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    [junit] at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    [junit] at
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
    [junit] at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    [junit] at
java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
    [junit] at
oracle.toplink.essentials.ejb.cmp3.persistence.SEPersistenceUnitInfo.<in
it>(SEPersistenceUnitInfo.java:64)
    [junit] at
oracle.toplink.essentials.internal.ejb.cmp3.xml.parser.PersistenceConten
tHandler.startElement(PersistenceContentHandler.java:86)
    [junit] at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElemen
t(AbstractSAXParser.java:533)
    [junit] at
com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startEleme
nt(XMLSchemaValidator.java:708)
    [junit] at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanSta
rtElement(XMLNSDocumentScannerImpl.java:330)
    [junit] at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$F
ragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:16
93)
    [junit] at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.s
canDocument(XMLDocumentFragmentScannerImpl.java:368)
    [junit] at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML1
1Configuration.java:834)
    [junit] at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML1
1Configuration.java:764)
    [junit] at
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.jav
a:148)
    [junit] at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Abstr
actSAXParser.java:1242)
    [junit] at
oracle.toplink.essentials.ejb.cmp3.persistence.PersistenceUnitProcessor.
processPersistenceXML(PersistenceUnitProcessor.java:136)
    [junit] at
oracle.toplink.essentials.ejb.cmp3.persistence.PersistenceUnitProcessor.
processPersistenceArchive(PersisteontentHandler.java:86)
    [junit] at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElemen
t(AbstractSAXParser.java:533)
    [junit] at
com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startEleme
nt(XMLSchemaValidator.java:708)
    [junit] at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanSta
rtElement(XMLNSDocumentScannerImpl.java:330)
    [junit] at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$F
ragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:16
93)
    [junit] at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.s
canDocument(XMLDocumentFragmentScannerImpl.java:368)
    [junit] at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML1
1Configuration.java:834)
    [junit] at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML1
1Configuration.java:764)
    [junit] at
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.jav
a:148)
    [junit] at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Abstr
actSAXParser.java:1242)
    [junit] at
oracle.toplink.essentials.ejb.cmp3.persistence.PersistenceUnitProcessor.
processPersistenceXML(PersistenceUnitProcessor.java:136)
    [junit] at
oracle.toplink.essentials.ejb.cmp3.persistence.PersistenceUnitProcessor.
processPersistenceArchive(PersistenceUnitProcessor.java:84)
    [junit] at
oracle.toplink.essentials.ejb.cmp3.persistence.PersistenceUnitProcessor.
getPersistenceUnits(PersistenceUnitProcessor.java:74)
    [junit] FATAL ERROR in native method: processing of -javaagent
failed
    [junit] at
oracle.toplink.essentials.internal.ejb.cmp3.JavaSECMPInitializer.initPer
sistenceUnits(JavaSECMPInitializer.java:223)
    [junit] at
oracle.toplink.essentials.internal.ejb.cmp3.JavaSECMPInitializer.initial
ize(JavaSECMPInitializer.java:242)
    [junit] at
oracle.toplink.essentials.internal.ejb.cmp3.JavaSECMPInitializer.initial
izeFromAgent(JavaSECMPInitializer.java:259)
    [junit] ... 11 more
 
-----
Jason Lee, SCJP
Senior Software Engineer
http://www.iec-okc.com <http://www.iec-okc.com/>