1 2 Previous Next 22 Replies Latest reply on Jun 12, 2012 5:42 AM by jaikiran

    JBoss As 7 problem with jndi port

    pd.rocha

      I got a problem with jndi port on Windows Vista 64-Bit using JBoss 7.

      Using the command "netstat -na" the port 1099 doesn't appear and can not connect to it using the telnet.

      Is there any special configuration for this port run on JBoss AS 7?

      Because when I run the code below have the following error: javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused: connect]]

       

          private static final String JNDI_NAME_CALC = "java:global/primeiroejb-0.0.1-SNAPSHOT/SimpleCalculatorBean";
             
          @BeforeClass

          public static void obtainProxyReferences() throws Throwable
          {
         
           //configure appender eclipse
          BasicConfigurator.configure();

       

           Properties props = new Properties();
           props.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
           props.put(Context.URL_PKG_PREFIXES, "jboss.naming:org.jnp.interfaces");
           props.put(Context.PROVIDER_URL, "jnp://localhost:1099"); // HA-JNDI port.
          
           namingContext = new InitialContext(props);
            

             // Obtain EJB 3.1 Business Reference
             calc = (SimpleCalculatorBean) namingContext.lookup(JNDI_NAME_CALC);
          }

        • 1. Re: JBoss As 7 problem with jndi port
          peterj

          It looks like you are running a client app that is attempting to access JNDI on your local machine.

           

          How did you start the app server? (Full command line, please.)

           

          Is the app server running on your machine? If so, please post the console log for the app server.

          • 2. Re: JBoss As 7 problem with jndi port
            pd.rocha

            Peter,

             

            I'm using the app server in my computer with default configuration in standalone.xml.

            When I start the server I'm using standalone.bat

             

            The strange thing is that the JNDI port 1099 works right on my machine with JBoss 5


            Boot.log

             

            13:45:40,036 INFO  [org.jboss.modules] JBoss Modules version 1.0.1.GA

            13:45:41,166 INFO  [org.jboss.msc] JBoss MSC version 1.0.0.GA

            13:45:41,346 INFO  [org.jboss.as] JBoss AS 7.0.0.Final "Lightning" starting

            13:45:41,346 DEBUG [org.jboss.as.config] Configured system properties:

                awt.toolkit = sun.awt.windows.WToolkit

                file.encoding = Cp1252

                file.encoding.pkg = sun.io

                file.separator = \

                java.awt.graphicsenv = sun.awt.Win32GraphicsEnvironment

                java.awt.printerjob = sun.awt.windows.WPrinterJob

                java.class.path = C:\Program Files\JBoss\jboss-as-web-7.0.0.Final\jboss-modules.jar

                java.class.version = 50.0

                java.endorsed.dirs = C:\Program Files\Java\jdk1.6.0_26\jre\lib\endorsed

                java.ext.dirs = C:\Program Files\Java\jdk1.6.0_26\jre\lib\ext;C:\Windows\Sun\Java\lib\ext

                java.home = C:\Program Files\Java\jdk1.6.0_26\jre

                java.io.tmpdir = C:\Users\pedro\AppData\Local\Temp\

                java.library.path = C:\Program Files\Java\jdk1.6.0_26\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Oracle\product\11.2.0\client_1\bin;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\PHP\;C:\Program Files (x86)\Borland\Delphi7\Bin;C:\Program Files (x86)\Borland\Delphi7\Projects\Bpl\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files (x86)\CyberLink\Power2Go\;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Common Files\Microsoft Shared\Windows Live;.;C:\Program Files\Java\jdk1.6.0_26;C:\Program Files\Java\jdk1.6.0_26\bin;C:\Program Files (x86)\Apache Software Foundation\apache-maven-3.0.3\bin;C:\Program Files\JBoss\jboss-5.1.0.GA\bin;.

                java.runtime.name = Java(TM) SE Runtime Environment

                java.runtime.version = 1.6.0_26-b03

                java.specification.name = Java Platform API Specification

                java.specification.vendor = Sun Microsystems Inc.

                java.specification.version = 1.6

                java.util.logging.manager = org.jboss.logmanager.LogManager

                java.vendor = Sun Microsystems Inc.

                java.vendor.url = http://java.sun.com/

                java.vendor.url.bug = http://java.sun.com/cgi-bin/bugreport.cgi

                java.version = 1.6.0_26

                java.vm.info = mixed mode

                java.vm.name = Java HotSpot(TM) 64-Bit Server VM

                java.vm.specification.name = Java Virtual Machine Specification

                java.vm.specification.vendor = Sun Microsystems Inc.

                java.vm.specification.version = 1.0

                java.vm.vendor = Sun Microsystems Inc.

                java.vm.version = 20.1-b02

                javax.xml.datatype.DatatypeFactory = __redirected.__DatatypeFactory

                javax.xml.parsers.DocumentBuilderFactory = __redirected.__DocumentBuilderFactory

                javax.xml.parsers.SAXParserFactory = __redirected.__SAXParserFactory

                javax.xml.stream.XMLEventFactory = __redirected.__XMLEventFactory

                javax.xml.stream.XMLInputFactory = __redirected.__XMLInputFactory

                javax.xml.stream.XMLOutputFactory = __redirected.__XMLOutputFactory

                javax.xml.transform.TransformerFactory = __redirected.__TransformerFactory

                javax.xml.validation.SchemaFactory:http://www.w3.org/2001/XMLSchema = __redirected.__SchemaFactory

                javax.xml.xpath.XPathFactory:http://java.sun.com/jaxp/xpath/dom = __redirected.__XPathFactory

                jboss.home.dir = C:\Program Files\JBoss\jboss-as-web-7.0.0.Final

                jboss.host.name = pedro-pc

                jboss.modules.dir = C:\Program Files\JBoss\jboss-as-web-7.0.0.Final\modules

                jboss.modules.system.pkgs = org.jboss.byteman

                jboss.node.name = pedro-pc

                jboss.qualified.host.name = pedro-pc

                jboss.server.base.dir = C:\Program Files\JBoss\jboss-as-web-7.0.0.Final\standalone

                jboss.server.config.dir = C:\Program Files\JBoss\jboss-as-web-7.0.0.Final\standalone\configuration

                jboss.server.data.dir = C:\Program Files\JBoss\jboss-as-web-7.0.0.Final\standalone\data

                jboss.server.deploy.dir = C:\Program Files\JBoss\jboss-as-web-7.0.0.Final\standalone\data\content

                jboss.server.log.dir = C:\Program Files\JBoss\jboss-as-web-7.0.0.Final\standalone\log

                jboss.server.name = pedro-pc

                jboss.server.temp.dir = C:\Program Files\JBoss\jboss-as-web-7.0.0.Final\standalone\tmp

                line.separator =

             

                logging.configuration = file:C:\Program Files\JBoss\jboss-as-web-7.0.0.Final/standalone/configuration/logging.properties

                module.path = C:\Program Files\JBoss\jboss-as-web-7.0.0.Final\modules

                org.jboss.boot.log.file = C:\Program Files\JBoss\jboss-as-web-7.0.0.Final\standalone\log\boot.log

                org.jboss.resolver.warning = true

                org.xml.sax.driver = __redirected.__XMLReaderFactory

                os.arch = amd64

                os.name = Windows Vista

                os.version = 6.0

                path.separator = ;

                program.name = standalone.bat

                sun.arch.data.model = 64

                sun.boot.class.path = C:\Program Files\Java\jdk1.6.0_26\jre\lib\resources.jar;C:\Program Files\Java\jdk1.6.0_26\jre\lib\rt.jar;C:\Program Files\Java\jdk1.6.0_26\jre\lib\sunrsasign.jar;C:\Program Files\Java\jdk1.6.0_26\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.6.0_26\jre\lib\jce.jar;C:\Program Files\Java\jdk1.6.0_26\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.6.0_26\jre\lib\modules\jdk.boot.jar;C:\Program Files\Java\jdk1.6.0_26\jre\classes

                sun.boot.library.path = C:\Program Files\Java\jdk1.6.0_26\jre\bin

                sun.cpu.endian = little

                sun.cpu.isalist = amd64

                sun.desktop = windows

                sun.io.unicode.encoding = UnicodeLittle

                sun.java.command = C:\Program Files\JBoss\jboss-as-web-7.0.0.Final\jboss-modules.jar -mp C:\Program Files\JBoss\jboss-as-web-7.0.0.Final\modules -logmodule org.jboss.logmanager -jaxpmodule javax.xml.jaxp-provider org.jboss.as.standalone -Djboss.home.dir=C:\Program Files\JBoss\jboss-as-web-7.0.0.Final

                sun.java.launcher = SUN_STANDARD

                sun.jnu.encoding = Cp1252

                sun.management.compiler = HotSpot 64-Bit Tiered Compilers

                sun.os.patch.level = Service Pack 2

                sun.rmi.dgc.client.gcInterval = 3600000

                sun.rmi.dgc.server.gcInterval = 3600000

                user.country = BR

                user.dir = C:\Program Files\JBoss\jboss-as-web-7.0.0.Final\bin

                user.home = C:\Users\pedro

                user.language = pt

                user.name = pedro

                user.timezone = GMT-03:00

                user.variant =

            13:45:44,726 INFO  [org.jboss.as] creating http management service using network interface (management) port (9990) securePort (-1)

            13:45:44,776 INFO  [org.jboss.as.logging] Removing bootstrap log handlers

            13:47:40,558 INFO  [org.jboss.as.logging] Restored bootstrap log handlers

            13:47:40,628 INFO  [com.arjuna.ats.jbossatx] ARJUNA32018: Destroying TransactionManagerService

            13:47:40,638 INFO  [com.arjuna.ats.jbossatx] ARJUNA32014: Stopping transaction recovery manager

            13:47:40,648 INFO  [org.apache.catalina.core.StandardContext] Container org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/] has not been started

            13:47:40,668 INFO  [org.jboss.as] JBoss AS 7.0.0.Final "Lightning" stopped in 143ms

             

             

            Server.log

             

            13:45:44,836 INFO  [org.jboss.as.connector.subsystems.datasources] (Controller Boot Thread) Deploying JDBC-compliant driver class org.h2.Driver (version 1.2)

            13:45:44,866 INFO  [org.jboss.as.clustering.infinispan.subsystem] (Controller Boot Thread) Activating Infinispan subsystem.

            13:45:45,266 INFO  [org.jboss.as.naming] (Controller Boot Thread) Activating Naming Subsystem

            13:45:45,306 INFO  [org.jboss.as.osgi] (Controller Boot Thread) Activating OSGi Subsystem

            13:45:45,356 INFO  [org.jboss.as.security] (Controller Boot Thread) Activating Security Subsystem

            13:45:45,406 INFO  [org.jboss.as.naming] (MSC service thread 1-1) Starting Naming Service

            13:45:45,436 INFO  [org.jboss.remoting] (MSC service thread 1-4) JBoss Remoting version 3.2.0.Beta2

            13:45:45,466 INFO  [org.xnio] (MSC service thread 1-4) XNIO Version 3.0.0.Beta3

            13:45:45,516 INFO  [org.xnio.nio] (MSC service thread 1-4) XNIO NIO Implementation Version 3.0.0.Beta3

            13:45:46,326 INFO  [org.apache.catalina.core.AprLifecycleListener] (MSC service thread 1-1) The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.6.0_26\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Oracle\product\11.2.0\client_1\bin;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\PHP\;C:\Program Files (x86)\Borland\Delphi7\Bin;C:\Program Files (x86)\Borland\Delphi7\Projects\Bpl\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files (x86)\CyberLink\Power2Go\;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Common Files\Microsoft Shared\Windows Live;.;C:\Program Files\Java\jdk1.6.0_26;C:\Program Files\Java\jdk1.6.0_26\bin;C:\Program Files (x86)\Apache Software Foundation\apache-maven-3.0.3\bin;C:\Program Files\JBoss\jboss-5.1.0.GA\bin;.

            13:45:46,416 INFO  [org.jboss.as.ee] (Controller Boot Thread) Activating EE subsystem

            13:45:46,416 INFO  [org.jboss.as.remoting] (MSC service thread 1-2) Listening on /127.0.0.1:9999

            13:45:46,766 INFO  [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-4) Starting Coyote HTTP/1.1 on http--127.0.0.1-8080

            13:45:46,976 INFO  [org.jboss.as.jmx.JMXConnectorService] (MSC service thread 1-3) Starting remote JMX connector

            13:45:47,562 INFO  [org.jboss.as.connector] (MSC service thread 1-1) Starting JCA Subsystem (JBoss IronJacamar 1.0.0.CR2)

            13:45:47,652 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-2) Bound data source [java:jboss/datasources/ExampleDS]

            13:45:48,692 INFO  [org.jboss.as.deployment] (MSC service thread 1-1) Started FileSystemDeploymentService for directory C:\Program Files\JBoss\jboss-as-web-7.0.0.Final\standalone\deployments

            13:45:48,822 INFO  [org.jboss.as] (Controller Boot Thread) JBoss AS 7.0.0.Final "Lightning" started in 9646ms - Started 92 of 147 services (55 services are passive or on-demand)

            • 3. Re: JBoss As 7 problem with jndi port
              andyhan

              I test it on Windows 7 x64 and XP x86, Windows 2003 x86, port 1099 never opened.

              Is it a big bug of JbossAS 7?

              • 4. Re: JBoss As 7 problem with jndi port
                jaikiran

                Remote JNDI hasn't been implemented yet in AS7. That port isn't used anywhere (probably should just be removed from that xml).

                • 5. Re: JBoss As 7 problem with jndi port
                  paulinux

                  jaikiran pai escribió:

                   

                  Remote JNDI hasn't been implemented yet in AS7. That port isn't used anywhere (probably should just be removed from that xml).

                   

                  But I'm running ejb + client in the same server, this is "local", isn't it? I haven't interfaces. Is it necesary the InitialContext to call lookup method?

                   

                  This is my client:

                   

                  public class PruebaEJBCliente {

                   

                       // -> This is the code that produces a NullPointerException

                      @EJB(lookup="java:global/SeguridadEar/SeguridadFenix/SeguridadBean!com.einsa.fenix.seguridad.ejb.SeguridadBean")

                      private SeguridadBean seguridadBean;

                   

                      public void ejecutar() throws Exception

                      {

                   

                  // -> If uncomment this code, the same error like before users is produced.

                  //        Properties properties = new Properties();

                  //       

                  //        properties.put(Context.INITIAL_CONTEXT_FACTORY/*"java.naming.factory.initial"*/,"org.jnp.interfaces.NamingContextFactory");

                  //        properties.put(Context.URL_PKG_PREFIXES /*"java.naming.factory.url.pkgs"*/,"org.jboss.naming:org.jnp.interfaces");

                  //        properties.put(Context.PROVIDER_URL/*"java.naming.provider.url"*/, "jnp://127.0.0.1:1099");

                  //       

                  //        InitialContext ctx = new InitialContext(properties);

                   

                  //        SeguridadBean seguridadBean = (SeguridadBean) ctx.lookup("java:global/SeguridadEar/SeguridadFenix         

                                                                                  /SeguridadBean!com.einsa.fenix.seguridad.ejb.SeguridadBean");

                          seguridadBean.insertarUsuario("pruebaJPA2", "pruebaJPA2", "prueba", "prueba", "AC");           

                      }

                  }

                   

                  Is the client ok?

                   

                  Thanks in advance

                   

                  Sorry for my bad english xD.

                  • 6. Re: JBoss As 7 problem with jndi port
                    snelders

                    So is there another way of doing remote method invocation for EJBs in the meantime or will this just not work? Shouldn't AS7 have been labeled beta without JNDI?

                    • 7. Re: JBoss As 7 problem with jndi port
                      dlofthouse

                      It is labeled Web Profile which means EJB3 lite which excludes remote EJB invocations.

                       

                      You could use the preview configuration and expose the EJB as a web service.

                      • 8. Re: JBoss As 7 problem with jndi port
                        snelders

                        I think that's not fully clear to a lot of users. I didn't download the version which is labeled "Web Profile" but the one labeled "Everything". Since the product has "Application Server" in it's name a lot of users (like me) automatically expect this to be a fully featured J2EE application server.

                         

                        I will just wait for the full J2EE 6 version (will this be 7.1?). Judging from this web profile version the JBoss 7 project looks very promising, great work!

                        • 9. Re: JBoss As 7 problem with jndi port
                          andyhan

                          how to visit hornetQ jms queue using jndi lookup?

                          • 10. Re: JBoss As 7 problem with jndi port
                            kabirkhan

                            Jan Snelders wrote:

                             

                            So is there another way of doing remote method invocation for EJBs in the meantime or will this just not work? Shouldn't AS7 have been labeled beta without JNDI?

                            A hack is described here: http://community.jboss.org/wiki/RemoteEJBLookupAndInvocationInJBossAS700

                            • 11. Re: JBoss As 7 problem with jndi port
                              paulinux

                              Hello

                               

                              With EJB injection must work fine? This is, without do lookup. Like I wrote in my last post?

                               

                              Thanks in advance

                              • 12. Re: JBoss As 7 problem with jndi port
                                migratetojboss

                                Even EJB injection doesn't seem to work for me. Paulo, please copy your last post about EJB injection which works for you.

                                • 13. Re: JBoss As 7 problem with jndi port
                                  ejroberts

                                  Some time has passed since your first post. Do you know the answer to your question with regards the latest JBoss AS 7 downloads ?

                                   

                                  I have the same problem; i.e. trying to understand where the JNDI port is.

                                  Is the answer that JNDI is now running on 4447 under the name remoting ?

                                  • 14. Re: JBoss As 7 problem with jndi port
                                    jaikiran

                                    Ed Roberts wrote:

                                     

                                    I have the same problem; i.e. trying to understand where the JNDI port is.

                                     

                                    There isn't a JNDI port because it hasn't been exposed for remote access.

                                     

                                     

                                    Ed Roberts wrote:

                                     

                                    Is the answer that JNDI is now running on 4447 under the name remoting ?

                                    No. That port is for remote EJB communication.

                                    1 2 Previous Next