7 Replies Latest reply on Aug 27, 2012 10:01 AM by Wolf-Dieter Fink

    Can't connect remote to jboss as 6.1.0

    Anton Yanchev Newbie

      Hi Folks,

       

      I have installed jboss-6.1.0. Final

      windows 2003 Server 32Bit

      java 1.7

       

      I'm using SilkPerformer to add predifined data source and connect to Jboss server remotely and take a data.

      from previous versions Jboss 4.0 and Jboss 5.0 has a xml file where a set configuration fields

      that is xml file

      <?xml version="1.0" encoding="ISO-8859-1"?>

      <AgentConfiguration Name="JBoss 6.x" DataSourceType="Base Configuration JBoss 6.x">

        <Host>lnz-jboss6</Host>

        <Port>1090</Port>

        <Protocol>jnp</Protocol>

        <!--0 .. JSR160/RMI-->

        <!--1 .. JSR160/IIOP-->

        <!--2 .. JNDI-->

        <!--3 .. JSR160/CORBALOC-->

        <!--4 .. JSR160/RMIIIOP-->

        <!--5 .. JSR160/PLAINRMI-->

        <ConnectionMode>2</ConnectionMode>

        <MEJBName>jmx/rmi/RMIAdaptor</MEJBName>

        <UrlPostfix />

        <ContextFactory>org.jnp.interfaces.NamingContextFactory</ContextFactory>

        <DefaultUser />

        <DefaultPassword />

        <TypePropertyString>j2eeType</TypePropertyString>

        <IsJsr77>true</IsJsr77>

        <JvmInfo>

          <JvmHomePath RecommendedVendor="SUN" RecommendedMajorVersion="2" />

          <Classpath ClasspathRootDir="C:\jboss-6.1.0.Final">

            <Entry>.\common\lib\jboss-management.jar</Entry>

            <Entry>.\client\jbossall-client.jar</Entry>

                  <Entry>.\lib\dom4j.jar</Entry>

          </Classpath>

          <AdditionalClasspath />

          <VmParameters />

        </JvmInfo>

      </AgentConfiguration>

       

       

      That is my run.conf.bat file where i setup setings for enable remote conection

      rem ### -*- batch file -*- ######################################################

      rem #                                                                          ##

      rem #  JBoss Bootstrap Script Configuration                                    ##

      rem #                                                                          ##

      rem #############################################################################

       

       

      rem # $Id: run.conf.bat 88820 2009-05-13 15:25:44Z dimitris@jboss.org $

       

       

      rem #

      rem # This batch file is executed by run.bat to initialize the environment

      rem # variables that run.bat uses. It is recommended to use this file to

      rem # configure these variables, rather than modifying run.bat itself.

      rem #

       

       

      if not "x%JAVA_OPTS%" == "x" goto JAVA_OPTS_SET

       

       

      rem #

      rem # Specify the JBoss Profiler configuration file to load.

      rem #

      rem # Default is to not load a JBoss Profiler configuration file.

      rem #

      rem set "PROFILER=%JBOSS_HOME%\bin\jboss-profiler.properties"

       

       

      rem #

      rem # Specify the location of the Java home directory (it is recommended that

      rem # this always be set). If set, then "%JAVA_HOME%\bin\java" will be used as

      rem # the Java VM executable; otherwise, "%JAVA%" will be used (see below).

      rem #

      rem set "JAVA_HOME=C:\opt\jdk1.6.0_13"

       

       

      rem #

      rem # Specify the exact Java VM executable to use - only used if JAVA_HOME is

      rem # not set. Default is "java".

      rem #

      rem set "JAVA=C:\opt\jdk1.6.0_13\bin\java"

       

       

      rem #

      rem # Specify options to pass to the Java VM. Note, there are some additional

      rem # options that are always passed by run.bat.

      rem #

       

       

      rem # JVM memory allocation pool parameters - modify as appropriate.

      set "JAVA_OPTS=-Xms128M -Xmx512M -XX:MaxPermSize=256M"

       

       

      rem # Reduce the RMI GCs to once per hour for Sun JVMs.

      set "JAVA_OPTS=%JAVA_OPTS% -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000"

       

       

      rem # Warn when resolving remote XML DTDs or schemas.

      set "JAVA_OPTS=%JAVA_OPTS% -Dorg.jboss.resolver.warning=true"

       

       

      rem # Sample JPDA settings for remote socket debugging

      rem set "JAVA_OPTS=%JAVA_OPTS% -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"

       

       

      rem # Sample JPDA settings for shared memory debugging

      rem set "JAVA_OPTS=%JAVA_OPTS% -Xrunjdwp:transport=dt_shmem,address=jboss,server=y,suspend=n"

       

       

      set "JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote"

      rem set "JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote.port=9999"

      set "JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote.authenticate=true"

      set "JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote.ssl=false"

      set "JAVA_OPTS=%JAVA_OPTS% -Djava.rmi.server.hostname=lnz-jboss6"

      set "JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote.password.file="c:\jmxremote\jmxremote.password""

      set "JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote.access.file="c:\jmxremote\jmxremote.access""

       

       

      # Use the JBoss MBeanServerBuilder

      set "JAVA_OPTS=%JAVA_OPTS% -Djboss.platform.mbeanserver"

      set "JAVA_OPTS=%JAVA_OPTS% -Djavax.management.builder.initial=org.jboss.system.server.jmx.MBeanServerBuilderImpl"

       

      #Use the jboss logmanager

      set "JAVA_OPTS=%JAVA_OPTS% -Djava.util.logging.manager=org.jboss.logmanager.LogManager"

      set "JAVA_OPTS=%JAVA_OPTS% -Dorg.jboss.logging.Logger.pluginClass=org.jboss.logging.logmanager.LoggerPluginImpl"

       

       

      set JBOSS_CLASSPATH="C:\jboss-6.1.0.Final\lib\jboss-logmanager.jar"

      rem set JBOSS_CLASSPATH="C:\jboss-6.1.0.Final\client\jbossall-client.jar"

      set "JAVA_OPTS=%JAVA_OPTS% -Djava.naming.factory.initial=org.jnp.interfaces.NamingContextFactory"

      set "JAVA_OPTS=%JAVA_OPTS% -Djava.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces"

       

      :JAVA_OPTS_SET

       

      when i execute run.bat om boot.log doesn't have any error and when i open http://<host>:8080 it open correctlty jboss

      also when i login throuhg jconsole service:jmx:rmi:///jndi/rmi://<host>:1090/jmxconnector it connect

       

      but when i have tried to connect remotely it shows this error log

       

       

      com.segue.monitoring.jmx.common.exception.RtException: Unable to connect

                at com.segue.monitoring.jmx.common.gui.swt.JMXSWTRunner.connect(JMXSWTRunner.java:312)

      Caused by: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:

                java.rmi.RemoteException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory

      javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory [Root exception is java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory]

                at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)

                at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)

                at javax.naming.InitialContext.init(Unknown Source)

                at javax.naming.InitialContext.<init>(Unknown Source)

                at com.segue.monitoring.jmx.common.runtime.DataSourceBase.createContext(DataSourceBase.java:41)

                at com.segue.monitoring.jmx.jboss.datasource.JBossDataSource.bootstrap(Unknown Source)

                at com.segue.monitoring.jmx.common.runtime.RemoteDataSourceBase.bootstrap(RemoteDataSourceBase.java:180)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

                at java.lang.reflect.Method.invoke(Unknown Source)

                at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)

                at sun.rmi.transport.Transport$1.run(Unknown Source)

                at java.security.AccessController.doPrivileged(Native Method)

                at sun.rmi.transport.Transport.serviceCall(Unknown Source)

                at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)

                at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown Source)

                at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)

                at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)

                at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

                at java.lang.Thread.run(Unknown Source)

      Caused by: java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory

                at java.net.URLClassLoader$1.run(Unknown Source)

                at java.security.AccessController.doPrivileged(Native Method)

                at java.net.URLClassLoader.findClass(Unknown Source)

                at java.lang.ClassLoader.loadClass(Unknown Source)

                at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)

                at java.lang.ClassLoader.loadClass(Unknown Source)

                at java.lang.Class.forName0(Native Method)

                at java.lang.Class.forName(Unknown Source)

                at com.sun.naming.internal.VersionHelper12.loadClass(Unknown Source)

                ... 21 more

       

       

                at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)

                at sun.rmi.transport.Transport$1.run(Unknown Source)

                at java.security.AccessController.doPrivileged(Native Method)

                at sun.rmi.transport.Transport.serviceCall(Unknown Source)

                at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)

                at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown Source)

                at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)

                at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)

                at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

                at java.lang.Thread.run(Unknown Source)

                at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)

                at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)

                at sun.rmi.server.UnicastRef.invoke(Unknown Source)

                at com.segue.monitoring.jmx.jboss.datasource.RemoteDataSource_Stub.bootstrap(Unknown Source)

                at com.segue.monitoring.jmx.common.client.RemoteDataSourceClient.bootstrap(RemoteDataSourceClient.java:265)

                at com.segue.monitoring.jmx.common.gui.swt.JMXSWTRunner.connect(JMXSWTRunner.java:301)

      Caused by: java.rmi.RemoteException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory

      javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory [Root exception is java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory]

                at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)

                at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)

                at javax.naming.InitialContext.init(Unknown Source)

                at javax.naming.InitialContext.<init>(Unknown Source)

                at com.segue.monitoring.jmx.common.runtime.DataSourceBase.createContext(DataSourceBase.java:41)

                at com.segue.monitoring.jmx.jboss.datasource.JBossDataSource.bootstrap(Unknown Source)

                at com.segue.monitoring.jmx.common.runtime.RemoteDataSourceBase.bootstrap(RemoteDataSourceBase.java:180)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

                at java.lang.reflect.Method.invoke(Unknown Source)

                at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)

                at sun.rmi.transport.Transport$1.run(Unknown Source)

                at java.security.AccessController.doPrivileged(Native Method)

                at sun.rmi.transport.Transport.serviceCall(Unknown Source)

                at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)

                at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown Source)

                at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)

                at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)

                at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

                at java.lang.Thread.run(Unknown Source)

      Caused by: java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory

                at java.net.URLClassLoader$1.run(Unknown Source)

                at java.security.AccessController.doPrivileged(Native Method)

                at java.net.URLClassLoader.findClass(Unknown Source)

                at java.lang.ClassLoader.loadClass(Unknown Source)

                at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)

                at java.lang.ClassLoader.loadClass(Unknown Source)

                at java.lang.Class.forName0(Native Method)

                at java.lang.Class.forName(Unknown Source)

                at com.sun.naming.internal.VersionHelper12.loadClass(Unknown Source)

                ... 21 more

       

       

                at com.segue.monitoring.jmx.common.runtime.RemoteDataSourceBase.bootstrap(RemoteDataSourceBase.java:189)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

                at java.lang.reflect.Method.invoke(Unknown Source)

                at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)

                at sun.rmi.transport.Transport$1.run(Unknown Source)

                at java.security.AccessController.doPrivileged(Native Method)

                at sun.rmi.transport.Transport.serviceCall(Unknown Source)

                at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)

                at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown Source)

                at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)

                at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)

                at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

                at java.lang.Thread.run(Unknown Source)

        • 1. Re: Can't connect remote to jboss as 6.1.0
          Wolf-Dieter Fink Master

          Looks like that you miss this class org.jnp.interfaces.NamingContextFactory  in the clients classpath.

          Try JBOSS/client/jbossall-client.jar in your client-classpath

          1 of 1 people found this helpful
          • 2. Re: Can't connect remote to jboss as 6.1.0
            Anton Yanchev Newbie

            yes but sorry for my stupid  question how can i add JBOSS/client/jbossall-client.jar in your client-classpath?

            • 3. Re: Can't connect remote to jboss as 6.1.0
              Wolf-Dieter Fink Master

              How do you start your remote client?

              From command line you have to add -cp xxxx\jbossall-client.jar;someother.jar if you start with Eclipse you must add it to the runtime configurations.

              • 4. Re: Can't connect remote to jboss as 6.1.0
                Anton Yanchev Newbie

                i'm staring from cmd

                i have tried on this way run.bat -cp C:\jboss-6.1.0.Final\client\jbossall-client.jar

                but it can't start jboss

                it failed with this error

                 

                run.bat: unused non-option argument: C:\jboss-6.1.0.Final\client\jbossall-client
                .jar
                Failed to boot JBoss:
                org.jboss.bootstrap.api.config.InvalidConfigurationException: Could not get a co
                nnection to the jboss.server.home.url: file:/C:/jboss-6.1.0.Final/server/p
                        at org.jboss.bootstrap.impl.as.config.JBossASBasedConfigurationValidator
                .require(JBossASBasedConfigurationValidator.java:217)
                        at org.jboss.bootstrap.impl.as.config.JBossASBasedConfigurationValidator
                .require(JBossASBasedConfigurationValidator.java:187)
                        at org.jboss.bootstrap.impl.as.config.JBossASBasedConfigurationValidator
                .validate(JBossASBasedConfigurationValidator.java:112)
                        at org.jboss.bootstrap.impl.as.config.JBossASBasedConfigurationValidator
                .validate(JBossASBasedConfigurationValidator.java:43)
                        at org.jboss.bootstrap.impl.base.server.AbstractServer.validate(Abstract
                Server.java:1010)
                        at org.jboss.bootstrap.impl.base.server.AbstractServer.doInitialize(Abst
                ractServer.java:566)
                        at org.jboss.bootstrap.impl.mc.server.AbstractMCServerBase.doInitialize(
                AbstractMCServerBase.java:230)
                        at org.jboss.bootstrap.impl.as.server.AbstractJBossASServerBase.doInitia
                lize(AbstractJBossASServerBase.java:284)
                        at org.jboss.bootstrap.impl.base.server.AbstractServer.initialize(Abstra
                ctServer.java:524)
                        at org.jboss.Main.boot(Main.java:469)
                        at org.jboss.Main$1.run(Main.java:816)
                        at java.lang.Thread.run(Thread.java:722)
                Caused by: java.io.FileNotFoundException: C:\jboss-6.1.0.Final\server\p
                        at org.jboss.net.protocol.file.FileURLConnection.connect(FileURLConnecti
                on.java:105)
                        at org.jboss.bootstrap.impl.as.config.JBossASBasedConfigurationValidator
                .require(JBossASBasedConfigurationValidator.java:213)
                        ... 11 more
                Posting Shutdown Request to the server...
                Server startup has not completed, so halting the process
                Press any key to continue . . .

                 

                I have tried to open jar file but it was empty here you can see jbossall-client.jar http://www40.zippyshare.com/v/65126821/file.html

                • 5. Re: Can't connect remote to jboss as 6.1.0
                  Wolf-Dieter Fink Master

                  I'm confused about your questions

                   

                  The server is started with run.bat, you might give the option '-b x.x.x.x' for your IP address otherwise the server is bound to localhost and can not accessed from other machines.

                   

                  The client is a java program outside the server (start with run.bat) in a different JVM there you have to add the jbossall-client.jar. Yes, the jar contains no classes, just dependencies, you might read the readme.txt inside the jar. Trick is that you have to have necessary jars in the same folder. Copy all jars of client/* to be save or check the readme.txt

                  • 6. Re: Can't connect remote to jboss as 6.1.0
                    Anton Yanchev Newbie

                    thank you yes i forgot to write i used run.bat -b 0.0.0.0

                    • 7. Re: Can't connect remote to jboss as 6.1.0
                      Wolf-Dieter Fink Master

                      How your client looks like?

                      As i said, it makes no sense to start the server with the client-libraries in the classpath.

                       

                      you need to do it at client side.