Jump to content
  • Custom data source problem: {some class} cannot be resolved to a type


    tcleenewerck_1
    CategoryBug report
    PriorityHigh
    ReproducibilityAlways
    ResolutionFixed
    SeverityMajor
    StatusResolved
    Versionv6.17.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

     

     



    User Feedback

    Recommended Comments

    Changed Status from New to 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.
    Link to comment
    Share on other sites

    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-jrdatasourceprovider-adapter. 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.

     

     

    Link to comment
    Share on other sites

    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-873711

     

    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.

    Link to comment
    Share on other sites

    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

    Link to comment
    Share on other sites

    Changed Priority from Normal to High


    Hi,I think i'm having same problem while trying to import a custom JAR into the classpath. How can I try the same patch?Thanks
    Link to comment
    Share on other sites

    Changed Resolution from Fixed to Reopened


    Dear MassimoSome of my colleagues are using windows to develop reports. They feel more comfortable using that OS. However we are running into the same problems as MAC OS X: {some class} cannot be resolved to a type.When I test the data adaptor then the code loaded and working. However when the report is running, the class references cannot be resolved.I applied the same patch as MAC OS X but that doesn't work. How can I solve the problem?Thomas
    Link to comment
    Share on other sites

    Changed Resolution from Reopened to Fixed


    Hi Thomas please give it a try looking at the following comment: https://community.jaspersoft.com/jaspersoft-studio/issues/13656#comment-875391Use the newer patch (that includes also the previous fix). Now the problem should be solved.As you see in that bug Michael confirmed it is now working ok for both functions and chart customizers as well.Regards,Massimo.P.S: there is no difference for Mac or Windows. That patch can be applied in the same way. You can drop it into the plugins folder of your/theirs installation (which of course is different depending on the OS). As said for Mac, it might help starting the Jaspersoft Studio using the -clean flag (the first time only after patch applying).
    Link to comment
    Share on other sites

    Hello Massimo

     

    It works now. Thank you for your assistance. I didn't look carefully at the jars name and didn't applied the patch correctly. Thank you for the quick response.

     

    Thomas

    Link to comment
    Share on other sites


×
×
  • Create New...