-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENC problem #1
Comments
Hi, Jérôme,
as you configured it, the path to your datasource should be "java/jboss/datasources/my_ds”. Note that "java" and "jboss" are divided by "/" not ":".
To use "java:jboss" as ENC set
org.osjava.sj.space=java:jboss
Then you can refer to your datasource with "java:jboss/jboss/datasources/my_ds”.
When you would move datasources.properties to src/test/resources/jndi the path to it were "java:jboss/datasources/my_ds”.
best regards
Holger
… On 28 Jan 2017, at 00:13, Jérôme Simmonds ***@***.***> wrote:
Hi,
I am trying to load:
InitialContext ic = new InitialContext();
ic.lookup("java:jboss/datasources/my_ds");
But I get the error Invalid subcontext 'java:jboss' in context ''
Content of the src/test/resources/jndi.properties file:
java.naming.factory.initial=org.osjava.sj.SimpleContextFactory
org.osjava.sj.root=src/test/resources/jndi
org.osjava.sj.delimiter=/
org.osjava.sj.space=java
org.osjava.sj.jndi.shared=true
Content of the src/test/resources/jndi/jboss/datasources.properties file:
my_ds.type=javax.sql.DataSource
my_ds.driver=com.mysql.jdbc.Driver
my_ds.url=jdbc:mysql://localhost:3306/my_ds
my_ds.user=xxx
my_ds.password=xxx
What is wrong? Thanks!
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub <#1>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AXnVr-Ttd8aGhnCxqE-4f4NS0_u3GLJ2ks5rWnohgaJpZM4LwUH9>.
|
Hi, Thanks for your answer. Then I moved Now I don't get the error anymore but |
Hi, because you set org.osjava.sj.delimiter=/ you have to use "/" as namespace separator in datasources.properties too: my_ds/type=javax.sql.DataSource |
Thanks! |
It is a bit unusual to use "/" in property names, and I am not happy with
it but it is the way it is implemented. But I am working on a way to
combine dots in configuration files with slashes in lookup pathes. So
revisit this site to get the next update.
…On Jan 30, 2017 5:06 PM, "Jérôme Simmonds" ***@***.***> wrote:
Thanks!
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AXnVr-OTyrJw7y2z1WWfZf_2eI3m2h6Tks5rXgpvgaJpZM4LwUH9>
.
|
Today I released 0.14.0. You can now use slash separated lookup pathes with dot separated property names. See https://github.com/h-thurow/Simple-JNDI/wiki/Use-slash-separated-lookup-pathes-with-dot-separated-property-names-(New-in-0.14.0) . |
Hi,
I am trying to load:
But I get the error
Invalid subcontext 'java:jboss' in context ''
Content of the
src/test/resources/jndi.properties
file:Content of the
src/test/resources/jndi/jboss/datasources.properties
file:What is wrong? Thanks!
The text was updated successfully, but these errors were encountered: