[MAGNOLIA-1053] Magnolia on headless servers Created: 14/Sep/06  Updated: 23/Jan/13  Resolved: 21/Nov/06

Status: Closed
Project: Magnolia
Component/s: None
Affects Version/s: 3.0 RC2
Fix Version/s: 3.0.1

Type: Bug Priority: Major
Reporter: Anthony Ogier Assignee: Magnolia International
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

RedHat (RHEL 4.3), with Tomcat 5.0 and Java 1.4.2_12 (latest 1.4.2 release)


Issue Links:
Cloners
is cloned by MGNLEE-13 Magnolia on headless servers Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

Look at http://webmail.magnolia.info/Lists/dev-list/Message/7149.html for the last mail about that problem.

I'm trying to boot-strap a fresh generated magnoliaAuthor.war (with "maven install", based on rc2 release).
I've noted that when I comment each <SearchIndex> nodes in the jackrabbit-mysql-search.xml and workspace.xml files, Magnolia boot-straps correctly and I can access the application in a rather limited way (I can't search documents, or add any DMS paragraphs).
The problem doesn't come from wrong rights on file as the user "tomcat" owns all folders and files in its application folder.

Here is the short stack trace to emphasis some problems :
----------------------------------------
INFO info.magnolia.jackrabbit.ProviderImpl ProviderImpl.java(init:141) 29.08.2006 16:22:03 Loading repository at /www/tomcat/jakarta-tomcat-5.0.28/webapps/magnoliaAuthor/repositories/magnolia (config file: /www/tomcat/jakarta-tomcat-5.0.28/webapps/magnoliaAuthor/WEB-INF/config/repo-conf/jackrabbit-mysql-search.xml)
INFO: Exception: java.lang.reflect.InvocationTargetException
ERROR org.apache.jackrabbit.core.RepositoryImpl RepositoryImpl.java(<init>:247) 29.08.2006 16:22:17 Failed to initialize workspace 'default'
javax.jcr.RepositoryException
at org.apache.jackrabbit.core.SearchManager.initializeQueryHandler(SearchManager.java:531)
at org.apache.jackrabbit.core.SearchManager.<init>(SearchManager.java:273)
...
Caused by: java.lang.IllegalArgumentException
at org.apache.commons.collections.BeanMap.put(BeanMap.java:374)
at org.apache.jackrabbit.core.config.BeanConfig.newInstance(BeanConfig.java:96)
...
ERROR org.apache.jackrabbit.core.RepositoryImpl RepositoryImpl.java(<init>:248) 29.08.2006 16:22:17 Unable to start repository, forcing shutdown...
ERROR info.magnolia.jackrabbit.ProviderImpl ProviderImpl.java(init:174) 29.08.2006 16:22:18 Unable to initialize repository: null
javax.jcr.RepositoryException
at org.apache.jackrabbit.core.SearchManager.initializeQueryHandler(SearchManager.java:531)
at org.apache.jackrabbit.core.SearchManager.<init>(SearchManager.java:273)
...
----------------------------------------

And the <SearchIndex> paragraph for my xml files :
----------------------------------------
<SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
<param name="textFilterClasses"
value="org.apache.jackrabbit.core.query.MsExcelTextFilter,org.apache.jackrabbit.core.query.MsPowerPointTextFilter,org.apache.jackrabbit.core.query.MsWordTextFilter,org.apache.jackrabbit.core.query.PdfTextFilter,org.apache.jackrabbit.core.query.HTMLTextFilter,org.apache.jackrabbit.core.query.XMLTextFilter,org.apache.jackrabbit.core.query.RTFTextFilter"/>
<param name="path" value="${wsp.home}/index"/>
<param name="useCompoundFile" value="true"/>
<param name="minMergeDocs" value="100"/>
<param name="volatileIdleTime" value="3"/>
<param name="maxMergeDocs" value="100000"/>
<param name="mergeFactor" value="10"/>
<param name="bufferSize" value="10"/>
</SearchIndex>
----------------------------------------



 Comments   
Comment by Anthony Ogier [ 17/Nov/06 ]

I come back two months later to say that we "partially" solved that bug.
Actually, by removing a textFilterClass from the jackrabbit-*-search.xml : one must remove org.apache.jackrabbit.core.query.RTFTextFilter !!
We finally get that sort of config :

<SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
<param name="textFilterClasses" value="org.apache.jackrabbit.core.query.MsExcelTextFilter,org.apache.jackrabbit.core.query.MsPowerPointTextFilter,org.apache.jackrabbit.core.query.MsWordTextFilter,org.apache.jackrabbit.core.query.PdfTextFilter,org.apache.jackrabbit.core.query.HTMLTextFilter,org.apache.jackrabbit.core.query.XMLTextFilter"/>
...
</SearchIndex>

I've searched the org.apache.jackrabbit.core.query.RTFTextFilter class (in jackrabbit-index-filters-1.0.1-sources.jar) to know why that strange InvocationTargetException appears.
Actually, it uses the javax.swing.text.rtf.RTFEditorKit class which is probably located in a jar which is not loaded while launching tomcat with "service tomcat start" on RHEL.

Comment by Philipp Bracher [ 17/Nov/06 ]

the package javax.swing is an GUI package not loaded on some unix systems in case you don't have a GUI to use. We had the same problem with some image manipulation code using awt classes.

I mark this as resolved. Thanks for pointing it out.

Comment by Magnolia International [ 17/Nov/06 ]

Anthony, could you please try the following, if you still have your server around, and a couple of minutes:

  • re-add the rtf filter in the jackrabbit config (i.e back to normal)
  • start java/tomcat with
    -Djava.awt.headless=true
    (add that in the CATALINA_OPTS environment variable for instance)

For all I know, it should help

Comment by Anthony Ogier [ 17/Nov/06 ]

Okay, I'll try this out and feed back my results !
Thanks Grégory for that hint.

Comment by David Smith [ 18/Nov/06 ]

I had this exact issue on a test install. Added -Djava.awt.headless=true fixed it and allowed magnolia to bootstrap normally.

Funny enough the system experiencing the issue on was running X, so it must be something in the way jsvc (commons-daemon project) starts tomcat that makes the X environmnet unavailable.

Comment by Magnolia International [ 20/Nov/06 ]

Subject was:
"doesn't run on linux with java 1.4.2 and tomcat 5.0 : InvocationTargetException"

Solution:
------------------
Add the
-Djava.awt.headless=true
option to your startup script.

Thanks all for reporting/testing.

Comment by Anthony Ogier [ 20/Nov/06 ]

Okay, solution seems to work here too.
Thanks Grégory for the hint !

Comment by Magnolia International [ 20/Nov/06 ]

I'll actually reopen this - I think we should make this setting a default in our bundled tomcats, too many people have this hard-to-report problem (since the exceptions thrown by underlying systems are pretty obscure)

Comment by Magnolia International [ 21/Nov/06 ]

Added
-Djava.awt.headless=true
to our startup scripts.

Generated at Mon Feb 12 03:23:12 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.