I am having a problem connecting to JDBC's EJB SessionBean. Error:
org.jboss.util.NestedSQLException: Failed to secure transaction while entering meta-discovery object !; - inested throwable: (javax.transaction.SystemException: java.lang.Throwable: Unabled to attract a resource, see previous warnings.
I thought this was happening because I already have an open connection to another data source, so I configured the XA data source to avoid transaction problems, but it doesn’t work at all, so I don’t know if I am doing something not so in my code. There he is:
try
{
Properties p = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
p.put(Context.PROVIDER_URL,"jnp://localhost:11099");
p.put("java.naming.factory.url.pkgs", "org.jboss.naming");
InitialContext ic = new InitialContext(p);
DataSource dataSource = (DataSource)ic.lookup("java:/jdbc/etlreportservices");
return dataSource.getConnection();
}
catch(Exception e)
{
e.printStackTrace();
}
An exception is thrown when called dataSource.getConnection().