vigneshwaran.ganesan Posted November 1, 2017 Share Posted November 1, 2017 I have created Java bean and connection factory in separate project and exported as JarJava Version - 1.8Downloaded TIBCO Jaspersoft Studio 6.4.0 community edition Created project -Added bean jar dependencies Clicked the new adapter - > Collection of JavaBeans Chosen factory class and static method from jar that added to projectTested the connection and getting below error. Please help me to resolve this issueExceptionnet.sf.jasperreports.engine.JRException: java.lang.ClassNotFoundException: com.xxx.Student cannot be found by net.sf.jasperreports_6.4.0.final at net.sf.jasperreports.data.bean.BeanDataAdapterService.contributeParameters(BeanDataAdapterService.java:101) at net.sf.jasperreports.data.AbstractDataAdapterService.test(AbstractDataAdapterService.java:122) at com.jaspersoft.studio.data.DataAdapterEditorPart$1.widgetSelected(DataAdapterEditorPart.java:166) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:249) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4418) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1079) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4236) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3824) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1121) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1022) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:150) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:693) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:610) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148) at com.jaspersoft.studio.rcp.intro.Application.start(Application.java:91) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:673) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:610) at org.eclipse.equinox.launcher.Main.run(Main.java:1519)Caused by: java.lang.ClassNotFoundException: com.xxx.Student cannot be found by net.sf.jasperreports_6.4.0.final at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:461) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:372) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:364) at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:161) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:348) at net.sf.jasperreports.engine.util.JRClassLoader.loadClassForRealName(JRClassLoader.java:174) at net.sf.jasperreports.data.bean.BeanDataAdapterService.contributeParameters(BeanDataAdapterService.java:83) ... 29 more Link to comment Share on other sites More sharing options...
vigneshwaran.ganesan Posted November 2, 2017 Author Share Posted November 2, 2017 I have resolved this issue by adding jar file path.Now I have created JRXML with static and dynamic fieldsOutline -> Right Click and choose Dataset and Query Dialog -> Java Bean tab -> Enter the class name which holds fields nameFields are not listing out and its showing as Class not found: com.xxx.StudentScoreCan anyone help me to list out the fields Link to comment Share on other sites More sharing options...
Massimo Rabbi Posted November 3, 2017 Share Posted November 3, 2017 Hi,can you please give a look at the following discussion: https://community.jaspersoft.com/questions/1072651/i-cannot-read-java-bean-data-source-jarThere is a similar issue, moreover it is strongly adviced to move to JSS 6.4.3 (recently released) that contains improvements in terms of classpath handling.Regards,Massimo. 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