1 2 Previous Next 21 Replies Latest reply on Jan 6, 2015 8:51 AM by myakkali Go to original post
      • 15. Re: Cant connect from EJB Client to EJB in JBOSS AS 7.1.0 Final
        vatsanm

        Wolf-Dieter,

             Should I not see teh authentication rejection in logs?  If not, can I request it to be added. It would have help me out a whole lot if I could see the error in some log.  I didnt see anythign in boot or server or console logs.

        • 16. Re: Cant connect from EJB Client to EJB in JBOSS AS 7.1.0 Final
          jaikiran

          The https://docs.jboss.org/author/display/AS71/EJB+invocations+from+a+remote+server+instance article has been updated to include details about security configuration when dealing with a server to server EJB invocations.

          • 17. Re: Cant connect from EJB Client to EJB in JBOSS AS 7.1.0 Final
            jamesviet

               m_properties.put("remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED", "false");
               m_properties.put("remote.connections", "192.168.95.22,192.168.95.23");

               m_properties.put("remote.connection.192.168.95.22.host", "192.168.95.22");
               m_properties.put("remote.connection.192.168.95.22.port", "4447");
               m_properties.put("remote.connection.192.168.95.22.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS", "false");

               m_properties.put("remote.connection.192.168.95.23.host", "192.168.95.23");
               m_properties.put("remote.connection.192.168.95.23.port", "4447");
               m_properties.put("remote.connection.192.168.95.23.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS", "false");*/

            And use

            EJBClientConfiguration clientConfiguration = new PropertiesBasedEJBClientConfiguration(
            EJBUtils.createClientConfigurationProperties());
            ContextSelector<EJBClientContext> contextSelector = new ConfigBasedEJBClientContextSelector(clientConfiguration);
            EJBClientContext.setSelector(contextSelector);
                       
                        Properties props = new Properties();
                        props.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
                        props.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.as.naming.InitialContextFactory");

             

                        Context context = new InitialContext(props);

                        ...          

                         MyBean bean = (MyBean) context.lookup(lookupName);

            I can lookup Bean successfully.

             

            But when I move to use jboss-ejb-client.properties, I put this file in my app when deploy.

             

            And configure my jboss-ejb-client.xml, standalond.xml,... all things look like you above.

            But when I get bean,

             

                       Properties props = new Properties();
                        // setup the ejb: namespace URL factory
                        props.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
                        props.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.as.naming.InitialContextFactory");
                        Context context = new InitialContext(props);
                        String lookupName = EJBUtils.getEJBName();
                        System.out.println(lookupName);
                        MyBean bean = (MyBean  context.lookup(lookupName);

            it throws error:

            Aug 16, 2013 3:10:10 PM org.jboss.ejb.client.EJBClient <clinit>
            INFO: JBoss EJB Client version 1.0.5.Final
            Exception in thread "main" java.lang.RuntimeException: java.lang.IllegalStateException: No EJB receiver available for handling [appName:,modulename:jboss7-server-demo-app-1.0-SNAPSHOT.sar,distinctname:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@722a20ec
                at com.alcatel.axs.jboss7.demo.client.EJBAppClientTest.test2(EJBAppClientTest.java:68)
                at com.alcatel.axs.jboss7.demo.client.EJBAppClientTest.main(EJBAppClientTest.java:73)
            Caused by: java.lang.IllegalStateException: No EJB receiver available for handling [appName:,modulename:jboss7-server-demo-app-1.0-SNAPSHOT.sar,distinctname:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@722a20ec
                at org.jboss.ejb.client.EJBClientContext.requireEJBReceiver(EJBClientContext.java:584)
                at org.jboss.ejb.client.ReceiverInterceptor.handleInvocation(ReceiverInterceptor.java:119)
                at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:181)
                at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:136)
                at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:121)
                at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:104)
                at $Proxy0.print(Unknown Source)
                at com.alcatel.axs.jboss7.demo.client.EJBAppClientTest.test2(EJBAppClientTest.java:60)
                ... 1 more

            I dont know why the error happen, can you help me?

             

            Thanks,

            • 18. Re: Cant connect from EJB Client to EJB in JBOSS AS 7.1.0 Final
              vatsanm

              James

                   couple of things.

                   1.  When looking up the EJB using conext, the name has to be prefixed by "ejb:".

                   1a.  Can you print out the "lookupName"? 

                   2.  Below is my code that created the EJB lookup name:

                                 final String beanName = "MyEJBImpl"; //JB7 specific

                                 final String appName = "min";
                                 final String moduleName = "test"; //JB7 specific
                                 final String distinctName = ""; //JB7 specific

                                 final String viewClassName = com.mine.test.server.etm.MyEJBInterface.class.getName();

                                 String jndiName = "ejb:" + appName + "/" + moduleName + "/" + distinctName + "/" + beanName + "!" + viewClassName;

               

              In the stanalone.xml: I did see your standalone.xml, below is mine.

                   Under the remoting sub-section:

                             <subsystem xmlns="urn:jboss:domain:remoting:1.1">
                             <outbound-connections>
                              <remote-outbound-connection name="remote-ejb-connection" outbound-socket-binding-ref="remote-ejb1">
                                  <properties>
                                      <property name="SASL_POLICY_NOANONYMOUS" value="false"/>
                                      <property name="SSL_ENABLED" value="false"/>
                                  </properties>
                              </remote-outbound-connection>
                          </outbound-connections>
                      </subsystem>
                  Under the socket section:

                       <outbound-socket-binding name="remote-ejb1">
                          <remote-destination host="my-appl.xxx.mydomain.com" port="32010"/>
                      </outbound-socket-binding>

                  

              • 19. Re: Cant connect from EJB Client to EJB in JBOSS AS 7.1.0 Final
                myakkali

                Need help.  Having same symptom, but cant seem to fix it.

                [Server:zldv7489_Acm_01] 08:25:23,443 INFO  [stdout] (http-zldv7489.vci.att.com-135.213.35.247-7001-1) Failed to create remoting connection

                [Server:zldv7489_Acm_01] 08:25:23,445 ERROR [stderr] (http-zldv7489.vci.att.com-135.213.35.247-7001-1) javax.naming.NamingException: Failed to create remoting connection [Root exception is org.jboss.remoting3.UnknownURISchemeException: No connection provider for URI scheme "service" is installed]

                [Server:zldv7489_Acm_01] 08:25:23,446 ERROR [stderr] (http-zldv7489.vci.att.com-135.213.35.247-7001-1)  at org.jboss.naming.remote.client.ClientUtil.namingException(ClientUtil.java:36)

                [Server:zldv7489_Acm_01] 08:25:23,447 ERROR [stderr] (http-zldv7489.vci.att.com-135.213.35.247-7001-1)  at org.jboss.naming.remote.client.InitialContextFactory.getInitialContext(InitialContextFactory.java:121)

                [Server:zldv7489_Acm_01] 08:25:23,449 ERROR [stderr] (http-zldv7489.vci.att.com-135.213.35.247-7001-1)  at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:684)

                [Server:zldv7489_Acm_01] 08:25:23,450 ERROR [stderr] (http-zldv7489.vci.att.com-135.213.35.247-7001-1)  at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:307)

                [Server:zldv7489_Acm_01] 08:25:23,451 ERROR [stderr] (http-zldv7489.vci.att.com-135.213.35.247-7001-1)  at javax.naming.InitialContext.init(InitialContext.java:242)

                [Server:zldv7489_Acm_01] 08:25:23,452 ERROR [stderr] (http-zldv7489.vci.att.com-135.213.35.247-7001-1)  at javax.naming.InitialContext.<init>(InitialContext.java:216)

                [Server:zldv7489_Acm_01] 08:25:23,453 ERROR [stderr] (http-zldv7489.vci.att.com-135.213.35.247-7001-1)  at com.sbc.sbcld.acmf.util.myContext.getContext(myContext.java:95)

                [Server:zldv7489_Acm_01] 08:25:23,453 ERROR [stderr] (http-zldv7489.vci.att.com-135.213.35.247-7001-1)  at com.sbc.sbcld.acmf.servlet.LoginServlet.doPost(LoginServlet.java:92)

                [Server:zldv7489_Acm_01] 08:25:23,454 ERROR [stderr] (http-zldv7489.vci.att.com-135.213.35.247-7001-1)  at com.sbc.sbcld.acmf.servlet.LoginServlet.doGet(LoginServlet.java:47)

                [Server:zldv7489_Acm_01] 08:25:23,455 ERROR [stderr] (http-zldv7489.vci.att.com-135.213.35.247-7001-1)  at javax.servlet.http.HttpServlet.service(HttpServlet.java:734)

                [Server:zldv7489_Acm_01] 08:25:23,456 ERROR [stderr] (http-zldv7489.vci.att.com-135.213.35.247-7001-1)  at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)

                [Server:zldv7489_Acm_01] 08:25:23,457 ERROR [stderr] (http-zldv7489.vci.att.com-135.213.35.247-7001-1)  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329)

                [Server:zldv7489_Acm_01] 08:25:23,458 ERROR [stderr] (http-zldv7489.vci.att.com-135.213.35.247-7001-1)  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)

                [Server:zldv7489_Acm_01] 08:25:23,459 ERROR [stderr] (http-zldv7489.vci.att.com-135.213.35.247-7001-1)  at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:840)

                [Server:zldv7489_Acm_01] 08:25:23,460 ERROR [stderr] (http-zldv7489.vci.att.com-135.213.35.247-7001-1)  at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:622)

                [Server:zldv7489_Acm_01] 08:25:23,461 ERROR [stderr] (http-zldv7489.vci.att.com-135.213.35.247-7001-1)  at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:560)

                [Server:zldv7489_Acm_01] 08:25:23,462 ERROR [stderr] (http-zldv7489.vci.att.com-135.213.35.247-7001-1)  at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:488)

                [Server:zldv7489_Acm_01] 08:25:23,463 ERROR [stderr] (http-zldv7489.vci.att.com-135.213.35.247-7001-1)  at org.apache.jsp.Acm_005flogin_005fpage_jsp._jspService(Acm_005flogin_005fpage_jsp.java:210)

                [Server:zldv7489_Acm_01] 08:25:23,464 ERROR [stderr] (http-zldv7489.vci.att.com-135.213.35.247-7001-1)  at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)

                [Server:zldv7489_Acm_01] 08:25:23,466 ERROR [stderr] (http-zldv7489.vci.att.com-135.213.35.247-7001-1)  at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)

                [Server:zldv7489_Acm_01] 08:25:23,466 ERROR [stderr] (http-zldv7489.vci.att.com-135.213.35.247-7001-1)  at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)

                [Server:zldv7489_Acm_01] 08:25:23,467 ERROR [stderr] (http-zldv7489.vci.att.com-135.213.35.247-7001-1)  at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:326)

                [Server:zldv7489_Acm_01] 08:25:23,468 ERROR [stderr] (http-zldv7489.vci.att.com-135.213.35.247-7001-1)  at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:253)

                [Server:zldv7489_Acm_01] 08:25:23,471 ERROR [stderr] (http-zldv7489.vci.att.com-135.213.35.247-7001-1)  at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)

                [Server:zldv7489_Acm_01] 08:25:23,472 ERROR [stderr] (http-zldv7489.vci.att.com-135.213.35.247-7001-1)  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329)

                [Server:zldv7489_Acm_01] 08:25:23,473 ERROR [stderr] (http-zldv7489.vci.att.com-135.213.35.247-7001-1)  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)

                [Server:zldv7489_Acm_01] 08:25:23,474 ERROR [stderr] (http-zldv7489.vci.att.com-135.213.35.247-7001-1)  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)

                [Server:zldv7489_Acm_01] 08:25:23,474 ERROR [stderr] (http-zldv7489.vci.att.com-135.213.35.247-7001-1)  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)

                [Server:zldv7489_Acm_01] 08:25:23,475 ERROR [stderr] (http-zldv7489.vci.att.com-135.213.35.247-7001-1)  at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153)

                [Server:zldv7489_Acm_01] 08:25:23,476 ERROR [stderr] (http-zldv7489.vci.att.com-135.213.35.247-7001-1)  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)

                [Server:zldv7489_Acm_01] 08:25:23,477 ERROR [stderr] (http-zldv7489.vci.att.com-135.213.35.247-7001-1)  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

                [Server:zldv7489_Acm_01] 08:25:23,478 ERROR [stderr] (http-zldv7489.vci.att.com-135.213.35.247-7001-1)  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

                [Server:zldv7489_Acm_01] 08:25:23,479 ERROR [stderr] (http-zldv7489.vci.att.com-135.213.35.247-7001-1)  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368)

                [Server:zldv7489_Acm_01] 08:25:23,480 ERROR [stderr] (http-zldv7489.vci.att.com-135.213.35.247-7001-1)  at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)

                [Server:zldv7489_Acm_01] 08:25:23,481 ERROR [stderr] (http-zldv7489.vci.att.com-135.213.35.247-7001-1)  at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671)

                [Server:zldv7489_Acm_01] 08:25:23,482 ERROR [stderr] (http-zldv7489.vci.att.com-135.213.35.247-7001-1)  at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930)

                [Server:zldv7489_Acm_01] 08:25:23,483 ERROR [stderr] (http-zldv7489.vci.att.com-135.213.35.247-7001-1)  at java.lang.Thread.run(Thread.java:744)

                [Server:zldv7489_Acm_01] 08:25:23,485 ERROR [stderr] (http-zldv7489.vci.att.com-135.213.35.247-7001-1) Caused by: org.jboss.remoting3.UnknownURISchemeException: No connection provider for URI scheme "service" is installed

                [Server:zldv7489_Acm_01] 08:25:23,486 ERROR [stderr] (http-zldv7489.vci.att.com-135.213.35.247-7001-1)  at org.jboss.remoting3.EndpointImpl.doConnect(EndpointImpl.java:265)

                [Server:zldv7489_Acm_01] 08:25:23,487 ERROR [stderr] (http-zldv7489.vci.att.com-135.213.35.247-7001-1)  at org.jboss.remoting3.EndpointImpl.doConnect(EndpointImpl.java:251)

                [Server:zldv7489_Acm_01] 08:25:23,488 ERROR [stderr] (http-zldv7489.vci.att.com-135.213.35.247-7001-1)  at org.jboss.remoting3.EndpointImpl.connect(EndpointImpl.java:349)

                [Server:zldv7489_Acm_01] 08:25:23,489 ERROR [stderr] (http-zldv7489.vci.att.com-135.213.35.247-7001-1)  at org.jboss.remoting3.EndpointImpl.connect(EndpointImpl.java:333)

                [Server:zldv7489_Acm_01] 08:25:23,489 ERROR [stderr] (http-zldv7489.vci.att.com-135.213.35.247-7001-1)  at org.jboss.naming.remote.client.EndpointCache$EndpointWrapper.connect(EndpointCache.java:105)

                [Server:zldv7489_Acm_01] 08:25:23,491 ERROR [stderr] (http-zldv7489.vci.att.com-135.213.35.247-7001-1)  at org.jboss.naming.remote.client.NamingStoreCache.getRemoteNamingStore(NamingStoreCache.java:55)

                [Server:zldv7489_Acm_01] 08:25:23,492 ERROR [stderr] (http-zldv7489.vci.att.com-135.213.35.247-7001-1)  at org.jboss.naming.remote.client.InitialContextFactory.getOrCreateCachedNamingStore(InitialContextFactory.java:166)

                [Server:zldv7489_Acm_01] 08:25:23,493 ERROR [stderr] (http-zldv7489.vci.att.com-135.213.35.247-7001-1)  at org.jboss.naming.remote.client.InitialContextFactory.getOrCreateNamingStore(InitialContextFactory.java:139)

                [Server:zldv7489_Acm_01] 08:25:23,494 ERROR [stderr] (http-zldv7489.vci.att.com-135.213.35.247-7001-1)  at org.jboss.naming.remote.client.InitialContextFactory.getInitialContext(InitialContextFactory.java:104)

                • 20. Re: Cant connect from EJB Client to EJB in JBOSS AS 7.1.0 Final
                  wdfink

                  Hello Mani,

                  welcome to the forum.

                  For your question I would recommend to create a new discussion and provide more information how your configuration and environment look like and how your invocation code look like.

                   

                  This would give us a better view what can be wrong and prevent from mixing different questions in one (long) thread.

                  • 21. Re: Cant connect from EJB Client to EJB in JBOSS AS 7.1.0 Final
                    myakkali

                    public class myContext {

                    private String INITIAL_CONTEXT_FACTORY = null;

                    private String PROVIDER_URL = null;

                     

                    public myContext() {

                    ContextLoader ctxLoader = new ContextLoader();

                    setInitialContextFactory(ctxLoader.getACMFProperty("INITIAL_CONTEXT_FACTORY"));

                    setProviderUrl(PROVIDER_URL = ctxLoader.getACMFProperty("PROVIDER_URL"));

                    System.out.println("in myContext() INITIAL_CONTEXT_FACTORY :

                    "+ctxLoader.getACMFProperty("INITIAL_CONTEXT_FACTORY"));

                    System.out.println("in myContext() PROVIDER_URL :

                    "+ctxLoader.getACMFProperty("PROVIDER_URL"));

                     

                    }

                     

                    public void setInitialContextFactory(String InitialContextFactory) {

                    INITIAL_CONTEXT_FACTORY = InitialContextFactory;

                    }

                     

                    public String getInitialContextFactory() {

                    return INITIAL_CONTEXT_FACTORY;

                    }

                     

                    public void setProviderUrl(String ProviderUrl) {

                    PROVIDER_URL = ProviderUrl;

                    }

                     

                    public String getProviderUrl() {

                    return PROVIDER_URL;

                    }

                     

                    public Context getContext() {

                    System.out.println(" after context method mycontextfile");

                    /* Context ctx = null;

                    System.out.println("Context ctx mycontextfile");

                    Hashtable env = new Hashtable();

                    System.out.println("after hash table mycontextfile");

                    env.put(Context.INITIAL_CONTEXT_FACTORY, getInitialContextFactory());

                    System.out.println("after getInitialContextFactory mycontextfile");

                    env.put(Context.PROVIDER_URL, getProviderUrl());

                    System.out.println("after getProviderUrl mycontextfile");*/

                    Context ctx = null;

                    System.out.println("Context ctx mycontextfile");

                     

                    Hashtable env = new Hashtable();

                    System.out.println("after hash table mycontextfile");

                     

                    env.put(Context.INITIAL_CONTEXT_FACTORY, getInitialContextFactory());

                    System.out.println("after getInitialContextFactory mycontextfile 1 :

                    "+getInitialContextFactory());

                    System.out.println("after getInitialContextFactory mycontextfile 2 :

                    "+Context.INITIAL_CONTEXT_FACTORY);

                     

                    env.put(Context.PROVIDER_URL, getProviderUrl());

                    System.out.println("after getProviderUrl mycontextfile 1 :

                    "+getProviderUrl());

                    System.out.println("after getProviderUrl mycontextfile 2 :

                    "+Context.PROVIDER_URL);

                    System.out.println("Setting props");

                    //env.put("java.naming.factory.initial",

                    "org.jboss.naming.remote.client.InitialContextFactory");

                    env.put("java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory");

                    env.put(InitialContext.PROVIDER_URL, "jnp://zldv7569.vci.vgu.com:8080/");

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

                    env.put("java.naming.factory.url.pkgs",

                    "org.jboss.naming:org.jnp.interfaces");

                    env.put(Context.SECURITY_PRINCIPAL, "a8791");

                    env.put(Context.SECURITY_CREDENTIALS, "54214");

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

                    System.out.println("Finished Setting props");

                     

                    try {

                    System.out.println("after try mycontextfile");

                            ctx = new InitialContext(env);

                    System.out.println("after ctx object mycontextfile"+ ctx);

                     

                    } catch ( Exception ctxException) {

                    System.out.println("after catch mycontextfile");

                    System.out.println(ctxException.getMessage());

                            ctxException.printStackTrace();

                     

                    }

                     

                    return ctx;

                    }

                    }

                     

                    On Sun, Jan 4, 2015 at 3:59 AM, Wolf-Dieter Fink <do-not-reply@jboss.com>

                    1 2 Previous Next