[#13621] - Custom data source problem: {some class} cannot be resolved to a type

Category:
Bug report
Priority:
Normal
Status:
Feedback Requested
Project: Severity:
Major
Resolution:
Open
Component: Reproducibility:
Always
Assigned to:
0

Hello Guys,

We've been using our own custom data source using the custom implementation of JRDataSource for many years now. Up till now, we are using Jasper Studio 6.8.0 and 6.10.0. It is now time to start using 6.17.0 because we want to migrate to Mac OSX Big Sur.

The code is packaged into a jar file. It is added to the java build path. The adaptor works fine. The test button on the adaptor yields the response 'successful'. So everything seems to be in order. However the studio cannot resolve class names of the jar to types. Upon compilation of the report or when previewing the report, we get the error ' {some class} cannot be resolved to a type'.

This is the screenshot with the error.

https://share.getcloudapp.com/o0ueQ8N8

I've started with a clean OSX Catalina, clean installation of the Jasper Studio 6.17.0. I've added the jar in several ways (as an external jar, as a library). I've restarted Jasper Studio 6.17.0 several times. Nothing seems to work.

What is going wrong?

Thomas Cleenewerck, colleague of Maarten Van Coile, Yesplan

v6.17.0
tcleenewerck_1's picture
Joined: Mar 19 2019 - 7:10am
Last seen: 4 hours 42 min ago

9 Comments:

#1
  • Severity:Minor» Major
#2
  • Status:New» Feedback Requested

Hi, can you confirm you used the "Custom implementation of JRDataSource" data adapter?
Is the data adapter including the jar reference in the "Jar File Path" section? Or did you simply included the DA in the project classpath where your report is created?

Let me know if you can successfully use it, creating the DA adapter file inside the Project folder.
Thanks.
Regards,
Massimo.

#3

Indeed I am using the 'Custom implementation of JRDataSource".

The jar file is not referenced in the adaptor: https://share.getcloudapp.com/xQu70Xkw . The jar file is part of a library https://share.getcloudapp.com/JruD7JYy and has been added via user library (https://share.getcloudapp.com/yAurLEqw) to the build path https://share.getcloudapp.com/QwuAGm1J .

To get closer to issue at hand I created a new dummy adaptor to illustrate the problem.

It is a new fresh new implementation which is based on the documentation in https://community.jaspersoft.com/wiki/how-create-and-use-jrdatasourcepro.... I called it my Hello World New Data Adaptor. I didn't use a jar. As you can see https://share.getcloudapp.com/d5uAe7Jj doesn't contain a jar.
I now created a new blank new report. The adaptor works fine up to the point where I reference a class from the adaptor. In https://share.getcloudapp.com/wbu6klDD I simply used the following expression (HelloWorldCustomDataProvider.HelloWorldCustomDataSource) $P{REPORT_DATA_SOURCE} .

I've added the files to this message. As such you can also test it.

T.

AttachmentSize
Binary Data blank_a4.jrxml2.32 KB
#4

Apparently I can only upload one file at a time. Here is the code for the Hello World Adaptor.

AttachmentSize
Package icon helloworldcustomdataprovider.zip2.88 KB
#5

I just tested our plugin with TIBCO Jaspersoft® Studio 6.16.0 - Visual Designer for JasperReports 6.16.0. And our Custom implementation of JRDataSource runs fine.

#6

Hi, I think the problem you are experiencing inside comment #3 is related to another issue with classpath that has been described in bug #13616. You could give it a try to see if the solution proposed with this patch here addresses the problem of sources in the project:
https://community.jaspersoft.com/jaspersoft-studio/issues/13616#comment-...

Let me know.

Indeed there are other issues as well, because I've experienced some problems with the usage of the libraries added to the project.
Still investigating. Thanks.

Best regards,
Massimo.

#7

Hello Massimo

Thank you for your assistance. The patch works indeed.

I assume that the patch will be integrated in the next version of the studio?

Best regards,
Thomas

#8

Hi Thomas,
yes it will be integrated. Did it help also for the "jar" use-case, besides the "code-in-project" scenario?

Thanks,
Massimo.

#9

Yes it also helped us in the 'jar' use-case.

Feedback