You are not logged in.

#1 2013-07-24 06:21:23

pied04
Member
Registered: 2011-05-20
Posts: 21

Errors starting eclimd using systemd

I'm having trouble using systemd to control the eclim daemon.

I wrote the following service file, /etc/systemd/system/eclim@myusername.service :

[Unit]
Description=Eclimd

[Service]
Type=simple
ExecStart=/usr/share/eclipse/eclimd
KillMode=process
User=%I

Attemping to start eclim using

# systemctl start eclim@myusername.service

fails. journalctl provides the following output:

eclimd[21081]: 2013-07-24 15:51:08,928 ERROR [org.eclim.eclipse.EclimApplication] Error durring 
eclimd[21081]: java.lang.IllegalStateException: Workbench has not been created yet.
eclimd[21081]: at org.eclipse.ui.PlatformUI.getWorkbench(PlatformUI.java:92)
eclimd[21081]: at org.eclim.eclipse.EclimApplication.shutdown(EclimApplication.java:101)
eclimd[21081]: at org.eclim.eclipse.EclimApplication$1.run(EclimApplication.java:75)

And directs me to the log file at

~/workspace/.metadata/.log

(where workspace is my eclipse workspace), which contains

!SESSION 2013-07-24 15:50:56.247 -----------------------------------------------
eclipse.buildId=M20130204-1200
java.version=1.7.0_40
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_AU
Framework arguments:  -refresh -application org.eclim.application
Command-line arguments:  -debug -clean -refresh -application org.eclim.application

!ENTRY org.eclipse.osgi 4 0 2013-07-24 15:51:07.636
!MESSAGE Application error
!STACK 1
org.eclipse.swt.SWTError: No more handles [gtk_init_check() failed]
	at org.eclipse.swt.SWT.error(SWT.java:4387)
	at org.eclipse.swt.widgets.Display.createDisplay(Display.java:914)
	at org.eclipse.swt.widgets.Display.create(Display.java:900)
	at org.eclipse.swt.graphics.Device.<init>(Device.java:156)
	at org.eclipse.swt.widgets.Display.<init>(Display.java:498)
	at org.eclipse.swt.widgets.Display.<init>(Display.java:489)
	at org.eclipse.ui.internal.Workbench.createDisplay(Workbench.java:669)
	at org.eclipse.ui.PlatformUI.createDisplay(PlatformUI.java:161)
	at org.eclipse.ui.internal.ide.application.IDEApplication.createDisplay(IDEApplication.java:154)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:96)
	at org.eclim.eclipse.EclimApplication.start(EclimApplication.java:85)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1414)

!ENTRY org.eclipse.core.resources 4 566 2013-07-24 15:51:07.758
!MESSAGE Workspace was not properly initialized or has already shutdown.

!ENTRY org.eclipse.core.jobs 4 1 2013-07-24 15:51:07.760
!MESSAGE Worker thread ended job: Refreshing workspace(12), but still holds rule: ThreadJob(Refreshing workspace(12),[F/progfun-example/target/scala-2.10])

This indicates that there may be a problem with the workspace, relating to the progfun-example project (I have checked that no instances of eclipse or eclim are running). Running

$ eclipse -clean

does not solve the problem, and starting eclimd directly using

$ /usr/share/eclipse/eclimd

works! When I start it directly I can use the

:PingEclim

command in vim successfully.

So my question is: what difference between the ways eclimd is started through systemd and through a direct call could cause the one method to fail while the other succeeds? And how can I resolve this problem?

Many thanks.

Offline

#2 2013-07-24 23:40:40

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,354

Re: Errors starting eclimd using systemd

Most probably there are environment variables that are needed. I haven't used eclim in ages since I finished my PhD so I can't remember what they would be, unfortunately. You could just parse your env for JAVA related stuff, to begin with.


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#3 2013-07-27 15:30:40

ervandew
Member
Registered: 2009-10-28
Posts: 12

Re: Errors starting eclimd using systemd

Eclimd, more specifically Eclipse, needs an xserver to connect to. You could provide some sort of wrapper around eclimd which first starts an xvfb instance and set the DISPLAY variable accordingly. There is an eclim headless server guide with an example of how to use xvfb:

http://eclim.org/install.html#install-headless

In the future you'll probably have better luck asking eclim questions on one of the eclim mailing lists.

Offline

Board footer

Powered by FluxBB