问题描述
我今天正在开发我的 Mule 4 应用程序,突然我的 Anypoint Studio 发疯了。当我尝试运行我的应用程序时,我收到一个错误,指出应用程序使用的端口已在使用中。没什么异常,但是当我重新启动 PC 并想再次运行该应用程序时,控制台中出现了可疑信息:
INFO 2021-05-25 12:40:21,056 [WrapperListener_start_runner] [处理器:;事件:] org.mule.runtime.core.internal.construct.AbstractFlowConstruct:Flow ImportPendingCorrectionsFlow 尚未启动 INFO 2021-05-25 12:40:21,056 [WrapperListener_start_runner] [处理器:;事件:] org.mule.runtime.core.internal.construct.FlowConstructLifecycleManager:启动流程:ImportInvoicesFlow INFO 2021-05-25 12:40:21,056 [WrapperListener_start_runner] [处理器:;事件:] org.mule.runtime.core.internal.construct.FlowConstructLifecycleManager:停止流:ImportInvoicesFlow
对于我的应用程序中的所有流都具有相同的消息。
然后我尝试运行现有的 munit 测试,该测试在一个月或更长时间后一直正常运行,但收到此错误:
++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++
- 运行测试:ImportInvoicesFlowTestWithIncorrectVehicleCount - 测试 + ++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++ java.lang.AssertionError: 抛出的错误 ID 与预期的不匹配。预期: 但是是: 在 org.mule.munit.runner.flow.TestFlow.run(TestFlow.java:313) 引起:java.io.IOException:远程关闭 引起:java.io.IOException:远程关闭
这确实很奇怪——因为这个流程与HTTP
完全没有关系。
终于在控制台发现了一个很奇怪的WARN
:
警告 2021-05-25 13:04:35,613 [Mule.app.deployer.monitor.1.thread.1] [处理器:;事件:] com.mulesoft.agent.configuration.descriptor.YamlMuleAgentDescriptor:描述符文件/home/xxxxxxx/apps/AnypointStudio-7.7.0-linux64/AnypointStudio/plugins/org.mule.tooling.server.4.3.0.ee_7。 3.5.202105101830/mule/conf/invoices-esb-mule4-app.yml 未找到。
我不知道这里发生了什么,我从未创建过 invoices-esb-mule4-app.yml
这样的文件。我假设这是 Mule 自己根据应用程序名称创建的某种配置文件。这里的路径很奇怪,因为我正在处理的工作区在 /home/xxxxxxx/AnypointStudio7/workspace-2/
其他可能有用(或无用)的信息
- 我正在开发 apikit SOAP 服务,但它仍然运行良好。
- 有一次,我误点击了 Mule Design 透视图并单击了 Api Desing 透视图,最终导致应用程序崩溃,但在再次启动 Anypoint Studio 后它似乎可以正常工作。
有人知道我的 Anypoint Studio 或我的应用程序会发生什么吗?
解决方法
YML 可以是由运行时管理器代理创建的每个应用程序配置文件。奇怪的是,它是在 Studio 内的执行中创建的。检查 /home/xxxxxxx/apps/AnypointStudio-7.7.0-linux64/AnypointStudio/plugins/org.mule.tooling.server.4.3.0.ee_7.3.5.202105101830/mule/conf/mule-agent.yml 是否为引用它。
,我遇到了类似的问题,其中日志显示 def main(req: func.HttpRequest) -> func.HttpResponse:
logging.info('Python HTTP trigger function processed a request. 11:38')
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument('--headless')
chrome_options.add_argument('--no-sandbox')
chrome_options.add_argument('--disable-dev-shm-usage')
path_to_chrome=os.path.join(os.getcwd(),'/usr/local/bin/chromedriver')
driver = webdriver.Chrome(executable_path=path_to_chrome,chrome_options=chrome_options)
,然后是 FROM mcr.microsoft.com/azure-functions/python:3.0-python3.8
# 0. Install essential packages
RUN apt-get update \
&& apt-get install -y \
build-essential \
cmake \
git \
wget \
unzip \
&& rm -rf /var/lib/apt/lists/*
# 1. Install Chrome (root image is debian)
# See https://stackoverflow.com/questions/49132615/installing-chrome-in-docker-file
ARG CHROME_VERSION="google-chrome-stable"
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list \
&& apt-get update -qqy \
&& apt-get -qqy install \
${CHROME_VERSION:-google-chrome-stable} \
&& rm /etc/apt/sources.list.d/google-chrome.list \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/*
# 2. Install Chrome driver used by Selenium
RUN LATEST=$(wget -q -O - http://chromedriver.storage.googleapis.com/LATEST_RELEASE) && \
wget http://chromedriver.storage.googleapis.com/$LATEST/chromedriver_linux64.zip && \
unzip chromedriver_linux64.zip && ln -s $PWD/chromedriver /usr/local/bin/chromedriver
ENV PATH="/usr/local/bin/chromedriver:${PATH}"
# 3. Install selenium in Python
RUN pip install -U selenium
# 4. Finally,copy python code to image
COPY . /home/site/wwwroot
# 5. Install other packages in requirements.txt
RUN cd /home/site/wwwroot && \
pip install -r requirements.txt
,然后是 FlowConstructLifecycleManager: Starting flow [flow name]
。然后在下一个流程中重复这三个。
在尝试了一天多的解决方案后,我的团队尝试去运行、运行配置、选择 Mule 应用程序、选择 Mule 应用程序、常规选项卡、“清除应用程序数据:”并将其更改为“始终”。一直是“从不”。进行此更改并再次运行后,它开始工作。希望这对您或其他有类似“停止流量”问题的人有所帮助。