2015-02-09 1 views
0

Я пытаюсь подписаться на Notification Service и потребительские сигналы, похожие на (org.omg.CORBA.MARSHAL: Server-side Exception: null) !, но получение сортировки ошибки. Огромное спасибо, если кто-то может помочь мне с тем, что мне не хватает или что-то не так.CORBA Уведомление о подписке (ОШИБКА: org.omg.CORBA.MARSHAL: vmcid: 0x0 minor code: 0 завершено: нет)

Файлы idls от NotificationIRP idls и использование jacorb-3.5 api.

NotificationConsumer.java

import org.omg.CORBA.*; 
import org.omg.CORBA.ORB; 
import org.omg.CosNotification.*; 
import org.omg.CosNotifyComm.*; 
import org.omg.CosNotifyChannelAdmin.*; 
import org.omg.CosNotifyFilter.*; 
import org.omg.CosNaming.*; 
import org.omg.PortableServer.*; 

import NotificationIRPSystem.*; 
//import AlarmIRPSystem.*; 
import java.io.*; 

public class NotificationConsumer { 

    private static String notifIRPName = "com/ericsson/nms/cif/service/NMSNAConsumer"; 
    private static String notifIRPPortal = "com/ericsson/nms/cif/service/NMSNAPortal"; 

    public static void main(String args[]) throws IOException { 
    try{ 
    //initialize ORB 
    org.omg.CORBA.ORB orb = ORB.init(args, null); 

    //read stringified object from file 
    FileReader fr = new FileReader("ExternalNamingService.1"); 
    BufferedReader br = new BufferedReader(fr); 
    String ior = br.readLine(); 
    org.omg.CORBA.Object obj = orb.string_to_object(ior); 

    NamingContextExt ncRef = NamingContextExtHelper.narrow(obj); 
    org.omg.CORBA.Object notiObj = ncRef.resolve_str(notifIRPName); 

    //get notification operations object 
    NotificationIRPOperations nOps = NotificationIRPOperationsHelper.narrow(notiObj); 
    System.out.println("NOTIFICATION|" + nOps); 

    //activate poa manager 
    IRPManager iManager = new IRPManager(); 
    POA poa = POAHelper.narrow(orb.resolve_initial_references("RootPOA")); 
    poa.the_POAManager().activate(); 
    org.omg.CORBA.Object notiServerObj = poa.servant_to_reference(iManager); 

    //subscribe to notifications 
    String manager_reference = orb.object_to_string(notiServerObj); 
    System.out.println("MANAGER REF|" + manager_reference); 
    int time_tick = 15; 
    String filter = ""; 
    String[] asd = {}; 
    NotificationIRPConstDefs.EventTypesSetHolder e_list = new NotificationIRPConstDefs.EventTypesSetHolder(); 
    NotificationIRPConstDefs.ExtendedEventTypesSetHolder ex_list = new NotificationIRPConstDefs.ExtendedEventTypesSetHolder(); 
    String cats[] = nOps.get_notification_categories(e_list, ex_list); 

    String vers[] = nOps.get_notification_IRP_version(); 
    for (String ver : vers){ 
    System.out.println("notification IRP version is: " + ver); 
    } 

    String resp = nOps.attach_push(manager_reference, time_tick, cats, filter); 

    //print subscription ids 
    String subs[] = nOps.get_subscription_ids(manager_reference); 
    for (String sub : subs){ 
    System.out.println("subscription id: "+sub); 
    } 

    } catch (Exception ex){ 
    System.out.println ("ERROR: " + ex); 
} 

}}

Результат

NOTIFICATION|IOR:000000000000004449444c3a336770707361352e6f72672f4e6f74696669636174696f6e49525053797374656d2f4e6f74696669636174696f6e4952504f7065726174696f6e733a312e300000000001000000000000008c000102000000000d31302e3234372e34362e32330000c27b0000002c00504d43000000040000000c2f466163746f7279504f4100000000104e4d534e41436f6e73756d6572322e3300000003564953030000000500070801ff000000000000000000000800000000564953000000000100000018000000000001000100000001050100010001010900000000 
MANAGER REF|IOR:000000000000003349444c3a6f6d672e6f72672f436f734e6f74696679436f6d6d2f53657175656e636550757368436f6e73756d65723a312e30000000000001000000000000008a000102000000000f31302e3136312e3133302e3131300000b0b8000000000031afabcb00000000206c4ce5e000000001000000000000000100000008526f6f74504f410000000008000000010000000014000000000000020000000100000020000000000001000100000002050100010001002000010109000000010001010000000026000000020002 
notification IRP version is: 1n1 
ERROR: org.omg.CORBA.MARSHAL: vmcid: 0x0 minor code: 0 completed: No 
org.omg.CORBA.MARSHAL: vmcid: 0x0 minor code: 0 completed: No 
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) 
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) 
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526) 
    at java.lang.Class.newInstance(Class.java:379) 
    at com.sun.corba.se.impl.protocol.giopmsgheaders.MessageBase.getSystemException(MessageBase.java:916) 
    at com.sun.corba.se.impl.protocol.giopmsgheaders.ReplyMessage_1_2.getSystemException(ReplyMessage_1_2.java:116) 
    at com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl.getSystemExceptionReply(CorbaMessageMediatorImpl.java:590) 
    at com.sun.corba.se.impl.protocol.CorbaClientRequestDispatcherImpl.processResponse(CorbaClientRequestDispatcherImpl.java:489) 
    at com.sun.corba.se.impl.protocol.CorbaClientRequestDispatcherImpl.marshalingComplete(CorbaClientRequestDispatcherImpl.java:373) 
    at com.sun.corba.se.impl.protocol.CorbaClientDelegateImpl.invoke(CorbaClientDelegateImpl.java:147) 
    at org.omg.CORBA.portable.ObjectImpl._invoke(ObjectImpl.java:475) 
    at NotificationIRPSystem._NotificationIRPOperationsStub.attach_push(_NotificationIRPOperationsStub.java:26) 
    at NotificationConsumer.main(NotificationConsumer.java:59) 

