[jboss-user] [JNDI/Naming/Network] - look Database not effect (Urgent). Please!

changemylife do-not-reply at jboss.com
Wed Feb 7 23:25:30 EST 2007


Hi all !
  I am using jboss-4.0.5.GA. I install MySQL and JBoss Server on the same machine. When I install JBoss server, I select mysql, so I need only copy driver "mysql-connector-java-3.1.14-bin.jar" to ..\server\lib and don't need edit file hsqldb-ds.xml (inside ..\server\default\deploy). Am I right?
  When I restart server, I see some messages: 
...
11:15:39,632 INFO  [WrapperDataSourceService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=QuocThaiDS' to JNDI name 'java:QuocThaiDS
...
My ejb-jar.xml:
----
   <res-ref-name>jdbc/QuocThaiDS</res-ref-name>
   <res-type>javax.sql.DataSource</res-type>
   <res-auth>Container</res-auth>
----
login-config.xml:
----
   <application-policy name="DB-Domain">
      
	 <login-module code="org.jboss.security.auth.spi.DatabaseServerLoginModule" flag="required">
	   <module-option name="dsJndiName">java:QuocThaiDS</module-option>
	   <module-option name="principalsQuery">
		select passwd from Users where username=?</module-option>
	   <module-option name="rolesQuery">
		select Role, 'Roles' from Roles where username=?</module-option>
	  </login-module>
	
   </application-policy>
----
jboss.xml:
----
...
<security-domain>DB-Domain</security-domain>
   <enterprise-beans>
        
            <ejb-name>Hello</ejb-name>
            <resource-ref>
            	<res-ref-name>jdbc/QuocThaiDS</res-ref-name>
		<jndi-name>java:QuocThaiDS</jndi-name>
            </resource-ref>
        
    </enterprise-beans>
...
----
But, on the other machine, I lookup:
DataSource ds = (DataSource) ctx.lookup("java:/comp/env/jdbc/QuocThaiDS");
I received some messages: comp not bound.
Have any ideals ? Thanks.

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

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



More information about the jboss-user mailing list