Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Messaging module + web logic = JNDI lookup error

    1.SmartClient Version: v8.2p_2012-08-27/PowerEdition Deployment (built 2012-08-27)
    2. Firefox ESR 17.0.5


    Issue:
    We are getting a JNDI lookup error when trying to configure the messaging module to work with weblogic jms:

    17:12:50.046 [jmsContainer-1] ERROR pd.logger -
    MessagingErrorEvent [getConnectionName()=Data Exchange Service, getCause()=javax.naming.NameNotFoundException: While trying to look up gui in java:comp/env.; remaining name 'gui', getID()=0, getMessage()=Failed to publish event updates to GUI clients., getTimestamp()=Wed Apr 17 17:12:50 EDT 2013, getMarker()=MESSAGING_ERROR_EVENT, getOriginatingCSU()=GUI_SERVICES_MANAGEMENT, getOriginatingHost()=app-goe-01.cec.companylabnet.net, getAffectedPDFunctionNames()=[PD GUI Services Service]]
    javax.naming.NameNotFoundException: While trying to look up gui in java:comp/env.
    at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:1139) ~[weblogic.jar:12.1.1.0]
    at weblogic.jndi.internal.ApplicationNamingNode.lookup(ApplicationNamingNode.java:143) ~[weblogic.jar:12.1.1.0]
    at weblogic.jndi.internal.WLEventContextImpl.lookup(WLEventContextImpl.java:250) ~[weblogic.jar:12.1.1.0]
    at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:406) ~[weblogic.jar:12.1.1.0]
    at weblogic.j2eeclient.java.ClientReadOnlyContextWrapper.lookup(ClientReadOnlyContextWrapper.java:35) ~[weblogic.jar:12.1.1.0]
    at com.isomorphic.messaging.JMSMessageDispatcher.reconnect(JMSMessageDispatcher.java:78) ~[isomorphic_realtime_messaging.jar:na]
    at com.isomorphic.messaging.JMSMessageDispatcher.ensureConnected(JMSMessageDispatcher.java:100) ~[isomorphic_realtime_messaging.jar:na]
    at com.isomorphic.messaging.JMSMessageDispatcher.deliver(JMSMessageDispatcher.java:197) ~[isomorphic_realtime_messaging.jar:na]
    at com.isomorphic.messaging.ISCMessageDispatcher.send(ISCMessageDispatcher.java:183) ~[isomorphic_realtime_messaging.jar:na]
    at goesr.gs.pd.pdd.userinterface.server.EventsSubscriptionCallback.onReceive(EventsSubscriptionCallback.java:88) [_wl_cls_gen.jar:na]
    at goesr.gs.pd.pdd.userinterface.server.EventsSubscriptionCallback.onReceive(EventsSubscriptionCallback.java:40) [_wl_cls_gen.jar:na]
    at goesr.gs.pd.pdd.cls.des.SubscriptionManager.provideDataToSubscribers(SubscriptionManager.java:258) [pdd-cls-des.jar:na]
    at goesr.gs.pd.pdd.cls.des.SubscriptionManager.provideDataToSubscribers(SubscriptionManager.java:235) [pdd-cls-des.jar:na]
    at goesr.gs.pd.pdd.cls.des.SubscriptionManager.distributeToSubscribers(SubscriptionManager.java:168) [pdd-cls-des.jar:na]
    at goesr.gs.pd.pdd.cls.des.JmsSubscriber.onMessage(JmsSubscriber.java:70) [pdd-cls-des.jar:na]
    at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:560) [org.springframework.jms-3.0.5.RELEASE.jar:3.0.5.RELEASE]
    at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:498) [org.springframework.jms-3.0.5.RELEASE.jar:3.0.5.RELEASE]
    at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:467) [org.springframework.jms-3.0.5.RELEASE.jar:3.0.5.RELEASE]
    at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:325) [org.springframework.jms-3.0.5.RELEASE.jar:3.0.5.RELEASE]
    at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:263) [org.springframework.jms-3.0.5.RELEASE.jar:3.0.5.RELEASE]
    at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1058) [org.springframework.jms-3.0.5.RELEASE.jar:3.0.5.RELEASE]
    at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1050) [org.springframework.jms-3.0.5.RELEASE.jar:3.0.5.RELEASE]
    at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:947) [org.springframework.jms-3.0.5.RELEASE.jar:3.0.5.RELEASE]
    at java.lang.Thread.run(Thread.java:662) [na:1.6.0_29]

    ...the MessageListenerContainer portion at the end repeats/continues until web logic crashes. The above exception appears to be triggered when trying to send the ISCMessage object using a dispatcher.

    Primary question is: where does "comp/env" come from? Why is it attempting to get the topic name from that?

    We have tried to find more "formal" documentation on how to set this up properly but not much luck.

    #2
    java:comp/env is sort of a defacto root for JNDI naming - more detail here.

    Basically this error means that the JNDI name of your JMS topic configured in WebLogic is not the same as the JNDI name you provided to the Messaging module.

    Comment


      #3
      Is there some extra data I need to include in the channel in order to make this work with weblogic? The JNDI name in weblogic is gui.messaging. In my server.properties, I have a JNDI prefix of gui, which seems to work for the initial context lookup. So far, for for the value of my channel I have tried:

      gui.messaging
      messaging
      comp.env.gui.messaging
      SmartGWT!gui.messaging ( I read in another forum post that some versions of weblogic include the Module name in this way)

      I also read that sometimes the topic name in the weblogic configuration needs to match the JNDI name, so I tried changing that too. So far, no luck.

      Checking on the JNDI tree for the server, I definitely see gui.messaging.


      relevant contents of server.properties:

      #--------------- Messaging Settings -----------------

      # how often do we send keepalives to the client (ms)
      messaging.keepaliveInterval: 3000
      # how long the client waits after the keepaliveInterval before re-establishing
      # the connection (ms)
      messaging.keepaliveReestablishDelay: 1000
      # how long the client waits for the connect handshake to complete before
      # retrying
      messaging.connectTimeout: 4000
      # connection time to live - the maximum amount of time a persistent connection
      # is allowed to stay open before being re-established (ms)
      messaging.connectionTTL: 120000
      # total response size to pad out to in order to defeat intervening
      # bufferring by proxies (bytes)
      messaging.flushBufferSize: 8096

      # dispatcher to use for user registration/message queueing
      # com.isomorphic.messaging.LocalMessageDispatcher for simple one-jvm messaging
      # com.isomorphic.messaging.JMSMessageDispatcher for JMS-backed messaging
      messaging.dispatcherImplementer: com.isomorphic.messaging.JMSMessageDispatcher

      # jms configuration - for JMSMessageDispatcher only
      jndi.messaging.java.naming.factory.initial: weblogic.jndi.WLInitialContextFactory
      jndi.messaging.java.naming.provider.url=t3://10.55.86.169:8001
      messaging.jms.context: _container_
      messaging.jms.jndiPrefix: gui
      messaging.jms.topicConnectionFactory: connectionFactory

      ----------------------------------
      We have a suspicion that the value for messaging.jms.context is probably wrong, actually though we're not sure what it should be.

      Comment


        #4
        This may seem obvious, but, it seems like the topic is "gui/messaging" but all you've provided to SmartGWT is "gui".

        Comment


          #5
          Hi, I am working on this issue as well.
          gui.messaging was on the list of things that we tried, but we've resolved this issue. The problem was, as I thought may be the case, the value of messaging.jms.context. Changing it to messaging made the server successfully publish events when I made the channel value messaging (since it uses the gui prefix from server.properties).

          However, our troubles are not over yet. The client side does not appear to be receiving the messages. I put an SC.say statement in the first line of our execute method, but it never pops up, no matter how many messages I see pushed from the server side.
          Where we subscribe looks like this:

          Code:
          Messaging.subscribe(ISC_TOPIC, new MessagingCallback()
                {
          
                   @Override
                   public void execute(Object aData)
                   {
                      ListableEvent event = (ListableEvent) aData;
                      updateEventTable(event);
                   }
          
                });
          and I have tried messaging, gui.messaging and comp.env.gui.messaging as the channel all to no avail.

          Thanks

          Comment


            #6
            Does the value of ISC_TOPIC match the topic and channel name you've declared in WebLogic?

            Comment


              #7
              I've been working on other things for a while, but I'm back. The topic in weblogic is gui.messaging, inside of a module named SmartGWT. For the value of ISC_TOPIC I have tried gui.messaging, messaging, SmartGWT!gui.messaging, comp.env.gui.messaging, comp.env.SmartGWT!gui.messaging. I used to have the prefix gui listed as the messaging.jms.jndiPrefix in server.properties, but I took that out and changed everything in the server to use the full names rather than just the part after the prefix. I then tried all the listed topics again with the change. So far the client has not created a successful connection, and it has not received any messages. The server side is publishing messages to the topic as expected.

              Comment


                #8
                It looks like in your setup the JNDI prefix should be blank. Try this:

                Code:
                messaging.jms.context: messaging
                messaging.jms.jndiPrefix:

                Comment


                  #9
                  EDIT: Just re-read the previous suggestion. I had already tried the suggested changes in my server.properties, and that is what I am using in my currently deployed version.

                  However, I did find some likely relevant information. I opened up the web console, and I see a ton of errors showing up of the form:
                  POST http://<Server>:<port>/PD_GUI_MANAGEMENT/productdistribution/sc/messaging?ts=1367869348782 [HTTP/1.1 404 Not Found]

                  I have a suspicion it's the reason I'm not seeing messages on the client side. Any idea what would cause the issue?
                  Last edited by smcdonald; 6 May 2013, 12:01.

                  Comment


                    #10
                    OH :)

                    Looks like you either do not have the Messaging servlet installed at all, or have it at the wrong URL. Check your web.xml file and see the Installation instructions and description of all the servlets for details. If you have some need to install the servlet at a non-default location, you can use setMessagingURL() to point to wherever you have it installed.

                    Comment


                      #11
                      Oh, well, that's embarrassing. Popped the messaging servlet in my web.xml and set a custom mapping to work with the system, and everything's talking happily. Thanks!

                      However, while I'm here, I suppose I can ask another question. Is there any way to add an individual piece of data to a ListGrid, rather than just using setData() to give it the entire set? I've tried a few approaches, but they've felt like hacks, and didn't work. Is there a good way to do this, or should I just keep a list of the data around?

                      Comment


                        #12
                        Well, there are a lot of scenarios that are covered by DataSource.updateCaches(), but we'd need more details about what the data is, whether this represents a change already made at the server, etc, to be able to really recommend something.

                        Comment


                          #13
                          We are receiving real time event data from our system, and the events are being forwarded to the client via the real time messenger. We just want the information to be displayed as it is received.

                          Comment


                            #14
                            We have a sample that shows an approach for this (undet Messaging) - any specific concerns with that approach?

                            Comment


                              #15
                              Yes, I've just narrowed down where it's going wrong. I'm publishing an object of type ListableEvent, defined in a shared package. When I try and convert the received message back to a ListableEvent using the JSOHelper, I'm getting an exception (Is there a good way to see a caught exception? I tried converting the stacktrace to a string and using SC.say to print it, but it just shows up as Unknown.anonymous(Unknown Source))

                              The line throwing the exception is:
                              Code:
                              ListableEvent event = (ListableEvent) JSOHelper.convertToJava((JavaScriptObject)aData);
                              If I don't catch the exception, it shows up in the web console as a ClassCastException.

                              Comment

                              Working...
                              X