glassfish
  1. glassfish
  2. GLASSFISH-20638

Java EE 7 JMS definitions on GlassFish 4 are not created

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Invalid
    • Affects Version/s: 4.0_b89_RC5
    • Fix Version/s: None
    • Component/s: jms
    • Labels:
      None
    • Environment:

      mac osx

      Description

      Hi,

      this does not do anything , I had to create these jms artifacts manually in the admin console.

      @JMSConnectionFactoryDefinition(
      name = "MyConnectionFactory2",
      maxPoolSize = 30,
      minPoolSize = 20,
      properties = {
      "addressList=mq://localhost:7676",
      "reconnectEnabled=true"
      })
      @JMSDestinationDefinition(
      name = "DemoQueue2",
      interfaceName = "javax.jms.Queue",
      destinationName="DemoQueue2",
      description="My Demo Queue")

        Activity

        Hide
        biemond added a comment -

        Hi,

        I resolved it. When you use this "MyConnectionFactory2" as name , you can't find it in the java:comp, java:module, java:app, java:global jndi tree

        @JMSConnectionFactoryDefinition(
        name = "MyConnectionFactory2",
        maxPoolSize = 30,
        minPoolSize = 20,
        properties =

        { "addressList=mq://localhost:7676", "reconnectEnabled=true" }

        )

        So change it to

        @JMSConnectionFactoryDefinition(
        name = "java:global/jms/MyConnectionFactory2",
        maxPoolSize = 30,
        minPoolSize = 20,
        properties =

        { "addressList=mq://localhost:7676", "reconnectEnabled=true" }

        )

        and do a lookup

        @Inject
        @JMSConnectionFactory("java:global/jms/MyConnectionFactory2")
        JMSContext context

        So keep them in sync ( definition and inject) and never use without java:global or java:app etc.

        Thanks Edwin

        Show
        biemond added a comment - Hi, I resolved it. When you use this "MyConnectionFactory2" as name , you can't find it in the java:comp, java:module, java:app, java:global jndi tree @JMSConnectionFactoryDefinition( name = "MyConnectionFactory2", maxPoolSize = 30, minPoolSize = 20, properties = { "addressList=mq://localhost:7676", "reconnectEnabled=true" } ) So change it to @JMSConnectionFactoryDefinition( name = "java:global/jms/MyConnectionFactory2", maxPoolSize = 30, minPoolSize = 20, properties = { "addressList=mq://localhost:7676", "reconnectEnabled=true" } ) and do a lookup @Inject @JMSConnectionFactory("java:global/jms/MyConnectionFactory2") JMSContext context So keep them in sync ( definition and inject) and never use without java:global or java:app etc. Thanks Edwin
        Hide
        David Zhao added a comment - - edited

        biemond,

        Can you elaborate what do you mean 'this does not do anything'?

        According to EE7 spec EE.5.18.5, the JMS Connection Factory and Destination resources may be defined in any of the JNDI namespaces described in Section EE.5.2.2, "Application Component Environment Namespaces".

        for example, the name should be declared with namespaces:

        java:comp
        java:module
        java:app
        java:global

        By default, if environment entries declared without namespace, those will be created in the java:comp/env namespace.

        So if you have the following definition, you can look it up from JNDI by "java:comp/env/MyConnectionFactory2".

        @JMSConnectionFactoryDefinition(
        name = "MyConnectionFactory2",
        maxPoolSize = 30,
        minPoolSize = 20,
        properties =

        { "addressList=mq://localhost:7676", "reconnectEnabled=true" }

        )

        BTW, please note that resources created by annotations will not show up in the admin console, they are only available in JNDI at runtime.

        Show
        David Zhao added a comment - - edited biemond, Can you elaborate what do you mean 'this does not do anything'? According to EE7 spec EE.5.18.5, the JMS Connection Factory and Destination resources may be defined in any of the JNDI namespaces described in Section EE.5.2.2, "Application Component Environment Namespaces". for example, the name should be declared with namespaces: java:comp java:module java:app java:global By default, if environment entries declared without namespace, those will be created in the java:comp/env namespace. So if you have the following definition, you can look it up from JNDI by "java:comp/env/MyConnectionFactory2". @JMSConnectionFactoryDefinition( name = "MyConnectionFactory2", maxPoolSize = 30, minPoolSize = 20, properties = { "addressList=mq://localhost:7676", "reconnectEnabled=true" } ) BTW, please note that resources created by annotations will not show up in the admin console, they are only available in JNDI at runtime.

          People

          • Assignee:
            David Zhao
            Reporter:
            biemond
          • Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: