[jboss-jira] [JBoss JIRA] (AS7-1338) Remote JNDI support for AS7
Miroslav Novak (JIRA)
jira-events at lists.jboss.org
Tue Feb 7 06:28:50 EST 2012
[ https://issues.jboss.org/browse/AS7-1338?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12664718#comment-12664718 ]
Miroslav Novak commented on AS7-1338:
-------------------------------------
Hi all,
I'm just adding some brief info from John about newly implemented remote jndi support and how to use it. As I understood everything what should be reachable in jndi from outside the server must be registered under "java:jboss/exported/" context.
As an example I used it in standalone jms client to get connection factory and queue from jndi:
{code}
// jms client code
// initialize context
final Properties env = new Properties();
env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");
env.put(Context.PROVIDER_URL, "remote://localhost:4447");
Context context = new InitialContext(env);
// do lookups
ConnectionFactory cf = (ConnectionFactory) context.lookup("jms/RemoteConnectionFactory");
Queue queue = (Queue) context.lookup("jms/queue/test");
// do whatever you want
{code}
How are jms objects registered to jndi in messaging subsystem in standalone-ha.xml:
{code}
<jms-connection-factories>
...
<!-- configuration for connection factory -->
<connection-factory name="RemoteConnectionFactory">
<connectors>
<connector-ref connector-name="netty"/>
</connectors>
<entries>
<entry name="java:jboss/exported/jms/RemoteConnectionFactory"/> <!- this is the important part -->
</entries>
</connection-factory>
...
</jms-connection-factories>
<jms-destinations>
...
<jms-queue name="testQueue">
<entry name="java:jboss/exported/jms/queue/test"/> <!- this is the important part -->
</jms-queue>
...
</jms-destinations>
{code}
Used libraries (in my simple client):
hornetq-core-2.2.11.Final.jar
hornetq-jms-2.2.11.Final.jar
jboss-as-naming-7.1.0.Final-SNAPSHOT.jar
jboss-jms-api_1.1_spec-1.0.0.Final.jar
jboss-logging-3.1.0.GA.jar
jboss-marshalling-1.3.6.GA.jar
jboss-marshalling-river-1.3.6.GA.jar
jboss-modules.jar
jboss-msc-1.0.2.GA.jar
jboss-remote-naming-1.0.0.Beta4.jar
jboss-remoting-3.2.0.CR9.jar
jboss-sasl-1.0.0.Beta9.jar
netty-3.2.6.Final.jar
xnio-api-3.0.0.GA.jar
xnio-nio-3.0.0.GA.jar
Note:
I had to add static block to my class so I could connect to server through remoting:
{code}
static {
Security.addProvider(new JBossSaslProvider());
}
{code}
Hopefully I didn't forget anything and this info will help.
Thanks for this cool feature,
Mirek
> Remote JNDI support for AS7
> ---------------------------
>
> Key: AS7-1338
> URL: https://issues.jboss.org/browse/AS7-1338
> Project: Application Server 7
> Issue Type: Task
> Components: Naming
> Reporter: Richard Opalka
> Assignee: John Bailey
> Priority: Critical
> Labels: eap6_prd_req
> Fix For: 7.1.0.Final
>
>
> Add support for remote JNDI after all. It was agreed that:
> * Remote JNDI would run over Remoting
> * Remote JNDI for EJB is strictly a legacy access protocol, deprecated in favor of "ejb:"
> * The Remote JNDI service would proxy to a specific Context of the server JNDI tree - maybe "java:jboss/shared", maybe something else
> * Server-side services would opt-in to Remote JNDI; initially we'd only support:
> ** Remote EJB interfaces
> ** HornetQ connection factories
> * In the future we may support:
> ** User bindings, so long as they're serializable
> * In the future we will never support:
> ** Proxied DataSources
> ** Proxied JMS invocations
> Initial project tree is at https://github.com/dmlloyd/jboss-remote-jndi for now.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list