File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes Solaris Java Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Solaris Java Problem" Watch "Solaris Java Problem" New topic
Author

Solaris Java Problem

Muhammad Zaheer Ahmad
Greenhorn

Joined: Dec 22, 2008
Posts: 7

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

Joined: Jul 08, 2003
Posts: 24183
    
  34

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.


[Jess in Action][AskingGoodQuestions]
Muhammad Zaheer Ahmad
Greenhorn

Joined: Dec 22, 2008
Posts: 7

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
 
jQuery in Action, 2nd edition
 
subject: Solaris Java Problem
 
Similar Threads
Problem in BeanUtils.populate
javax.servlet.ServletException: Cannot create bean of class...
struts problem
OutOfMemoryError
show buffered image