diff --git a/nevado-jms/src/main/java/org/skyscreamer/nevado/jms/resource/NevadoReferencableFactory.java b/nevado-jms/src/main/java/org/skyscreamer/nevado/jms/resource/NevadoReferencableFactory.java index 075defc..c8a7d2c 100644 --- a/nevado-jms/src/main/java/org/skyscreamer/nevado/jms/resource/NevadoReferencableFactory.java +++ b/nevado-jms/src/main/java/org/skyscreamer/nevado/jms/resource/NevadoReferencableFactory.java @@ -78,10 +78,18 @@ public Object getObjectInstance(Object obj, Name name, Context ctx, Hashtable en instance = connectionFactory; } else if (ref.getClassName().equals(NevadoQueue.class.getName())) { - instance = new NevadoQueue(getRefContent(ref, NevadoDestination.JNDI_DESTINATION_NAME)); + String destinationName = getRefContent(ref, NevadoDestination.JNDI_DESTINATION_NAME); + if (destinationName == null) { + destinationName = name.toString(); + } + instance = new NevadoQueue(destinationName); } else if (ref.getClassName().equals(NevadoTopic.class.getName())) { - instance = new NevadoTopic(getRefContent(ref, NevadoDestination.JNDI_DESTINATION_NAME)); + String destinationName = getRefContent(ref, NevadoDestination.JNDI_DESTINATION_NAME); + if (destinationName == null) { + destinationName = name.toString(); + } + instance = new NevadoTopic(destinationName); } else { throw new IllegalArgumentException("This factory does not support objects of type "