It's because the underlying calls to make graphics at some point are run 
out to some native code so that it can run a little more smoother. I ran 
into the same problem trying to get graphics to happen on my servlet 
hosting provider.

Apparently you can get Java 1.4 to run in a headless mode which means 
that it will do everything. Otherwise, the VM needs to get at a running 
X service. My provider solved it by simply running a VNC process under 
my environment.

But, there is said to be more basic solutions like telling 1.4 to be 
headless etc. Do a search on JGuru.com, that's where I found the start 
to my answers. You cn even run a pure java AWT, which also gets around 
the head issues. This does mean you have to change only a few of the 
classes you normally use (BufferedImage etc)...
Pure Java AWT...
http://www.eteks.com/pja/en/

There may be others out there.


Arron.


Micael Padraig Og mac Grene wrote:

> Do you mean the ip address of the server? If so, that would be easy to 
> set with
>
> export DISPLAY=<ip address>:0.0
>
> But, is that right? If so, should be a snap.
>
> If you mean the client machine, then I don't want to do that, because 
> the functionality is not to send image data but to manipulate it in a 
> servlet.
>
> Thanks for a prompt suggestion.
>
> Micael
>
> At 10:36 PM 5/12/02 -0700, you wrote:
>
>> Micael,
>> Is your display variable set to the machine that you are running on? 
>> It should be <the IP address of your machine>:0.0.
>>
>> Regards,
>>
>> Richard
>>
>> At 10:15 PM 5/12/2002 -0700, you wrote:
>>
>>> I presently am having difficulty using the awt with servlets to do 
>>> image reconstruction work on a RedHat 7.2 Linux platfrom, because I 
>>> get the following exception, which some think is a bug in JDK 1.4, 
>>> but seems to be something Sun has tolerated intentionally
>>>
>>> Exception in thread "main" java.lang.InternalError: Can't connect to 
>>> X11 window server using ':0,0' as the value of the DISPLAY variable.
>>> at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
>>> at 
>>> sun.awt.X11GraphicsEnvironment.<clinit><>(11GraphicsEnvironment.java:126) 
>>>
>>> at java.lang.Class.forName0(Native Method)
>>> at java.lang.Class.forName(Class.java:130)
>>> at java.awt.Toolkit#2.run(Toolket.java:712)
>>> at java.security.AccessController.doPrivileged(Native Method)
>>> at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:703)
>>> at javax.swing.ImageIcon.(init>(ImageIcon.java:81)
>>> at javax.swing.ImageIcon.<init>(ImageIcon.java:107)
>>>
>>> My "ps aux" says:
>>>
>>> /etc/X11/X -auth /var/lib/kdm/authfiles/A:0-0Dqymv
>>>
>>> for the X11 server. Does anyone have an idea what I need to do at 
>>> this point? Everything works on a pc, of course.
>>>
>>> This is not strictly a struts problem, of course, but it is 
>>> something that struts users that deal with multimedia will need to 
>>> deal with since it is essentially a server side problem. I have no 
>>> problem with leaving an X11 server running to make this work. I 
>>> cannot live with the client having to do anything special. The 
>>> problem is that I don't want to use the graphics but do want to 
>>> access the graphic functionality.
>>>
>>> Thanks for any assistance.
>>>
>>> Micael
>>>
>>> P.S. If you don't understand the above, please do not offer 
>>> suggestions. Thanks for that too.
>>>
>>>
>>>
>>> -- 
>>> To unsubscribe, e-mail: 
>>> <mailto:[EMAIL PROTECTED]>
>>> For additional commands, e-mail: 
>>> <mailto:[EMAIL PROTECTED]>
>>
>>
>>
>>
>> -- 
>> To unsubscribe, e-mail: 
>> <mailto:[EMAIL PROTECTED]>
>> For additional commands, e-mail: 
>> <mailto:[EMAIL PROTECTED]>
>>
>
>
>
> -- 
> To unsubscribe, e-mail: 
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: 
> <mailto:[EMAIL PROTECTED]>
>
>



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to