[#13616] - Jaspersoft Studio 6.17 did not find own project-classes

Category:
Bug report
Priority:
High
Status:
Resolved
Project: Severity:
Block
Resolution:
Fixed
Component: Reproducibility:
Always
Assigned to:
0

Excuse my bad english...

We use Jaspersoft Studio as an Eclipse plugin. After upgrading Studio from 6.14 to 6.17 the compiler didn't find referenced classes of its own project.

For example:
<variable name="materialsumme" class="de.rekers.core.general.Wert" resetType="Group" resetGroup="Materialgruppe">
<variableExpression><![CDATA[$V{materialsumme}.add($F{Wert})]]></variableExpression>
<initialValueExpression><![CDATA[de.rekers.core.general.Wert.ZERO]]></initialValueExpression>
</variable>

Where de.rekers.core.general.Wert is an class of the project where also the report is part of.

When compiling with 6.17, we get these errors:

====================================================================

Started the compilation of the resource AngebotMaterialsumme.jrxml
net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file:
1. de.rekers.core.general.Wert kann nicht in einen Typ aufgelöst werden.
value = ((de.rekers.core.general.Wert)variable_materialsumme.getValue()).add(((de.rekers.core.general.Wert)field_Wert.getValue())); //$JR_EXPR_ID=10$
<------------------------->
2. de.rekers.core.general.Wert kann nicht in einen Typ aufgelöst werden.
value = ((de.rekers.core.general.Wert)variable_materialsumme.getValue()).add(((de.rekers.core.general.Wert)field_Wert.getValue())); //$JR_EXPR_ID=10$
<------------------------->
3. de.rekers.core.general.Wert.ZERO kann nicht in einen Typ aufgelöst werden.
value = de.rekers.core.general.Wert.ZERO; //$JR_EXPR_ID=11$
<------------------------------>
4. de.rekers.core.general.Wert kann nicht in einen Typ aufgelöst werden.
value = ((de.rekers.core.general.Wert)variable_materialsumme.getOldValue()).add(((de.rekers.core.general.Wert)field_Wert.getOldValue())); //$JR_EXPR_ID=10$
<------------------------->
5. de.rekers.core.general.Wert kann nicht in einen Typ aufgelöst werden.
value = ((de.rekers.core.general.Wert)variable_materialsumme.getOldValue()).add(((de.rekers.core.general.Wert)field_Wert.getOldValue())); //$JR_EXPR_ID=10$
<------------------------->
6. de.rekers.core.general.Wert.ZERO kann nicht in einen Typ aufgelöst werden.
value = de.rekers.core.general.Wert.ZERO; //$JR_EXPR_ID=11$
<------------------------------>
7. de.rekers.core.general.Wert kann nicht in einen Typ aufgelöst werden.
value = ((de.rekers.core.general.Wert)variable_materialsumme.getEstimatedValue()).add(((de.rekers.core.general.Wert)field_Wert.getValue())); //$JR_EXPR_ID=10$
<------------------------->
8. de.rekers.core.general.Wert kann nicht in einen Typ aufgelöst werden.
value = ((de.rekers.core.general.Wert)variable_materialsumme.getEstimatedValue()).add(((de.rekers.core.general.Wert)field_Wert.getValue())); //$JR_EXPR_ID=10$
<------------------------->
9. de.rekers.core.general.Wert.ZERO kann nicht in einen Typ aufgelöst werden.
value = de.rekers.core.general.Wert.ZERO; //$JR_EXPR_ID=11$
<------------------------------>
9 errors
.
at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:229)
at net.sf.jasperreports.eclipse.builder.JasperReportCompiler.compileReport(JasperReportCompiler.java:289)
at net.sf.jasperreports.eclipse.builder.JasperReportCompiler.compileReport(JasperReportCompiler.java:141)
at net.sf.jasperreports.eclipse.builder.JasperReportsBuilder.compileJRXML(JasperReportsBuilder.java:212)
at com.jaspersoft.studio.editor.action.CompileAction.actionCompile(CompileAction.java:154)
at com.jaspersoft.studio.editor.action.CompileAction$1.run(CompileAction.java:98)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

Unable to create the binary file, check the compilation errors

====================================================================

After downgrading to 6.16, everthing works fine.

Maybe it has something to do with the separation of the sources and the objects in different directories (see attached screenshot). Jaspersoft Studio has always had problems to handle this setting correctly. So the .jasper files are still created in the source folder and not in the object folder. It seems that now also the classes from the current project are not found in the object folder.

