12 Replies Latest reply on Apr 2, 2013 2:00 AM by nickarls

    Some error message about remoting

    xin.zhang.song

      Hi All

       

      There are some errors in my log file when I lookup the jndi. any comment for it?

      My JBoss version is JBoss 7.1.1final

          ![java] ERROR: Failed to open channel for context EJBReceiverContext{clientContext=org.jboss.ejb.client.EJBClientContext@1e75e08, receiver=Remoting connection EJB receiver [connection=Remoting connection <6782a9>,channel=jboss.ejb,nodename=094edb8502c94aa]}
          ![java] org.jboss.remoting3.ProtocolException: Too many channels open
           [java] at org.jboss.remoting3.remote.RemoteConnectionHandler.handleOutboundChannelOpen(RemoteConnectionHandler.java:177)
           [java] at org.jboss.remoting3.remote.RemoteConnectionHandler.open(RemoteConnectionHandler.java:307)
           [java] at org.jboss.remoting3.ConnectionImpl.openChannel(ConnectionImpl.java:75)
           [java] at org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver.associate(RemotingConnectionEJBReceiver.java:126)
           [java] at org.jboss.ejb.client.EJBClientContext.registerEJBReceiver(EJBClientContext.java:297)
           [java] at org.jboss.ejb.client.EJBClientContext.registerEJBReceiver(EJBClientContext.java:252)
           [java] at org.jboss.ejb.client.EJBClientContext.registerConnection(EJBClientContext.java:342)
           [java] at org.jboss.naming.remote.client.ejb.RemoteNamingEjbClientContextSelector.setCurrent(RemoteNamingEjbClientContextSelector.java:25)
           [java] at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
           [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           [java] at java.lang.reflect.Method.invoke(Method.java:597)
           [java] at org.jboss.naming.remote.client.InitialContextFactory.setupEjbContext(InitialContextFactory.java:425)
           [java] at org.jboss.naming.remote.client.InitialContextFactory.getInitialContext(InitialContextFactory.java:115)
           [java] at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
           [java] at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
           [java] at javax.naming.InitialContext.init(InitialContext.java:223)
           [java] at javax.naming.InitialContext.<init>(InitialContext.java:197)
           [java] at com.broadvision.sysconf.ServiceAgent._sync_newJndiContextPi(ServiceAgent.java:526)
           [java] at com.broadvision.sysconf.ServiceAgent.newJndiContextPi(ServiceAgent.java:502)
           [java] at com.broadvision.sysconf.ServiceAgent._sync_getBVJndiContextByResource(ServiceAgent.java:365)
           [java] at com.broadvision.sysconf.ServiceAgent.getBVJndiContextByResource(ServiceAgent.java:343)
           [java] at com.broadvision.sysconf.ServiceAgent._sync_getBVAppServerResource(ServiceAgent.java:1010)
           [java] at com.broadvision.sysconf.ServiceAgent.getBVAppServerResource(ServiceAgent.java:984)
           [java] at com.broadvision.data.message.MsgReceiver.subscriberInstance(MsgReceiver.java:385)
           [java] at com.broadvision.data.message.MsgReceiver.registerMessageContext(MsgReceiver.java:170)
           [java] at com.broadvision.data.webcache.WebCacheManager.init(WebCacheManager.java:193)
           [java] at com.broadvision.data.webcache.WebCacheManager.getWebCacheManager(WebCacheManager.java:96)
           [java] at com.broadvision.system.accesscontrol.client.GenericRoleDBContentImpl.appendPermissionList(GenericRoleDBContentImpl.java:622)
           [java] at com.broadvision.system.accesscontrol.client.AdminRole.appendPermissionList(AdminRole.java:219)
           [java] at com.broadvision.system.accesscontrol.schema.ACLPolicy.processRegistryAndPolicy(ACLPolicy.java:547)
           [java] at com.broadvision.system.accesscontrol.schema.ACLPolicy.processSections(ACLPolicy.java:268)
           [java] at com.broadvision.system.accesscontrol.schema.ACLPolicy.parse(ACLPolicy.java:190)
           [java] at com.broadvision.system.accesscontrol.schema.ACLPolicy.initialize(ACLPolicy.java:148)
           [java] at com.broadvision.system.accesscontrol.schema.ACLPolicy.<init>(ACLPolicy.java:128)
           [java] at com.broadvision.system.accesscontrol.schema.ACLPolicy.main(ACLPolicy.java:102)
      
      

       

      Thanks

       

      Xin

        • 1. Re: Some error message about remoting
          nickarls

          org.jboss.remoting3.ProtocolException: Too many channels open

           

          Looks like some sort of resource starvation. Something not being closed?

          • 2. Re: Some error message about remoting
            xin.zhang.song

            How can I close this thing or increase the number of things?

             

            Thanks

             

            Xin

            • 3. Re: Some error message about remoting
              nickarls

              If -Djboss.thing.maxlimit=1000 doesn't help (which it won't) I suggest you paste some code here.

              • 4. Re: Some error message about remoting
                xin.zhang.song

                In my code, There are too many times to look up the EJB.

                 

                So I think it will caused this issue.

                 

                Thanks

                 

                Xin

                • 5. Re: Some error message about remoting
                  xin.zhang.song

                  How can I close the remote connection ?

                   

                  Thanks

                   

                  Xin

                  • 6. Re: Some error message about remoting
                    nickarls

                    Hard to say without seeing the related code.

                    • 7. Re: Some error message about remoting
                      als

                      Shouldnt the connection be closed when you close the InitialContext object?where is the parameter of maximum open channel number in standalone.xml?

                      • 8. Re: Some error message about remoting
                        jaikiran

                        That looks like this bug https://issues.jboss.org/browse/AS7-3884

                         

                        Edit: Didn't realize this was 3 month old thread.

                        • 9. Re: Some error message about remoting
                          als

                          they said in this bug its fixed in 7.1.1 Final which was released at March 2012.And the thread is from 3 month from now. We saw the similar issues at 7.1.1 final. So question is- when I am closing InitialContext - should this kill the connection? Where is the parameter of maximum allowed number of channels in standalone.xml

                          • 10. Re: Some error message about remoting
                            jaikiran

                            What does your code look like? What kind of lookups are you doing? Are you using remote naming project?

                            • 11. Re: Some error message about remoting
                              als

                              here is some piece of pseudocode doing exactly what my real code does. should the initialcontext.close() to close the connection?

                              jndiProperties.put(Context.INITIAL_CONTEXT_FACTORY,                                        "org.jboss.naming.remote.client.InitialContextFactory");

                                jndiProperties.put(Context.SECURITY_PRINCIPAL, "user");

                                                  jndiProperties.put(Context.SECURITY_CREDENTIALS, "pass");

                              jndiProperties.put(Context.URL_PKG_PREFIXES,                                        "org.jboss.ejb.client.naming");

                              jndiProperties.put(Context.PROVIDER_URL, "remote://localhost:4447");

                              jndiProperties.put("jboss.naming.client.ejb.context", true);

                                                  jndiProperties

                                                                      .put("jboss.naming.client.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT",

                                                                                          "false");

                               

                               

                                          try {

                               

                                                             if (context!=null)

                                                             {          

                                                             context.close();

                                System.out.println("Trying to connect to "+(String)jndiProperties.get(Context.PROVIDER_URL));

                                                            

                                                             }

                                   context = new InitialContext(jndiProperties);

                                   XRemote m = (XRemote) context.lookup("ejb:" + appName + "/"

                                                                                + moduleName + "/" + distinctName + "/" + beanName + "!"

                                                                                + viewClassName);

                                }catch (Throwable t)

                                                            {

                                                                      context=null;

                                 }

                              • 12. Re: Some error message about remoting
                                nickarls

                                How about a plain

                                 

                                try {

                                   // create context

                                } finally {

                                  // close context

                                }

                                 

                                Closing on next request sounds a bit strange. And the null assignment in the catch block is not guaranteed to do any good.