Java 5, AWT in headless mode and X11 Libraries

Hi All,
In Java 5, does AWT still require X11 libs to be present (not running or started) when using AWT in headless mode ?
What level of grahpics (non GUI) activities can you perform with Java 5 and AWT in headless mode.
Cheers

i found something here...
http://forum.java.sun.com/thread.jspa?threadID=444149&start=10&tstart=0

Similar Messages

  • Printerjob, awt headless mode and mac os x server

    hello
    i've an application that print a page using classes like jframe, jpanel, jtable, etc
    when i run it on a linux server or on a windows one there are no problems, but when i try to print this page on mac os x server 10.6.8 i get this error:
    on system dock appear a java icon named org.apache.catalina.startup.Bootstrap and the printed page comes empty. if i set the visibility property to true i can see the correct page, but i can't print!
    I've searched on google and i found various articles that say to set JAVA_OPTS to awt headless = true. i've tryed but i've obtained an headlessexception, because i use jframe etc that need headless mode disactive...so what can i do?
    i want to print with a shared network windows printer, if i print with textedit all go well, the problem appears only using java PrinterService class
    thanks in advance

    Paolo - Welcome to Discussions!
    At the moment - this is partly implemented.
    Networked home directories only are searched (new to tiger)
    Although there appear to be stubs of routines (and some low level documentation) that seem to point to support for indexing entire shares, it is not enabled.
    I know your case seems like a good one for this - but in general, it makes little sense for a lot of clients to hammer a network volume - all of them making their own index. I would presume there is a plan to allow the server to make one index and have the clients either refer to that index or download a copy of that index as needed to reduce the overhead on the server... (but that's just an educated guess - with no way of knowing)
    For more information, see http://docs.info.apple.com/article.html?artnum=301533 and http://discussions.apple.com/message.jspa?messageID=1303423#1303423

  • Measuring string bounds in headless mode on a server?

    I have a problem with calculating screen string width for the browser client.
    I'm outputting a stream of content type application/vnd.ms-excel and sending back an XML spreadsheet. (No complaints about using Mc$oft products, it's what's needed!)
    Excel does not autosize columns which contain string data, so the text columns are the standard Excel width, and the text is wrapped onto about 7 lines. See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnexcl2k2/html/odc_xmlss.asp for details of the XML format.
    Excel does allow you to specify the with of a column in points, so I was using the awt Font classes to calculate the string bounds in pixels. I explicitly set the resolution to be used to 72dpi by creating a FontRenderContext with an AffineTransform with a scaling factor of (1.0, 1.0), so that asking the pixel width, gets the point width.
    This worked fine testing it on my windoze machine, but on the Unix server, it's obviously running in headless mode, and anyway, it doesn't have the Arial font which I'm specifying in my spreadsheet as the font to use.
    Is there any way of calculating the width of a string in points knowing its font and the point size of the font? You shouldn't need a graphcs environment, just the font information. I have all the .TTF files, I could copy them to the Unix machine if Java could use them and do the calculation.
    I hate leaving the user interface looking so shoddy with wrong sized columns!
    It SHOULD have worked in a headless environment according to http://java.sun.com/j2se/1.4.2/docs/guide/awt/AWTChanges.html#headless and we are on version 1.4.2_01. It actually blew up in awt code:
    java.lang.NoClassDefFoundError
         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)That's when I'm trying to instantiate a new Font("Arial", Font.PLAIN, 10);I've looked at the FOP project wondering whether that has a solution but it's a huge, confusing thing. There must be a way. Can anyone help?

    When you say "unix doesn't have Arial" you obviously aren't using Solaris where Arial most certainly
    ships and is in fact the main font used to support dialog & sanserif.
    There are numerous APIs to calculate the width of a string in pixels, depending on whether
    you want the integer metrics, fp metrics , logical bounds, pixel bounds (which guarantees to enclose
    every pixel if you correctly specify the graphics/FRC)
    Every single one of these works in headless mode.
    Even the most simple-minded FontMetrics.stringWidth(String) call should be good enough
    for your requirements.
    The error you show looks like you have a misconfigured environment.. It can't find
    the correct implementation class of GraphicsEnvironment which is nothing to do with
    fonts. Moreover this DOES work for me :
    import java.awt.*;
    public class Arial {
    public static void main(String args[]) {
    Font arial = new Font("Arial", Font.PLAIN, 10);
    System.out.println(arial);
    % java -version
    java version "1.4.2_01"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_01-b06)
    Java HotSpot(TM) Client VM (build 1.4.2_01-b06, mixed mode)
    % java -Djava.awt.headless=true Arial
    java.awt.Font[family=Arial,name=Arial,style=plain,size=10]
    QED.
    -Phil.

  • J2sdk1.4 headless mode

    Hello,
    Can u help me set the headless mode in my linux server? I'm not familiar with command line stuff, I'm having a hard time! What I've done so far:
    - I downloaded j2sdk1.4 for linux and installed it in my linux server.
    - I set the system variable JAVA_HOME to my java home directory: /usr/java/j2sdk1.4.0
    Now I know I'm supposed to start my JVM with the -Djava.awt.headless=true option, but I don't know how to do this. How does this apply to a servlet generating images? Can I run a servlet from the command line? How can I set the headless mode once and for all? Should I start ANY java program with the headless option, and then it will apply to any other java program, including my servlet?
    I will really appreciate any help!
    Miguel

    java -Djava.awt.headless=true classname

  • RFC JAVA CONNECTOR CAUSING THE JAVA TO BE IN SAFE MODE

    Hi GURUS :
    We have SolMan with JAVA as Add in . Now during the JSPM Launch the JSPM Aborts with the Err Messages as shown :
    in trace file dev_jrfc.trc and in defaultTrace we have this same message :
    >>>>
    #1.5 #0003BA951BE1004C0000000500007486000456B88DE8595D#1221250561628#com.sap.engine.services.rfcengine##com.sap.engine.services.rfcengine#J2EE_GUEST#0##n/a##d7e28da080f311ddc3de0003ba951be1#SAPEngine_Application_Thread[impl:3]_27##0#0#Error#1#/System/Server#Plain###Bean SLDJAVA_ACCESSOR_REQUESTnot found on host <fqdn of host name> ProgId =JCOLDAPI: Path to object does not exist at rfcaccessejb_stateful, the whole lookup name is rfcaccessejb_stateful/SLDJAVA_ACCESSOR_REQUEST.registered entries for FuctionName=JNDIName : {}#
    #1.5 #0003BA951BE1004C0000000600007486000456B88DE85D04#1221250561629#com.sap.engine.services.rfcengine##com.sap.engine.services.rfcengine.handleRequest#J2EE_GUEST#0##n/a##d7e28da080f311ddc3de0003ba951be1#SAPEngine_Application_Thread[impl:3]_27##0#0#Error##Plain###java.lang.RuntimeException: Bean SLDJAVA_ACCESSOR_REQUESTnot found on host <fqdn of host name>, ProgId =JCOLDAPI: Path to object does not exist at rfcaccessejb_stateful, the whole lookup name is rfcaccessejb_stateful/SLDJAVA_ACCESSOR_REQUEST.#
    #1.5 #0003BA951BE1004C0000000700007486000456B88DE85E8C#1221250561629#com.sap.engine.services.rfcengine##com.sap.engine.services.rfcengine.handleRequest#J2EE_GUEST#0##n/a##d7e28da080f311ddc3de0003ba951be1#SAPEngine_Application_Thread[impl:3]_27##0#0#Error##Plain###java.lang.RuntimeException: Bean SLDJAVA_ACCESSOR_REQUESTnot found on host <fqdn of host name>, ProgId =JCOLDAPI: Path to object does not exist at rfcaccessejb_stateful, the whole lookup name is rfcaccessejb_stateful/SLDJAVA_ACCESSOR_REQUEST.
         at com.sap.engine.services.rfcengine.RFCDefaultRequestHandler.handleRequest(RFCDefaultRequestHandler.java:138)
         at com.sap.engine.services.rfcengine.RFCJCOServer$J2EEApplicationRunnable.run(RFCJCOServer.java:254)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:102)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:172)
    <<<
    Now , this JCOLDAPI is Java RFC Connector with User PORTALADMIN and at the ABAP Side we see that the J2EE_ADMIN pwd was changed by this PORTALADMIN !! We had at the same time stamp, the message in the log file of the JSPM that credential supplied to log in to J2EE Engine is not valid ( 'cause, the PORTALADMIN had changed the PW
    of the J2EE_ADMIN ) - While attempting to Launch the JSPM for JAVA Patches > It aborts with the same above message !!
    Half of the SW Comp were updated and rest half aborts repeatedly with the above message.
    Same way the Vis Admin won't start with the msg that Credential to connect J2EE is not valid. Although there was no change at the Config Tool Secure Store > J2EE Admin and SAPSR3DB passwords !!
    I have changed both the J2EE_ADMIN and the PORTAL ADMIN to the User Type Service User ( note 622464 ) ..have
    kept the same pw at ABAP and configtool secure store. But the java is not coming up neither through SMICM nor through the startsap j2ee command as SMPADM.
    i.e. it would comeup only in SAFE Mode !!
    This JCOLDAPI RFC Java Connector 's PORTALADMIN has several rights at the ABAP Side and is used for EWA Purpose.
    JAVA is running in SAFE mode and no matter how many time I try at the config tool Side to bring it in normal mode it is not swithcing to normal mode > I disble the safe mode at the ConfigTool Side > Apply > Save . > Restart the JAVA through the jcmon > shutdown and restart cluster under #10 Cluster Admin Menu > it is coming up only in SAFE mode again with the abvoe error message !!! Restart through the SMICM don't even work at all !!. Also, the system is slow ..even to come in safe
    mode JAVA takes about 45 minutes !!!
    Also, since the JAVA is coming up only in safe mode the SLD and the browser page is not available. The jcomon displays the instance status as ' Synchronizing Binaries' since
    last 20 hours ..this  means that the instance is in hang state.
    Any idea how to solve this problem ?
    Thanks a Lot in Advance,
    Regards,
    - Ishan
    Edited by: ISHAN P on Sep 13, 2008 2:54 PM

    hi ishan,
    do you have solved the problem?? as ??
    thanks
    umberto

  • A short and fundamental question: Java3D in headless mode

    To begin I would like to introduce myself as a complete Java3D newbie.
    What I would like to accomplish is to produce an application which, in headless mode, will read in data and generate 3d images as files, without ever making any GUI components to appear on the screen.
    Is this possible?
    Thanks!

    When you say "unix doesn't have Arial" you obviously aren't using Solaris where Arial most certainly
    ships and is in fact the main font used to support dialog & sanserif.
    There are numerous APIs to calculate the width of a string in pixels, depending on whether
    you want the integer metrics, fp metrics , logical bounds, pixel bounds (which guarantees to enclose
    every pixel if you correctly specify the graphics/FRC)
    Every single one of these works in headless mode.
    Even the most simple-minded FontMetrics.stringWidth(String) call should be good enough
    for your requirements.
    The error you show looks like you have a misconfigured environment.. It can't find
    the correct implementation class of GraphicsEnvironment which is nothing to do with
    fonts. Moreover this DOES work for me :
    import java.awt.*;
    public class Arial {
    public static void main(String args[]) {
    Font arial = new Font("Arial", Font.PLAIN, 10);
    System.out.println(arial);
    % java -version
    java version "1.4.2_01"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_01-b06)
    Java HotSpot(TM) Client VM (build 1.4.2_01-b06, mixed mode)
    % java -Djava.awt.headless=true Arial
    java.awt.Font[family=Arial,name=Arial,style=plain,size=10]
    QED.
    -Phil.

  • Want the link to open EAS IN WEb mode and also the Java API details needed

    Want the link to open EAS IN WEb mode and also the Java API details needed to get it up and running.
    Kindly provide the answer if knows.
    Thanks .

    Yes, you can have single sign on enabled on multiple essbase servers,
    It works like using single userid and password across mulple servers. you can configure essbase server to read from active directory.
    you can configure css.xml file in bin folder
    sample CSS FILE
    here is an example of a css.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <css xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <spi>
    <provider>
    <msad name="msad1"> <trusted>false</trusted>
    <url>ldap://ldapserver:389/dc=CompanyName,dc=com</url>
    <userDN>CN=#######,OU=Security Accounts,OU=IT,DC=CompanyName,DC=com</userDN>
    <password>########</password>
    <authType>simple</authType>
    <identityAttribute>dn</identityAttribute>
    <user>
    <loginAttribute>sAMAccountName</loginAttribute>
    <fnAttribute>givenname</fnAttribute>
    <snAttribute>sn</snAttribute>
    <emailAttribute>mail</emailAttribute>
    <objectclass>
    </objectclass>
    </user>
    <group>
    <url>cn=LostAndFound</url>
    </group>
    </msad>
    </provider>
    </spi>
    <searchOrder>
    <el>msad1</el>
    </searchOrder>
    <token>
    <timeout>60</timeout>
    </token>
    <logger>
    <priority>ERROR</priority>
    </logger>
    </css>

  • Java Swing/AWT and FX is so old school! Give me HTML and CSS for GUI!

    Dear Java,
    I am a seasoned programmer and I feel it's time JAVA implements a GUI system where it uses HTML and CSS for the GUI. For the love of god just look at the interfaces you can make using HTML and CSS alone. I am a big fan of Java Swing and the recent GUI designer for FX is quite cool. But they are just not as simple as HTML and CSS. And JavaFX has some interesting requirements for the graphics.
    I know it is possible to use JavaFX and implement the WebView/WebDriver and make it load a HTML page, etc... but why go through all the trouble?
    Just imagine... if you make Java where it has powerful back-end to do what it does best and the HTML/CSS powered GUI on the front-end. It will make the lives of many developers much much easier.
    I am not sure whether a Swing designed GUI will be faster than a HTML designed GUI... but if you look at a traditional browser and how fast it renders HTML/CSS, I am sure if Java had a native Form where it uses HTML and CSS to render the GUI, Java will make the dreams of many programmers a reality.
    Make it happen!!!!

    Check this i solve problem just now using this
    https://wiki.archlinux.org/index.php/Ja … ow_Manager

  • JTable in Headless Mode

    Is it possible to create a JTable (with the table header) in headless mode?
    Thanks,
    Steve Sinai

    You don't know what headless mode is??? Then you're in the majority. It's one of those things I've seen mentioned in Swing books, but I've never had to deal with it before. On a server, we're trying to fill JTables with data, and then convert the JTables to pdf using iText. If you're wondering why we don't go straight to pdf using iText, thus bypassing JTables, you'll have to talk to our architect.
    An explanation of headless mode is at the following link.
    http://java.sun.com/developer/technicalArticles/J2SE/Desktop/headless/
    I stole some example code from that site, and have been trying to use it to create a JTable. It's below. Some code that creates a JLabel works fine, and I commented it out. Now I'm trying to get it to create a JTable. The example displays the output on a printer, which is a little bit of a hassle, but it is what it is. If anyone can get the table (with header) to show up, it would be pretty nice.
    import java.awt.*;
    import java.io.*;
    import java.awt.print.*;
    import java.util.*;
    import javax.swing.*;
    public class HeadlessBasics
        public static void main(String[] args)
            // Set system property.
            // Call this BEFORE the toolkit has been initialized, that is,
            // before Toolkit.getDefaultToolkit() has been called.
            System.setProperty("java.awt.headless", "true");
            // This triggers creation of the toolkit.
            // Because java.awt.headless property is set to true, this
            // will be an instance of headless toolkit.
            Toolkit tk = Toolkit.getDefaultToolkit();
            // Standard beep is available.
            tk.beep();
            // Check whether the application is
            // running in headless mode.
            GraphicsEnvironment ge =
            GraphicsEnvironment.getLocalGraphicsEnvironment();
            System.out.println("Headless mode: " + ge.isHeadless());
              /**     The JLabel works.
                     final JLabel c = new JLabel("I'm a Label!");
                     Dimension dim = c.getPreferredSize();
                     c.setBounds(0,0,dim.width,dim.height);
                     Vector data = new Vector();
                   for (int i = 0 ; i < 5 ; i++) {
                        Vector row = new Vector();
                        for (int j = 0 ; j < 4 ; j++) {
                             row.add(i+","+j);
                        data.add(row);
                   Vector columns = new Vector();
                   for (int i = 0 ; i < 4 ; i++) {
                        columns.add("Col "+i);
                   JTable table = new JTable(data, columns);
                   final JScrollPane c = new JScrollPane(table);
                   Dimension dim = c.getPreferredSize();
                   c.setBounds(0,0,dim.width,dim.height);
            // Print system is available.
            PrinterJob pj = PrinterJob.getPrinterJob();
            pj.setPrintable(new Printable()
                public int print(Graphics g, PageFormat pf, int pageIndex)
                    if (pageIndex > 0)
                        return Printable.NO_SUCH_PAGE;
                    ((Graphics2D)g).translate(pf.getImageableX(),
                                              pf.getImageableY());
                    // Paint the canvas.
                    c.paint(g);
                    return Printable.PAGE_EXISTS;
            try
                pj.print();
            catch (Exception z)
                z.printStackTrace(System.err);
    }

  • How to run adt.jar in headless mode?

    Hi,
    I am facing issues packaging flex iOS applicaition in headless mode. Here is the error I am getting: After googling, I found this error might not occur when run in headless mode. I have already set the <headless-server>true</headless-server> in the air-config.xml and others.
         [java] Exception in thread "main" java.lang.InternalError: Can't connect to window server - not enough permissions.
         [java]     at java.lang.ClassLoader$NativeLibrary.load(Native Method)
         [java]     at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1827)
         [java]     at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1724)
         [java]     at java.lang.Runtime.loadLibrary0(Runtime.java:823)
         [java]     at java.lang.System.loadLibrary(System.java:1045)
         [java]     at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:50)
         [java]     at java.security.AccessController.doPrivileged(Native Method)
         [java]     at java.awt.Toolkit.loadLibraries(Toolkit.java:1605)
         [java]     at java.awt.Toolkit.<clinit>(Toolkit.java:1627)
         [java]     at java.awt.Dimension.<clinit>(Dimension.java:70)
         [java]     at com.adobe.air.validator.ApplicationDescriptorValidator.validateImageUri(ApplicationDescri ptorValidator.java:183)
         [java]     at com.adobe.air.validator.ApplicationDescriptorValidator20.validateElement(ApplicationDescr iptorValidator20.java:121)
         [java]     at com.adobe.air.validator.ApplicationDescriptorValidator25.validateElement(ApplicationDescr iptorValidator25.java:65)
         [java]     at com.adobe.air.validator.ApplicationDescriptorValidator26.validateElement(ApplicationDescr iptorValidator26.java:62)
         [java]     at com.adobe.air.validator.ApplicationDescriptorValidator30.validateElement(ApplicationDescr iptorValidator30.java:52)
         [java]     at com.adobe.air.validator.ApplicationDescriptorValidator31.validateElement(ApplicationDescr iptorValidator31.java:46)
         [java]     at com.adobe.air.validator.DescriptorValidator.endElement(DescriptorValidator.java:239)
         [java]     at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser .java:601)
         [java]     at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XML DocumentFragmentScannerImpl.java:1782)
         [java]     at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDri ver.next(XMLDocumentFragmentScannerImpl.java:2939)
         [java]     at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImp l.java:648)
         [java]     at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScanne rImpl.java:140)
         [java]     at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDo cumentFragmentScannerImpl.java:511)
         [java]     at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.ja va:808)
         [java]     at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.ja va:737)
         [java]     at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
         [java]     at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java :1205)
         [java]     at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.j ava:522)
         [java]     at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
         [java]     at javax.xml.parsers.SAXParser.parse(SAXParser.java:198)
         [java]     at com.adobe.air.Descriptor.validateXML(Descriptor.java:182)
         [java]     at com.adobe.air.Descriptor.<init>(Descriptor.java:56)
         [java]     at com.adobe.air.ApplicationDescriptor.<init>(ApplicationDescriptor.java:84)
         [java]     at com.adobe.air.ApplicationPackager.validateApplicationDescriptor(ApplicationPackager.java: 101)
         [java]     at com.adobe.air.ApplicationPackager.createPackage(ApplicationPackager.java:64)
         [java]     at com.adobe.air.ipa.IPAPackager.createPackage(IPAPackager.java:217)
         [java]     at com.adobe.air.ADT.parseArgsAndGo(ADT.java:557)
         [java]     at com.adobe.air.ADT.run(ADT.java:414)
         [java]     at com.adobe.air.ADT.main(ADT.java:464)
    Please help.
    Thanks,
    Swathi.

    Hi Swathi,
    Can you quickly check the following:
    1) Are you using the <headless-server> tag correctly, i.e. inside the <compiler> tag?
    2) Are you able to run it as a normal user and the problem is only when running via Jenkins?
    3) Can you check that the libraries you are trying to load are loadable via a daemon process?
    4) Does your daemon process have sufficient permissions for reading/writing/executing as per your requirements?
    5) Does the issue exist for an application not using native extensions(ANE) or is it specific to when using extensions?
    Also, please check your firewall settings.

  • AdvanceCache throwing NPE in headless mode

    Using jCharts (cross-posted there too), axisChart.render() is throwing this NullPointerException, but only some of the time. Looks like about half the time, the other half everything works great. I'm at a loss. It's a servlet that generates a JPEG chart, running in Caucho's Resin engine, 1.4 jdk running in headless mode, on a Linux box. Any ideas are appreciated...
    dataSeries.addIAxisChartDataSet( new AxisChartDataSet( data, legendLabels, paints, ChartType.BAR, barChartProperties ) );
    AxisChart axisChart= new AxisChart( dataSeries, chartProperties, axisProperties, legendProperties, width, height );
    BufferedImage awtImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
    axisChart.setGraphics2D(awtImage.createGraphics());
    axisChart.render();
    try {
    JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(response.getOutputStream());
    encoder.encode(awtImage);
    } catch (Exception e) {
    System.out.println(e);
    java.lang.NullPointerException
    at sun.awt.font.AdvanceCache.get(AdvanceCache.java:125)
    at java.awt.font.TextLayout$OptInfo.handleGetVisualBounds(TextLayout.java:280)
    at sun.awt.font.Decoration.getVisualBounds(Decoration.java:105)
    at java.awt.font.TextLayout$OptInfo.getVisualBounds(TextLayout.java:309)
    at java.awt.font.TextLayout.getBounds(TextLayout.java:1109)
    at org.jCharts.Chart.renderChartTitle(Unknown Source)
    at org.jCharts.axisChart.AxisChart.renderChart(Unknown Source)
    at org.jCharts.Chart.render(Unknown Source)
    at ChartGen.doGet(ChartGen.java:76)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:126)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:103)
    at com.caucho.server.http.FilterChainServlet.doFilter(FilterChainServlet.java:96)
    at com.caucho.server.http.Invocation.service(Invocation.java:311)
    at com.caucho.server.http.RunnerRequest.handleRequest(RunnerRequest.java:342)
    at com.caucho.server.http.RunnerRequest.handleConnection(RunnerRequest.java:272)
    at com.caucho.server.TcpConnection.run(TcpConnection.java:137)
    at java.lang.Thread.run(Thread.java:536)

    I'm also running into this. It seems after having Tomcat running for a while (days) it suddenly starts happening. It's as if it caches something that is then forgotten (or closed), and when called, it throws NPE. I'd love to know if this turns out to be a JDK bug or if there's a logical explanation.

  • Java.lang.InternalError: Can't connect to X11 window server using ':0.0'

    Hi all,
    I am getting the following error while running the JSP program.
    Actually we are running our applications in REMOTE LINUX SERVER (Redhat 7.0).
    Installed Softwares : jdk1.3.1_02 & Resin-2.1.0
    500 Servlet Exception
    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>(X11GraphicsEnvironment.java:59)
         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.Font.initializeFont(Font.java:264)
         at java.awt.Font.<init>(Font.java:298)
         at CreateImage.create(CreateImage.java:22)
         at send2trinity_jsp._jspService(/sms/send2trinity.jsp:136)
         at com.caucho.jsp.JavaPage.service(JavaPage.java:74)
         at com.caucho.jsp.Page.subservice(Page.java:485)
         at com.caucho.server.http.FilterChainPage.doFilter(FilterChainPage.java:181)
         at com.caucho.server.http.Invocation.service(Invocation.java:291)
         at com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:132)
         at com.caucho.server.http.RunnerRequest.handleRequest(RunnerRequest.java:341)
         at com.caucho.server.http.RunnerRequest.handleConnection(RunnerRequest.java:271)
         at com.caucho.server.TcpConnection.run(TcpConnection.java:136)
         at java.lang.Thread.run(Thread.java:484)
    After getting this error i have logged in from local and set the DISPLAY varible as ':0.0'.
    But there is no improvemnt and getting the error like,
    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.Font.initializeFont(Font.java:264)
         at java.awt.Font.<init>(Font.java:298)
         at CreateImage.create(CreateImage.java:22)
         at send2trinity_jsp._jspService(/sms/send2trinity.jsp:136)
         at com.caucho.jsp.JavaPage.service(JavaPage.java:74)
         at com.caucho.jsp.Page.subservice(Page.java:485)
         at com.caucho.server.http.FilterChainPage.doFilter(FilterChainPage.java:181)
         at com.caucho.server.http.Invocation.service(Invocation.java:291)
         at com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:132)
         at com.caucho.server.http.RunnerRequest.handleRequest(RunnerRequest.java:341)
         at com.caucho.server.http.RunnerRequest.handleConnection(RunnerRequest.java:271)
         at com.caucho.server.TcpConnection.run(TcpConnection.java:136)
         at java.lang.Thread.run(Thread.java:484)
    How should i solve this problem? Have anybody faced the same problem ?
    Please help.
    Thanks in advance.
    Bye.

    Hi all,
    Thanks a lot for ur reply. It worked me atlast.I have installed JDK1.4 and try to run my program.But it was creating some junk value instaed of creating picture. Actullay my programme needs some third party fonts , it was not loading after i have upgraded. But what i did is , copied the fonts file in to <Java_home>/jre/lib/fonts/ directory. Now it's working fine.
    I have done another thing .I am using resin-2.1.0 to serve my JSp pages . So i have added $JAVA_ARGS="-Djava.awt.headless=true"; in wrapper.pl . If u will not add this line then iot will not work for you.
    Thank u once again.
    Bye.

  • Bug between JRockit and X11 forwarding via ssh

    I have encountered what appears to be a bug in the interaction of JRockit with X11 ssh forwarding.
    When running any Java GUI application on a remote machine using X11 forwarding via ssh, a variety of problems occur. For example:
    --- cut here ---
    % mitrion-ide
    The program '' received an X Window System error.
    This probably reflects a bug in the program.
    The error was 'BadAtom (invalid Atom parameter)'.
      (Details: serial 189 error_code 5 request_code 20 minor_code 0)
      (Note to programmers: normally, X errors are reported asynchronously;
       that is, you will receive the error a while after causing it.
       To debug your program, run it with the --sync command line
       option to change this behavior. You can then get a meaningful
       backtrace from your debugger if you break on the gdk_x_error() function.)
    --- cut here ---That's the good case. When running the rmmlite application (available at https://rmml.dev.java.net/servlets/ProjectDocumentList?folderID=437&expandFolder=437&folderID=438 ), I experience what appears to be a near-lockup of my local workstation.
    Neither of these problems occur if I set my DISPLAY to not use ssh X11 forwarding. Likewise, non-Java applications work just fine with ssh X11 forwarding. Therefore the problem seems to be limited to the Java + ssh X11 forwarding combination.
    I have a suitable workaround (i.e. setting the DISPLAY variable to avoid ssh X11 forwarding), but I thought this was worth bringing to BEA's attention. I'd also be curious to know if others have run into similar difficulties.
    Here are the configuration details:
    Remote X11 client (where applications are hosted)
    =================================================
    % java -version
    java version "1.4.2_12"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_12-b03)
    BEA JRockit(R) (build R27.1.0-109-73164-1.4.2_12-20061129-1418-linux-ia32, compiled mode)
    % uname -a
    Linux earthling 2.6.9-34.ELsmp #1 SMP Fri Feb 24 16:54:53 EST 2006 i686 athlon i386 GNU/Linux
    % rpm -qa | grep openssh-server
    openssh-server-3.9p1-8.RHEL4.12
    This is a vanilla RedHat Linux RHEL 4 Update 3 system, with all other versions of Java removed.
    Local workstation (i.e. X11 server)
    ===================================
    % uname -a
    FreeBSD somewhere.sgi.com 6.2-RELEASE FreeBSD 6.2-RELEASE #5: Mon Jan 15 08:41:01 CST 2007 [email protected]:/usr/obj/usr/src/sys/somewhere i386
    % ssh -v
    OpenSSH_4.5p1 FreeBSD-20061110, OpenSSL 0.9.7e-p1 25 Oct 2004
    % pkg_info -Ix xorg-server
    xorg-server-6.9.0_3 X.Org X server and related programs
    Thank you,
    Brent Casavant

    Brent,
    it would be nice to know if this problem is specific to the JRockit JDK or
    if you also can reproduce it using the corresponding Sun JDK 1.4.2. Please
    do also try with a later version such as latest JRockit JDK 5.0.
    Thanks
    /Robert
    <Brent Casavant> wrote in message news:[email protected]...
    I have encountered what appears to be a bug in the interaction of JRockit
    with X11 ssh forwarding.
    When running any Java GUI application on a remote machine using X11
    forwarding via ssh, a variety of problems occur. For example:
    --- cut here ---
    % mitrion-ide
    The program '' received an X Window System error.
    This probably reflects a bug in the program.
    The error was 'BadAtom (invalid Atom parameter)'.
      (Details: serial 189 error_code 5 request_code 20 minor_code 0)
      (Note to programmers: normally, X errors are reported asynchronously;
       that is, you will receive the error a while after causing it.
       To debug your program, run it with the --sync command line
       option to change this behavior. You can then get a meaningful
       backtrace from your debugger if you break on the gdk_x_error() function.)
    --- cut here ---That's the good case. When running the rmmlite application (available at
    https://rmml.dev.java.net/servlets/ProjectDocumentList?folderID=437&expandFolder=437&folderID=438 )
    , I experience what appears to be a near-lockup of my local workstation.
    Neither of these problems occur if I set my DISPLAY to not use ssh X11
    forwarding. Likewise, non-Java applications work just fine with ssh X11
    forwarding. Therefore the problem seems to be limited to the Java + ssh X11
    forwarding combination.
    I have a suitable workaround (i.e. setting the DISPLAY variable to avoid ssh
    X11 forwarding), but I thought this was worth bringing to BEA's attention.
    I'd also be curious to know if others have run into similar difficulties.
    Here are the configuration details:
    Remote X11 client (where applications are hosted)
    =================================================
    % java -version
    java version "1.4.2_12"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_12-b03)
    BEA JRockit(R) (build R27.1.0-109-73164-1.4.2_12-20061129-1418-linux-ia32,
    compiled mode)
    % uname -a
    Linux earthling 2.6.9-34.ELsmp #1 SMP Fri Feb 24 16:54:53 EST 2006 i686
    athlon i386 GNU/Linux
    % rpm -qa | grep openssh-server
    openssh-server-3.9p1-8.RHEL4.12
    This is a vanilla RedHat Linux RHEL 4 Update 3 system, with all other
    versions of Java removed.
    Local workstation (i.e. X11 server)
    ===================================
    % uname -a
    FreeBSD somewhere.sgi.com 6.2-RELEASE FreeBSD 6.2-RELEASE #5: Mon Jan 15
    08:41:01 CST 2007
    [email protected]:/usr/obj/usr/src/sys/somewhere i386
    % ssh -v
    OpenSSH_4.5p1 FreeBSD-20061110, OpenSSL 0.9.7e-p1 25 Oct 2004
    % pkg_info -Ix xorg-server
    xorg-server-6.9.0_3 X.Org X server and related programs
    Thank you,
    Brent Casavant

  • Exception in thread "main" java.lang.InternalError: Can't connect to X11 wi

    Hello Friends,
    I dont know whether this would be the correct forum or not but my problem is very critical so please help me.
    1. I am working on linux server where I have installed Tomcat4.x, Apache 2.0, JDK1.4.2. I have set all CLASSPATH.
    Java is working fine. I am using one JCLASS component which is useful in chart creation.
    3. Few days back the code regarding Frame cration was working fine but now its giving an error. I am actually running these files using cron and my requirement is also same.
    4. I have tried almost all possibilities like
    export DISPLAY=localhost:0.0
    export DISPLAY=ipaddress:0.0, but no luck.
    Can you explain me what could be the reason.
    JAVA ERROR:
    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>(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 sun.awt.motif.MToolkit.<clinit>(MToolkit.java:81)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:141)
    at java.awt.Toolkit$2.run(Toolkit.java:748)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:739)
    at java.awt.Toolkit.getEventQueue(Toolkit.java:1519)
    at java.awt.EventQueue.invokeLater(EventQueue.java:792)
    at javax.swing.SwingUtilities.invokeLater(SwingUtilities.java:1170)
    at FrameDemo.main(FrameDemo.java:35)
    Please let me know your suggestions as possible as follows.
    PuneProgrammer

    You are probably creating images on the fly.
    Due to a bug/annoyance in the JDK, it requires an X-display. This is not related to the Sun ONE Webserver but a general problem.
    -Either install an X server, but this might not be possible because of a server security strip.
    -install a virtual X xvfb or something alike to emulate this behaviour.
    I thought it would be solved in newer JDK's but in which i'm not sure.

  • Is it possible to install a JDev extension bundle in headless mode.

    We are looking to see if there is a way to automate install of JDev and application of an extension in "headless" mode, or some other command line option that could enable this.
    This is for internal development purposes aiming at reducing the number of steps dev has to get through to be in a position to run JDev setup with the required extension.
    I could not find anything related to this in the forum, or help guide, apologies if I missed it.
    thanks
    Nick

    For most of the extensions the check for update simply download the zip file, and extracts the jar file from within into the extensions directory.
    I think you should be able to just manually copy the jar file to the specific location and this will be enough.
    Some extensions specify in their bundle.xml file another location for install (like the JDev root directory) and then you'll need to copy the files to the specific locations under the root.

Maybe you are looking for