This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Getting errors while trying to get graphics environment  RSS feed

 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its a webapp. An error occured during PDF generation on linux machine. Below is the stack trace.


Some other error occured during PDF generation on MAC machine. Below is the stack trace.



Error on MAC is quite simple but dont know what kind of permission it is talking about. My webapp is running on Tomcat5.0.28.

Any inputs would be appreciated.
 
Jessica Sant
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hmmmm....

What happens if you execute this code from a standalone program (outside of tomcat). That way you eliminate one possible complication. If the problem still exists outside Tomcat, then you know it's gotta be something else. Of course, if it works just fine and dandy when you execute it from the command line, then you know its gotta be something in your Tomcat environment.

Try eliminating sources of possible complication and see where it leads you.

- Jess
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moreover, I have tried to run the tomcat in headless mode. But that didn't really work. A new error occured and I am stuck some where in between. Below is the stack trace



Before starting Tomcat I did,. . .

export CATALINA_OPTS="-Djava.awt.Headless=true"

. . .in order to run JVM in Headless mode.
Any other suggestion please.
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can run Xvfb, the X virtual frame buffer, as the tomcat user on display 1 (or any other number besides 0) and then set DISPLAY=:1 in Tomcat's environment. It's basically a mini X server, and AWT will be perfectly happy with it. I've done this instead of using headless mode. Works great for testing GUI code, too.
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its working like charm. Thanks Ernest and Jessica.
It is late due to some security/privileges issues on the linux/MAC Servers.

Thanks a million.
 
Omar Palomino Sandoval
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've tried to run Tomcat in headless mode by modifying the startup.sh script but i've got the same Exception and I have no idea of how to: first, install Xvfb and second, set the correct mode to make JR to show my reports. Can anybody give a hand please? The server is a Fedora 3, Java 1.4 y Tomcat 5.0

Thanks in advance

ps. Sorry, I'm a newbie on Linux Servers. :$
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Omar Palomino Sandoval:
I've tried to run Tomcat in headless mode by modifying the startup.sh script but i've got the same Exception and I have no idea of how to: first, install Xvfb and second, set the correct mode to make JR to show my reports. Can anybody give a hand please? The server is a Fedora 3, Java 1.4 y Tomcat 5.0

Thanks in advance

ps. Sorry, I'm a newbie on Linux Servers. :$


Omar, rather than drudging up this old Swing thread (I don't really know why it was in the Swing forum to begin with) and then asking an associated Tomcat question, you'd be better off starting a new thread in the Tomcat forum. You'll have better luck there.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!