AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / coding / 问题

问题[mule](coding)

Martin Hope
AndyDaSilva52
Asked: 2024-12-07 05:44:55 +0800 CST

导出 Mule 项目 - 无法调用 org.eclipse.aether.RepositorySystem.newLocalRepositoryManager

  • 5

当我导出项目时发生此错误:

Cannot invoke "org.eclipse.aether.RepositorySystem.newLocalRepositoryManager(org.eclipse.aether.RepositorySystemSession, org.eclipse.aether.repository.LocalRepository)" because "repositorySystem" is null 

我正在使用:

  • Anypoint Studio 7.19
  • Mule 运行时 4.6.9
  • MMP(Mule Maven 插件)3.2.0

我需要使用最新的 LTS Runtime 4.6.9 成功导出一个简单的项目(代理)

mule
  • 1 个回答
  • 11 Views
Martin Hope
Anonim
Asked: 2024-12-04 20:20:15 +0800 CST

将 XML 转换为 JSON,使用属性和文本作为键,无需 __text

  • 5

我有一个 XML 格式的有效负载,我需要将其转换为 JSON。XML 包含许多键值对以及许多属性,我需要将这些属性也包含在 JSON 中。

<CustomData>

  <CustomIdentifier attribute1="value1" attribute2="value2">

    test  </CustomIdentifier>

</CustomData>

这个output writeAttributes=true可以,__text但我并不想拥有它。我想动态地改变它,以便它__text成为一个键。我有更多的属性,我不能到处都有__text

例子:

{

"CustomData": {

"CustomIdentifier": {

"@attribute1": "value1",

"@attribute2": "value2",

"CustomIdentifier": "test"

}

}

}
mule
  • 1 个回答
  • 26 Views
Martin Hope
veejay
Asked: 2024-11-25 21:39:37 +0800 CST

如何根据过滤条件后的键创建数组?

  • 5

我有一个如下所示的数组,它是过滤条件的输出。它有 documentItemName1、documentItemName2、documentItemName3 等字段,最小值为 1,最大值为 3。

对于每个 contentVersion documentItemToSigner,根据其中存在的 documentItemName{n} 数量,没有对象数量

有效载荷:

 [
      {
        "contentVersion": "068DQ000000lK0iYAE",
        "documentName": "ESRA with Exhibit_A",
        "documentItemName1": "Signature001",
        "typeCd1": "Signature",
        "typeCd2": null,
        "typeCd3": null,
        "subtypeCd1": "CAPTURE",
        "subtypeCd2": null,
        "subtypeCd3": null
      },
      {
        "contentVersion": "068DQ000000kK0OYAU",
        "documentName": "Agreement 1",
        "documentItemName1": "Signature001",
        "documentItemName2": "Signature002",
        "typeCd1": "Signature",
        "typeCd2": "Signature",
        "typeCd3": null,
        "subtypeCd1": "CAPTURE",
        "subtypeCd2": "LABEL",
        "subtypeCd3": null
      },
      {
        "contentVersion": "068DQ000000lK0OYAU",
        "documentName": "Agreement 2",
        "documentItemName1": "Signature001",
        "documentItemName2": "Signature002",
        "documentItemName3": "Signature003",
        "typeCd1": "Signature",
        "typeCd2": "Signature",
        "typeCd3": "Signature",
        "subtypeCd1": "CAPTURE",
        "subtypeCd2": "CAPTURE",
        "subtypeCd3": "CAPTURE"
      }
    ]

我尝试过下面的脚本,但不确定如何根据其中的 documentItemName{no} 号创建对象。

例如:从有效负载中,我要过滤到此 contentVersion =“068DQ000000lK0OYAU”,其中包含 documentItemName1、documentItemName2、documentItemName3。因此,documentItemToSigner 数组应该有 3 个对象,它们映射如下

