• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Error in JRXML bean

 
Ranch Hand
Posts: 127
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
After make changes in my jrxml I am receiving the following error:

This is my BEAN:

This is my jrxml:

Thanks.
 
Marshal
Posts: 24594
55
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Cezar Apulchro wrote:This is my BEAN...



Well, it does declare the correct getter and setter, but on the other hand it also extends HttpServlet. I can't imagine a class being both a bean and a servlet at the same time.

Perhaps just not declaring it to be a servlet would fix the problem. Or maybe there's something else you have to do to declare that it's a bean?
 
Cezar Apulchro
Ranch Hand
Posts: 127
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
After make changes the problem still the same
 
Cezar Apulchro
Ranch Hand
Posts: 127
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Paul,
no news?
 
Paul Clapham
Marshal
Posts: 24594
55
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not from me. I did some web searching and all I could find were examples of using some program to configure Jasper reports.
 
Cezar Apulchro
Ranch Hand
Posts: 127
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have changed my servlet that generate the report. I put into the servlet the mysql select to load to hashmap.
The servlet:


I don't receive more error but  the result is:

 
Rancher
Posts: 4116
47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take that code out of the servlet and get it working in a standalone class.
That would be a lot easier for you to do.

Then, once that's working the way you want you can then have the servlet call that class instead, assuming you've written it in a reasonably accessible way.

You'll be able to do fixes far faster that way...and debugging will be simpler.

 
Paul Clapham
Marshal
Posts: 24594
55
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That output looks like a PDF to me, sort of. If you want to test that feature then having Adobe Acrobat try to open the output would be the way to go. Although your code suggests that you are expecting HTML. Maybe your Jasper configuration needs to be fixed?

And it looks to me like you're doing a POST request to return that PDF data. And as far as I can see you aren't updating anything on the server from your POST parameters. A GET request would be suitable for that scenario, not a POST.
 
Paul Clapham
Marshal
Posts: 24594
55
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Paul Clapham wrote:Although your code suggests that you are expecting HTML. Maybe your Jasper configuration needs to be fixed?



No, I see that you're calling a method named exportReportToPdfStream. So you're asking for PDF output. In that case your code which specifies the format of the servlet's response:



isn't right. You ought to be specifying PDF here, not HTML.
 
Cezar Apulchro
Ranch Hand
Posts: 127
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Paul,
after remove

I'm receiving a page blank.
 
Paul Clapham
Marshal
Posts: 24594
55
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Cezar Apulchro wrote:Hi Paul,
after remove

I'm receiving a page blank.



Well, yeah. So why didn't you just change it to use the MIME type for PDF instead?
 
Cezar Apulchro
Ranch Hand
Posts: 127
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how I do that?
 
Paul Clapham
Marshal
Posts: 24594
55
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It would be fair to say that you don't yet know what a MIME type is, right?

So when I searched the web for that term, the first site I found was MIME types (IANA media types). It would be a good idea for you to read through this document, even though it doesn't answer your immediate question immediately. Sure, you can eventually get working code by asking people on the web to help you, but that doesn't speed up the process of getting working code the next time.

And yes, that site does provide the answer to your question, eventually.

 
Cezar Apulchro
Ranch Hand
Posts: 127
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
after read the articles in  MIME types (IANA media types) and
after change my jsp putting the enctype to use the MIME type for PDF the problem still the same.
 
Paul Clapham
Marshal
Posts: 24594
55
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your servlet should be saying that it's returning PDF. It used to say, incorrectly, that it was returning HTML. When I suggested you should change that to say it was returning PDF, you just deleted the relevant line of code.

So changing your JSP (which I assume is whatever is requesting that servlet) to incorrectly say that it's sending multipart form-data (which isn't the MIME type for PDF) won't fix the problem you created by changing the servlet.

 
Cezar Apulchro
Ranch Hand
Posts: 127
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can't understand, my original problem was mask to format date of my mysql table "yyyy-mm-dd" to "dd/mm/yyyy". If I return to use the original servlet my report is generated fine without problemas.
 
Cezar Apulchro
Ranch Hand
Posts: 127
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This contact are closed without solution.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!