-
1. Re: JNDI String binding
jaikiran Jul 15, 2011 3:04 AM (in response to quanlin)Currently it's not possible to bind arbitrary objects to JNDI. JNDI bindings in AS7 are backed by MSC services. So if you have to bind something to JNDI, you'll have to come up with a binding service to do that. Maybe we could introduce a common JNDI binding service which does that. I don't know if there are any issues introducing such a service, probably not. Please create a feature request in the AS7 JIRA so that someone can take a look.
-
2. Re: JNDI String binding
quanlin Jul 15, 2011 3:13 AM (in response to jaikiran)Thanks for the quick reply and I will do some reserch on MSC services. I'll go ahead and create a feature request, please keep me posted when you have such a common service, really appreciate that.
-
3. Re: JNDI string binding
quanlin Nov 23, 2011 5:02 PM (in response to quanlin)This is claimed to be resolved in 7.1.0 beta1
-
4. Re: JNDI string binding
anewton Dec 7, 2011 3:25 PM (in response to quanlin)I see that AS7-1293 marks this issue as resolved.
But I just downloaded AS7.1beta1b and cannot figure out where this new feature is.
Is there any documentation on this at all?
-
5. Re: JNDI string binding
seafoxx Dec 15, 2011 6:14 AM (in response to anewton)Hey, I just figured it out:
in your /standalone/configuration folder you'll find the standalone.xml where all the subsystems are configured.
Within the xml you'll find the following empty tag:
<subsystem xmlns="urn:jboss:domain:naming:1.1"/>
This would be a simple string binding (string is the default if not specified):
<subsystem xmlns="urn:jboss:domain:naming:1.1">
<bindings>
<simple name="my/jndi/key" value="MyJndiValue"/>
</bindings>
</subsystem>
you can find a detailed description in the schema /docs/schema/jboss-as-naming_1_1.xsd
-
6. Re: JNDI string binding
benze Feb 2, 2012 9:30 AM (in response to seafoxx)Sebastian Kaempfe wrote:
Hey, I just figured it out:
in your /standalone/configuration folder you'll find the standalone.xml where all the subsystems are configured.
Within the xml you'll find the following empty tag:
<subsystem xmlns="urn:jboss:domain:naming:1.1"/>
This would be a simple string binding (string is the default if not specified):
<subsystem xmlns="urn:jboss:domain:naming:1.1">
<bindings>
<simple name="my/jndi/key" value="MyJndiValue"/>
</bindings>
</subsystem>
you can find a detailed description in the schema /docs/schema/jboss-as-naming_1_1.xsd
Is this only available in AS7.1? I've got 7.0 installed and the naming schema file in 7.0 shows an empty element.
Thanks,
Eric -
7. Re: JNDI string binding
jaikiran Feb 2, 2012 9:43 AM (in response to benze)Eric B wrote:
Is this only available in AS7.1?
Yes
-
8. Re: JNDI string binding
benze Feb 2, 2012 9:53 AM (in response to jaikiran)jaikiran pai wrote:
Eric B wrote:
Is this only available in AS7.1?
Yes
Thanks for the info. Does this mean that anyone running AS7.0 is out of luck of creating String JNDI bindings? That would seem like a significant oversight.
-
9. Re: JNDI string binding
quanlin Feb 2, 2012 12:37 PM (in response to benze)It is confirmed that this feature is available in AS7.1, so if you want to continue to use AS7.0, you can probably do the same thing as I did, create a dummy web app that only serves the purpose of loading those "JNDI bindings", inside the web.xml of that app,
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<display-name>jndiBinding</display-name>
<env-entry>
<env-entry-name>java:global/env/snotel/webAppsRoot</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>http://localhost:8080/your app namel/</env-entry-value>
</env-entry>
basically, use the local environment to fulfill the task, but remember one thing, since you are trying to bind the value for other apps to use, you have to make sure, before every other apps trying to hit the binding string here, this dummy app has been loaded first. Be aware of the new domain name of JNDI.
-
10. Re: JNDI string binding
zerkowski.maciek Mar 22, 2014 2:35 PM (in response to quanlin)And do you know if instead of changing standalone.xml file located in configuration folder, there is a possibility in JBoss 7.1 of adding such JNDI binding in some standalone file like it was in case of JBoss 5 with the *-service.xml file? I would like to put such a file together with the war and *-ds.xml into the deployments folder as it was possible in JBoss 5.
Regards,
Maciek