[Javassist user questions] - Exception while calling insertBefore() for a static method
by thethoks
Hi,
I am getting below Exception while i am trying to call insertBefore() for a static method. Please help me out.
Thanks in advance.
[java] javassist.CannotCompileException: [source error] not-available: this
[java] at javassist.CtBehavior.insertBefore(CtBehavior.java:523)
[java] at com.pg.junit.GenerateClasses.generateUpdatedClass(GenerateClasses.java:150)
[java] at com.pg.junit.GenerateClasses.generateNewClasses(GenerateClasses.java:108)
[java] at com.pg.junit.GenerateClasses.runMain(GenerateClasses.java:75)
[java] at com.pg.junit.GenerateClasses.main(GenerateClasses.java:37)
[java] Caused by: compile error: not-available: this
[java] at javassist.compiler.CodeGen.atKeyword(CodeGen.java:1845)
[java] at javassist.compiler.ast.Keyword.accept(Keyword.java:34)
[java] at javassist.compiler.CodeGen.atAssignCore(CodeGen.java:846)
[java] at javassist.compiler.CodeGen.atVariableAssign(CodeGen.java:779)
[java] at javassist.compiler.CodeGen.atDeclarator(CodeGen.java:713)
[java] at javassist.compiler.ast.Declarator.accept(Declarator.java:99)
[java] at javassist.compiler.CodeGen.atStmnt(CodeGen.java:344)
[java] at javassist.compiler.ast.Stmnt.accept(Stmnt.java:49)
[java] at javassist.compiler.CodeGen.atStmnt(CodeGen.java:344)
[java] at javassist.compiler.ast.Stmnt.accept(Stmnt.java:49)
[java] at javassist.compiler.MemberCodeGen.atTryStmnt(MemberCodeGen.java:140)
[java] at javassist.compiler.CodeGen.atStmnt(CodeGen.java:360)
[java] at javassist.compiler.ast.Stmnt.accept(Stmnt.java:49)
[java] at javassist.compiler.CodeGen.atStmnt(CodeGen.java:344)
[java] at javassist.compiler.ast.Stmnt.accept(Stmnt.java:49)
[java] at javassist.compiler.Javac.compileStmnt(Javac.java:558)
[java] at javassist.CtBehavior.insertBefore(CtBehavior.java:505)
[java] ... 4 more
[java] Exception in thread "main" java.lang.NullPointerException
[java] at com.pg.junit.GenerateClasses.generateNewClasses(GenerateClasses.java:110)
[java] at com.pg.junit.GenerateClasses.runMain(GenerateClasses.java:75)
[java] at com.pg.junit.GenerateClasses.main(GenerateClasses.java:37)
[java] Java Result: 1
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4111100#4111100
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4111100
18 years, 4 months
[JBoss jBPM] - Re: Setting ProcessVariable as a
by kamleshkr
Hi,
In spite of setting the 'to' attribute in the processdefinition.xml, I have found other way out.
I have tried custome mail class, but jbpm does not delegates the call to my custom mail class, rather it calls its own Mail.class only.
I have taken a normal node, and written my ActionHandler for the node. In the ActionHandler class i have written the following code...
-----------------------------------------------------------------------------------
String to = "abc(a)xyz.com";
String text="Success sending mail from jbpm";
String subject="Test mail from JBPM";
org.jbpm.mail.Mail mail=new org.jbpm.mail.Mail(null,null,to,subject,text);
mail.send();
-----------------------------------------------------------------------------------
And EUREKA, its working....
Now i can set the contextVariable as the 'to' attribute without using any EL.
Please tell me how advisable is this way to send mail?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4111095#4111095
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4111095
18 years, 4 months