Category: | Bug report |
Priority: | Immediate |
Status: | Acknowledged |
Project: | Severity: | Block |
Resolution: | Fixed |
|
Component: | Reproducibility: | Always |
Assigned to: |
Hi,
I've noticed that since the latest snapshot of 25 march, JSS often "forgets" our custom provider class. The strange part is, it is still shown as the selected data adapter, but the log says "cannot find class: [our class]".
After hitting the preview button a buck of times it sometimes decides to find it after all.
Kind regards,
Maarten Van Coile
v6.1
22 Comments:
Hi Maarten,
do you tried also with the 6.0.4 released yesterday?
The class you are referring to is the one set into a "JasperReports Datasource Provider class" data adapter?
The class is inside a jar or is it inside your project as source code?
Regards,
Massimo.
This feels extremely similar to http://community.jaspersoft.com/jaspersoft-studio/issues/4014
I tried 6.0.4. Exactly the same.
I reference an external jar, it's external of the project.
It says it is using our provider, even the console says it has mapped the jar. However, the console then states that it can't find the classes in our jar. The preview clearly shows it's still using the empty rows default provider.
The dat provider.xml is stored in a directory in our project and normally (pre-JSS 6) directly found and linked based on the name. I notice that:
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="YP Provider"/>
Is now:
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="Github/0 JasperTemplates/YPProvider.xml"/>
Which seems logical, but fairly impractical to have a hardcoded location reference since this project is shared among many of our colleagues. Project name and base paths may differ.
Some log parts:
Start Report Execution
Compiling report......DONE
StartingSetting Data Adapter...DONE
Setting Virtualizer...DONE
Filling Report........DONE
Report Execution Finished.
JSS Console:
Mapping: Archive: file:/Applications/TIBCO Jaspersoft Studio 6.0.4.final/configuration/org.eclipse.osgi/bundles/55/1/.cp/lib/jasperreports-6.0.4.jar
Mapping: Archive: file:/Applications/TIBCO Jaspersoft Studio 6.0.4.final/configuration/org.eclipse.osgi/bundles/55/1/.cp/lib/jasperreports-chart-themes-6.0.4.jar
Mapping: Archive: file:/Applications/TIBCO Jaspersoft Studio 6.0.4.final/configuration/org.eclipse.osgi/bundles/55/1/.cp/lib/jasperreports-fonts-6.0.4.jar
Mapping: Archive: file:/Applications/TIBCO Jaspersoft Studio 6.0.4.final/configuration/org.eclipse.osgi/bundles/55/1/.cp/lib/jasperreports-functions-6.0.4.jar
Mapping: Archive: file:/Applications/TIBCO Jaspersoft Studio 6.0.4.final/configuration/org.eclipse.osgi/bundles/40/1/.cp/lib/js-common.jar
Mapping: Archive: file:/Applications/TIBCO Jaspersoft Studio 6.0.4.final/configuration/org.eclipse.osgi/bundles/40/1/.cp/lib/js-extra-classes.jar
Mapping: Archive: file:/Users/maarten/Dropbox (2Rivers)/Yesplan/Product/Reporting/Plugin/nextplan-ireport-designer-plugin-1.17.1.jar
End ClassPath Mapping
Then a lot of these, which are classes of our plugin:
net.sf.jasperreports.engine.JRRuntimeException: java.lang.ClassNotFoundException: Yesplan.Group
Kind regards,
Maarten @ Yesplan
Hi Marteen,
thanks for referencing also the old bug. Tomorrow I will try to create a test case similar to yours and just in case I will involve JR team since it appears the mentioned bug was a JR one.
About the data adapters thing, in order to avoid the usage of the file based xml reference, you could right click on the "Data Adapters" node in the Repository Explorer and "Import from workspace" selecting your xml file.
After you've done this you can use the "name" reference. It should work, I tested with a Sample DB copy: see the attached screenshot.
Regards,
Massimo.
Hi Maarten, after a debug investigation it appears that the problem is not connected to the mentioned #4014 bug.
Anyhow it's related to a nasty classloading issue.
I will report the problem to JR team and talk with them. I found a possible fix, but I want them to first certify it.
Keep you posted, probably next week we will produce an integration build solving the problem.
Regards,
Massimo.
I changed the order of class loading in case of this particular data adapter type, please test in the next snapshot
Any chance you'll do a community snapshot this week?
I tested the build, I can't get a report to preview. It's as if it -always- uses the "One Empty Record".
The JSS console prints a lot of "JRRuntimeException: java.lang.ClassNotFoundException". This used to happen randomly before JSS 6.x, but never dramatically so. "Yesplan.ResourceGroups" is a class defined in our custom provider class.
net.sf.jasperreports.engine.JRRuntimeException: java.lang.ClassNotFoundException: Yesplan.ResourceGroups
at net.sf.jasperreports.engine.base.JRBaseParameter.getValueClass(JRBaseParameter.java:147)
at com.jaspersoft.studio.editor.preview.input.ParameterJasper.getValueClass(ParameterJasper.java:33)
at com.jaspersoft.studio.editor.preview.view.control.VParameters.createInput(VParameters.java:227)
at com.jaspersoft.studio.editor.preview.view.control.VParameters.createInputControls(VParameters.java:57)
at com.jaspersoft.studio.editor.preview.view.control.ReportControler$1.run(ReportControler.java:215)
at org.eclipse.ui.internal.UILockListener.doPendingWork(UILockListener.java:164)
at org.eclipse.ui.internal.UISynchronizer$3.run(UISynchronizer.java:158)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3946)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3623)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at com.jaspersoft.studio.rcp.intro.Application.start(Application.java:96)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
Caused by: java.lang.ClassNotFoundException: Yesplan.ResourceGroups
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:501)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:278)
at net.sf.jasperreports.engine.util.JRClassLoader.loadClassForRealName(JRClassLoader.java:174)
at net.sf.jasperreports.engine.util.JRClassLoader.loadClassForName(JRClassLoader.java:114)
at net.sf.jasperreports.engine.base.JRBaseParameter.getValueClass(JRBaseParameter.java:143)
... 30 more
could you send me your project to test? remove all sensitive information, this will help a lot
report, data adapter, and this class, I want to see where you setup classpaths, and scenario you have
Hi,
I can't give you a project or data adapter, I'll have to discus this internally (you can't run them without access to our servers).
I have 2 methods of setting up class paths.
The one I currently use is to set up through Preferences > Java > Build Path > User Libraries: http://cl.ly/b4fv
Then bind it to the project "MyReports" > properties > Java Build Path > add provider library.
I could have just linked the plugin as an external JAR also, but this is easier to manage.
Kind regards,
Maarten @ Yesplan
Hi,
I'll have to investigate the issue further on our side. I believe JSS now loads the class correctly, but does not allow our plugin to fetch new data once the initial data has been fetched. That explains the "empty row" result I got before. We fill our subdata sets with method calls to our plugin who queries our servers. This no longer occurs with JSS 6.1.
Kind regards,
Maarten @ Yesplan
it's not very clear for me what are you doing there,
I don't ask access to your data, or source code of your project, I just want a sample to debug
you can trace your subdataset, for this go to Preferences->Jaspersoft Studio->Global Settings and check "Enable internal JSS Console" this will redirect all output to the console view of eclipse restart eclipse to take effect
then open View "Trace Report View", in this view you can select your dataset, and select for which events you want to see output in the console, rerun the report, in console you should see your fields
Hi,
We made a simple dummy report provider plugin, based on our knowledge of building one. I'll attach a link with the project, testfile, provider class setting and precompiled plugin.
We noticed a strange behaviour:
- Open JSS 6.1.0 with provider and plugin added
- Open the dummy report file
- Press run:
Now JSS preview does load the base records, but not the subdatasets.
- Now generate a compiled report by either right-clicking the report or pressing the compile button in the designer
- Press run:
Now JSS loads all data correctly and keeps doing so until restart.
Dummy project and test file:
http://cl.ly/2K46292q1q0w
Note: This bug affects only JSS; Generating using only the library works perfectly. We just can't design reports now.
Kind regards,
Maarten @ Yesplan
Workaround:
- Press preview
- Let it fail
- Got to design
- Compile the report
- Preview again
- It should work for a while
# When resetting the input parameters from the left side pane in the preview screen also reset the workaround.
This is a breaking bug. Can we get a status on this?
Kind regards,
Maarten @ Yesplan
could you resend me your project by email please? your link is not working
@chicuslavic: http://cl.ly/2P3s2X0c0w2b
This is the java project for a (dummy) provider plugin and a test jrxml. Simply use ant to build it.
Sorry, I made it automatically expire.
Kind regards,
Maarten @ Yesplan
could you test on last JSS? I fixed a bug similar to what you describe, basically, when reseting parameters another classloader loaded some JR libraries
your project is not very clear for me, it's not an eclipse project, looks like it's an ireport project? where is your data adapter?
you should have a data adapter, jrxml file, and .classpath file with your classpath
@chicuslavic: Yes, sill not solved.
We made this dataprovider project to with one goal: to make the most simple dataprovider we could that always returns 2 rows of data.
The project is a java project, you can simply build it using "ant".
I made a compiled version for you to play with:
- nextplan-dummy-ireport-plugin.jar should be in your build path
- Dummy-IReport-Plugin.xml is your provider file
- dummyreport.jrxml is the sample jasper report
Kind regards,
Maarten @ Yesplan
Update JSS 6.1.1 is IMPOSSIBLE to work with. The small workaround we found no longer works and _every_ preview fails. _every time_ we need to click "preview", "design", "compile", "prieview, "run preview" for each and every preview.
@chicuslavic: I made a screencast illustrating a step-by-step guide on how to install the plugin and how to run a report. Then it clearly shows the problem. See the jasper project for more info on that's expected.
http://cl.ly/cyuw
This seems like a rather a big breaking bug. Could someone else have a look at this also?
Seems fixed now.