I have successfully bound a DataSource to the naming service:
[WrapperDataSourceService] Bound connection factory for resource adapter for 
ConnectionManager 'jboss.jca:name=MySqlDS,service=DataSourceBinding to JNDI 
name 'java:MySqlDS'

Objects deployed in the Application Server are able to look this up using:

  |         private String initialContextFactory = 
"org.jnp.interfaces.NamingContextFactory";
  |     private String url = "localhost:1099";
  |     private String namingFactoryURLPackages = 
"org.jboss.naming:org.jnp.interfaces";
  | 
  |     env = new Properties();
  |     env.setProperty(Context.INITIAL_CONTEXT_FACTORY, initialContextFactory);
  |     env.setProperty(Context.PROVIDER_URL, url);
  |     env.setProperty(Context.URL_PKG_PREFIXES, namingFactoryURLPackages);
  |     try {
  |                     ctx = new InitialContext(env);
  |                         Object o = ctx.lookup("java:MySqlDS");
  |             } catch (NamingException e) {
  |                    //
  |             }
  |     }
  | 

I am now writing JUnit test cases; these objects are not deployed into the 
Application Server. When I use the same code to lookup java:MySqlDS I receive a 
NamingException. When I list all bindings, none are found. 

It seems I'm missing something conceptually... based on what I know there 
should be no difference between objects deployed / outside the Application 
Server and how they interact with the naming service.

Thanks in advance.

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3860815#3860815

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3860815


-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to