You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Orbeon Forms 2025.1-pe连接MySQL时$attachment-mediatypes空序列错误求助

问题

使用镜像 orbeon/orbeon-forms:2025.1-pe,搭配MySQL数据库,已完成以下配置:

  • 配置了 orbeon.xml、properties-prod.xml
  • Dockerfile安装了MySQL驱动
  • MySQL的Schema、表已创建,容器可正常连接数据库

启动Orbeon容器后访问/orbeon/fr/时出现如下错误:

2026-03-10T22:04:39,083 - 86 - INFO  lifecycle - event: {"request": "2", "session": "A550BDA573EE2E7D2E930F13582E1A81", "source": "service", "message": "start: handle"}
2026-03-10T22:04:39,083 - 86 - INFO  ProcessorService - Start request: GET /orbeon/fr/
2026-03-10T22:04:39,843 - 86 - ERROR XSLTTransformer - Error at line 1097 of oxf:/apps/fr/components/components.xsl:
An empty sequence is not allowed as the value of variable $attachment-mediatypes
2026-03-10T22:04:39,853 - 86 - ERROR PageFlowControllerProcessor - error caught {controller: "oxf:/apps/fr/page-flow.xml", method: "GET", path: "/fr/"}
2026-03-10T22:04:39,876 - 86 - ERROR PageFlowControllerProcessor -
+----------------------------------------------------------------------------------------------------------------------+
|An Error has Occurred                                                                                                 |
|----------------------------------------------------------------------------------------------------------------------|
|An empty sequence is not allowed as the value of variable $attachment-mediatypes                                      |
|----------------------------------------------------------------------------------------------------------------------|
|Application Call Stack                                                                                                |
|----------------------------------------------------------------------------------------------------------------------|
|oxf:/apps/fr/components/components.xsl                                            |                              |1097|
|oxf:/apps/fr/page-flow.xml                                                        |reading page view data output | 260|
|······················································································································|
|element=<page id="fr-landing" path="/fr/" model="landing/landing.xhtml" view="html-view.xpl" default-submission="reque|
|st-parameters.xml">[...]</page>                                                                                       |
|page id=fr-landing                                                                                                    |
|view   =html-view.xpl                                                                                                 |
|----------------------------------------------------------------------------------------------------------------------|
|oxf:/apps/fr/html-view.xpl                                                        |reading processor output      |  34|
|······················································································································|
|element=<p:output name="data" ref="data"/>                                                                            |
|name   =data                                                                                                          |
|ref    =data                                                                                                          |
|----------------------------------------------------------------------------------------------------------------------|
|oxf:/apps/fr/unroll-form.xpl                                                      |reading processor output      | 107|
|······················································································································|
|element=<p:output name="data" ref="data"/>                                                                            |
|name   =data                                                                                                          |
|ref    =data                                                                                                          |
|----------------------------------------------------------------------------------------------------------------------|
|oxf:/apps/fr/unroll-form.xpl                                                      |reading processor output      |  95|
|······················································································································|
|element=<p:output name="data" id="after-components"/>                                                                 |
|name   =data                                                                                                          |
|id     =after-components                                                                                              |
|----------------------------------------------------------------------------------------------------------------------|
|oxf:/apps/fr/components/components.xsl                                            |executing XSLT transformation |1097|
|----------------------------------------------------------------------------------------------------------------------|
|Exception: org.orbeon.saxon.trans.XPathException                                                                      |
|----------------------------------------------------------------------------------------------------------------------|
|org.orbeon.saxon.expr.CardinalityCheckingIterator  |typeError                     |                              | 120|
|org.orbeon.saxon.expr.CardinalityCheckingIterator  |<init>                        |                              |  47|
|org.orbeon.saxon.expr.CardinalityChecker           |iterate                       |                              | 171|
|org.orbeon.saxon.expr.ExpressionTool               |evaluate                      |                              | 308|
|org.orbeon.saxon.instruct.GlobalVariable           |getSelectValue                |                              | 209|
|org.orbeon.saxon.instruct.GlobalVariable           |evaluateVariable              |                              | 233|

解决方法

错误核心是$attachment-mediatypes变量为空,该变量对应Orbeon配置中的oxf.fr.attachment.mediatypes属性,需在配置文件中明确设置有效值:

  • 打开properties-prod.xml(或当前使用的生产环境配置文件)
  • 添加或修改以下配置项,设置允许的附件媒体类型,示例如下:
<property
    as="xs:string"
    name="oxf.fr.attachment.mediatypes"
    value="image/jpeg, image/png, application/pdf, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.openxmlformats-officedocument.wordprocessingml.document"/>
  • 保存配置后重启Orbeon容器

若需针对特定应用或表单做精细配置,可使用带应用/表单前缀的属性,例如:

<property
    as="xs:string"
    name="oxf.fr.attachment.mediatypes.acme.expense"
    value="image/jpeg, application/pdf"/>

内容的提问来源于stack exchange,提问作者A Basak

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.11 10:37:03