2004 IR Help Posted August 23, 2006 Share Posted August 23, 2006 By: santaperera - dilanperera Problem on Solaris [web application ] 2005-09-14 02:55 I have developed a web application just according to the way that is shown in samples-->webapp-->applet example provided with jasperreport distribution archive. So what i am doing is that i am showing the report to the user on an applet. When i host my application on a windows or linux server and access the site from a remote machine i am able to view reports without any problem. But when i host it on the Solaris machine and when i access the web application from a remote machine, i get the following error. ********************************************************************** [type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception javax.servlet.ServletException: Servlet execution threw an exception root cause java.lang.NoClassDefFoundError at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:115) at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:53) at net.sf.jasperreports.engine.util.JRGraphEnvInitializer.initializeGraphEnv(JRGraphEnvInitializer.java:59) at net.sf.jasperreports.engine.fill.JRBaseFiller.<init>(JRBaseFiller.java:181) at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:83) at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:75) at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:68) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:248) at servlets.LocationDetailSummaryServlet.service(LocationDetailSummaryServlet.java:53) at javax.servlet.http.HttpServlet.service(HttpServlet.java:856) note The full stack trace of the root cause is available in the Tomcat logs. ] ********************************************************************* Software i am using are Java 2 Runtime Environment, Standard Edition (build 1.3.1_13-b03) Java HotSpot Client VM (build 1.3.1_13-b03, mixed mode) MySQL <-- no problem connecting to mysql db Tomcat 5.x jasperreports 0.6.7 /0.6.8/0.6.5 <-- all these versions i have same problem please help me because i cant seem to find a reason why this is happening. By: Andres Ederra - andres RE: Problem on Solaris [web application ] 2005-09-14 03:47 Hi, Its seems you are suffering a quite common problem when you use java in a unix server. The problem may be that your java process want to connecto to your XWindow server and it doesnt fint it. Check this thread in one of my projects forums it looks the same problem, check it out in case it applyes: http://sourceforge.net/forum/forum.php?thread_id=1346523&forum_id=290139 By: Denny Valliant - xenden RE: Problem on Solaris [web application ] 2005-09-14 03:48 do a search for "headless" or java.awt in this forum, and see if that is what the problem is. By: santaperera - dilanperera RE: Problem on Solaris [web application ] 2005-09-16 03:16 Thanks guys , you were right, it was the headless problem. the solaris machine already had the Xsun installed so all i had to do is what was said below (found the below instrunction from web) The catalina.sh shell script file literally starts the execution of Tomcat by invoking a Java Virtual Machine (JVM) instance. Given this fact, it is the catalina.sh shell script file that needs to be modified for running Tomcat perpetually; i.e. in order to continue Tomcat's execution even upon user "logout." The modification that will allow this is such, that it will force the JVM to be run using the UNIX "nohup" command. The UNIX nohup command tells a program (i.e. in this case Tomcat) to ignore SIGHUP and SIGQUIT signals, which are generated when a user logs out from their account. This is what keeps Tomcat running. The modification steps are given below: Within the catalina.sh shell script file, scroll down until the following text is found (i.e. highlighted in red): elif [ "$1" = "run" ]; then shift if [ "$1" = "-security" ] ; then echo "Using Security Manager" shift exec "$_RUNJAVA" $JAVA_OPTS $CATALINA_OPTS -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" -Djava.security.manager -Djava.security.policy=="$CATALINA_BASE"/conf/catalina.policy -Dcatalina.base="$CATALINA_BASE" -Dcatalina.home="$CATALINA_HOME" -Djava.io.tmpdir="$CATALINA_TMPDIR" org.apache.catalina.startup.Bootstrap "$@" start else exec "$_RUNJAVA" $JAVA_OPTS $CATALINA_OPTS -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" -Dcatalina.base="$CATALINA_BASE" -Dcatalina.home="$CATALINA_HOME" -Djava.io.tmpdir="$CATALINA_TMPDIR" org.apache.catalina.startup.Bootstrap "$@" start fi Change this text to the following values (in blue), which force the JVM to run in "headless mode" via the "nohup" UNIX utility program: nohup "$_RUNJAVA" -Djava.awt.headless=true $JAVA_OPTS $CATALINA_OPTS Once this change has been made, Tomcat can then be restarted and the user can safely logout from their UNIX account. Any debug messages generated by Tomcat during its lifetime will be output to a text file named "nohup.out." The nohup.out text file, which is automatically generated by the nohup command for the process it is running, will exist in the directory from which nohup was invoked. Specifically, if the MapXtremeJava "startup.sh" file is used to start Tomcat (i.e. via nohup by calling the catalina.sh file, directly), then the nohup.out text file will be created at the same directory level. Since this is the case, the following two files would therefore exist: /export/home/techsupport/MapXtreme-4.7.1/bin/startup.sh /export/home/techsupport/MapXtreme-4.7.1/bin/nohup.out Caveat: if the Tomcat JVM is not started in headless mode, then the below exception (in red) can be thrown if remote map rendering occurs. Specifically, users would see this stacktrace within the "nohup.out" text file: java.lang.NoClassDefFoundError at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:130) at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:62) at java.awt.image.BufferedImage.createGraphics(BufferedImage.java:1053) at com.mapinfo.mapxtreme.ImageHandlerServlet.b(Unknown Source) at com.mapinfo.mapxtreme.ImageHandlerServlet.sendResponse(Unknown Source) at com.mapinfo.mapxtreme.ImageHandlerServlet.service(Unknown Source) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:404) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:356) at com.mapinfo.mapxtreme.MapXtremeServlet.a(Unknown Source) at com.mapinfo.mapxtreme.MapXtremeServlet.doPost(Unknown Source) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now