Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

java.lang.ClassFormatError: (Truncated class file)

  Asked By: Pedro    Date: May 12    Category: Java    Views: 2993
  

I got following error when try to run a java code in JBoss.
15:39:56,696 ERROR [LogInterceptor] Unexpected Error:
java.lang.ClassFormatError: Thilina (Truncated class file)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:537)
at java.lang.ClassLoader.defineClass(ClassLoader.java:448)
at com.sun.tools.javac.v8.StringCompiler$Loader.findClass(StringCompiler
.java:63)
at com.sun.tools.javac.v8.StringCompiler.executeMethodWithReturnType(Str
ingCompiler.java:120)
at cc.aot.qVoice.domain.ejb.qVoiceManager.qVoiceManagerEJB.getVxmlString
(qVoiceManagerEJB.java:125)
I use JBoss 3.0.6 and sdk 1.4. In my program, classes are create and load on the
fly. Then using Reflection API I called some methods in the dynamically created
class(this class not
write into a file and it is taken as a String variable).
I refferd this url as a guid to write class loader and compiler.(actually same
thing i copied
from there and change it's name Pmat1 to StringCompiler)
forum.java.sun.com/thread.jsp
When I run this as a normal application, it is work well. Then I try to run it
in a jboss and it will give the above error. In here I Wote some EJBs and struts
also and i called the methodds in the StringCompiler(Pamat1) class in a EJB.
Thilina is the name of the dynamically created calss and StringCompiler is the
class that includes the class loader and compiler methods as in the above url.
qVoiceManagerEJB has a getvxmlString method. Whithin this method
i called required the methods in the String compiler.

Share: 

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on java.lang.ClassFormatError: (Truncated class file) Or get search suggestion and latest updates.




Tagged: