| View previous topic :: View next topic |
| Author |
Message |
quiffhanger General User

Joined: 22 Dec 2005 Posts: 13
|
Posted: Thu Dec 22, 2005 2:14 am Post subject: "internal error occured" running oo via perl |
|
|
I'm *very* close to finishing an document conversion facility using OO2.0 but have stumbled at the very last hurdle.
To get straight to the point:
When calling a java conversion program from my perl script, a message box pops up in the vnc display (despite the invisible switch) "The Application cannot be started. An internal error occured". My mimedefang log script would display:
| Code: | <snip>Slave 0 stderr: [Java framework] Error in function createUserSettingsDocument (elements.cxx).
<snip>Slave 0 stderr: javaldx failed!
<snip>Slave 0 stderr: [Java framework] Error in function createUserSettingsDocument (elements.cxx) |
(Bizzarely this error doesn't show up all the time, it seems to fail silentlly sometimes. I'm not sure exactly why or when however).
The long version
My setup so far: I have a OO installation on White Box enterprise Linux v3. I have managed to get a OO instance to behave like a daemon using this simple script:
| Code: |
#!/bin/bash
# Run's open office in a virtual framebuffer
xvfb-run /opt/openoffice.org2.0/program/soffice -invisible "-accept=socket,host=192.168.1.4,port=8100;urp;StarOffice.ServiceManager" |
I have also setup a /etc/init.d/ooffice startup script that run's the above script as the correct user and allows the usual control via "/etc/init.d/ooffice (start|stop|status|kill)".
Via some sudoers trickery I have configured the startup script so that it can be run by the ooffice user (namely user "defang") aswell as root, allowing the "defang" user to control the OO daemon if necessary.
This all works great, I can control OO easily logged in as defang & logged in as root, when it's running my java program connects to it via UNO fine and converts documents as required.
I noticed after reading quite a lot of posts on the subject openoffice can get a bit grumpy after running for ages. To solve this I have included in my java program a method which, if it fails to connect to OO issues a "/etc/init.d/ooffice restart" command which tries very hard to shutdown (& kill if necessary) OO then restart it again. Again, this all works fine when I test it, logged in as user defang.
Here's the strange bit: if I then get my perl script (actually, as you may have guessed "mimedefang-filter") to run the java program I run into all sorts of problems, but only if it has to try and start open office.
Initially, it would appear that open office would start then close again shortly after and the document conversion would fail: my java program would simpy fail to connect and give up.
To aid debugging, I changed my oofficed script, to instead use VNC, I preloaded vnc then set the $DISPLAY variable in my script. Again, this worked fine when testing my java program on the command line, but as explained in "Straight to the point" above it didn't work
So in short, I can't get open ooffice to automatically start when being called via mimedefang-filter. I can get it to work fine when I call my java app from the command line. Mimdefang-filter works fine when OO is already running. As I'm sure you'll understand, it's not just the error that's frustrating me, it's my inability to recreate it outwith mimedefang-filter.
Apologies for the long post - I thought I should include the whole story for the sake of completeness.
This conversion system I'm writing is part of a larger system I've been putting a fair bit of work into. Once I get it working I'll create a wee webpage to detail what I've done.
-ross |
|
| Back to top |
|
 |
LarsB OOo Advocate


Joined: 31 Aug 2005 Posts: 465 Location: Hamburg, Germany
|
Posted: Thu Dec 22, 2005 3:41 am Post subject: Not sure |
|
|
Hi,
I'm not sure but when I looked at the following error
| Quote: |
<snip>Slave 0 stderr: [Java framework] Error in function createUserSettingsDocument (elements.cxx).
<snip>Slave 0 stderr: javaldx failed!
<snip>Slave 0 stderr: [Java framework] Error in function createUserSettingsDocument (elements.cxx)
|
It seems that it is a user problem. I guess OO try to get the user settings for the
user that try to open it and this would fail. Don't know exactly if this is correct, but
I would play arround with user that execute the perl script.
Cheers
LarsB
Cheers
LarsB _________________ AODC - A free OpenDocument Converter
AODL - An independent OpenDocument Library C#
EmbeddedOpenOffice .net UserControl C#
EmbeddedOpenOffice Visual Studio .net Add In
http://www.OpenDocument4all.com/ |
|
| Back to top |
|
 |
