Jboss: How to Find a remote data sources

  Abstract: jboss: How to Find a remote data sources 


  Below jbuilder run in the process, Baoxi: javax.naming.NameNotFoundException: ssDS not bound 
  If jsp: direct writing 
  InitialContext ctx = new InitialContext (); 
  Ctx.lookup (); you will find initialization InitialContext guess is the problem, but could not find reasons, please expert advice 

  Public static void getDataSource () 
  ( 
  Try 
  ( 
  Properties properties = new Properties (); 
  Properties.put ( "java.naming.factory.initial" 
  "Org.jnp.interfaces.NamingContextFactory"); 
  Properties.put ( "java.naming.provider.url", "jnp: / / localhost: 1099"); 
  Properties.put ( "jjava.naming.factory.url.pkgs", "org.jboss.naming: org.jnp.interfaces"); 

  InitialContext ctx = new InitialContext (properties); 
  DataSource datasource = (DataSource) ctx.lookup ( "java: / ssDS"); 
  ) 
  Catch (Exception ex) 
  ( 
  Ex.printStackTrace (); 
  ) 
  ) 




  The landlord to use JNDI is a proper way of concrete I do not know what the top-huh 



  Ds.xml oracle-in configuration is not the problem, or could not find any datasource with the jsp 



  Using EJB bar, this method is better 



  Please expert advice ah 



  You use the localhost, is not the server machines? 



  In the plane 



  Lookup ( "java: / ssDS"); 
  This is a problem, JNDI is the result of the visit.    Java: / ssDS overall situation is not accessible, then the only local visit, if you use when bundled jdni ssDS, ssDS is that the overall situation.    Jboss with the jndiview can see such a change. 



  Agree with the views of the upper floors 



  Below is the positive solution 
  In JBoss4 you can bind the ConnectionFactory / DataSource in the global namespace 


GenericDS
  False 
  [Jdbc: url for use with Driver class] 
  [Fully qualified class name of java.sql.Driver implementation] 
  X 

  Y 




  Jboss answer from the wiki, hey, speechless, which is the gap we have with others 



  ↑ Back 

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Facebook
  • DotNetKicks
  • DZone
  • Netvouz
  • Propeller

Tags: ,

Releated Java Articles

Comments

Leave a Reply