Why is AccessControlException throwing DataSource.getConnection() ?!?!

I am trying to learn how to code a BMP entity bean. I created a

simple bean. Inside of the setEntityContext() method it uses JNDI to

get the name of a Microsoft SQL Server DataSource that I have

configured. I deployed it on the reference implementation. It seems

I am getting the DataSource OK. The problem is that

dataSource.getConnection() is always failing. It throws an

AccessControlException every time.

I took a look inside the sun-j2ee-ri.xml file and found the following

snippet:

<resource-ref>

<res-ref-name>jdbc/MyBmpData</res-ref-name>

<jndi-name>jdbc/MyDummyDataSourceJNDI</jndi-name>

<default-resource-principal>

<name>sa</name>

<password></password>

</default-resource-principal>

</resource-ref>

This XML seems like it should produce a valid connection to the

database since "sa" / "" are the corret username / password for my SQL

Server. Can somebody offer me a suggestion?

Thanks in advance,

Craig

[1141 byte] By [crmilley] at [2007-9-19]
# 1

Here is the stack trace from error.log.

java.rmi.RemoteException: nested exception is: java.security.AccessControlException: access denied (java.lang.RuntimePermission modifyThreadGroup); nested exception is:

java.security.AccessControlException: access denied (java.lang.RuntimePermission modifyThreadGroup)

java.security.AccessControlException: access denied (java.lang.RuntimePermission modifyThreadGroup)

at java.security.AccessControlContext.checkPermission(AccessControlContext.java:272)

at java.security.AccessController.checkPermission(AccessController.java:399)

at java.lang.SecurityManager.checkPermission(SecurityManager.java:545)

at com.sun.enterprise.J2EESecurityManager.checkAccess(J2EESecurityManager.java:50)

at java.lang.ThreadGroup.checkAccess(ThreadGroup.java:279)

at java.lang.Thread.init(Thread.java:265)

at java.lang.Thread.<init>(Thread.java:330)

at com.microsoft.jdbc.base.BaseGarbageThread.<init>(Unknown Source)

at com.microsoft.jdbc.base.BaseGarbageThread.EnsureRunning(Unknown Source)

at com.microsoft.jdbc.base.BaseConnection.open(Unknown Source)

at com.microsoft.jdbc.base.BaseDriver.connect(Unknown Source)

at java.sql.DriverManager.getConnection(DriverManager.java:517)

at java.sql.DriverManager.getConnection(DriverManager.java:177)

at com.sun.enterprise.resource.JdbcUrlAllocator.createResource(JdbcUrlAllocator.java:49)

at com.sun.enterprise.resource.PoolManagerImpl.getResourceFromPool(PoolManagerImpl.java:181)

at com.sun.enterprise.resource.JdbcXAConnection.<init>(JdbcXAConnection.java:60)

at com.sun.enterprise.resource.Jdbc10XaAllocator.createResource(Jdbc10XaAllocator.java:70)

at com.sun.enterprise.resource.PoolManagerImpl.getResourceFromPool(PoolManagerImpl.java:181)

at com.sun.enterprise.resource.PoolManagerImpl.getResource(PoolManagerImpl.java:130)

at com.sun.enterprise.resource.JdbcDataSource.internalGetConnection(JdbcDataSource.java:141)

at com.sun.enterprise.resource.JdbcDataSource.getConnection(JdbcDataSource.java:78)

at ejb.MyBmpBean.ejbCreate(MyBmpBean.java:34)

at ejb.MyBmpBean_RemoteHomeImpl.create(MyBmpBean_RemoteHomeImpl.java:25)

at ejb._MyBmpBean_RemoteHomeImpl_Tie._invoke(Unknown Source)

at com.sun.corba.ee.internal.POA.GenericPOAServerSC.dispatchToServant(GenericPOAServerSC.java:519)

at com.sun.corba.ee.internal.POA.GenericPOAServerSC.internalDispatch(GenericPOAServerSC.java:204)

at com.sun.corba.ee.internal.POA.GenericPOAServerSC.dispatch(GenericPOAServerSC.java:112)

at com.sun.corba.ee.internal.iiop.ORB.process(ORB.java:273)

at com.sun.corba.ee.internal.iiop.RequestProcessor.process(RequestProcessor.java:84)

at com.sun.corba.ee.internal.orbutil.ThreadPool$PooledThread.run(ThreadPool.java:99)

crmilley at 2007-7-4 > top of java,Enterprise & Remote Computing,Enterprise Technologies...
# 2
Sorry my title is backwards: I meant to type:Why is DataSource.getConnection() throwing AccessControlException ?!?!
crmilley at 2007-7-4 > top of java,Enterprise & Remote Computing,Enterprise Technologies...