-
1. Re: JNDI Names
prasad.deshpande Jul 13, 2011 9:31 AM (in response to simas_ch)the one that worked for me is to use "java:/" before queue or topic. So in your case it will be :
for connectionfactory use: java:/ConnectionFactory
for topic & queue
"java:/queue/test", "java:/bestellqueue" & "java:/topic/test".
Use following:
@Resource(mappedName = "java:/ConnectionFactory")
private ConnectionFactory connectionFactory;@Resource(mappedName = "java:/queue/bestellqueue")
private Queue queue; -
2. Re: JNDI Names
simas_ch Jul 13, 2011 9:45 AM (in response to prasad.deshpande)Thanks for your answer.
Unfortunatly this doesn't work for me:
missing [ jboss.naming.context.java.ConnectionFactory ]
-
3. Re: JNDI Names
prasad.deshpande Jul 13, 2011 9:54 AM (in response to simas_ch)Can you post your <jms-connection-factories> node? Also, are you using hornetq-ra as a pooled connectionfactory? for me it is
<pooled-connection-factory name="hornetq-ra">
<connectors>
<connector-ref connector-name="in-vm"/>
</connectors>
<entries>
<entry name="java:/JmsXA"/>
</entries>
</pooled-connection-factory>
so I use "java:/JmsXA" as mappedName in @Resource annotation.
-
4. Re: JNDI Names
simas_ch Jul 13, 2011 10:00 AM (in response to prasad.deshpande)<jms-connection-factories>
<connection-factory name="InVmConnectionFactory">
<connectors>
<connector-ref connector-name="in-vm"/>
</connectors>
<entries>
<entry name="java:/ConnectionFactory"/>
</entries>
</connection-factory>
<connection-factory name="RemoteConnectionFactory">
<connectors>
<connector-ref connector-name="netty"/>
</connectors>
<entries>
<entry name="RemoteConnectionFactory"/>
</entries>
</connection-factory>
<pooled-connection-factory name="hornetq-ra">
<transaction mode="xa"/>
<connectors>
<connector-ref connector-name="in-vm"/>
</connectors>
<entries>
<entry name="java:/JmsXA"/>
</entries>
</pooled-connection-factory>
</jms-connection-factories> -
5. Re: JNDI Names
prasad.deshpande Jul 13, 2011 10:11 AM (in response to simas_ch)1 of 1 people found this helpful@Resource(mappedName = "java:/JmsXA")
private ConnectionFactory connectionFactory;@Resource(mappedName = "java:/queue/bestellqueue")
private Queue queue;should work for you.
-
6. Re: JNDI Names
simas_ch Jul 13, 2011 10:26 AM (in response to prasad.deshpande)Thanks Prasad, this helped. With java:/JmsXA theres no more error message but with ConnectionFactory it does not work.
But now I run in another problem.
I have defined a SecurityRealm:
<security-realm name="ActiveDirectory">
<authentication>
<properties path="shop-users.properties" relative-to="jboss.server.config.dir" />
</authentication>
</security-realm>And have a mapping in jboss-web.xml:
<jboss-web>
</jboss-web>
But it does not find it:
missing [ jboss.security.security-domain.ActiveDirectory ]
Any ideas on that?
-
7. Re: JNDI Names
jaikiran Jul 13, 2011 10:36 AM (in response to simas_ch)Simon Martinelli wrote:
Thanks Prasad, this helped. With java:/JmsXA theres no more error message but with ConnectionFactory it does not work.
But now I run in another problem.
I have defined a SecurityRealm:
<security-realm name="ActiveDirectory">
<authentication>
<properties path="shop-users.properties" relative-to="jboss.server.config.dir" />
</authentication>
</security-realm>security-realm? That's used for the management interfaces. You should be using a security-domain in the security subsystem. Check the standalone.xml/domain.xml which has an example.
Simon Martinelli wrote:
And have a mapping in jboss-web.xml:
<jboss-web>
</jboss-web>
Once you have setup the security-domain, then within the jboss-web.xml, just use the security domain name and not the jndi name:
<jboss-web> <security-domain>ActiveDirectory</security-domain> </jboss-web>
-
8. Re: JNDI Names
simas_ch Jul 13, 2011 11:17 AM (in response to jaikiran)Oh I see. But there is no useful example.
What's the replacement for login-config.xml <= AS6? I like to use LDAP for authentication.
That's how I did it in AS 6
<application-policy name="ActiveDirectory">
<authentication>
<login-module code="org.jboss.security.auth.spi.LdapExtLoginModule" flag="required" >
<!-- Some AD configurations may require searching against the Global Catalog on port 3268 instead of the usual port 389.
This is most likely when the AD forest includes multiple domains. -->
<module-option name="java.naming.provider.url">ldap://xy.ch:3168</module-option>
<module-option name="java.naming.security.authentication">simple</module-option>
<module-option name="bindDN">ad\ab</module-option>
<module-option name="bindCredential">xy</module-option>
<module-option name="baseCtxDN">dc=ad,dc=bls,dc=ch</module-option>
<module-option name="baseFilter">(sAMAccountName={0})</module-option>
<module-option name="rolesCtxDN">dc=ad,dc=bls,dc=ch</module-option>
<module-option name="roleFilter">(member={1})</module-option>
<module-option name="roleAttributeIsDN">true</module-option>
<module-option name="roleNameAttributeID">name</module-option>
</login-module>
<login-module code="org.jboss.security.auth.spi.RoleMappingLoginModule" flag="optional">
<module-option name="rolesProperties">props/rolesMapping-roles.properties</module-option>
</login-module>
</authentication>
</application-policy>