[Logo] Mango M2M Community
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Mango wants to conect to X server  XML
Forum Index -> Mango installation
Author Message
rmb

Initiate

Joined: 01/03/2010 15:16:08
Messages: 4
Offline

Hi
I have installed Mango 1.8 as the root application in tomcat6 on Fedora linux .
I changed the paths in log4j.xml and env.properties files in the
[mango]/WEB-INF/classes/ to a folder writable by the tomcat user.

I am getting an error in the tomcat6/localhost.log, saying mango cannot connect to the X server.
Code:
 SEVERE: Exception sending context initialized event to listener instance of class com.serotonin.mango.MangoContextListener
 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.access$100(X11GraphicsEnvironment.java:52)
         at sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:155)
         at java.security.AccessController.doPrivileged(Native Method)
         at sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:131)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Class.java:169)
         at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:68)
         at sun.awt.X11.XToolkit.<clinit>(XToolkit.java:89)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Class.java:169)
         at java.awt.Toolkit$2.run(Toolkit.java:834)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:826)
         at com.serotonin.mango.view.ViewGraphicLoader.loadDirectory(ViewGraphicLoader.java:107)
         at com.serotonin.mango.view.ViewGraphicLoader.loadViewGraphics(ViewGraphicLoader.java:55)
         at com.serotonin.mango.MangoContextListener.imageSetInitialize(MangoContextListener.java:379)
         at com.serotonin.mango.MangoContextListener.contextInitialized(MangoContextListener.java:84)
         at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3934)
         at org.apache.catalina.core.StandardContext.start(StandardContext.java:4429)
         at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
         at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
         at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:526)
         at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:987)
         at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:909)
         at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:495)
         at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1206)
         at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:314)
         at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
         at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
         at org.apache.catalina.core.StandardHost.start(StandardHost.java:722)
         at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
         at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
         at org.apache.catalina.core.StandardService.start(StandardService.java:516)
         at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
         at org.apache.catalina.startup.Catalina.start(Catalina.java:583)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
         at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
 Mar 1, 2010 7:55:13 PM org.apache.catalina.core.ApplicationContext log
 INFO: Closing Spring root WebApplicationContext
 
 


mlohbihler


[Avatar]

Joined: 01/03/2007 22:48:52
Messages: 899
Online

Google says: http://www.linuxquestions.org/questions/linux-general-1/cant-connect-to-x11-window-server-using-0.0-as-the-value-of-the-display-variable.-178234/

Best regards,
Matthew Lohbihler
rmb

Initiate

Joined: 01/03/2010 15:16:08
Messages: 4
Offline

I am confused as to why mango wants to connect to a display, as it is being started by the tomcat user, when the system starts tomcat.
The tomcat user does not "login" to the system, and has no display.
mlohbihler


[Avatar]

Joined: 01/03/2007 22:48:52
Messages: 899
Online

Mango doesn't care about the display. It's Java that is trying to connect. The referenced link tell you how to tell Java not to care.

You might say that Mango should tell Java itself, but this is the first i've heard of this issue.

Best regards,
Matthew Lohbihler
rmb

Initiate

Joined: 01/03/2010 15:16:08
Messages: 4
Offline

Hi,
Found the fix for headless mode, on Fedora 11. Edit /etc/tomcat6/tomcat6.conf and add the following
Code:
 # To run our environment with a headless implementation,
 # the follow property may be specified at the java command line:
 
 JAVA_OPTS="-Djava.awt.headless=true"
 


I get a bit further now, in that the folder mangoDB , and the mango.log file are created in /var/log/tomcat6.
I modified ROOT/WEB-INF/classes/env.properties
Code:
 # db.url=~/../../mangoDB
 db.url=/var/log/tomcat6/mangoDB
 

and log4j.xml
Code:
   <appender name="logfile" class="org.apache.log4j.DailyRollingFileAppender">
 <!--    <param name="File" value="../logs/mango.log"/> -->
     <param name="File" value="/var/log/tomcat6/mango.log"/>
 


I am now getting the following error in the tomcat localhost file
Code:
 SEVERE: Exception sending context initialized event to listener instance of class com.serotonin.mango.MangoContextListener
 com.serotonin.ShouldNeverHappenException: java.io.FileNotFoundException: createTables.log (Permission denied)
 .
 .
 Caused by: java.io.FileNotFoundException: createTables.log (Permission denied)
         at java.io.FileOutputStream.open(Native Method)
 

Where is the path set for createTables.log

Thanks

mlohbihler


[Avatar]

Joined: 01/03/2007 22:48:52
Messages: 899
Online

Those logs get written to the default directory, which is likely the directory you are in when you start Tomcat.

Best regards,
Matthew Lohbihler
rmb

Initiate

Joined: 01/03/2010 15:16:08
Messages: 4
Offline

The user tomcat does not own the home directory /usr/share/tomcat6
the fix is to
Code:
 # chown tomcat:tomcat /usr/share/tomcat6
 


Mango now runs

Mango does not recognise Firefox 3.5.8, as I get a complaint on the login page
Code:
 Firefox 3.5 on Linux
 This browser is supported. Your browser may work with this product, but is not officially supported by Serotonin Software. We instead recommend the use of Firefox, Chrome, or Internet Explorer 7.
 

However, I can login, and everything appears OK
 
Forum Index -> Mango installation
Go to:   
Powered by JForum 2.1.7 © JForum Team