"documentItemToSigner": [{

documentItemName: documentItemName1,
"typeCd": typeCd1,
"subtypeCd": subtypeCd1
},
 {

documentItemName: documentItemName2,
"typeCd": typeCd2,
"subtypeCd": subtypeCd3
},
 {

documentItemName: documentItemName3,
"typeCd": typeCd3,
 "subtypeCd": subtypeCd3
}]

对于示例 2:从有效负载中,如果我要过滤到此contentVersion = “068DQ000000lK0iYAE”,其中仅包含 documentItemName1。因此,documentItemToSigner 数组应该有 1 个对象,其映射方式如下

"documentItemToSigner": [{
        
        documentItemName: documentItemName1,
        "typeCd": typeCd1,
        "subtypeCd": subtypeCd1
        }]
    
"documentItemToSigner": (payload filter ((g, index) -> g.contentVersion == "068DQ000000lK0OYAU")) map ((item, index) -> {
    "typeCd": item."typeCd{n}",
    "subtypeCd": item."subtypeCd{n}",
    "eSignLiveExtension": {
      "extractInd": true
    },
    "documentItemName": item."documentItemName{n}"
  })

预期输出:

{
  "documentItemToSigner": [
    {
      "typeCd": "Signature",
      "subtypeCd": "CAPTURE",
      "eSignLiveExtension": {
        "extractInd": true
      },
      "documentItemName": "Signature001"
    },
    {
      "typeCd": "Signature",
      "subtypeCd": "LABEL",
      "documentItemName": "Signature002",
      "eSignLiveExtension": {
        "extractInd": false
      }
    },
 {
      "typeCd": "Signature",
      "subtypeCd": "CAPTURE",
      "eSignLiveExtension": {
        "extractInd": true
      },
      "documentItemName": "Signature003"
    }
  ]
}
mule
  • 3 个回答
  • 58 Views
Martin Hope
E F
Asked: 2024-11-14 00:02:36 +0800 CST

发送给多个收件人 MuleSoft 电子邮件 SMTP

  • 5

我一直试图发送给多个收件人,但无济于事。目前,我定义了一个转换来拆分然后合并收件人字符串,然后将其传递给电子邮件连接器,但它失败了,说

Error while sending email: Error while creating [email protected],[email protected] InternetAddress

原始变换定义如下:

if((emailString as String) contains "," )
        (emailString as String) splitBy "," joinBy ","
    else if(emailString != "" and emailString != null)
        [emailString]
    else
        null

我想知道是否存在我在检查文档时没有看到的错误或特殊情况。

mule
  • 1 个回答
  • 16 Views
Martin Hope
boomslaw
Asked: 2024-09-11 16:58:24 +0800 CST

将 UTC 字符串日期转换为 AEST

  • 5

我正在尝试将 UTC 时区的字符串格式的日期转换为澳大利亚/悉尼时区。它似乎适用于一个值,但不适合另一个值,所以我有点困惑

%dw 2.0
import * from dw::core::Strings
output application/json

var inputUtc1 = "2024-09-08T08:23:00Z"
var inputUtc2 = "2024-10-15T00:00:00Z"
fun format(d: DateTime) = d as String {format: "yyyy-MM-dd'T'HH:mm:ss"}
---
{
    "a1" : (format(inputUtc1) >> "Australia/Sydney") as String {format: 'yyyy-MM-dd\'T\'HH:mm:ss'},
    "a2" : (format(inputUtc2) >> "Australia/Sydney") as String {format: 'yyyy-MM-dd\'T\'HH:mm:ss'}
}

生成的输出是:

{
  "a1": "2024-09-08T18:23:00",
  "a2": "2024-10-15T11:00:00"
}

a1 的值似乎是正确的,但对于 2024-10-15T00:00:00ZUTC 中的 a2 来说似乎不正确,应该转换为2024-10-15T10:00:00

然而它正在将其转换为 2024-10-15T 11 :00:00Z

我不确定为什么它对一个日期有效而对另一个日期无效?(我在操场上尝试这个。)

mule
  • 1 个回答
  • 28 Views
