Good afternoon.
[http://shale.apache.org/features-jndi-integration.html] link says to me
that I can aquire a java.sql.Connection from this data source ..
but it constantly return null.
from the myfaces BackBean this datasource resolves good.
Does anybody have any ideas?
I have next entry in the web.xml
<resource-ref>
<description>postgreSQL Datasource</description>
<res-ref-name>jdbc/postgres</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
and use next class:
public class jndiTest extends AbstractViewController
{
public jndiTest()
{
try
{
FacesContext context = FacesContext.getCurrentInstance();
Application appl = context.getApplication();
ValueBinding vb =
context.getApplication().createValueBinding("#{jndi['jdbc/postgres'].connection}");
Connection conn = (Connection) vb.getValue(context);
}
catch (Exception e)
{
e.printStackTrace();
}
}
}
and I call object of this class in this way:
public class TestLoginBackBean extends AbstractViewControllerTestCase
{
LoginBackBean loginBackBean;
public TestLoginBackBean(String name)
{
super(name);
}
public static Test suite()
{
return (new TestSuite(TestLoginBackBean.class));
}
public void setUp()
{
super.setUp();
loginBackBean = new LoginBackBean();
}
public void tearDown()
{
loginBackBean = null;
super.tearDown();
}
public void testLoginBackBean_one()
{
jndiTest jnditest = new jndiTest();
}
}
--
View this message in context:
http://www.nabble.com/shale%3A-jndi-lookup-error-tf2055640.html#a5663762
Sent from the Struts - User forum at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]