Can't connect to X11 window server

By: Romy Yuliawan - snricek
Can't connect to X11 window server
2002-02-12 19:14
Hi,
I used Tomcat on RedHat7.0, when I browse (via IE5.0 on Windows2000) a JSP file, I've got the following error:

javax.servlet.ServletException: Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable.

I also recieved the error when I execute taskFill.bat at Linux shell.
(the same JSP is work OK on Tomcat under Windows 2000)

Can anyone tell me why it's happening ?

Thank's


By: Steven Blough - stevenblough
RE: Can't connect to X11 window server
2002-02-25 09:23
There is also the option of installing Xvfb instead of XServer. Xvfb is available at ftp.x.org

-Steven Blough



By: Romy Yuliawan - snricek
RE: I Can connect to X11 :)
2002-02-26 01:28
Thanks Teodor, thanks Steven...
for a while I can connect to X11 by installing Xvfb, but I've got another error after this.

exception:
javax.servlet.ServletException at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:463)

root cause:
java.lang.NoClassDefFoundError at dori.jasper.engine.JRBand.getJRFBand JRBand.java:72)

I think, an error above look like Tomcat cannot find jasper class, whereas on windows is work OK by put jasper at Tomcat/lib.
any suggestion for my Tomcat ?

sorry for makes much questions :)
Thanks again.



By: Teodor Danciu - teodord
Class not found problem
2002-02-26 04:51

Hi,

Try to see if the class called
dori.jasper.engine.JRBandFiller is present
in your JasperReports JAR file.

Recent versions of JasperReports do not have
the class loader problem anymore and you could
place your JasperReports JAR file in the
WEB-INF/lib directory if your Web application
and not in the server's classpath.

Also make sure you don't have different versions
of JasperReports in your classpath.

I hope it helps!
Teodor



By: Roberto Rios - bobrivers
RE: Can't connect to X11 window server
2002-02-28 18:20
Hi,
It's me again...

I have developed some tests into W2K environment. When I migrated it a Linux environment, I got the same errors.

First the one regarding X11. So I solved it.

Then I received the other one, JRBandFiller.

I have checked the classpath, jar, everything. Nothing looks to be wrong.

Any hint?

Roberto



By: Romy Yuliawan - snricek
RE: X11 Issue
2002-03-01 01:06
Hi Teodor,
I believe, this subject is a little bit of topic :), but it might help others as well.
About to solve the X11 problem, I found this::

[*] from http://www.eteks.com/pja/en/
--------------------------------------------------
PJA (Pure Java AWT) Toolkit is a JavaTM library for drawing graphics developed by eTeks. It is 100% Pure Java and doesn't use any native graphics resource of the system on which the Java Virtual Machine runs.
java.awt.Graphics methods such as drawLine (), fillOval (), drawString (),... are implemented in the default JVM with native graphical functions (except in some cases for Java2D) : That means that drawLine () finally calls a GDI system function on Windows or X11 function on a X11/UNIX machine even if the drawing is done in an off-screen image using the class java.awt.Image. This ensures the best performance for drawing graphics with Java.
When no X11 Display is available on a UNIX machine (also called headless environment) or when GDI resources are low on Windows, it is impossible to compute off-screen images with java.awt.Graphics methods, even if your program doesn't need to display these images. Typically, this situation happens for servlets returning dynamically generated images like pies, charts or web counters.
With PJA, no need to change your Java programs that you expected to run : setting java.awt system property to com.eteks.awt.PJAToolkit is the only required modification to your program with Java 1.1
--------------------------------------------------

Maybe the PJA can solve the problem, or if possible it can be integrate with JasperReports :)

Thanks,
Romy



By: peter lee - whlpeter
RE: Can't connect to X11 window server
2002-07-28 20:42
Hi,

Can some one help me?

I tested a simple report in Win2K and see the OK result. However, I moved the envirement to linux and followed this thread, I kept get the java.lang.NoClassDefFoundError.

root cause:
java.lang.NoClassDefFoundError atdori.jasper.engine.fill.JRFiller.fillReport(JRFiller.java:62)

I used RH7.3, tomcat 4.0.4, JDK 1.4 and JasperReports 0.3.3. Ant compiling is OK. Classpath is OK and there is no other version of JasperReports in my classpath. It looked like JRVerticalFiller is not found. I had tryed to put the jar file in WEB-INF/lib and server's classpath. Both ways got the same error.

