Your example makes no sense.
You don't show how the compiler knows about the source.
The execute method you show is not in the provided link.

My guess is it failed to compile.
Try dumping the bytestream before you defineClass it.

Regards,
Adrian

On Mon, 2003-09-01 at 13:12, Thilina Anjitha wrote:
> hi,
> 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.executeMethod(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)
> http://forum.java.sun.com/thread.jsp?thread=347467&forum=4&message=1439418
> 
> 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.
> 
> I call the executeMethod() in the getVxmlStrin() method in qVoiceManagerEJB 
> classs which implemenys the sessionBean interface. It calls as normall java 
> calling ..
> StringCompiler sc =new StringCompiler();
> sc.executeMethod();
> Treated as.......
> StringCompiler = Pmat1
> 
> Thanx in advanced for any help.
> 
> _________________________________________________________________
> Add photos to your e-mail with MSN 8. Get 2 months FREE*. 
> http://join.msn.com/?page=features/featuredemail
> 
> 
> 
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to