_NotificationIRPOperationsStub.attach_push, где произошла ошибка ($ в = _invoke ($ уходит) ;)

/** 
    * NotificationIRPSystem/_NotificationIRPOperationsStub.java . 
    * Generated by the IDL-to-Java compiler (portable), version "3.2" 
    * from NotificationIRPSystem.idl 
    * Wednesday, 4 February 2015 3:49:56 PM EST 
    */ 

    public class _NotificationIRPOperationsStub extends org.omg.CORBA.portable.ObjectImpl implements NotificationIRPSystem.NotificationIRPOperations 
    { 
    /* ## Operation: attach_push 
    */ 
    public String attach_push (String manager_reference, int time_tick, String[] notification_category_set, String filter) throws NotificationIRPSystem.Attach, NotificationIRPSystem.ParameterNotSupported, NotificationIRPSystem.InvalidParameter, NotificationIRPSystem.AlreadySubscribed, NotificationIRPSystem.AtLeastOneNotificationCategoryNotSupported 
    { 
      org.omg.CORBA.portable.InputStream $in = null; 
      try { 
       org.omg.CORBA.portable.OutputStream $out = _request ("attach_push", true); 
       $out.write_string (manager_reference); 
       $out.write_long (time_tick); 
       NotificationIRPConstDefs.NotificationCategorySetHelper.write ($out, notification_category_set); 
       $out.write_string (filter); 
       $in = _invoke ($out); 
       String $result = NotificationIRPConstDefs.SubscriptionIdHelper.read ($in); 
       return $result; 
      } catch (org.omg.CORBA.portable.ApplicationException $ex) { 
      $in = $ex.getInputStream(); 
      String _id = $ex.getId(); 
       if (_id.equals ("IDL:3gppsa5.org/NotificationIRPSystem/Attach:1.0")) 
       throw NotificationIRPSystem.AttachHelper.read ($in); 
       else if (_id.equals ("IDL:3gppsa5.org/NotificationIRPSystem/ParameterNotSupported:1.0")) 
        throw NotificationIRPSystem.ParameterNotSupportedHelper.read ($in); 
       else if (_id.equals ("IDL:3gppsa5.org/NotificationIRPSystem/InvalidParameter:1.0")) 
        throw NotificationIRPSystem.InvalidParameterHelper.read ($in); 
       else if (_id.equals ("IDL:3gppsa5.org/NotificationIRPSystem/AlreadySubscribed:1.0")) 
        throw NotificationIRPSystem.AlreadySubscribedHelper.read ($in); 
       else if (_id.equals ("IDL:3gppsa5.org/NotificationIRPSystem/AtLeastOneNotificationCategoryNotSupported:1.0")) 
        throw NotificationIRPSystem.AtLeastOneNotificationCategoryNotSupportedHelper.read ($in); 
       else 
        throw new org.omg.CORBA.MARSHAL (_id); 
      } catch (org.omg.CORBA.portable.RemarshalException $rm) { 
       return attach_push (manager_reference, time_tick, notification_category_set, filter  ); 
      } finally { 
       _releaseReply ($in); 
      } 
    } // attach_push 

ответ

0

Проблемы я думаю, здесь вам нужно будет добавить еще до регистратора вы используете именование службы в новом CORBA сразу после orb.init(). Когда вы передаете какой-либо объект с помощью orb, он пытается проверить, зарегистрирован ли он с какой-либо службой. иначе он начинает маршалинг данных. Я просматриваю ваш код, который попытается найти решение в ближайшее время

+0

Это было бы здорово, если бы вы могли понять, что случилось с моим объектом обратного вызова. большое спасибо – user2326017

0

Вы поняли это? Я пытаюсь сделать то же самое, чтобы подключиться к интерфейсу Ericsson Corba по северу, но в Perl, а не на Java.

Вы отправляете неправильные объекты attach_push(), типы объектов должны быть точно:

  • manager_reference: простая строка,
  • time_tick: ManagedGenericIRPConstDefs :: UnsignedLongOpt, не Int, как в вашем коде !
  • кошки: УведомлениеИнструмент: NotificationCategorySet, не строковый массив.
  • фильтр: ManagedGenericIRPConstDefs :: StringOpt, не строка.

Кроме того, вы пытаетесь отправить все категории у кошек, но это включает в себя события и качество обслуживания. Для событий вам нужно использовать собственные EventIRP вместо NotificationIRPSystem и qos, которые вам, вероятно, не нужны. Для сигналов тревоги вы можете использовать только одну категорию «1f1». В Perl это делается следующим образом:

my $category_set=NotificationIRPConstDefs::NotificationCategorySetOpt->new(); 
$category_set->value(["1f1"]); 

Постарайтесь выяснить то же самое на Java. Это еще не работает для меня, работа еще продолжается ...

Смежные вопросы