Can anyone help me?

Thanks

Peter





By: Andres Jaimes - ajaimes
RE: Can't connect to X11 window server
2002-07-30 14:06
Hi, I had that problem and solved it this way:

1) delete your jasperreports.jar from classpath, but be sure tomcat can see it, this means, copy it to $catalina_home/webapps/your_app/WEB_INF/lib.
2) be sure that's the only place where it exists! look for it in other tomcat directories.
3) Check you only have one version of jasperreports.jar, if you find another files like jasperreports-0.2.5.jar, delete them!

Hope this helps :)


By: Teodor Danciu - teodord
RE: Can't connect to X11 window server
2002-02-12 23:23

Hi,

In order to run JasperReports on Unix systems
you have to have XServer installed.
That's because when generating reports,
JasperReports makes use of various classes in
the java.awt package that do not work if there
is no XServer installed.
(for example, when working with fonts)
On Windows platforms this problem does not occur.

Good luck!
Teodor



By: Matt Mastrangelo - mmastrangelo
RE: Can't connect to X11 window server
2002-10-09 23:08
Does this mean I have to have a window environment running whenever using jasperreports?

Wouldn't this be extremely inefficient for a servlet application to have to have an x windows system running on the server at all times?

I must be missing something here.


By: Matt Mastrangelo - mmastrangelo
RE: Can't connect to X11 window server
2002-10-09 23:08
Does this mean I have to have a window environment running whenever using jasperreports?

Wouldn't this be extremely inefficient for a servlet application to have to have an x windows system running on the server at all times?

I must be missing something here.


By: Matt Mastrangelo - mmastrangelo
RE: Can't connect to X11 window server
2002-10-09 23:25
Scratch that last question - I wasn't aware of what Xvfb was.

Sorry bout that!


By: Vince Clark - vmclark
RE: Can't connect to X11 window server
2002-12-03 20:54
This thread talks about the two errors I am receiving but doesn't quite clarify the solution. I have read all of the threads I can find about this problem.

I am trying to get the sample reports working.

I was receiving the error:
javax.servlet.ServletException: Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable.

So I installed xvfb. That error went away but now I receive the JRVerticalFiller NoClassDefFound error. If I restart Tomcat while xvfb is running the error goes back to the first one. Then if I kill the xvfb proc and start it again I get the JRVerticalFiller error.

Environment:
SuSe Linux 7.0, Tomcat 3.2.3, JDK 1.3.1, JasperReports 0.4.4, Xerces 2.2.1

The following jar files are in my $TOMCAT_HOME/webapps/<my-jasper-webapp/WEB-INF/lib directory.
commons-beanutils.jar
jasperreports-0.4.4-applet.jar
xercesSamples.jar
commons-collections.jar
jasperreports-0.4.4.jar
xmlParserAPIs.jar
commons-digester.jar
jasperreports.jar
itext-0.92.jar
xercesImpl.jar

My $TOMCAT_HOME/lib directory contains:
ant.jar
jasper.jar
jaxp.jar
parser.jar
servlet.jar
webserver.jar


By: Boris Klug - bklug
RE: Can't connect to X11 window server
2002-12-05 05:02
Hello!

I have the same problem, I receive:
javax.servlet.ServletException: Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable.

And on my server, I have a full XFree86 running. I think its more a problem that the user running jasperreports (for my setup its root) is not allowed to connect to X. Before the exception above I get:

Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

So I have to figure out why.. if someone know the solution, please tell me ;-)
When I figure out a solution, I let you know.



By: Danny Liu - dsyliu
RE: Can't connect to X11 window server
2003-06-11 11:33
I ran into the same problem and tried to install Xvfb on my Linux box without success. I think maybe I did something wrong in installing Xvfb. Can somebody please tell me how to install Xvfb properly?



By: mcalex - mcalexy2k
RE: Can't connect to X11 window server
2004-09-19 20:50
Hello,
I found the real solution for this. This is not a class error. Follow this steps to resolve this problem
01. Use JDK 1.4.2 or Later version
02. setup tomcat option as follows

export CATALINA_OPTS=-Djava.awt.headless=true
(Insert above statement into startup.sh file in your <tomcat home>/bin folder)
ktrinad's picture
1157
Joined: Aug 9 2006 - 2:36am
Last seen: 16 years 10 months ago

0 Answers:

No answers yet
Feedback
randomness