Posted By:
Arindam_Das
Posted On:
Friday, May 30, 2003 02:11 AM
I am writing a handler class which is responseble for image size and type convertion , where , I have used the following code : package com.bftg.picture; import com.sun.image.codec.jpeg.*; import java.awt.*; import java.awt.image.*; import java.io.*; public class Picture { private int m_ImageWidth; private int m_ImageHeight; private Image image = null; protected Picture(String source) throws Exception { //Loads the image System.out.println("Printing from Picture : ..1"); image = Toolkit.getDefaultToolkit().getImage(source); Sys
More>>
I am writing a handler class which is responseble for image size and type convertion , where , I have used the following code :
package com.bftg.picture;
import com.sun.image.codec.jpeg.*;
import java.awt.*;
import java.awt.image.*;
import java.io.*;
public class Picture
{
private int m_ImageWidth;
private int m_ImageHeight;
private Image image = null;
protected Picture(String source) throws Exception
{
//Loads the image
System.out.println("Printing from Picture : ..1");
image = Toolkit.getDefaultToolkit().getImage(source);
System.out.println("Printing from Picture : ..2");
MediaTracker mediaTracker = new MediaTracker(new Frame());
........
........
}
.........
.........
}
When I am running the above code in windows it's working like a charm. But in Sun-Solaris os 5.8 or Linux 8.0 environment with WebLogic 7.0 sp2 and jdk1.3.1 (as well as 1.4.0) it is generating the following error , after printing the first System.out. :
webdevel@devapp01:/bea70sp1/user_projects/pvtstest/applications/DefaultWebApp/WEB-INF/
classes/com/bftg/picture1>java ImageConverter.class /var/weblogic/tempfile/logo2New.g
if /var/weblogic/finalfile/logo2New.JPEG
Exception in thread "main" java.lang.NoClassDefFoundError: ImageConverter/class
webdevel@devapp01:/bea70sp1/user_projects/pvtstest/applications/DefaultWebApp/WEB-INF/
classes/com/bftg/picture1>java ImageConverter /var/weblogic/tempfile/logo2.jpg /var/we
blogic/finalfile/logo2.JPEG
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
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:124)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironmen
t.java:63)
at
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:124)
at java.awt.Toolkit$2.run(Toolkit.java:499)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:492)
at Picture.
(Picture.java:33)
at ImageConverter.resizeImage(ImageConverter.java:119)
at ImageConverter.convertImage(ImageConverter.java:40)
at ImageConverter.main(ImageConverter.java:186)
-------------
Can you suggest me what step(s) should I take.
Arindam.
<<Less