Issue 121914 - openjdk7 - SYSUSERCONFIG gets meaningless
Summary: openjdk7 - SYSUSERCONFIG gets meaningless
Status: CLOSED NOT_AN_OOO_ISSUE
Alias: None
Product: Installation
Classification: Application
Component: ui (show other issues)
Version: 3.4.1
Hardware: All Linux 64-bit
: P3 Normal (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-18 20:53 UTC by SET
Modified: 2013-03-18 23:37 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description SET 2013-03-18 20:53:18 UTC
Since I upgraded ARCH (x86_64), there's no more openjdk6 but openjdk7. AOO would not start with javaldx errors. SYSUSERCONFIG, whether in bootstraprc or at the command line (-env:UserInstallation=\$SYSUSERCONFIG/../.openoffice.org/3 or -env:UserInstallation=$SYSUSERCONFIG/../.openoffice.org/3) is not expanded rightly. The only way to start AOO is with UserInstallation=file://~/.openoffice.org/3, in bootstraprc or at the command line.

But then, the spell checker stops to work. hunspell gets missed.

Using UserInstallation=file://$HOME/.openoffice.org/3 in bootstraprc or at the command line resolves the problem.

Happens with 3.5.0 also.

It would be nice we don't have to do this.

Regards.
Comment 1 Ariel Constenla-Haile 2013-03-18 22:40:50 UTC
(In reply to comment #0)
> (-env:UserInstallation=\$SYSUSERCONFIG/../.openoffice.org/3 or
> -env:UserInstallation=$SYSUSERCONFIG/../.openoffice.org/3) is not expanded
> rightly.

These paths are both wrong:

]$ cat /opt/openoffice.org3/program/bootstraprc 
[Bootstrap]
BaseInstallation=${OOO_BASE_DIR}
InstallMode=<installmode>
ProductKey=OpenOffice.org 3.4.1
UserInstallation=$SYSUSERCONFIG/.openoffice.org/3
[ErrorReport]
ErrorReportPort=80
ErrorReportServer=


It is $SYSUSERCONFIG/.openoffice.org/3
not $SYSUSERCONFIG/../.openoffice.org/3

/opt/openoffice.org3/program/soffice -env:UserInstalletion=$SYSUSERCONFIG/.openoffice.org/3

works fine.

> It would be nice we don't have to do this.

You don't have to do this.
What is the original problem?
Can you attach the output of running /opt/openoffice.org3/program/soffice  from a terminal, with no extra arguments?

If the javaldx message you are seeing is

"javaldx failed. User must select a JRE from options dialog!"

then it has been changed in Revision 1377429 to a warning. But this doesn't prevent OpenOffice from running.
Comment 2 Ariel Constenla-Haile 2013-03-18 23:01:20 UTC
(In reply to comment #1)
> /opt/openoffice.org3/program/soffice
> -env:UserInstalletion=$SYSUSERCONFIG/.openoffice.org/3
> 
> works fine.

Correction, this does not work; $SYSUSERCONFIG isn't expanded. 
But is this the bug you are seeing?
I'm not sure if it never worked before, but at least since 3.0.0 it doesn't:

]$ ~/OOo/prev-versions/3.0.0-OOO300_m9/openoffice.org3/program/soffice -env:UserInstallation="$SYSUSERCONFIG/.openoffice.org/3"
[Java framework] Error in function createSettingsDocument (elements.cxx).javaldx failed! 


]$ ~/OOo/prev-versions/3.1.1-OOO310_m19-9420/openoffice.org3/program/soffice -env:UserInstallation="$SYSUSERCONFIG/.openoffice.org/3"
[Java framework] Error in function createSettingsDocument (elements.cxx).
javaldx failed! 


]$ ~/OOo/prev-versions/3.2.1-OOO320_m18-9502/openoffice.org3/program/soffice -env:UserInstallation="$SYSUSERCONFIG/.openoffice.org/3"
[Java framework] Error in function createSettingsDocument (elements.cxx).
javaldx failed! 


]$ ~/OOo/prev-versions/3.4.0-BETA-OOO340_m0-9583/ooo-dev3/program/soffice -env:UserInstallation="$SYSUSERCONFIG/.openoffice.org/3"
[Java framework] Error in function createSettingsDocument (elements.cxx).
javaldx failed! 

--------------------

The error has nothing to with java, java7, or javaldx; it just happens that this error/warning is printed to stderr before the application terminates due to a runtime exception.
Comment 3 SET 2013-03-18 23:07:47 UTC
With $SYSUSERCONFIG/.openoffice.org/3

soffice starts normally with openjdk7 !!! And .openoffice.org/3 in $HOME is being used.


I used to have $SYSUSERCONFIG/../.openoffice.org/3 in bootstraprc with openjdk6, to use $HOME/.openoffice.org/3 . $SYSUSERCONFIG/.openoffice.org/3 with openjdk6 would use $HOME/.config/.openoffice.org/3 .

If bootstraprc contains $SYSUSERCONFIG/../.openoffice.org/3 with openjdk7, I get these errors : 

[Java framework] Error in function createSettingsDocument (elements.cxx).
javaldx failed!


It seems that $SYSUSERCONFIG points to $HOME or to $HOME/.config with openjdk7 and openjdk6 respectively.

In pure semantics, we would expect $SYSUSERCONFIG to mean $HOME/.config .

Please close if necessary.

Regards.
Comment 4 Ariel Constenla-Haile 2013-03-18 23:36:58 UTC
(In reply to comment #3)
> It seems that $SYSUSERCONFIG points to $HOME or to $HOME/.config with
> openjdk7 and openjdk6 respectively.

Technically speaking, $SYSUSERHOME is $HOME; $SYSUSERCONFIG first looks at the environment variable $XDG_CONFIG_HOME; if not set, it resolves to $HOME

Code pointer for the interested reader:
http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sal/rtl/source/bootstrap.cxx?revision=1198277&view=markup#l510
http://svn.apache.org/viewvc/openoffice/trunk/main/sal/inc/osl/security.hxx?revision=1413471&view=markup#l87
http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sal/osl/unx/security.c?revision=1303378&view=markup#l774

Note that in any case, Java is never involved.

> In pure semantics, we would expect $SYSUSERCONFIG to mean $HOME/.config .

This looks like a bug, indeed:
http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sal/osl/unx/security.c?revision=1303378&view=markup#l795

795 	static sal_Bool SAL_CALL osl_psz_getConfigDir(oslSecurity Security, sal_Char* pszDirectory, sal_uInt32 nMax)
796 	{
797 	sal_Char *pStr = getenv("XDG_CONFIG_HOME");
798 	
799 	if ((pStr == NULL) || (strlen(pStr) == 0) ||
800 	(access(pStr, 0) != 0))
801 	return (osl_psz_getHomeDir(Security, pszDirectory, nMax));
802 	
803 	strncpy(pszDirectory, pStr, nMax);
804 	return sal_True;
805 	}

the code is getting the value from XDG_CONFIG_HOME; if it is unset or empty, then it resolves to $HOME.

But the freedesktop specification says:
http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
"$XDG_CONFIG_HOME defines the base directory relative to which user specific configuration files should be stored. If $XDG_CONFIG_HOME is either not set or empty, a default equal to $HOME/.config should be used."

It should resolve to $HOME/.config

> Please close if necessary.

Closing.

@Andrea: for the $HOME/.config bug, open a new one (and/or start a discussion on the development list).