Hi!
The 'ElementBean' entity bean I have written works fine when used with the
Hypersonic database, which constitutes the default database for JBoss.
However, when switching to MS SQL Server the following exception is raised.
All methods have unchecked access. Would someone please explain this
behaviour?
Thanks
:07:13,179 DEBUG [Element#findByPrimaryKey] Executing SQL: SELECT
Column_Name1, Column_Name2 FROM Element WHERE Column_Name1=? AND
Column_Name2=?
:07:13,320 DEBUG [Element#findByPrimaryKey] Find failed
va.sql.SQLException: [Microsoft][SQLServer 2000 Driver for
JDBC][SQLServer]SELECT permission denied on object 'Element', database
'jbossdatabase', owner 'jbossuser'.
at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown
Source)
at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
at
com.microsoft.jdbc.sqlserver.tds.TDSRequest.processErrorToken(Unknown
Source)
at
com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReplyToken(Unknown
Source)
at
com.microsoft.jdbc.sqlserver.tds.TDSRPCRequest.processReplyToken(Unknown
Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReply(Unknown
Source)
at
com.microsoft.jdbc.sqlserver.SQLServerImplStatement.getNextResultType(Unknow
n Source)
at
com.microsoft.jdbc.base.BaseStatement.commonTransitionToState(Unknown
Source)
at com.microsoft.jdbc.base.BaseStatement.postImplExecute(Unknown
Source)
at
com.microsoft.jdbc.base.BasePreparedStatement.postImplExecute(Unknown
Source)
at com.microsoft.jdbc.base.BaseStatement.commonExecute(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.executeQueryInternal(Unknown
Source)
at com.microsoft.jdbc.base.BasePreparedStatement.executeQuery(Unknown
Source)
at
org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(Wrappe
dPreparedStatement.java:302)
at
org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractQueryCommand.execute(JDBCAbstract
QueryCommand.java:161)
at
org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractQueryCommand.execute(JDBCAbstract
QueryCommand.java:106)
at
org.jboss.ejb.plugins.cmp.jdbc.JDBCFindEntityCommand.execute(JDBCFindEntityC
ommand.java:49)
at
org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.findEntity(JDBCStoreManager.
java:536)
at
org.jboss.ejb.plugins.CMPPersistenceManager.findEntity(CMPPersistenceManager
.java:299)
at
org.jboss.resource.connectionmanager.CachedConnectionInterceptor.findEntity(
CachedConnectionInterceptor.java:300)
at org.jboss.ejb.EntityContainer.find(EntityContainer.java:696)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContaine
r.java:1042)
at
org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.jav
a:88)
at
org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySync
hronizationInterceptor.java:197)
at
org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(
CachedConnectionInterceptor.java:214)
at
org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.jav
a:88)
at
org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInt
erceptor.java:89)
at
org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor
.java:61)
at
org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInt
erceptor.java:28)
at
org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor
.java:88)
at
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.
java:267)
at
org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:98)
at
org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.jav
a:92)
at
org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:120)
at
org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryF
inderInterceptor.java:93)
at
org.jboss.ejb.EntityContainer.internalInvokeHome(EntityContainer.java:484)
at org.jboss.ejb.Container.invoke(Container.java:720)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispat
cher.java:284)
at
org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
at
org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:367)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
at sun.rmi.transport.Transport$1.run(Transport.java:148)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
at
sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:7
01)
at java.lang.Thread.run(Thread.java:534)
Petros Petrou - 26 Feb 2004 21:54 GMT
I havent tried it myself but
it seems that the user that you have specified in
your sql server datasource xml file in JBoss, does not
have permissions to do the SELECT on the table element.
Open Enterprise Manager and set the permissions or try to change the
user name , password in the data source xml and
login as sa (System Administrator), password is usually blank
and see what it happens. If it works fine then its a permissions
issue on your orinigal user.
Hope this helps
Petros
> Hi!
>
[quoted text clipped - 149 lines]
> 01)
> at java.lang.Thread.run(Thread.java:534)