LarsB OOo Advocate


Joined: 31 Aug 2005 Posts: 465 Location: Hamburg, Germany
|
Posted: Thu Dec 22, 2005 3:49 am Post subject: Checked the source |
|
|
Hi,
I have checked the source and it's a user problem, a dirextory
and maybe a right problem. See the method where yourr would be stop.
I think it will help you
| Code: |
void createUserSettingsDocument()
{
//make sure there is a user directory
rtl::OString sExcMsg("[Java framework] Error in function createUserSettingsDocument "
"(elements.cxx).");
// check if javasettings.xml already exist
rtl::OUString sURL = BootParams::getUserData();
if (checkFileURL(sURL) == FILE_OK)
return;
//make sure that the directories are created in case they do not exist
FileBase::RC rcFile = Directory::createPath(getDirFromFile(sURL));
if (rcFile != FileBase::E_EXIST && rcFile != FileBase::E_None)
throw FrameworkException(JFW_E_ERROR, sExcMsg);
//javasettings.xml does not exist yet
CXmlDocPtr doc(xmlNewDoc((xmlChar *)"1.0"));
if (! doc)
throw FrameworkException(JFW_E_ERROR, sExcMsg);
//Create a comment
xmlNewDocComment(
doc, (xmlChar *) "This is a generated file. Do not alter this file!");
//Create the root element and name spaces
xmlNodePtr root = xmlNewDocNode(
doc, NULL, (xmlChar *) "java", (xmlChar *) "\n");
if (root == NULL)
throw FrameworkException(JFW_E_ERROR, sExcMsg);
if (xmlNewNs(root, (xmlChar *) NS_JAVA_FRAMEWORK,NULL) == NULL)
throw FrameworkException(JFW_E_ERROR, sExcMsg);
if (xmlNewNs(root,(xmlChar*) NS_SCHEMA_INSTANCE,(xmlChar*)"xsi") == NULL)
throw FrameworkException(JFW_E_ERROR, sExcMsg);
xmlDocSetRootElement(doc, root);
//Create a comment
xmlNodePtr com = xmlNewComment(
(xmlChar *) "This is a generated file. Do not alter this file!");
if (com == NULL)
throw FrameworkException(JFW_E_ERROR, sExcMsg);
if (xmlAddPrevSibling(root, com) == NULL)
throw FrameworkException(JFW_E_ERROR, sExcMsg);
if (xmlSaveFormatFileEnc(
getUserSettingsStoreLocation().getStr(), doc,"UTF-8", 1) == -1)
throw FrameworkException(JFW_E_ERROR, sExcMsg);
}
|
Cheers
LarsB _________________ AODC - A free OpenDocument Converter
AODL - An independent OpenDocument Library C#
EmbeddedOpenOffice .net UserControl C#
EmbeddedOpenOffice Visual Studio .net Add In
http://www.OpenDocument4all.com/ |
|
| Back to top |
|
 |
quiffhanger General User

Joined: 22 Dec 2005 Posts: 13
|
Posted: Thu Dec 22, 2005 8:18 am Post subject: |
|
|
Cheers for the pointer.
My enviroment variables were getting screwed up somewhere and $HOME was pointing to /root which the program didn't have write access to.
I'll post a link to my full setup when I'm done.
-ross |
|
| Back to top |
|
 |
blackgenomer Newbie

Joined: 06 Jan 2006 Posts: 1
|
Posted: Fri Jan 06, 2006 12:06 pm Post subject: |
|
|
The problem with that issue:
[Java framework] Error in function createUserSettingsDocument (elements.cxx).
Is always related to user permissions in ~/..openoffice.org2/ (or ~/.openoffice/). Check permissions. |
|
| Back to top |
|
 |
gmolleda Newbie

Joined: 28 Jun 2006 Posts: 1
|
Posted: Wed Jun 28, 2006 4:10 am Post subject: Solved |
|
|
The solution is:
Erase, as root, the /home/user/.openoffice.org2 (is hidden!!) directory and run the program.
Then the directory /home/user/.openoffice.org2 is created new.
Bye. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|