0
votes

CloudBees is add a new Java EE 7/Glassfish 4 Full plateform in their clickstart. If I understand correctly, this mean that it support all Java EE 7 features(contain JMS app). But when I run my JMS app, it log a error "Failed to obtain/create connection from connection pool [ jms/__defaultConnectionFactory-Connection-Pool"

This is my code, it work in my localhost:

@Named
@RequestScoped
public class ReceiverBean {

    static final Logger logger = Logger.getLogger("ReceiverBean");
    @Inject
    private JMSContext context;
    @Resource(lookup = "java:comp/jms/webappQueue")
    private Queue queue;
   .....

public void getMessage() {
        try {
            JMSConsumer receiver = context.createConsumer(queue);
            String text = receiver.receiveBody(String.class, 1000);

            if (text != null) {
                FacesMessage facesMessage =
                        new FacesMessage("Reading message: " + text);
                FacesContext.getCurrentInstance().addMessage(null, facesMessage);
            } else {
                FacesMessage facesMessage =
                        new FacesMessage("No message received after 1 second");
                FacesContext.getCurrentInstance().addMessage(null, facesMessage);
            }
        } catch (JMSRuntimeException t) {
            logger.log(Level.SEVERE,
                    "ReceiverBean.getMessage: Exception: {0}",
                    t.toString());
        }
    }

The log of glassfish in CloudBees console:

[#|2013-11-19T07:36:43.737+0000|INFO|glassfish 4.0|javax.enterprise.resource.jms.com.sun.enterprise.connectors.jms.system|_ThreadID=21;_ThreadName=http-listener-1(1);_TimeMillis=1384846603737;_LevelValue=800;_MessageID=addresslist.setjmsservice.provider;| JMS010: ADDRESSLIST in setJmsServiceProvider: mq://localhost:0/|#]

[#|2013-11-19T07:36:43.738+0000|INFO|glassfish 4.0|javax.enterprise.resource.jms.com.sun.enterprise.connectors.jms.system|_ThreadID=21;_ThreadName=http-listener-1(1);_TimeMillis=1384846603738;_LevelValue=800;_MessageID=jms.connection.url;| JMS08: JMS Service Connection URL is : mq://localhost:0/|#]

[#|2013-11-19T07:36:44.552+0000|INFO|glassfish 4.0|javax.resourceadapter.mqjmsra.lifecycle|_ThreadID=21;_ThreadName=http-listener-1(1);_TimeMillis=1384846604552;_LevelValue=800;| MQJMSRA_RA1101: GlassFish MQ JMS Resource Adapter: Version: 5.0 (Build 14-e) Compile: April 12 2013 0104|#]

[#|2013-11-19T07:36:44.559+0000|INFO|glassfish 4.0|javax.resourceadapter.mqjmsra.lifecycle|_ThreadID=21;_ThreadName=http-listener-1(1);_TimeMillis=1384846604559;_LevelValue=800;| MQJMSRA_RA1101: GlassFish MQ JMS Resource Adapter starting: broker is EMBEDDED, connection mode is Direct|#]

[#|2013-11-19T07:36:44.847+0000|INFO|glassfish 4.0|imq.log.Logger|_ThreadID=21;_ThreadName=http-listener-1(1);_TimeMillis=1384846604847;_LevelValue=800;| [B1002]: An existing property file for imqbroker was not found, no stored properties will be loaded |#]

[#|2013-11-19T07:36:45.558+0000|SEVERE|glassfish 4.0||_ThreadID=21;_ThreadName=Thread-4;_TimeMillis=1384846605558;_LevelValue=1000;| Broker exiting.|#]

[#|2013-11-19T07:36:45.562+0000|INFO|glassfish 4.0|javax.resourceadapter.mqjmsra.lifecycle|_ThreadID=21;_ThreadName=http-listener-1(1);_TimeMillis=1384846605562;_LevelValue=800;| MQJMSRA_RA1101: GlassFish MQ JMS Resource Adapter Started:EMBEDDED|#]

[#|2013-11-19T07:36:49.808+0000|WARNING|glassfish 4.0|javax.enterprise.resource.resourceadapter.com.sun.enterprise.connectors|_ThreadID=22;_ThreadName=http-listener-1(2);_TimeMillis=1384846609808;_LevelValue=900;_MessageID=poolmgr.get_connection_failure;| RAR5117 : Failed to obtain/create connection from connection pool [ jms/__defaultConnectionFactory-Connection-Pool ]. Reason : com.sun.appserv.connectors.internal.api.PoolingException|#]

[#|2013-11-19T07:36:49.811+0000|SEVERE|glassfish 4.0|SenderBean|_ThreadID=22;_ThreadName=http-listener-1(2);_TimeMillis=1384846609811;_LevelValue=1000;| SenderBean.sendMessage: Exception: com.sun.messaging.jms.MQRuntimeException: MQRA:DCF:allocation failure:createConnection:Error in allocating a connection. Cause: null|#]

Anyone could tell me why? Many thanks in advance

2

2 Answers

0
votes

CloudBees supports the web profile on the Glassfish stack, see here. JMS is only supported on the full profile, see here.

You can try the Glassfish 3 full profile here. It is a community stack.

0
votes

"Glassfish 4 Full Profile" clickstack is a work in progress, it doesn't support JMS yet, neither does it support distributed EJB or comparable JavaEE stuff.