Martin Hope
Devendra
Asked: 2024-08-05 18:32:43 +0800 CST

如何在 http 请求者 mule 4 中保留标头键的大小写

  • 5

我在 mule 4 中从 http 请求者调用 rest api 时遇到问题,rest api 要求标头中的 Key 为大写格式,例如Key和 i 仅在标头中定义为大写格式,但默认情况下它会自动转换为小写。有什么方法可以在 mule4 中修复此问题吗?

在此处输入图片描述

mule
  • 2 个回答
  • 19 Views
Martin Hope
GettingStarted With123
Asked: 2024-05-04 06:50:17 +0800 CST

Mule 4 dataweave 2 - 如何对包含其他对象的 json 对象进行排序

  • 5

我需要对一个 json 对象(不是数组)进行排序,它不是一个简单的键值,而是里面有其他对象

{
"Memo": {
    "itemAmount1": "5",
    "taxName1": "TAX",
    "productPrice1": "10",
    "accountName1": "Account Receivable (Debtors)"
},
"Footer": {
    "productDescription2": "Maggie",
    "itemQuantity2": "49.5",
    "accountName2": "Account Receivable (Debtors)",
    "taxName2": "TAX"
},
"Header": {
    "itemDiscount3": "10",
    "accountName3": "Account Receivable (Debtors)",
    "productPrice3": "10",
    "taxName3": "TAX"
}
}

预期输出是:(也应该对内部对象的键进行排序)

 {
"Footer": {
    "accountName2": "Account Receivable (Debtors)",
    "itemQuantity2": "49.5",
    "productDescription2": "Maggie",
    "taxName2": "TAX"
},
"Header": {
    "accountName3": "Account Receivable (Debtors)",
    "itemDiscount3": "10",
    "productPrice3": "10",
    "taxName3": "TAX"
},
"Memo": {
    "accountName1": "Account Receivable (Debtors)",
    "itemAmount1": "5",
    "productPrice1": "10",
    "taxName1": "TAX"
}
}

不一定是 2 级对象层次结构,它可能包含需要排序的 n 级对象层次结构。

这个问题是这里提出的问题的虚拟复制粘贴(但那是针对 javascript 而不是 dataweave / mule )

mule
  • 1 个回答
  • 12 Views
Martin Hope
spoonboy
Asked: 2023-10-04 08:59:48 +0800 CST

如何在DW中将DateTime截断为分钟?

  • 6

寻找一种将时间戳 DateTime 值(例如 now() 的结果)截断为分钟并保留时区的方法,如下所示:

来自: |2023-10-04T10:48:07.975905Z|

至: |2023-10-04T10:48:00.000000Z|

当然,可以通过首先将 DateTime 转换为 String,然后应用字符串操作,然后再转换回 DateTime 来完成。但我想这会很丑陋。

因此,寻找更优雅的方式来实现这一结果。

Mule 提供了类似的函数atBeginningOfHour,它可以按小时级别进行截断。
我正在寻找类似的功能,但需要几分钟。

Mule DW版本是2.4.0(最新)。

mule
  • 2 个回答
  • 29 Views
Martin Hope
MiguelSlv
Asked: 2023-08-18 01:27:38 +0800 CST

Mule API 代理返回 503 服务不可用

  • 5

我在一台非常受限的服务器上安装了 Mule API 代理。为了查看代理是否正常工作,我从服务器尝试了以下操作:

curl https://localhost:8080/console/

正如预期的那样,代理响应了一些 html:

<!doctype html>
<html lang="en">
...
<api-console-app  ...>
..  

当尝试发送有效请求时:

 curl -Lv -X 'GET'  'https://localhost:8080/<basepath>/<some valid path>'   -H 'accept: application/json'

它返回 http 代码 503:

* About to connect() to localhost port 8080 (#0)
*   Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 8080 (#0)
* Initializing NSS with certpath: ...
* skipping SSL peer certificate verification
* SSL connection using TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
* Server certificate:
*     ...
> GET /...
> User-Agent: curl/7.29.0
> Host: localhost:8080
> accept: application/json
>
< HTTP/1.1 503 Service Unavailable
< Content-Type: text/plain; charset=UTF-8
< Content-Length: 0
< Date: Thu, 17 Aug 2023 17:10:48 GMT
< Connection: close
<
* Closing connection 0

值得一提的是,如果我更改基本路径,我会收到 404 - 未找到错误,因此我将到达代理。

我在 Mule API 日志或 Anypoint 平台(门户)中找不到错误。

有任何想法吗?我如何记录/访问日志?

mule
  • 1 个回答
  • 24 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    重新格式化数字,在固定位置插入分隔符

    • 6 个回答
  • Marko Smith

    为什么 C++20 概念会导致循环约束错误,而老式的 SFINAE 不会?

    • 2 个回答
  • Marko Smith

    VScode 自动卸载扩展的问题(Material 主题)

    • 2 个回答
  • Marko Smith

    Vue 3:创建时出错“预期标识符但发现‘导入’”[重复]

    • 1 个回答
  • Marko Smith

    具有指定基础类型但没有枚举器的“枚举类”的用途是什么?

    • 1 个回答
  • Marko Smith

    如何修复未手动导入的模块的 MODULE_NOT_FOUND 错误?

    • 6 个回答
  • Marko Smith

    `(表达式,左值) = 右值` 在 C 或 C++ 中是有效的赋值吗?为什么有些编译器会接受/拒绝它?

    • 3 个回答
  • Marko Smith

    在 C++ 中,一个不执行任何操作的空程序需要 204KB 的堆,但在 C 中则不需要

    • 1 个回答
  • Marko Smith

    PowerBI 目前与 BigQuery 不兼容:Simba 驱动程序与 Windows 更新有关

    • 2 个回答
  • Marko Smith

    AdMob:MobileAds.initialize() - 对于某些设备,“java.lang.Integer 无法转换为 java.lang.String”

    • 1 个回答
  • Martin Hope
    Fantastic Mr Fox msvc std::vector 实现中仅不接受可复制类型 2025-04-23 06:40:49 +0800 CST
  • Martin Hope
    Howard Hinnant 使用 chrono 查找下一个工作日 2025-04-21 08:30:25 +0800 CST
  • Martin Hope
    Fedor 构造函数的成员初始化程序可以包含另一个成员的初始化吗? 2025-04-15 01:01:44 +0800 CST
  • Martin Hope
    Petr Filipský 为什么 C++20 概念会导致循环约束错误,而老式的 SFINAE 不会? 2025-03-23 21:39:40 +0800 CST
  • Martin Hope
    Catskul C++20 是否进行了更改,允许从已知绑定数组“type(&)[N]”转换为未知绑定数组“type(&)[]”? 2025-03-04 06:57:53 +0800 CST
  • Martin Hope
    Stefan Pochmann 为什么 {2,3,10} 和 {x,3,10} (x=2) 的顺序不同? 2025-01-13 23:24:07 +0800 CST
  • Martin Hope
    Chad Feller 在 5.2 版中,bash 条件语句中的 [[ .. ]] 中的分号现在是可选的吗? 2024-10-21 05:50:33 +0800 CST
  • Martin Hope
    Wrench 为什么双破折号 (--) 会导致此 MariaDB 子句评估为 true? 2024-05-05 13:37:20 +0800 CST
  • Martin Hope
    Waket Zheng 为什么 `dict(id=1, **{'id': 2})` 有时会引发 `KeyError: 'id'` 而不是 TypeError? 2024-05-04 14:19:19 +0800 CST
  • Martin Hope
    user924 AdMob:MobileAds.initialize() - 对于某些设备,“java.lang.Integer 无法转换为 java.lang.String” 2024-03-20 03:12:31 +0800 CST

热门标签

python javascript c++ c# java typescript sql reactjs html

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve