Welcome, Guest. Please login or register.
Did you miss your activation email?
March 13, 2010, 02:53:01 PM
Home Help Search Login Register
News: Noojee Click 1.0 released.
Download it from

+  Noojee Telephony Solutions Forums
|-+  Noojee Fax
| |-+  Bug Reports
| | |-+  X11 errors when processing received e-mail
« previous next »
Pages: [1] Print
Author Topic: X11 errors when processing received e-mail  (Read 215 times)
ppuri
Newbie
*
Offline Offline

Posts: 13


« on: February 03, 2010, 12:52:49 PM »

Hello,

The following errors occur occasionally when processing an e-mail containing a PDF attachment to be faxed.  This results in the file failing to get transmitted.  It is happening only sometimes.

Quote
02 Feb 2010 19:32:55,822 INFO Loading submitter au.com.noojee.noojeefax.outbound.submitter.DefaultFaxSubmitter
02 Feb 2010 19:32:55,881 INFO Valid license found
02 Feb 2010 19:32:55,887 INFO Valid license found
02 Feb 2010 19:32:58,052 ERROR Unable to set property 'items' to '0' on org.asteriskjava.manager.event.StatusCompleteEvent: no setter
02 Feb 2010 19:33:16,838 INFO entering setHeaderFooter
02 Feb 2010 19:33:23,091 ERROR Unable to set header and footer for page 0
java.lang.InternalError: Can't connect to X11 window server using 'localhost:10.0' as the value of the DISPLAY variable.
    at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
    at sun.awt.X11GraphicsEnvironment.access$100(Unknown Source)
    at sun.awt.X11GraphicsEnvironment$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.awt.X11GraphicsEnvironment.<clinit>(Unknown Source)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(Unknown Source)
    at java.awt.image.BufferedImage.createGraphics(Unknown Source)
    at au.com.noojee.noojeefax.outbound.Fax.setHeaderFooter(Fax.java:702)
    at au.com.noojee.noojeefax.outbound.MultiPageTiff.saveAsMultipageTIFF(MultiPageTiff.java:147)
    at au.com.noojee.noojeefax.outbound.MultiPageTiff.createMultipageTiff(MultiPageTiff.java:236)
    at au.com.noojee.noojeefax.outbound.MultiPageTiff.createMultipageTiff(MultiPageTiff.java:222)
    at au.com.noojee.noojeefax.outbound.Fax.getTiffFile(Fax.java:277)
    at au.com.noojee.noojeefax.outbound.submitter.DefaultFaxSubmitter.sendFax(DefaultFaxSubmitter.java:200)
    at au.com.noojee.noojeefax.outbound.SubmitFax.send(SubmitFax.java:124)
    at au.com.noojee.noojeefax.outbound.Channel.run(Channel.java:105)
02 Feb 2010 19:33:23,091 INFO entering setHeaderFooter
02 Feb 2010 19:33:23,178 ERROR Unable to set header and footer for page 1
java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11GraphicsEnvironment
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(Unknown Source)
    at java.awt.image.BufferedImage.createGraphics(Unknown Source)
    at au.com.noojee.noojeefax.outbound.Fax.setHeaderFooter(Fax.java:702)
    at au.com.noojee.noojeefax.outbound.MultiPageTiff.saveAsMultipageTIFF(MultiPageTiff.java:147)
    at au.com.noojee.noojeefax.outbound.MultiPageTiff.createMultipageTiff(MultiPageTiff.java:236)
    at au.com.noojee.noojeefax.outbound.MultiPageTiff.createMultipageTiff(MultiPageTiff.java:222)
    at au.com.noojee.noojeefax.outbound.Fax.getTiffFile(Fax.java:277)
    at au.com.noojee.noojeefax.outbound.submitter.DefaultFaxSubmitter.sendFax(DefaultFaxSubmitter.java:200)
    at au.com.noojee.noojeefax.outbound.SubmitFax.send(SubmitFax.java:124)
    at au.com.noojee.noojeefax.outbound.Channel.run(Channel.java:105)
02 Feb 2010 19:33:23,200 INFO entering setHeaderFooter
02 Feb 2010 19:33:23,442 ERROR Unable to set header and footer for page 2
java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11GraphicsEnvironment
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(Unknown Source)
    at java.awt.image.BufferedImage.createGraphics(Unknown Source)
    at au.com.noojee.noojeefax.outbound.Fax.setHeaderFooter(Fax.java:702)
    at au.com.noojee.noojeefax.outbound.MultiPageTiff.saveAsMultipageTIFF(MultiPageTiff.java:147)
    at au.com.noojee.noojeefax.outbound.MultiPageTiff.createMultipageTiff(MultiPageTiff.java:236)
    at au.com.noojee.noojeefax.outbound.MultiPageTiff.createMultipageTiff(MultiPageTiff.java:222)
    at au.com.noojee.noojeefax.outbound.Fax.getTiffFile(Fax.java:277)
    at au.com.noojee.noojeefax.outbound.submitter.DefaultFaxSubmitter.sendFax(DefaultFaxSubmitter.java:200)
    at au.com.noojee.noojeefax.outbound.SubmitFax.send(SubmitFax.java:124)
    at au.com.noojee.noojeefax.outbound.Channel.run(Channel.java:105)
02 Feb 2010 19:33:23,443 INFO entering setHeaderFooter
02 Feb 2010 19:33:23,545 ERROR Could not initialize class sun.awt.X11GraphicsEnvironment
java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11GraphicsEnvironment
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(Unknown Source)
    at java.awt.image.BufferedImage.createGraphics(Unknown Source)
    at au.com.noojee.noojeefax.outbound.Fax.setHeaderFooter(Fax.java:702)
    at au.com.noojee.noojeefax.outbound.MultiPageTiff.saveAsMultipageTIFF(MultiPageTiff.java:197)
    at au.com.noojee.noojeefax.outbound.MultiPageTiff.createMultipageTiff(MultiPageTiff.java:236)
    at au.com.noojee.noojeefax.outbound.MultiPageTiff.createMultipageTiff(MultiPageTiff.java:222)
    at au.com.noojee.noojeefax.outbound.Fax.getTiffFile(Fax.java:277)
    at au.com.noojee.noojeefax.outbound.submitter.DefaultFaxSubmitter.sendFax(DefaultFaxSubmitter.java:200)
    at au.com.noojee.noojeefax.outbound.SubmitFax.send(SubmitFax.java:124)
    at au.com.noojee.noojeefax.outbound.Channel.run(Channel.java:105)
02 Feb 2010 19:33:23,547 INFO Waiting 40 seconds to retry

What is causing these errors?

Thanks,
Puneet
Logged
Brett Sutton
Asterisk IT Staff
Sr. Member
*****
Offline Offline

Posts: 353



« Reply #1 on: February 03, 2010, 12:57:38 PM »

sounds like you haven't installed the Xvfb package.

what OS are you running?
Logged
ppuri
Newbie
*
Offline Offline

Posts: 13


« Reply #2 on: February 03, 2010, 01:05:33 PM »

Hi Brett,

I do have Xvfb installed.  Whenever the problem occurs, I have to restart NoojeeFax, and then it clears up the problem.

Puneet
Logged
Brett Sutton
Asterisk IT Staff
Sr. Member
*****
Offline Offline

Posts: 353



« Reply #3 on: February 04, 2010, 10:30:54 PM »

Puneet,
 can you post your NoojeeFax.xml as well as a complete copy of your NoojeeFax log file.

/var/log/njfax/noojeefax.log

can you also post the output of:

Code:
set | grep -i display
Logged
ppuri
Newbie
*
Offline Offline

Posts: 13


« Reply #4 on: February 05, 2010, 02:36:29 PM »

Brett,

Please see attached the two files you asked for.  I want to point out that I am running NoojeeFax as an SMTP service.  This has the consequence that it has to deal with a lot of spam e-mail from the Internet (you can see examples of such e-mail in the attached log file, e.g., any mail from domain "yahoo.com.tw" is spam).  Could this be messing it up?

The output of the command:

Quote
set | grep -i display

is:

Quote
DISPLAY=localhost:10.0

Puneet

* NoojeeFax.xml (13.04 KB - downloaded 4 times.)
* noojeefax.log.2010-02-02 (50.27 KB - downloaded 4 times.)
Logged
Brett Sutton
Asterisk IT Staff
Sr. Member
*****
Offline Offline

Posts: 353



« Reply #5 on: February 08, 2010, 09:03:54 AM »

First thing is that we don't recommend placing the Noojee Fax SMTP service directly onto the Internet. Its not a full blow SMTP service. We normally recommend that you place as standard SMTP server in front of it (such as Postfix).

Have said that, Noojee Fax will essentially ignore all emails which don't have an appropriately formatted email address (no phone number or alias) so the problem is unlikely to be the spam messages.

I've some discussion with the developers and the best guess at this point is that it is a problem with SUSE.
It sounds like the Xvfb service is either crashing or becoming unresponsive.
Noojee Fax starts the Xvfb service when Noojee Fax first starts. Xvfb is a X virtual frame buffer which allows programs to render graphic objects when the system is headless (no active graphics card). When you restart Noojee Fax the Xvfb service will also be restarted as Noojee Fax owns the Xvfb process. This is likley the reason for the problem going away when you restart Noojee Fax.

The recommendation has come back that you should upgrade to the latest version of SUSE. 

If you are going to re-image your box completely the other option is ubuntu server. The reason I suggest ubuntu is that we have now made ubuntu our primary development and test platform. We will still support other OSs its simply that it will be easier to get quick responses with ubuntu.

Regards,
Brett
Logged
ppuri
Newbie
*
Offline Offline

Posts: 13


« Reply #6 on: February 08, 2010, 02:34:35 PM »

Thanks for looking into it.  I do plan to upgrade to the latest version of SuSE after we successfully pass through a Beta trial that is a couple of weeks away.  However, at this point, given the proximity to the Beta trial, I find it too risky to upgrade.  For the time being, I'd like to better understand the nature of this problem with Xvfb, specifically:

  • What causes NoojeeFax to invoke Xvfb?  I am always using PDF attachments, so why is Xvfb even being invoked in the first place?  I thought Xvfb is only invoked for OpenOffice documents.  Furthermore, it looks like Xvfb is being invoked inconsistently -- even though the attachment is always a PDF file, sometimes Xvfb gets invoked and sometimes it doesn't.  Why is this?
  • I'd like to be able to run a background script to periodically check Xvfb's status, and take corrective action (e.g., restarting it) if it is not working properly.  Can this be done?  If so, what command would you recommend to check Xvfb's status, and what command would you recommend as the corrective action to take if it is not working properly?

Thanks,
Puneet
Logged
Brett Sutton
Asterisk IT Staff
Sr. Member
*****
Offline Offline

Posts: 353



« Reply #7 on: February 09, 2010, 10:29:50 AM »

Noojee Fax 'starts' the Xvfb service when it first starts up.
The java libraries utilise the Xvfb services in a number of scenarios. The stack trace that is being generated is one where the header/footer of the fax is being formatted which happens for 'every' fax not just pdf/word etc.

You may be able to run a script that checks if Xvfb is up and then restart it. The only issue will be if Xvfb is hanging rather than terminating cleanly.

The development team here have suggested one other alternative.

You can run java in a headless mode by staring Noojee Fax with the following command:

java -Djava.awt.headless=true

While we haven't tried this, according to the documentation this removes the dependency on X.

http://java.sun.com/j2se/1.4/docs/guide/awt/AWTChanges.html#headless

To make this change you would have to edit /opt/njfax/nohupnoojeefax.sh

Find the following line:
Code:
nohup "/usr/bin/java" -jar NoojeeFax.jar >>$LOG_DIR/console.out 2>>$LOG_DIR/error.out&

and change it to:

Code:
nohup "/usr/bin/java" -Djava.awt.headless=true -jar NoojeeFax.jar >>$LOG_DIR/console.out 2>>$LOG_DIR/error.out&

Logged
ppuri
Newbie
*
Offline Offline

Posts: 13


« Reply #8 on: February 10, 2010, 01:52:15 PM »

When running java in headless mode as described above, I notice that Xvfb is still getting started.  Is that okay?

Thanks,
Puneet
Logged
Brett Sutton
Asterisk IT Staff
Sr. Member
*****
Offline Offline

Posts: 353



« Reply #9 on: February 10, 2010, 10:12:29 PM »

Yes, Xvfb is still required by open office etc.

I'm hoping that the Xvfb problem is limited to how java uses it. Run some test and lets us know how you go.

Logged
ppuri
Newbie
*
Offline Offline

Posts: 13


« Reply #10 on: February 11, 2010, 10:48:23 AM »

So, the following lines in NoojeeFax.xml should not be commented out?:

Quote
            <Service>
                <Name>Xvfb</Name>
                <Class>au.com.noojee.noojeefax.util.Xvfb</Class>
                <Config>
                    <Screen>25</Screen>
                </Config>
            </Service>

I have them commented out while running java in headless mode, and things seem to be working fine.  But I'm testing only with PDF attachments.

But based on your previous comment, should I put those lines back in to allow for OpenOffice attachments to be used in future?

Thanks,
Puneet
Logged
Brett Sutton
Asterisk IT Staff
Sr. Member
*****
Offline Offline

Posts: 353



« Reply #11 on: February 12, 2010, 12:51:17 PM »

Yes if you want to process OpenOffice documents then you must have the Xvfb service running.

I should note that some versions of Open Office don't actually require X. The problem is that the dependency keeps changing from version to version so its just safer to have it in.
Logged
Pages: [1] Print 
« previous next »
Jump to:  


Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!