iReport - java.lang.ClassNotFoundException
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4509836/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
iReport - java.lang.ClassNotFoundException
提问by y0dA
Im using iReport 3.7.6.
我使用 iReport 3.7.6。
I have a Parameter with following parameter class: at.gv.domain.print.impl.ParameterClass
.
我有一个带有以下参数类的参数:at.gv.domain.print.impl.ParameterClass
.
For using that class I did following:
为了使用该类,我执行了以下操作:
--> Extras --> Option --> Classpath --> Add Folder -->
--> 附加 --> 选项 --> 类路径 --> 添加文件夹 -->
C:\Development\Projectname\workspace\DomainProject\target\classes
Under C:\Development\Projectname\workspace\DomainProject\target\classes\at\gv\domain\print\impl
there are my ParameterClass.class
.
在C:\Development\Projectname\workspace\DomainProject\target\classes\at\gv\domain\print\impl
有我的ParameterClass.class
。
Now if I wanna compile the .jrxml
I get following error:
现在,如果我想编译.jrxml
我会收到以下错误:
net.sf.jasperreports.engine.design.JRValidationException: Report design not valid :
1. java.lang.ClassNotFoundException: at.gv.domain.print.impl.ParameterClass
Someone can tell me why? I added the classpath entry so why the class got not found?
有人可以告诉我为什么吗?我添加了类路径条目,为什么找不到类?
I tried to make a .jar
of my Domain project - if I added that the class got found. Is there any problem with target directory (Im using Maven)?
我试图创建一个.jar
我的域项目 - 如果我添加了该类被找到。目标目录有问题吗(我使用 Maven)?
回答by y0dA
Your probleme is with the jar of ireport, I think that the version of ireport is not the same as the jar used in the IDE, if it's true try to change the jar that's all, hope this help.
你的问题是 ireport 的 jar,我认为 ireport 的版本与 IDE 中使用的 jar 不一样,如果是真的尝试更改 jar 就可以了,希望对您有所帮助。