AttachmentSize
Image icon screenshot_2021-06-03_134722.png46.28 KB
v6.17.0
mwrekers's picture
Joined: Jun 23 2011 - 1:00am
Last seen: 3 months 2 weeks ago

11 Comments:

#1
AttachmentSize
Binary Data angebotmaterialsumme.jrxml7.86 KB
#2
  • Status:New» Feedback Requested

Hi I just tried to replicate a possible scenario inside a 6.17.0 standalone on Mac OS X BigSur, but I was not able to.
I tried creating some classes and using them inside a simple JRXML file, just to see if I could trigger an error like yours.

I simply needed to kick the usual manual build (CMD/CTRL + B), having the "Build automatically" disabled, but it worked ok. I gave it a try switch from the compiler configuration the "Compiler Compliance Level" from 11/8, but no luck.

I saw you mentioned you were using a plugin version 6.14.0 and you upgraded to 6.17.0 with all your code base on the project. Looking at your screenshot you are on Windows, but can you please detail on which Eclipse flavor and version you installed the JSS plugin?
Moreover can you give it a try with a fresh new installation both plugin and standalone to double check you still have the issue?

Thanks!
Best regards,
Massimo.

P.S: it would be nice if you can reproduce the problem with a minimal set of files (i.e a sample report and a dummy java class) that you can attach here. I will probably have to setup a Windows environment to double check your issue.

#3

I have made a sample and attached the complete workspace and a screenshot.

I have download a fresh "Eclipse IDE for Enterprise Java and Web Developers", added JasperReports and Subclipse from the marketplace. Importeted our projekt and deleted everything not needed.

AttachmentSize
Image icon screenshot.png231.06 KB
#4

The workspace is 12MB, attachments are limited to 2MB. Is there another way to upload 12MB?

#5

Removed the index-files in .metadata\.plugins\org.eclipse.jdt.core\, now the zip-file is mutch smaller.

AttachmentSize
Package icon workspace.zip250.19 KB
#6

Hi,
I tracked back the issue. It was a regression introduced in the latest version.
Can you please give it a try to the patch I prepared?

=============
To apply the patches, perform the following steps:

1. Stop the Jaspersoft Studio Community 6.17.0 instance.
2. Locate the installation directory of Jaspersoft Studio and its sub-folder plugins
3. Add the "net.sf.jasperreports.patch_swt_6.17.0.js-patch01.jar" file
5. Restart Jaspersoft Studio normally and verify the problems are solved.
6. If the problem appears to be still there, try restarting Jaspersoft Studio using the "-clean" flag in order to clear any possible OSGI and Eclipse runtime information that might have been cached and related to the plug-ins. The flag can be removed on the next startup, because it usually has impact on startup times.
=============

I tested locally and it works fine. I was able to make your sample work fine after that.
Let me know.

Best regards,
Massimo.

#7

Hi Massimo,
i can confirm , the patch work for linux (Fedora release 33 ). The "-clean" flag have to be set.
thnxs

Best regards
Bon

#8
  • Resolution:Open» Fixed
  • Status:Feedback Requested» Resolved

Ok thanks for your feedback. I will set the bug as resolved.

Best regards,
Massimo.

#9

If anybody looks for it. The Eclipse plugin: Jaspersoft Studio, has the same problem. Downgrading helps. But I've got not a single idea how to apply the above patch there.

#10
  • Resolution:Fixed» Open
  • Status:Resolved» New

Hi Massimo,

I have encountered the same issue while using custom function when the report language is set to java and it works fine with both groovy and JavaScript.
I have applied the patch you provided on the Jasper plugins and now it works perfectly with java language.
However, when I upload my report to SAP FSM Cloud, I am getting below error after using custom functions inside my report.
CA-32: Error while compiling one of the report files [report.jrxm].
Can you help to fix this issue?
Note:
Jasper studio 6.17, Installed on Windows 10.

#11
  • Resolution:Open» Fixed
  • Status:New» Resolved

About comment #10: Please do not re-open a bug for something that is completely different. If needed open a new one. That said, I already heard about this SAP FSM Cloud thing. It's not something we shipped in the past or dealt with it. So you scenario might be out-of-scope. Not sure if you can find some useful information on this old bug entry: https://community.jaspersoft.com/jaspersoft-studio/issues/13416

About comment #9: You should be able to drop the jar patch inside the plugins folder of the Eclipse installation (instead of JSS one).

Regards,
Massimo.

Feedback
randomness