From: SourceForge.net <no...@so...> - 2009-01-15 12:55:39
|
Support Requests item #2508239, was opened at 2009-01-14 22:37 Message generated for change (Comment added) made by jmaerki You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=615505&aid=2508239&group_id=96670 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: General Problem Group: None >Status: Pending Priority: 5 Private: No Submitted By: Barry James (b_james) Assigned to: Nobody/Anonymous (nobody) Summary: Unable to Open Font Properties File Initial Comment: I have successfully created a PDF417 2D barcode using Barcode4J on my PC when running in Eclipse. When I try running the same code on our company server, calling it from Oracle PL/SQL, I get the error below on the call to generateBarcode. I have added System.setProperty("java.awt.headless", "true") to my code to account for the info in 4.3. What do I need to do to run Barcode4J on a "headless" server? But it did not make a difference. I'm not sure as to how to proceed. Please help. Thanks, Barry ************************************************************************************************* unable to open font properties file java.lang.NullPointerException at java.util.Properties$LineReader.readLine(Properties.java) at java.util.Properties.load(Properties.java) at sun.awt.FontConfiguration$PropertiesHandler.load(FontConfiguration.java:1738) at sun.awt.FontConfiguration.loadProperties(FontConfiguration.java:371) at sun.awt.FontConfiguration.readFromResource(FontConfiguration.java:278) at sun.awt.FontConfiguration.readFontConfigFile(FontConfiguration.java:127) at sun.awt.FontConfiguration.<init>(FontConfiguration.java:75) at oracle.aurora.awt.OracleFontConfiguration.<init>(OracleFontConfiguration.java:33) at oracle.aurora.awt.OracleGraphicsEnvironment.createFontConfiguration(OracleGraphicsEnvironment.java:25) at sun.java2d.SunGraphicsEnvironment$1.run(SunGraphicsEnvironment.java:186) at java.security.AccessController.doPrivileged(Native Method) at sun.java2d.SunGraphicsEnvironment.<init>(SunGraphicsEnvironment.java:94) at oracle.aurora.awt.OracleGraphicsEnvironment.<init>(OracleGraphicsEnvironment.java:14) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java) at java.lang.reflect.Constructor.newInstance(Constructor.java) at java.lang.Class.newInstance0(Class.java) at java.lang.Class.newInstance(Class.java) at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:68) at java.awt.image.BufferedImage.createGraphics(BufferedImage.java:1141) at org.krysalis.barcode4j.output.bitmap.BitmapBuilder.prepareGraphics2D(BitmapBuilder.java:89) at org.krysalis.barcode4j.output.bitmap.BitmapCanvasProvider.establishDimensions(BitmapCanvasProvider.java:99) at org.krysalis.barcode4j.output.Canvas.establishDimensions(Canvas.java:54) at org.krysalis.barcode4j.impl.DefaultTwoDimCanvasLogicHandler.startBarcode(DefaultTwoDimCanvasLogicHandler.java:67) at org.krysalis.barcode4j.impl.pdf417.PDF417LogicImpl.generateBarcodeLogic(PDF417LogicImpl.java:236) at org.krysalis.barcode4j.impl.pdf417.PDF417Bean.generateBarcode(PDF417Bean.java:80) at SampleBitmapBarcodeWithBean.getBarcode(SampleBitmapBarcodeWithBean.java:275) at SampleBitmapBarcodeWithBean.GetImage(SampleBitmapBarcodeWithBean.java:210) at SampleBitmapBarcodeWithBean.main(SampleBitmapBarcodeWithBean.java:112) ---------------------------------------------------------------------- >Comment By: Jeremias Mrki (jmaerki) Date: 2009-01-15 12:41 Message: That exception doesn't look like any normal reaction on a headless server I've ever seen before. I'd even dare say this might be a corrupt JDK/JRE installation. Anyway, setting the "java.awt.headless" property must occurs early enough to have an effect. I don't think it's a good idea to use System.setProperty() for this. A better idea is to specify it at VM startup as a parameter. You didn't say which JRE you're using. Usually, java.awt.headless works fine. If it doesn't help you might find two alternatives here: http://xmlgraphics.apache.org/fop/0.95/graphics.html#batik There's nothing Barcode4J can do any better to improve the situation I'm afraid. Good luck! Please close this issue when you've solved the problem. Thanks. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=615505&aid=2508239&group_id=96670 |