• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Printing Problem in .jar?

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

The Report is print using netbeans and when we create .jar file is not printing they give error as follow??
net.sf.jasperreports.engine.JRException: Error compiling report java source file
s : C:\Users\Winner\Documents\NetBeansProjects\Service_care\dist\report32name_138
2940347930_211863.java C:\Users\Winner\Documents\NetBeansProjects\Service_care\di
st\report32name_Service_1382940347930_211863.java

I am using the Syntax for that is as follow:
jsperdesigns = getClass().getResourceAsStream("/Report/singleToken1.jrxml");
 
Saloon Keeper
Posts: 15510
363
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you give us an SSCCE?
 
Prashant Shirode
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


InputStream jsperdesigns = this.getClass().getResourceAsStream("/Report/singleToken1.jrxml");
JasperDesign jd = JRXmlLoader.load(jsperdesigns);
The code is working with net beans. after that we create jar file using Clean and Build function.
When we run jar file the above code is not working,it show error message like i say earlier...

 
Stephan van Hulst
Saloon Keeper
Posts: 15510
363
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm afraid this is not an SSCCE. Please click on the link in either of my two posts, and see how you can create one. We won't really be able to do much for you without one.
 
Prashant Shirode
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Error compiling report java source files...
This error message comes when we click on print button this problem come for only .jar file,
when i run project in net beans it print the actual report...
 
Bartender
Posts: 3323
86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you sure your path is correct. Starting it with a '/' means you are giving the absolute path rather than a path relative to the class' package name.
 
Prashant Shirode
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Yes...
Also when i try with absolute path or relevant path both are not work in .jar file..
 
Tony Docherty
Bartender
Posts: 3323
86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Prashant Shirode wrote:
Yes...
Also when i try with absolute path or relevant path both are not work in .jar file..


How have you checked your path is correct? Have you checked to see if the returned stream is not null?
If it isn't null dump the stream to the console (or a file) to check the contents of singleToken1.jrxml are what you think they are - you may be picking up a different version of the file, an empty file etc.

As Stephan has said twice now, without seeing your code and preferably an SSCCE we are just guessing at possible fixes. The more effort you put into your posts the more likely you are to get your problem fixed.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic