Jump to content
We've recently updated our Privacy Statement, available here ×

Including a jar


Recommended Posts

  • Replies 21
  • Created
  • Last Reply

Top Posters In This Topic

 

In Jaspersoft Studio there is no longer a big unique classpath for the whole application like in iReport.

Each report is supposed to be part of a project. The project has a classpath, and here is where you should add the jars you need.

All is done by opening the projects view and right click the project folder with which you are working on. By default, new reports are created in the project My Reports (this is the standalone RCP version).

Giulio

Link to comment
Share on other sites

  • 3 months later...

Hi,

I tried the way you describe but that didn't work. Added all needed jars to the "My Procects - Build Path - Configure Build Path". There are still lots of errors generated from "classes not found" allthough they are in the classpath.

Is that a bug or am I doing wrong? The other thing is that I get errors (e.g. "Errors 31 items") but there is no way to get detailled information about the errors.

Any idea?

Best,

Volker

Link to comment
Share on other sites

  • 2 months later...

 I tried to add the jar of my chart template as an external jar to my Java Project (right click on project folder > properties > java build path > libraries). But I still get an error message. Can somebody shed some light onto how this is supposed to be done?

Link to comment
Share on other sites

I have updated JS Studio to 1.0.7.   Reports that do not need/reference my external jar file work properly.

My jar is contained in the Java Build Path (and confirmed in .classpath) for the project.  If I rename the <import> to something misspelled, that misspelling is not noticed by the compiler.  Is the <import> somehow being ignored?  Every reference to its methods "cannot be resolved."

I can't believe that I am the only person so far trying to incorporate an external jar into a report run under the Studio.  The report works properly under iReport, so I know that my <import> directive is correct.

Sorry for the lack of precision in my problem description - I am not that conversant in eclipse java projects.

Post Edited by rlfisher at 01/19/2012 19:13

Really?  Nobody can help me?  It seems to be ignoring my jar.



Post Edited by rlfisher at 02/08/2012 18:33
Link to comment
Share on other sites

 I upgraded my Eclipse plugin to the latest version. I tried to add the chart theme jar as well to the class path (Using Add External Jar) and then my report still doesn't work. The same report works in iReport though.



Post Edited by diddy at 01/20/2012 13:55
Link to comment
Share on other sites

  • 1 month later...

 I'm using 1.0.8, and I have the same issue - I am unable to get my scriptlet jar classes to resolve to a type. My project has a Jasper nature, and a java nature. I have the Jasper builder and the Java builder. I have a .classpath file, and in it is an entry for the jar files. This does not work, and all of my reports that utilize any of my custom Scriptlets are littered with errors.

Any advice would be appreciated

heading back to iReport...

Link to comment
Share on other sites

 Hello and thank you for your reply.

I'm not sure what type of file you would want to test exactly? The jrxml files are well formed and work in iReport  when I include my scriptlet jars in the classpath in preferences. The only other file might be the .project or .classpath, and both of those look right to me based on my experience using Eclipse to develop Java.

Please advise.

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 months later...
  • 1 month later...

I am using 1.1.1 and having the same problem I have the scriptlet included on the project build path, however any reference to it simply returns null. There are no errors reported during build or preview, is there any way of increasing the logging level so I can try and see what is going on?

EDIT

ok have tested the scriptlet in iReport and it is working as expected I am getting the attached stack trace in studio with the attached .classpath



Post Edited by daveianstanley at 07/06/2012 13:56
Link to comment
Share on other sites

Hi,
could you please attach your current .project?
We verified a bug, fixed in version 1.1.2 (next release), that led to missing compilation of sources in project folders (java.lang.NoClassDefFoundError exceptions).

So have a look if you have the following lines in bold: 

<buildSpec>
   <buildCommand>
       <name>org.eclipse.jdt.core.javabuilder</name>
       <arguments></arguments>
   </buildCommand>

   <buildCommand>
       <name>net.sf.jasperreports.builder</name>
       <arguments></arguments>
   </buildCommand>
</buildSpec>

Just in case try to add them.

Regards,
Massimo.
 

 

 

Link to comment
Share on other sites

  • 1 year later...
Having same problem with 5.6....except that I've never used iReport so have no basis for comparison. The instructions on adding a custom Jar to JS Studio are sketchy at best, though maybe it's my lack of familiarity with the product (which honestly I don't like at all) and with Java. I posted a question here but have had 0 responses (8 views) so far, so apparently I'm not the only one who still doesn't know how to do this. This is likely the most frustrating piece of software I've ever used, and I've been forced to use some doozies in my 32 years of working in IT.
Link to comment
Share on other sites

  • 1 month later...

I've been using iReport 4.0 where I could find a way to add my custom jars.

Using the actual v5.6.0 of Jasperstudio is killing me. Like drummer54, I can't find a way to have them taken into account while designing.

Any help would greatly be appreciated.

Thanks in advance,


EDIT: After sooo much efforts to get something to work, I found out that referencing external class path with .class file may work. Though you may consider refreshing project/files to have new modification taken into account. To me it seems that classpath is not taken into account as immediatly as in a standard Java project.

add_jar.png.0b86e2a9dcd1029935d61804104fca13.png

Hope this can help

Link to comment
Share on other sites

  • 1 year later...

Hello Oliver, hello Community ,

I have the same problem as you while including the UniqueCategoryLabel.jar in JasperReportStudio 6.1 and JasperReportServer 6.0.
After the change of <field name="charge" class="java.lang.String"/>  to <field name="charge" class="java.lang.UniqueCategoryLabel"/>
I always get the error :

Description Resource Path Location Type
java.lang.ClassNotFoundException: java.lang.UniqueCategoryLabel --- net.sf.jasperreports.engine.design.JRDesignField@d094e3c ic_charge_messdatumV3.4.jrxml /MyReports/01 Kundenreports/entwurf/pg_lokal/R&R line 0 JRXML Problem.
 
I have added the jar-file to the buildpath:
 
/sites/default/files/images/jasperbuildpath.PNG
 
I appreciate any help to this problem.
 
Thanks 
Rainer

 

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...