Solved

graphic process in unix

Posted on 2008-06-20
5
454 Views
Last Modified: 2012-06-21
hi,

i've developed an web-base application which creates vertial title images in runtime with java.awt libaries. it works fine in windows
but it does not work in my sun solaris 10. i searched the error in web and found two solutions;
      first one: using -Djava.awt.headless=true in startup script but when i try i get this error;
                        ERROR 2007-09-19 12:09:54,527 com.zzz.dm.actions.ImageWriter - java.awt.HeadlessException
                        
      second one: using xwindow like this;                        
                        DISPLAY=localhost:10
                        export DISPLAY
                        but i get this error; (i think i set the wrong port, how can i get the xwindow port?)
                        <Jun 19, 2008 12:07:56 PM EEST> <Error> <HTTP> <BEA-101017> <[ServletContext(id=28914982,name=NewDMWEB,context-path=/NewDMWEB)] Root cause of ServletException.
                        java.lang.InternalError: Can't connect to X11 window server using 'localhost:10' as the value of the DISPLAY variable.
                              at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
                              at sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:134)
                              at java.lang.Class.forName0(Native Method)
                              at java.lang.Class.forName(Class.java:141)
                              at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:62)
                              at java.awt.Font.initializeFont(Font.java:308)
                              at java.awt.Font.<init>(Font.java:344)

how can i run the application?

thanks in advance...
0
Comment
Question by:janavar
  • 3
  • 2
5 Comments
 
LVL 16

Expert Comment

by:Hanno Schröder
ID: 21830014
a) Using "headless" means that you do not have any graphical display at all
b) To use an X11 display you must
    - Have an X11 display server up and runing (X11 started on some workstation)
      This could be a local X11 display on your Solaris workstation or any other
       display somewhere on the network.
    - The environment variable $DISPLAY must be set to point to this very display
       If you have a local display (on your Solaris 10 workstation) it will usually be
       set to something like
           :0.0
       or
           localhost:0.0
       You may verify this right after starting an xterm (or some other shell window)
       and entering
           echo $DISPLAY
       If you have a remote X11 display, it would be set to something like
           hostname:0.0
       or to
           localhost:10.0    (or simply localhost:10)
       when you logged in to your Solaris 10 box via ssh with X11 tunneling enabled.
       When using cygwin as the X11 display (server), you must (!) omit the .0 at the
       end.
0
 
LVL 16

Expert Comment

by:Hanno Schröder
ID: 21830027
To verify if you can use the DISPLAY variable as it is set right now,
try to open some X11 application like
    xterm -ls -sl &
( or, if your PATH is not set:
    /usr/openwin/bin/xterm -ls -sl &
) or
    xclock -update 1 &

   
0
 

Author Comment

by:janavar
ID: 21844966
i am connecting to the server with telnet so i can not execute xterm. how can i test if xwindow works fine and which port it listens?
0
 
LVL 16

Expert Comment

by:Hanno Schröder
ID: 21845622
when you got an term opened, check the DISPLAY variable
    echo $DISPLAY
Now, try to start another X11 program (like xterm, xclock etc.)
and see if it gets displayed on your screen.

X11 usually listens on ports 5000 and above
0
 

Accepted Solution

by:
janavar earned 0 total points
ID: 22272903
i fixed the problem by using pja toolkit (http://www.eteks.com/pja/en/) but it does not support java 1.5 or above :-(
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to have a cron job run until a condition is met 12 54
print map entry 34 53
table example 4 19
Error Message during CentOS 7 Minimal Install 3 33
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

943 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now