Closed lastbattle closed 7 years ago
To reproduce the error, run the following lines of code:
private static final String SENDERID = "<Enter your senderID>"; private static final String HUBNAME = "<enter your hub id>"; private static final String CONNECTION_STRING = "Endpoint=sb://bi<enter your endpoint>"; private static final NamespaceManager NAMESPACE = new NamespaceManager(CONNECTION_STRING); private static PeriodicPushNotification INSTANCE; private static NotificationHub hub; private static NotificationHubDescription hubDesc; public static PeriodicPushNotification getInstance() { if (INSTANCE == null) { INSTANCE = new PeriodicPushNotification(); try { **hub = new NotificationHub(CONNECTION_STRING, HUBNAME); // Error occurs here.** hubDesc = NAMESPACE.getNotificationHub(HUBNAME); } catch (NotificationHubsException exp) { exp.printStackTrace(); throw new RuntimeException("Error initializing notification hub."); // rethrow... cant do much about this crap } } return INSTANCE; }
Thanks for this fix!
To reproduce the error, run the following lines of code: