Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Solaris Java Problem

 
Muhammad Zaheer Ahmad
Greenhorn
Posts: 7
Eclipse IDE Firefox Browser Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,
I am facing a problem with Solaris.
I create a buffered Image and trying to make it render my cpatcha text data.Every thing goes fine on window, but when i deploy application on solaris it gives error. for creatingGraphics

CODE: for jdk1.3

BufferedImage image = new BufferedImage(width, height,BufferedImage.TYPE_4BYTE_ABGR);
Graphics2D graphics2D = image.createGraphics();

-----------
ERROR:
java.lang.NoClassDefFoundError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:120)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:58)
at java.awt.image.BufferedImage.createGraphics(BufferedImage.java:1011)
at T_00033.jsp.n_00025wsletter._0002fT_00033_0002fjsp_0002fnewsletter_0002fkaptcha_0002ejspkaptcha_jsp_7._jspService(_0002fT_00033_0002fjsp_0002fnewsletter_0002fkaptcha_0002ejspkaptcha_jsp_7.java:81)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:126)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.java:174)
at org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java:268)
at org.apache.jasper.runtime.JspServlet.service(JspServlet.java:381)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.broadvision.servlet.ServletContainer.service(ServletContainer.java:404)
at com.broadvision.servlet.ServletContainer.processRequest(ServletContainer.java:348)
at com.broadvision.servlet.ServletContextContainer.processRequest(ServletContextContainer.java:660)
at com.broadvision.servlet.BVServletEngine.service(BVServletEngine.java:202)
at com.broadvision.servlet.BVServletConnector.service(BVServletConnector.java:146)


I found it that its a bug for non windows os to createGraphics for them but there must be an other way to do this.
I just want to createBuffer image using jdk1.3 and return it to jsp pages.
Can any body help who have solaris exp.

Thanks in advance
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Welcome to JavaRanch!

Servers on UNIX machines are generally running without access to an X/Windows display, so attempting to initialize the graphics system leads to an error -- as you've found. This FAQ page mentions the issue.

One problem is that the java.awt.headless system property that provides an easy solution to this wasn't introduced until JDK 1.4; why are you running such an old JVM?

I'm going to move this to our Tomcat forum; this isn't an advanced Java programming question.
 
Muhammad Zaheer Ahmad
Greenhorn
Posts: 7
Eclipse IDE Firefox Browser Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
Thanks for your reply,
the points you mentioned are valid but, infect i cant use all of those.
I have to make change in an existing application which is built using jdk1.3
and also i cant do more with server like installing VNC based new OS or other utilities which provide graphics operations like in windows.
Is there any JAVA API for images creation which does not require that OS has GUI or not but can provide image creation operations.
I think images can be created with out any native OS support.
If any one knows some tricks or tips will be helpful.

Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic