Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Java (http://www.velocityreviews.com/forums/f30-java.html)
-   -   java.lang.ClassFormatError when creating JAXBContext object (http://www.velocityreviews.com/forums/t518594-java-lang-classformaterror-when-creating-jaxbcontext-object.html)

gwinsor 06-29-2007 05:04 PM

java.lang.ClassFormatError when creating JAXBContext object
 
Hi,
I am trying to marshal an XML document using JAXB 2.0. At runtime,
when my web application tries to create a JAXBContext object, I get
the following exception:

type Exception report

message

description The server encountered an internal error () that prevented
it from fulfilling this request.

exception

javax.servlet.ServletException: Servlet execution threw an exception

org.displaytag.filter.ResponseOverrideFilter.doFil ter(ResponseOverrideFilter.java:
125)

root cause

java.lang.ClassFormatError: Illegal class modifiers in class com/
innatedb/xml/mi/package-info: 0x1600
java.lang.ClassLoader.defineClass1(Native Method)
java.lang.ClassLoader.defineClass(ClassLoader.java :620)
java.security.SecureClassLoader.defineClass(Secure ClassLoader.java:
124)

org.apache.catalina.loader.WebappClassLoader.findC lassInternal(WebappClassLoader.java:
1815)

org.apache.catalina.loader.WebappClassLoader.findC lass(WebappClassLoader.java:
869)

org.apache.catalina.loader.WebappClassLoader.loadC lass(WebappClassLoader.java:
1322)

org.apache.catalina.loader.WebappClassLoader.loadC lass(WebappClassLoader.java:
1201)
java.lang.ClassLoader.loadClassInternal(ClassLoade r.java:319)
java.lang.Class.forName0(Native Method)
java.lang.Class.forName(Class.java:242)
java.lang.Package.getPackageInfo(Package.java:350)
java.lang.Package.getAnnotation(Package.java:361)

com.sun.xml.bind.v2.model.annotation.RuntimeInline AnnotationReader.getPackageAnnotation(RuntimeInlin eAnnotationReader.java:
85)

com.sun.xml.bind.v2.model.annotation.RuntimeInline AnnotationReader.getPackageAnnotation(RuntimeInlin eAnnotationReader.java:
17)

com.sun.xml.bind.v2.model.impl.TypeInfoImpl.parseE lementName(TypeInfoImpl.java:
86)

com.sun.xml.bind.v2.model.impl.ClassInfoImpl.<init >(ClassInfoImpl.java:
126)

com.sun.xml.bind.v2.model.impl.RuntimeClassInfoImp l.<init>(RuntimeClassInfoImpl.java:
50)

com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder .createClassInfo(RuntimeModelBuilder.java:
59)

com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder .createClassInfo(RuntimeModelBuilder.java:
41)

com.sun.xml.bind.v2.model.impl.ModelBuilder.getCla ssInfo(ModelBuilder.java:
123)

com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder .getClassInfo(RuntimeModelBuilder.java:
49)

com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder .getClassInfo(RuntimeModelBuilder.java:
41)

com.sun.xml.bind.v2.model.impl.ModelBuilder.getTyp eInfo(ModelBuilder.java:
189)

com.sun.xml.bind.v2.model.impl.RegistryInfoImpl.<i nit>(RegistryInfoImpl.java:
63)

com.sun.xml.bind.v2.model.impl.ModelBuilder.addReg istry(ModelBuilder.java:
232)

com.sun.xml.bind.v2.model.impl.ModelBuilder.getTyp eInfo(ModelBuilder.java:
201)
com.sun.xml.bind.v2.runtime.JAXBContextImpl
$3.run(JAXBContextImpl.java:352)
com.sun.xml.bind.v2.runtime.JAXBContextImpl
$3.run(JAXBContextImpl.java:350)
java.security.AccessController.doPrivileged(Native Method)

com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTyp eInfoSet(JAXBContextImpl.java:
349)

com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init> (JAXBContextImpl.java:
215)
com.sun.xml.bind.v2.ContextFactory.createContext(C ontextFactory.java:
76)
com.sun.xml.bind.v2.ContextFactory.createContext(C ontextFactory.java:
55)
com.sun.xml.bind.v2.ContextFactory.createContext(C ontextFactory.java:
124)
sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)

sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:
39)

sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:
25)
java.lang.reflect.Method.invoke(Method.java:585)
javax.xml.bind.ContextFinder.newInstance(ContextFi nder.java:132)
javax.xml.bind.ContextFinder.find(ContextFinder.ja va:286)
javax.xml.bind.JAXBContext.newInstance(JAXBContext .java:372)
javax.xml.bind.JAXBContext.newInstance(JAXBContext .java:337)
javax.xml.bind.JAXBContext.newInstance(JAXBContext .java:244)

com.innatedb.search.interaction.DownloadPsiMiXmlAc tion.execute(DownloadPsiMiXmlAction.java:
155)

org.apache.struts.action.RequestProcessor.processA ctionPerform(RequestProcessor.java:
431)

org.apache.struts.action.RequestProcessor.process( RequestProcessor.java:
236)
org.apache.struts.action.ActionServlet.process(Act ionServlet.java:
1196)
org.apache.struts.action.ActionServlet.doGet(Actio nServlet.java:414)
javax.servlet.http.HttpServlet.service(HttpServlet .java:689)
javax.servlet.http.HttpServlet.service(HttpServlet .java:802)

org.displaytag.filter.ResponseOverrideFilter.doFil ter(ResponseOverrideFilter.java:
125)



Here is the line of code which throws the exception:
JAXBContext jc = JAXBContext.newInstance("com.innatedb.xml.mi");

I am using JDK1.6.0
I have no problem creating XML objects from classes based on the xml
schema and I used the xjc compiler belonging to the JKD1.6.0. In
addition, the java class containing the above snippet of code compiles
without any problems.
Is there anything obvious that I am overlooking? Thanks for any
suggestions you can offer.
Geoff


timjowers 07-02-2007 09:36 PM

Re: java.lang.ClassFormatError when creating JAXBContext object
 
Geoff,

Did you solve this one? Looks like the class bytecode being produced
is not a valid Java class. ??? Maybe you can post an XML.

TimJowers




All times are GMT. The time now is 05:22 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.