首页 \ 问答 \ 在weblogic服务器的上下文中,关于“避免捕获throwable”的良好文档(good documentation about “avoid catching throwable”, in context of weblogic server)

在weblogic服务器的上下文中,关于“避免捕获throwable”的良好文档(good documentation about “avoid catching throwable”, in context of weblogic server)

我目前正在重构现有的代码库(EJB),以淘汰在EJB内部捕获Throwable的所有块。

try {
    ... do some business logic
} catch(Throwable t){
    ... log and swallow ... :-(
}

我希望/需要用适当的文档说服我周围的人,“抓住Throwable”对于EJB来说是不可取的(我们对此有很多讨论)。 Weblogic将处理所有“错误”条件,并可能使EJB无效并将新的(工作)EJB放入池中。 捕捉Throwable会破坏weblogic提供的所有这些安全网,无论如何捕捉Throwable都是不好的做法(但是这里的人不情愿并且到处使用“Throwable”锤子)。

是否有人能够指向我解释此行为的一些在线文档(对于weblogic,jboss等)。 我通过谷歌搜索并查看了weblogic文档,但无法找到任何内容,只是通用的java doc。


I am currently refactoring an existing codebase (EJBs) to rip out all blocks where a Throwable is caught inside of the EJB.

try {
    ... do some business logic
} catch(Throwable t){
    ... log and swallow ... :-(
}

I want/need to convince the people around me with proper documentation that "catching Throwable" is a no-go for an EJB (we have lots of discussions around this). Weblogic will handle all the "Error" conditions and maybe invalidate EJBs and put fresh (working) EJBs into the pool. Catching Throwable would undermine all these security nets provided by weblogic, and catching Throwable is bad practice anyway (but people here are reluctant and use the "Throwable" hammer everywhere).

Is anyone able to point me to some online docs where this behaviour is explained (for weblogic, jboss, etc.). I searched via Google and had a look at the weblogic docs but wasn't able to find anything, just generic java doc.


原文:https://stackoverflow.com/questions/2803693
更新时间:2023-10-27 12:10

最满意答案

我没有看到这样做的任何关键问题,但是我想起了一些不利因素/风险。

  1. 可能会意外撞击WP核心文件并将其发送出去,这并不好。

  2. 它混淆了当地的开发环境。 而不是让你的WP核心代码在本地生活在容器中,你必须在本地浏览它。

理想情况下,我会考虑将这个位置自动化,只移动该wp-content目录,并在部署时让其他内核由其他内容构建。 如果不是Docker,可能是Composer。


I don't see any critical problem in doing that, but there are a couple of downsides/risk that come to mind for me.

  1. It's possible to accidentally bump WP core files and ship them, which isn't good.

  2. It clutters up your local development environment. Rather than having your WP core code just live in the container locally, you have to navigate around it locally too.

Ideally, I'd think about automating this somewhere, where you only move that wp-content directory, and have the rest of core built by something else on deploy. If not Docker, may be Composer.

相关问答

更多
  • 手头上有很多东西; 首先,Dockerfile只有一个命令( CMD ); 你正在做什么是行不通的; 如果在启动容器时需要执行多个步骤,请考虑使用入口点脚本,例如这是官方mysql映像的入口点脚本 其次,在容器中进行mount需要额外的权限。 您可以使用--privileged但这可能过于宽泛,并且给容器提供了太多的权限。 您可以尝试使用--cap-add SYS_ADMIN来运行容器。 替代解决方案 一个更清洁的解决方案可能是在主机上安装大页面,并让容器访问该设备,例如; docker run --dev ...
  • 您可以指定一个卷应该是只读的,通过追加:ro到-v开关: docker run -v /path/on/host:/path/on/container:ro my/image 请注意,该文件夹然后只读在容器中并在主机上进行读写。 You can specify that a volume should be read-only by appending :ro to the -v switch: docker run -v volume-name:/path/in/container:ro my/imag ...
  • 事实证明,这与您网站的永久链接设置有关。 当您将站点设置为使用自定义永久链接设置时, /wp-json/wp/v2端点可用。 如果我使用/%post%/ permalink结构,它可以工作。 有一个使用其他永久链接结构的网站的替代路线: 在没有漂亮永久链接的网站上,路由将作为rest_route参数添加到网址中。 对于上面的示例,完整的URL将是http://example.com/?rest_route=/wp/v2/posts/123 资料来源: https : //developer.wordpres ...
  • 我没有看到这样做的任何关键问题,但是我想起了一些不利因素/风险。 可能会意外撞击WP核心文件并将其发送出去,这并不好。 它混淆了当地的开发环境。 而不是让你的WP核心代码在本地生活在容器中,你必须在本地浏览它。 理想情况下,我会考虑将这个位置自动化,只移动该wp-content目录,并在部署时让其他内核由其他内容构建。 如果不是Docker,可能是Composer。 I don't see any critical problem in doing that, but there are a couple ...
  • 也许我找到了一些东西...... volumes: - wp-content:/var/www/html/wp-content 根据这篇文章: ... wp-content包含所有用户提供的内容。 基本上任何你可以上传到你的网站的东西都会在这里结束。 这不包括你写的任何内容,请关注你。 这些东西都存储在WordPress数据库中。 但是, 只要您拥有数据库和wp-content文件夹 ,即使其他所有内容都丢失,也可以始终使您的网站恢复正常。 这也适用于这里: 使用Docker设置WordPress ...
  • 尝试赋予音量绝对路径[例如/ home / user / wp]并检查是否已创建“wp”文件夹。 Try to give the absolute path in volume [e.g /home/user/wp] and check whether "wp" folder has been created.
  • 你的Dockerfile和Dockerfile docker-compose.yml应该在你的wordpress目录中。 (你改名的代码) 你的困惑 出于某种原因,您认为有涉及的代码目录。 在wordpress中没有像这样的目录,这很正常。 让我们来分析让你感到困惑的命令: 在Dockerfile : ADD . /code 该行有效地将所指示的目录(在这里)复制到指示的容器目录(在这里是/ code)。 它只相当于您从主机复制到容器的cp命令。 在docker-compose.yml : volumes: ...
  • 对于本地开发,安装app dir并在容器中运行它是有意义的。 但是对于生产我总是把所有东西放在容器里。 否则它只是凌乱。 从宝石更新开始等等。 如果您首先添加Gemfile并运行bundle update,然后添加应用程序文件,您将拥有一个非常精简的构建过程,只需很短的时间进行更新。 结合一些自动化,它不应该是生产应用程序的问题。 Gems只会在Gemfile更改时更新。 示例Dockerfile: # everything else ADD Gemfile* $APP/ ENV BUNDLE_GEMFI ...
  • 您正在将当前目录添加到图像内的/wordpress 。 因此,Wordpress文件的位置在/wordpress/wordpress 。 如果您使用/wordpress的文档根启动PHP,那么您将需要导航到http://192.168.99.100:8000/wordpress 。 You are adding the current directory to /wordpress inside the image. So, the location of the Wordpress files is at ...
  • 怎么了,本! 您的问题与Docker引入的名为entrypoint的概念有关。 它通常是在运行容器时执行的脚本,包含需要在运行时运行的操作,而不是构建时。 运行映像后立即运行该脚本。 它们用于使容器表现得像服务一样。 默认情况下,使用CMD指令设置的参数是直接传递给入口点的参数,并且可以被覆盖。 你可以在这里找到你所拉图像的Dockerfile的debian模板。 如您所见,它调用名为docker-entrypoint.sh的入口docker-entrypoint.sh 。 由于我不想过多地涉及它,基本上, ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。