private void processing(TextMessage msg) throws JMSException, ParseException {
       
        
        System.out.println("processing in SHSMessageBean starts...");
        String tempMsg = msg.getText();

        String[] temp = tempMsg.split("%%");
        String roomNumber = temp[0];
        String serviceType = temp[1];
        String description = temp[2];
System.out.println("this is : room Number: "+roomNumber);
        try {
            
            Query q = em.createQuery("SELECT t from ServiceEntity t");
        for (Object o : q.getResultList()) {
            ServiceEntity p = (ServiceEntity) o;
            if (p.getRooms().getRoomNumber()==Integer.parseInt(roomNumber)){
                if (p.getServiceType().equals(serviceType)) {
                    System.out.println("SERVICE: duplicated service found");
                    return;
                }
            }
        }
            
            
            createService(serviceType, description, roomNumber);
        } catch (IllegalArgumentException iae) {
            System.out.println("MessageDrivenBean1.setUpEntities: "
                    + "No entity found");
        } catch (Exception e) {
            System.out.println("MessageDrivenBean1.setUpEntities: "
                    + "em.find failed without throwing "
                    + "IllegalArgumentException");
        }
    }