4 Replies Latest reply on Dec 20, 2011 9:15 PM by he_man888

    JNDI invoke issues

    he_man888

      Hi All,

       

          My EJB application has been deployed  successfully.

           JBoss AS Version: JBoss AS 7.0.2.Final "Arc"

       

          the startup logs are below: (from console)

          ----------------------------------------------------------------------------------------------------------------------------------------------- 

      12:10:16,187  INFO    [org.jboss.modules] JBoss Modules version 1.0.2.GA

      12:10:16,656 INFO  [org.jboss.msc] JBoss MSC version 1.0.1.GA

      12:10:16,781 INFO  [org.jboss.as] JBoss AS 7.0.2.Final "Arc" starting

      12:10:19,406 WARN  [org.jboss.as] No security realm defined for native management service, all access will be unrestricted.

      12:10:19,406 INFO  [org.jboss.as] creating http management service using network interface (management) port (9990)

      12:10:19,406 WARN  [org.jboss.as] No security realm defined for http management service, all access will be unrestricted.

      12:10:19,484 INFO  [org.jboss.as.logging] Removing bootstrap log handlers

      12:10:19,562 INFO  [org.jboss.as.connector.subsystems.datasources] (Controller Boot Thread) Deploying JDBC-compliant driver class oracle.jdbc.driver.OracleDriver (version 10.2)

      12:10:19,593 INFO  [org.jboss.as.connector.subsystems.datasources] (Controller Boot Thread) Deploying JDBC-compliant driver class org.h2.Driver (version 1.2)

      12:10:19,625 INFO  [org.jboss.as.clustering.infinispan.subsystem] (Controller Boot Thread) Activating Infinispan subsystem.

      12:10:19,734 INFO  [org.jboss.as.jacorb] (Controller Boot Thread) Activating JacORB Subsystem

      12:10:19,937 INFO  [org.jboss.as.naming] (Controller Boot Thread) JBAS011800: Activating Naming Subsystem

      12:10:19,968 INFO  [org.jboss.as.naming] (MSC service thread 1-3) JBAS011802: Starting Naming Service

      12:10:20,093 INFO  [org.jboss.as.osgi] (Controller Boot Thread) JBAS011910: Activating OSGi Subsystem

      12:10:20,140 INFO  [org.jboss.as.security] (Controller Boot Thread) Activating Security Subsystem

      12:10:20,156 INFO  [org.jboss.remoting] (MSC service thread 1-1) JBoss Remoting version 3.2.0.Beta2

      12:10:20,218 INFO  [org.xnio] (MSC service thread 1-1) XNIO Version 3.0.0.Beta3

      12:10:20,250 INFO  [org.xnio.nio] (MSC service thread 1-1) XNIO NIO Implementation Version 3.0.0.Beta3

      12:10:21,187 INFO  [org.jboss.as.webservices] (Controller Boot Thread) Activating WebServices Extension

      12:10:21,218 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: D:\Programs\Java\j2sdk1.6.0_25\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;D:\Programs\Java\j2sdk1.6.0_25\jre\bin;D:/Programs/MyEclipse10.0/Common/binary/com.sun.java.jdk.win32.x86_1.6.0.013/jre/bin/client;D:/Programs/MyEclipse10.0/Common/binary/com.sun.java.jdk.win32.x86_1.6.0.013/jre/bin;D:/Programs/MyEclipse10.0/Common/binary/com.sun.java.jdk.win32.x86_1.6.0.013/jre/lib/i386;D:\Programs\Java\jdk1.6.0_25\bin;C:\Program Files\Common Files\NetSarang;C:\oracle\ora90\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;D:\Programs\apache\ant\1.7.1\bin;C:\Program Files\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\Microsoft SQL Server\80\Tools\Binn\;C:\Program Files\Microsoft SQL Server\90\DTS\Binn\;C:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\Program Files\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies\;D:\Programs\Subversion\bin;D:\Programs\TortoiseSVN\bin;C:\Program Files\QuickTime\QTSystem\;D:\Programs\Borland\Delphi7\Bin;D:\Programs\Borland\Delphi7\Projects\Bpl\;E:\Repositories\userLibs\apache\maven\3.0\bin;

      12:10:21,312 INFO  [org.jboss.as.ee] (Controller Boot Thread) Activating EE subsystem

      12:10:21,312 INFO  [org.jboss.as.remoting] (MSC service thread 1-2) Listening on /127.0.0.1:9999

      12:10:21,531 INFO  [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-1) Starting Coyote HTTP/1.1 on http--127.0.0.1-8080

      12:10:21,671 INFO  [org.jboss.as.jmx.JMXConnectorService] (MSC service thread 1-1) Starting remote JMX connector

      12:10:21,968 INFO  [org.jboss.ws.common.management.AbstractServerConfig] (MSC service thread 1-4) JBoss Web Services - Stack CXF Server 4.0.0.Beta3

      12:10:22,093 INFO  [org.jboss.as.connector] (MSC service thread 1-4) Starting JCA Subsystem (JBoss IronJacamar 1.0.3.Final)

      12:10:22,234 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-4) Bound data source [java:/ds/spmgr]

      12:10:22,250 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-4) Bound data source [java:jboss/datasources/ExampleDS]

      12:10:22,578  INFO    [org.hornetq.core.server.impl.HornetQServerImpl] (MSC service thread 1-4) live server is starting with configuration HornetQ Configuration (clustered=false,backup=false,sharedStore=true,journalDirectory=D:\Programs\redhat\jboss-as-7.0.2.Final\standalone\data\messagingjournal,bindingsDirectory=D:\Programs\redhat\jboss-as-7.0.2.Final\standalone\data\messagingbindings,largeMessagesDirectory=D:\Programs\redhat\jboss-as-7.0.2.Final\standalone\data\messaginglargemessages,pagingDirectory=D:\Programs\redhat\jboss-as-7.0.2.Final\standalone\data\messagingpaging)

      12:10:22,593 INFO  [org.jboss.as.connector.services.ResourceAdapterActivatorService$ResourceAdapterActivator] (MSC service thread 1-3) Registered connection factory java:/JmsXA

      12:10:22,593 INFO  [org.hornetq.ra.HornetQResourceAdapter] (MSC service thread 1-3) HornetQ resource adaptor started

      12:10:22,593 INFO  [org.jboss.as.connector.services.ResourceAdapterActivatorService$ResourceAdapterActivator] (MSC service thread 1-3) IJ020002: Deployed: file://RaActivatorhornetq-ra

      12:10:22,656 WARN    [org.hornetq.core.server.impl.HornetQServerImpl] (MSC service thread 1-4) Security risk! It has been detected that the cluster admin user and password have not been changed from the installation default. Please see the HornetQ user guide, cluster chapter, for instructions on how to do this.

      12:10:22,859 WARN  [jacorb.codeset] (MSC service thread 1-2) Warning - unknown codeset (GBK) - defaulting to ISO-8859-1

      12:10:22,984 INFO  [org.hornetq.core.remoting.impl.netty.NettyAcceptor] (MSC service thread 1-4) Started Netty Acceptor version 3.2.3.Final-r${buildNumber} localhost:5445 for CORE protocol

      12:10:22,984 INFO  [org.hornetq.core.remoting.impl.netty.NettyAcceptor] (MSC service thread 1-4) Started Netty Acceptor version 3.2.3.Final-r${buildNumber} localhost:5455 for CORE protocol

      12:10:23,000  INFO    [org.hornetq.core.server.impl.HornetQServerImpl] (MSC service thread 1-4) Server is now live

      12:10:23,000  INFO    [org.hornetq.core.server.impl.HornetQServerImpl] (MSC service thread 1-4) HornetQ Server version 2.2.7.Final (HQ_2_2_7_FINAL_AS7, 121) [462fc994-1fa4-11e1-84c4-d8d3852a87bd] started

      12:10:23,000 INFO  [org.jboss.as.jacorb] (MSC service thread 1-2) CORBA ORB Service Started

      12:10:23,000  INFO    [org.hornetq.core.server.impl.HornetQServerImpl] (MSC service thread 1-4) trying to deploy queue jms.topic.testTopic

      12:10:23,343 INFO  [org.jboss.as.messaging.jms.AS7BindingRegistry] (MSC service thread 1-4) Bound messaging object to jndi name java:/topic/test

      12:10:23,359 INFO  [org.jboss.as.messaging.jms.AS7BindingRegistry] (MSC service thread 1-2) Bound messaging object to jndi name java:/RemoteConnectionFactory

      12:10:23,375 INFO  [org.jboss.as.messaging.jms.AS7BindingRegistry] (MSC service thread 1-3) Bound messaging object to jndi name java:/ConnectionFactory

      12:10:23,375  INFO    [org.hornetq.core.server.impl.HornetQServerImpl] (MSC service thread 1-1) trying to deploy queue jms.queue.testQueue

      12:10:23,406 INFO  [org.jboss.as.messaging.jms.AS7BindingRegistry] (MSC service thread 1-1) Bound messaging object to jndi name java:/queue/test

      12:10:23,500 INFO  [org.jboss.as.jacorb] (MSC service thread 1-4) CORBA Naming Service Started

      12:10:23,500 WARN  [org.jboss.as.deployment] (MSC service thread 1-4) Reliable deployment behaviour is not possible when auto-deployment of exploded content is enabled (i.e. deployment without use of ".dodeploy"' marker files). Configuration of auto-deployment of exploded content is not recommended in any situation where reliability is desired. Configuring the deployment scanner's auto-deploy-exploded setting to "false" is recommended.

      12:10:23,515 INFO  [org.jboss.as.deployment] (MSC service thread 1-4) Started FileSystemDeploymentService for directory D:\Programs\redhat\jboss-as-7.0.2.Final\standalone\deployments

      12:10:23,562 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-4) Starting deployment of "spPlatformEJB.jar"

      12:10:23,703 INFO  [org.jboss.jpa] (MSC service thread 1-3) read persistence.xml for spMgr

      12:10:23,718 INFO  [org.jboss.as.jpa] (MSC service thread 1-4) added javax.persistence.api, javaee.api, org.jboss.as.jpa, org.javassist dependencies to spPlatformEJB.jar

      12:10:23,718 INFO  [org.jboss.as.jpa] (MSC service thread 1-4) added (default provider) org.hibernate dependency to application deployment (since 1 PU(s) didn't specify jboss.as.jpa.providerModule)

      12:10:23,718 INFO  [org.jboss.as.jpa] (MSC service thread 1-4) added org.hibernate dependency to application deployment

      12:10:23,937 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-2) JNDI bindings for session bean named AppStartupBaseBean in deployment unit deployment "spPlatformEJB.jar" are as follows:

       

                java:global/spPlatformEJB/AppStartupBaseBean!com.wasu.as.sp.service.core.AppStartupBaseBean

                java:app/spPlatformEJB/AppStartupBaseBean!com.wasu.as.sp.service.core.AppStartupBaseBean

                java:module/AppStartupBaseBean!com.wasu.as.sp.service.core.AppStartupBaseBean

                java:global/spPlatformEJB/AppStartupBaseBean

                java:app/spPlatformEJB/AppStartupBaseBean

                java:module/AppStartupBaseBean

       

      12:10:23,937 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-2) JNDI bindings for session bean named UserActionAuthImpl in deployment unit deployment "spPlatformEJB.jar" are as follows:

       

                java:global/spPlatformEJB/UserActionAuthImpl!com.wasu.as.sp.service.core.auth.IUserActionAuthLocal

                java:app/spPlatformEJB/UserActionAuthImpl!com.wasu.as.sp.service.core.auth.IUserActionAuthLocal

                java:module/UserActionAuthImpl!com.wasu.as.sp.service.core.auth.IUserActionAuthLocal

                java:global/spPlatformEJB/UserActionAuthImpl!com.wasu.as.sp.service.core.auth.IUserActionAuthRemote

                java:app/spPlatformEJB/UserActionAuthImpl!com.wasu.as.sp.service.core.auth.IUserActionAuthRemote

                java:module/UserActionAuthImpl!com.wasu.as.sp.service.core.auth.IUserActionAuthRemote

       

      12:10:23,937 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-2) JNDI bindings for session bean named AppClientActionAuthImpl in deployment unit deployment "spPlatformEJB.jar" are as follows:

       

                java:global/spPlatformEJB/AppClientActionAuthImpl!com.wasu.as.sp.service.core.auth.IAppClientAuthLocal

                java:app/spPlatformEJB/AppClientActionAuthImpl!com.wasu.as.sp.service.core.auth.IAppClientAuthLocal

                java:module/AppClientActionAuthImpl!com.wasu.as.sp.service.core.auth.IAppClientAuthLocal

                java:global/spPlatformEJB/AppClientActionAuthImpl!com.wasu.as.sp.service.core.auth.IAppClientAuthRemote

                java:app/spPlatformEJB/AppClientActionAuthImpl!com.wasu.as.sp.service.core.auth.IAppClientAuthRemote

                java:module/AppClientActionAuthImpl!com.wasu.as.sp.service.core.auth.IAppClientAuthRemote

       

      12:10:23,937 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-2) JNDI bindings for session bean named TestWS in deployment unit deployment "spPlatformEJB.jar" are as follows:

                java:global/spPlatformEJB/TestWS!com.wasu.as.sp.service.core.auth.impl.TestWSLocal

                java:app/spPlatformEJB/TestWS!com.wasu.as.sp.service.core.auth.impl.TestWSLocal

                java:module/TestWS!com.wasu.as.sp.service.core.auth.impl.TestWSLocal

      12:10:24,000 INFO  [org.jboss.wsf.stack.cxf.deployment.aspect.DescriptorDeploymentAspect] (MSC service thread 1-3) Spring not available, skipping check for user provided jbossws-cxf.xml / cxf.xml configuration files.

      12:10:24,015 INFO  [org.jboss.wsf.stack.cxf.metadata.MetadataBuilder] (MSC service thread 1-3) Add Service

      id=TestWS

      address=http://localhost:8080/spPlatformEJB/TestWS

      implementor=com.wasu.as.sp.service.core.auth.impl.TestWS

      invoker=org.jboss.wsf.stack.cxf.JBossWSInvoker

      serviceName={http://impl.auth.core.service.sp.as.wasu.com/}TestWSService

      portName={http://impl.auth.core.service.sp.as.wasu.com/}TestWSPort

      wsdlLocation=null

      mtomEnabled=false

      12:10:24,015 INFO  [org.jboss.wsf.stack.cxf.metadata.MetadataBuilder] (MSC service thread 1-3) Add Service

      id=UserActionAuthImpl

      address=http://localhost:8080/spPlatformEJB/services/UserAuthService

      implementor=com.wasu.as.sp.service.core.auth.impl.UserActionAuthImpl

      invoker=org.jboss.wsf.stack.cxf.JBossWSInvoker

      serviceName={http://impl.auth.core.service.sp.as.wasu.com/}services

      portName={http://impl.auth.core.service.sp.as.wasu.com/}UserAuthServicePort

      wsdlLocation=null

      mtomEnabled=false

      12:10:24,015 INFO  [org.jboss.ws.common.management.DefaultEndpointRegistry] (MSC service thread 1-3) register: jboss.ws:context=spPlatformEJB,endpoint=TestWS

      12:10:24,015 INFO  [org.jboss.ws.common.management.DefaultEndpointRegistry] (MSC service thread 1-3) register: jboss.ws:context=spPlatformEJB,endpoint=UserActionAuthImpl

      12:10:24,531  INFO    [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] (MSC service thread 1-3) Creating Service {http://impl.auth.core.service.sp.as.wasu.com/}TestWSService from class com.wasu.as.sp.service.core.auth.impl.TestWS

      12:10:25,031  INFO    [org.apache.cxf.endpoint.ServerImpl] (MSC service thread 1-3) Setting the server's publish address to be http://localhost:8080/spPlatformEJB/TestWS

      12:10:25,046 WARN  [org.jboss.wsf.stack.cxf.resolver.JBossWSResourceResolver] (MSC service thread 1-3) Cannot resolve resource: cxf

      12:10:25,312 INFO  [org.jboss.wsf.stack.cxf.deployment.WSDLFilePublisher] (MSC service thread 1-3) WSDL published to: file:/D:/Programs/redhat/jboss-as-7.0.2.Final/standalone/data/wsdl/spPlatformEJB.jar/TestWSService.wsdl

      12:10:25,312  INFO    [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] (MSC service thread 1-3) Creating Service {http://impl.auth.core.service.sp.as.wasu.com/}services from class com.wasu.as.sp.service.core.auth.impl.UserActionAuthImpl

      12:10:25,515  INFO    [org.apache.cxf.endpoint.ServerImpl] (MSC service thread 1-3) Setting the server's publish address to be http://localhost:8080/spPlatformEJB/services/UserAuthService

      12:10:25,609 INFO  [org.jboss.wsf.stack.cxf.deployment.WSDLFilePublisher] (MSC service thread 1-3) WSDL published to: file:/D:/Programs/redhat/jboss-as-7.0.2.Final/standalone/data/wsdl/spPlatformEJB.jar/services.wsdl

      12:10:25,812 INFO  [org.jboss.as.webservices.service.EndpointService] (MSC service thread 1-3) Starting service jboss.ws.endpoint.spPlatformEJB.TestWS

      12:10:25,828 INFO  [org.jboss.jpa] (MSC service thread 1-2) starting Persistence Unit Service 'spPlatformEJB.jar#spMgr'

      12:10:25,828 INFO  [org.jboss.as.webservices.service.EndpointService] (MSC service thread 1-4) Starting service jboss.ws.endpoint.spPlatformEJB.UserActionAuthImpl

      12:10:26,187 INFO  [org.hibernate.annotations.common.Version] (MSC service thread 1-2) HCANN000001: Hibernate Commons Annotations {4.0.0.CR2}

      12:10:26,187 INFO  [org.hibernate.Version] (MSC service thread 1-2) HHH00412:Hibernate Core {4.0.0.CR2}

      12:10:26,203 INFO  [org.hibernate.cfg.Environment] (MSC service thread 1-2) HHH00206:hibernate.properties not found

      12:10:26,203 INFO  [org.hibernate.cfg.Environment] (MSC service thread 1-2) HHH00021:Bytecode provider name : javassist

      12:10:26,203 INFO  [org.hibernate.ejb.Ejb3Configuration] (MSC service thread 1-2) HHH00204:Processing PersistenceUnitInfo [

                name: spMgr

                ...]

      12:10:26,390 INFO  [org.hibernate.service.jdbc.connections.internal.ConnectionProviderInitiator] (MSC service thread 1-2) HHH00130:Instantiating explicit connection provider: org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider

      12:10:27,031 INFO  [org.hibernate.dialect.Dialect] (MSC service thread 1-2) HHH00400:Using dialect: org.hibernate.dialect.Oracle9iDialect

      12:10:27,046 INFO  [org.hibernate.engine.jdbc.internal.LobCreatorBuilder] (MSC service thread 1-2) HHH00424:Disabling contextual LOB creation as createClob() method threw error : java.lang.reflect.InvocationTargetException

      12:10:27,046 INFO  [org.hibernate.engine.transaction.internal.TransactionFactoryInitiator] (MSC service thread 1-2) HHH00268:Transaction strategy: org.hibernate.engine.transaction.internal.jta.CMTTransactionFactory

      12:10:27,062 INFO  [org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory] (MSC service thread 1-2) HHH00397:Using ASTQueryTranslatorFactory

      12:10:27,140 INFO  [org.hibernate.validator.util.Version] (MSC service thread 1-2) Hibernate Validator 4.2.0.Final

      12:10:27,765 INFO  [org.jboss.web] (MSC service thread 1-2) registering web context: /spPlatformEJB

      12:10:27,765 INFO  [com.wasu.as.sp.service.core.AppStartupBaseBean] (MSC service thread 1-3) startup bean is init......

      12:10:27,765 INFO  [org.jboss.as] (MSC service thread 1-3) JBoss AS 7.0.2.Final "Arc" started in 11906ms - Started 223 of 284 services (61 services are passive or on-demand)

      12:10:27,812 INFO  [org.jboss.as.server.controller] (DeploymentScanner-threads - 2) Deployed "spPlatformEJB.jar"

        -----------------------------------------------------------------------------------------------------------------------------------------------

       

       

       

       

       

       

       

         My EJB client:

          -----------------------------------------------------------------------------------------------------------------------------------------------

      Hashtable<String, String> env = new Hashtable<String, String>();

      env.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");

      env.put(Context.URL_PKG_PREFIXES,"org.jboss.naming:org.jnp.interfaces");

      env.put(Context.PROVIDER_URL, "iiop://localhost:1099");

      try {

                javax.naming.InitialContext ic =new javax.naming.InitialContext(env);

       

                Object object = ic.lookup("java:app/spPlatformEJB/AppClientActionAuthImpl!com.wasu.as.sp.service.core.auth.IAppClientAuthRemote");

                IAppClientAuthLocal appClientAuthLocal = (IAppClientAuthLocal)PortableRemoteObject.narrow(object, IAppClientAuthLocal.class);

       

      } catch (NamingException e) {

                e.printStackTrace();

      }

       

       

       

       

       

      When  ran the EJB client to invoke a stateless bean via JNDI,it show me the listed exceptions:

           ---------------------------------------------------------------------------------------------------------------------------------------------

      javax.naming.CommunicationException: Could not obtain connection to any of these urls: iiop://localhost:1099 and discovery failed with error: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out] [Root exception is javax.naming.CommunicationException: Failed to connect to server iiop://localhost:1099:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server iiop://localhost:1099:1099 [Root exception is java.net.UnknownHostException: iiop://localhost:1099]]]

                at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1763)

                at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:693)

                at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)

                at javax.naming.InitialContext.lookup(InitialContext.java:392)

                at com.wasu.as.sp.service.core.auth.impl.AppClientActionAuthImplTest.testAuthenticateClientAccess(AppClientActionAuthImplTest.java:132)

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

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                at java.lang.reflect.Method.invoke(Method.java:597)

                at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)

                at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)

                at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)

                at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)

                at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)

                at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)

                at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)

                at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)

                at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)

                at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)

                at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)

                at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)

                at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)

                at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)

                at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)

                at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)

                at org.junit.runners.ParentRunner.run(ParentRunner.java:236)

                at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)

                at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)

                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)

                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)

                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)

                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

      Caused by: javax.naming.CommunicationException: Failed to connect to server iiop://localhost:1099:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server iiop://localhost:1099:1099 [Root exception is java.net.UnknownHostException: iiop://localhost:1099]]

                at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:335)

                at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1734)

                ... 31 more

      Caused by: javax.naming.ServiceUnavailableException: Failed to connect to server iiop://localhost:1099:1099 [Root exception is java.net.UnknownHostException: iiop://localhost:1099]

                at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:305)

                ... 32 more

      Caused by: java.net.UnknownHostException: iiop://localhost:1099

                at java.net.InetAddress.getAllByName0(InetAddress.java:1158)

                at java.net.InetAddress.getAllByName(InetAddress.java:1084)

                at java.net.InetAddress.getAllByName(InetAddress.java:1020)

                at java.net.InetAddress.getByName(InetAddress.java:970)

                at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:81)

                at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:301)

      ---------------------------------------------------------------------------------------------------------------------------------------------

       

      seemed that there was something matter with  iiop://localhost:1099.

      it indeed failed when telnet to localhost 1099. (the 1099 port is not binded)

       

      the socket-binding configration could be found in standalone.xml:

      ---------------------------------------------------------------------------------------------------------------------------------------------

          <socket-binding-group name="standard-sockets" default-interface="public">

              <socket-binding name="http" port="8080"/>

              <socket-binding name="https" port="8443"/>

              <socket-binding name="jacorb" port="3528"/>

              <socket-binding name="jacorb-ssl" port="3529"/>

              <socket-binding name="jmx-connector-registry" port="1090" interface="management"/>

              <socket-binding name="jmx-connector-server" port="1091" interface="management"/>

              <socket-binding name="jndi" port="1099"/>

              <socket-binding name="messaging" port="5445"/>

              <socket-binding name="messaging-throughput" port="5455"/>

              <socket-binding name="osgi-http" port="8090" interface="management"/>

              <socket-binding name="remoting" port="4447"/>

              <socket-binding name="txn-recovery-environment" port="4712"/>

              <socket-binding name="txn-status-manager" port="4713"/>

          </socket-binding-group>

       

       

      What is the matter ?

      Any suggestion will be appreciated.

       

      Thanks

        • 1. Re: JNDI invoke issues
          jaikiran

          EJB invocations from a remote client is not supported in 7.0.x. It's available in the recently released 7.1.0.Beta1. For more details, see https://docs.jboss.org/author/display/AS71/EJB+invocations+from+a+remote+client+using+JNDI

          • 2. Re: JNDI invoke issues
            he_man888

            Many  thanks to jaikiran pai.

            I will get the 7.1.0.Beta1 release.

             

            Following https://docs.jboss.org/author/display/AS71/EJB+invocations+from+a+remote+client+using+JNDI ,

             

            here is the client code:

            ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

            private static IAppClientAuthRemote lookupRemoteStatelessCalculator() throws NamingException {

               final Hashtable jndiProperties = new Hashtable();

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

               jndiProperties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");                 

               final Context context = new InitialContext(jndiProperties);

               // The app name is the application name of the deployed EJBs. This is typically the ear name

               // without the .ear suffix. However, the application name could be overridden in the application.xml of the

               // EJB deployment on the server.

                              // Since we haven't deployed the application as a .ear, the app name for us will be an empty string

                              final String appName = "";

                              // This is the module name of the deployed EJBs on the server. This is typically the jar name of the

                              // EJB deployment, without the .jar suffix, but can be overridden via the ejb-jar.xml

                              // In this example, we have deployed the EJBs in a jboss-as-ejb-remote-app.jar, so the module name is

                              // jboss-as-ejb-remote-app

                              final String moduleName = "spPlatformEJB";

                              // AS7 allows each deployment to have an (optional) distinct name. We haven't specified a distinct name for

                              // our EJB deployment, so this is an empty string

                             final String distinctName = "";

                              // The EJB name which by default is the simple class name of the bean implementation class

                              final String beanName = AppClientActionAuthImpl.class.getSimpleName();

                              // the remote view fully qualified class name

                             final String viewClassName = IAppClientAuthRemote.class.getName();

                              // let's do the lookup

                             IAppClientAuthRemote client = (IAppClientAuthRemote) context.lookup("ejb:" + appName + "/" + moduleName + "/" + distinctName + "/" + beanName + "!" + viewClassName);

                              // let's do the lookup

             

             

                              return client;

            }

            ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

             

             

            also that encountered the below exceptions:

            ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

            javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out]

                      at org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:1678)

                      at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1795)

                      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:693)

                      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)

                      at javax.naming.InitialContext.lookup(InitialContext.java:392)

                      at com.wasu.as.sp.service.core.auth.impl.AppClientActionAuthImplTest.lookupRemoteStatelessCalculator(AppClientActionAuthImplTest.java:100)

                      at com.wasu.as.sp.service.core.auth.impl.AppClientActionAuthImplTest.testAuthenticateClientAccess(AppClientActionAuthImplTest.java:115)

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

                      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

                      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                      at java.lang.reflect.Method.invoke(Method.java:597)

                      at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)

                      at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)

                      at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)

                      at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)

                      at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)

                      at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)

                      at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)

                      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)

                      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)

                      at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)

                      at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)

                      at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)

                      at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)

                      at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)

                      at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)

                      at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)

                      at org.junit.runners.ParentRunner.run(ParentRunner.java:236)

                      at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)

                      at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)

                      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)

                      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)

                      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)

                      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

            Caused by: java.net.SocketTimeoutException: Receive timed out

                      at java.net.PlainDatagramSocketImpl.receive0(Native Method)

                      at java.net.PlainDatagramSocketImpl.receive(PlainDatagramSocketImpl.java:145)

                      at java.net.DatagramSocket.receive(DatagramSocket.java:725)

                      at org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:1647)

             

             

             

             

            so, is there any way for me to continue under  JBoss AS 7.0.2.Final "Arc" ?

             

            Thanks


            • 3. Re: JNDI invoke issues
              wdfink

              No,

              as Jaikiran mentioned there is no support for remote access to EJB in AS7.0.x.

               

              For me it works with AS7.1

              First check whether you use a JAR and not a EAR (first element of the ejb:/ name)

              drop Context.INITIAL_CONTEXT_FACTORY from your InitialContext it is not needed, maybe it destroy it

              check whether you have the 'jboss-ejb-client.properties' set correct and in your classpath!

              check that you have all necessary jar's in the runtime classpath (there are some confusing errors if not)

              • 4. Re: JNDI invoke issues
                he_man888

                Thanks to Wolf-Dieter Fink, I'll try that.