- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
以下是我使用的类的摘录,它继承自 TAO 中的 PortableServer::ServantLocator 类。当调用 preinvoke() 的覆盖方法时,如果 servant 为 NULL(在此实例之前已被销毁),我将抛出 CORBA::OBJECT_NOT_EXIST() 异常,如下所示
class Locator : public PortableServer::ServantLocator {
public:
PortableServer::Servant preinvoke(
const PortableServer::ObjectId& oid,
PortableServer::POA_ptr adapter,
const char * operation,
Cookie& cookie ) throw ()
{
.
.
.// retrieve servant
.
if (servant == NULL) {
//return NULL;
throw CORBA::OBJECT_NOT_EXIST ();
}
return servant;
}
};
但这会使进程崩溃并产生以下核心转储
[1] __exdbg_notify_of_unexpected(0xfffffc7ffad91640, 0x1, 0xfffffc7ffb849200, 0xfffffc7ffce202e0, 0x18, 0x101010101010101), at 0xfffffc7ffce07f90
[2] __Crun::ex_chk_unexpected(0x0, 0x0, 0x0, 0x0, 0x0, 0x0), at 0xfffffc7ffce09234
[3] Locator::preinvoke(this = 0x7c77f0, oid = CLASS, adapter = 0xdcf538, operation = 0xfffffc7ffad92740 "nextData", cookie = (nil)), line 238 in "locator.cpp"
[4] TAO::Portable_Server::RequestProcessingStrategyServantLocator::locate_servant(0x0, 0x0, 0x0, 0x0, 0x0, 0x0), at 0xfffffc7ffd7521d2
为什么 TAO 库没有捕捉到我抛出的异常?我为此做了很多谷歌搜索,但找不到任何解决方案。我引用例子here抛出这个异常.我还尝试返回 NULL,希望 TAO 中调用函数 RequestProcessingStrategyServantLocator::locate_servant() 的 NULL 指针异常检查能够处理它。即使那样,我也会得到相同的核心转储。
我的另一个问题是,如果我已经销毁了仆人并删除了它的引用,为什么 TAO 首先调用 preinvoke()。谁能给我一个很好的例子,说明如何删除 this 引用,这样 preinvoke() 就不会被调用?
编辑
我使用的是 ACE TAO 6.0.7_x86
正如@Johnny Willemsen 的回复中所建议的,我在客户端代码处捕获异常,这是调用服务器操作的地方。但它并没有在这里被捕获。代码仍然崩溃。
我的客户端代码如下所示
try
{
rs->getValue(tab.out());
}
catch (CORBA::OBJECT_NOT_EXIST& x)
{
cout << "OMG OMG ERROR: CORBA : " << x << endl;
}
最佳答案
您很可能没有在客户端代码中捕获异常,异常从服务器传回给您的客户端。在 TAO 发行版中,另请参阅 TAO/tests/On_Demand_Activation 以获取此功能的单元测试。
关于c++ - 当 PortableServer::ServantLocator preinvoke() 返回 CORBA::OBJECT_NOT_EXIST() 时处理 SIGABRT,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31608348/
我的代码在使用 malloc 时遇到问题。直到一个小时前它一直运行良好。它导致这一行 temp2 = (Temp*)malloc(sizeof(Temp));
我的应用程序运行完美,没有任何问题。但是当我尝试调试它时,android studio 卡住了。所以我收到消息“等待调试器”,然后该消息消失,接下来我在模拟器中只看到黑屏。 我也收到了消息 SIGNA
我用 node-js 和 fluent-ffmpeg 编写了一个 node-js api: 'use strict'; require('babel-register'); const path =
我只是在过去一直工作的模拟器上运行我的代码。我真正为启动代码所做的唯一一件事就是设置用户默认值 NSUserDefaults *defaults = [NSUserDefaults standard
我遇到应用程序每次运行时都会在模拟器上崩溃。由于某种原因,他们收到一个中止信号(见附件截图)。最近才开始用,不知道是不是和10.8.4升级有关。 我刚刚基于“单一 View 应用程序”模板创建了一个新
我的应用程序中存在一个错误,使我发疯!尝试隐藏navigationController工具栏后,主线程会收到SIGABRT消息。 [self.navigationController setToolb
我无法理解以下崩溃,因为它是随机发生的,并且我怀疑可能是多线程问题,但是这里是: Incident Identifier: 0BE956AB-228A-4B1B-8A3D-A99A481F7F3F C
我最近设置了 Crashlytics 以从我的 iOS 应用程序接收崩溃日志,并且我不断收到 SIGABRT 崩溃日志,但我找不到它的来源。 如果你能帮我一点,这是崩溃日志: Exception Ty
我正在尝试通过指针来理解这项工作。所以我编写了一个测试程序,其中通过删除分隔点将名称分成标签。每个标签都表示为长度/数据对,如下所示:google.ru 表示为“x\06googlex\02ru”当我
我正在研究教授给我们的一些旧课本,为即将到来的考试做准备,我遇到了这个问题。 我的任务是从结构如下的文本文件中读取信息: [十进制数字],[罗马数字(字符串)],[o 或 u(优化或未优化的罗马数字)
#toggle the string #include int main() { char S[100],ch; int i=0; gets(S); while((S[i]!
我正在开展一个学校项目,我需要从文件中获取矩阵的信息(高度、宽度、单元格状态)。像这样的事情: 30 40 /*height and width*/ 3 /*nr of lines
我学习 Swift 一段时间了,SIGABRT 信号随机出现了好几次。我尝试过一些在线教程,但似乎并不总是有效。 这次我试图用两个 View Controller 设置一个待办事项列表。一个有一个表格
我在我的项目中添加了第二个目标,以便能够对多个应用程序使用相同的 Xcode 项目(基本应用程序的风格略有变化)。我重命名了目标,更改了方案以匹配名称,还重命名了第二个 info.plist。现在,当
我试图运行一个简单的代码,它编译但当我尝试运行它时我得到(核心转储)错误。于是用gdb查看错误是什么。 代码: #include #include #include void gerar() {
我为这个问题苦苦挣扎了 2 天。我有一个解决方法,但我想了解更多会发生什么。让我们开始吧。我有一个非常原始的异常类,它保存一条错误消息作为指向字符数组的指针(我知道 std::string 的利润)。
NSString *aName = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 1)];
我正在尝试从框架动态加载类,但应用程序因转换发送 SIGABRT 信号而崩溃: let newClassType = NSClassFromString("MyFramework.CustomClas
当我运行我的应用程序时, View Controller 中会调用一个函数,当发生这种情况时,我会收到信号 SIGABRT。 如何解决这个问题? 功能: func setRootViewControl
我正在尝试保存 UISwitch 结果并使用它们来填充 Parse.com 推送通知的“ channel ”。我遵循了解析指南,但每次我尝试单击保存开关值的保存按钮时,我都会收到一个 SIGABRT。
我是一名优秀的程序员,十分优秀!