2005 IR Help Posted August 27, 2006 Share Posted August 27, 2006 By: sepi - sepideh err class(scriptlet) not found in namespace? 2004-10-01 09:16 Class: AccLib not found in namespace. I created a scriptlet also create a jar file of that class too. then call ((AccLib)$P{REPORT_SCRIPTLET}).hello() in my xml. when I compile it I get the error "AccLib not found in namespace." Any suggestion? I am so new in scriptlet and jasper. Thanks, By: Chuck Deal - cdeal RE: err class(scriptlet) not found in namespace? 2004-10-01 09:28 the jar needs to be on the classpath and the class name should be fully qualified (com.xyz.AccLib) By: sepi - sepideh RE: err class(scriptlet) not found in namespace? 2004-10-01 09:48 Thanks, But the class is like you said(white.Id.AccLib) and I created a jar file and and it's in the classpath, AI compilked is okay,when i run it I get error: "Error loading scriptlet class : AccLib" nested by ClassNotFoundException: AccLib What else should i check? Can you cjeck the java file and theat part of the xml file please? /** * File: AccLib.java * Created on Oct 1, 2004 * Author: sepideh * * Description: TODO */ package xxx.yyy; import dori.jasper.engine.*; public class AccLib extends JRDefaultScriptlet{ public void beforeGroupInit(String s){} public void beforePageInit(){} public void beforeColumnInit(){} public void afterColumnInit(){} public void afterGroupInit(String s){} public void beforeReportInit(){} public void afterReportInit(){} public void beforeDetailEval(){} public void afterDetailEval(){} public void afterPageInit(){} public String hello() throws JRScriptletException { return "I'm the report's scriptlet object."; } } then in xml put : scriptletClass="AccLib" <textFieldExpression class="java.lang.String">((AccLib)$P{REPORT_SCRIPTLET}).hello()</textFieldExpression> By: Chuck Deal - cdeal RE: err class(scriptlet) not found in namespace? 2004-10-01 10:03 What I meant was that where ever you use you class, it needs to be fully qualified. When you typecast the REPORT_SCRIPTLET in the <jasperReport> tag where you identify it...everywhere. ((xxx.yyy.AccLib)$P{REPORT_SCRIPTLET}).hello() By: sepi - sepideh RE: err class(scriptlet) not found in namespace? 2004-10-01 11:32 I added scriptletClass="xxx.yyy.AccLib" in <jasperReort> and also ((xxx.yyy.AccLib)$P{REPORT_SCRIPTLET}).hello() Now I get java.lang.ClassNotFoundException: xxx.yyy.AccLib nested BY : dori.jasper.engine.JRException: Error loading scriptlet class : xxx.yyy.AccLib what else should i change to make it work? By: sepi - sepideh RE: err class(scriptlet) not found ???? 2004-10-01 12:50 Even if I remove the calling hello() method,and just put the complete name of the class in the <jasperReport> I get same error that couldn't find the class,But I think I add the jar file to the shared_library in my project and also lib directory under web-inf. and defined in the project classpath. where else should I add. By: Chuck Deal - cdeal RE: err class(scriptlet) not found ???? 2004-10-04 04:35 I think it needs to be in the same place as your jasperreports.jar. But, it definitely sounds like a classpath error. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now