Version 1

    I am also trying to connect to a stateless session bean, and it works partially – I can deploy my application ear successfully, also can contact the server, but no matter how I try to name the EJB, I get a NameNotFoundException, just like:

     

    javax.naming.NameNotFoundException: eclipselink-advanced-model/TestRunner!org.eclipse.persistence.testing.framework.server.TestRunner -- service jboss.naming.context.java.jboss.exported.eclipselink-advanced-model."TestRunner!org.eclipse.persistence.testing.framework.server.TestRunner"

        at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:97)

        at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:178)

        at org.jboss.naming.remote.protocol.v1.Protocol$1.handleServerMessage(Protocol.java:127)

        at org.jboss.naming.remote.protocol.v1.RemoteNamingServerV1$MessageReciever$1.run(RemoteNamingServerV1.java:73)

        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

        at java.lang.Thread.run(Thread.java:662)

     

    I have the following environment:

     

    JBoss-as-7.1.1.Final

    My EAR: eclipselink-advanced-model.ear

    My EJB archive: eclipselink-advanced-model_ejb.jar

    My stateless session bean: TestRunnerBean

     

    Actually my application worked fine on JBoss-5.1.0, I have made the following changes with jndi.properties and lookup, my jndi.properties just like the following:

     

    java.naming.factory.initial=org.jboss.naming.remote.client.InitialContextFactory

    java.naming.factory.url.pkgs=org.jboss.ejb.client.naming

    java.naming.provider.url=remote://localhost:4447

    java.naming.security.principal=usera

    java.naming.security.credentials=passworda

    java.naming.security.authentication=none

     

    And the lookup just like: ejb:eclipselink-advanced-model/eclipselink-advanced-model_ejb/TestRunner!org.eclipse.persistence.testing.framework.server.TestRunner

    (for JBoss-5.1.0, the lookup is: TestRunner/remote-org.eclipse.persistence.testing.framework.server.TestRunner)

     

    I have referred to the post: https://community.jboss.org/message/722635, and I also tried to add jboss-ejb-client.properties in the client classpath, still didn't help. BTW, my jboss-ejb-client.properties just like the following:

     

    remote.connections=default

    endpoint.name=client-endpoint

    remote.connection.default.port=4447

    remote.connection.default.host=127.0.0.1

    remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false

    remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false

    remote.connection.default.username=usera

    remote.connection.default.password=passworda

     

    Does anyone can give me a hint to things I can try out? Any suggestion will be appreciated.