[jboss-user] [Beginners Corner] - jboss doesn't use my datasource

Sanver do-not-reply at jboss.com
Wed Dec 27 05:34:56 EST 2006


First of all, merry Christmas to everybody.

I'm using Jboss4.0.4 with xdoclet and, once deployed an ear file with my project,  I access a CMP bean by its home interface and it throws the following exception:

 10:33:36,587 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
  | javax.ejb.ObjectNotFoundException: No such entity!
  | 	at org.jboss.ejb.plugins.cmp.jdbc.JDBCFindEntityCommand.execute(JDBCFindEntityCommand.java:64)
  | 	at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.findEntity(JDBCStoreManager.java:604)
  | 	at org.jboss.ejb.plugins.CMPPersistenceManager.findEntity(CMPPersistenceManager.java:315)
  | 	at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.findEntity(CachedConnectionInterceptor.java:236)
  | 	at org.jboss.ejb.EntityContainer.findSingleObject(EntityContainer.java:1103)
  | 	at org.jboss.ejb.EntityContainer.findLocal(EntityContainer.java:669)
  | 	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:585)
  | 	at org.jboss.invocation.Invocation.performCall(Invocation.java:359)
  | 	at org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContainer.java:1130)
  | 	at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:105)
  | 	at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySynchronizationInterceptor.java:203)
  | 	at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:189)
  | 	at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:105)
  | 	at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:134)
  | 	at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:76)
  | 	at org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInterceptor.java:43)
  | 	at org.jboss.ejb.plugins.CallValidationInterceptor.invokeHome(CallValidationInterceptor.java:56)
  | 	at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:125)
  | 	at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)
  | 	at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:161)
  | 	at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:145)
  | 	at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:132)
  | 	at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryFinderInterceptor.java:107)
  | 	at org.jboss.ejb.EntityContainer.internalInvokeHome(EntityContainer.java:514)
  | 	at org.jboss.ejb.Container.invoke(Container.java:975)
  | 	at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invokeHome(BaseLocalProxyFactory.java:359)
  | 	at org.jboss.ejb.plugins.local.LocalHomeProxy.invoke(LocalHomeProxy.java:133)
  | 	at $Proxy57.findByUser(Unknown Source)
  | 	at mat.icm.ICMCoreBean.BuscarUsuario(ICMCoreBean.java:87)
  | 	at mat.icm.ICMCoreBean.GetContactosDeUsuario(ICMCoreBean.java:107)
  | 	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:585)
  | 	at org.jboss.invocation.Invocation.performCall(Invocation.java:359)
  | 	at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:237)
  | 	at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:158)
  | 	at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:169)
  | 	at org.jboss.ws.server.ServiceEndpointInterceptor.invoke(ServiceEndpointInterceptor.java:64)
  | 	at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)
  | 	at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)
  | 	at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)
  | 	at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
  | 	at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:168)
  | 	at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
  | 	at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:136)
  | 	at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:648)
  | 	at org.jboss.ejb.Container.invoke(Container.java:954)
  | 	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:585)
  | 	at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
  | 	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
  | 	at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
  | 	at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
  | 	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
  | 	at org.jboss.invocation.local.LocalInvoker$MBeanServerAction.invoke(LocalInvoker.java:169)
  | 	at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:118)
  | 	at org.jboss.invocation.InvokerInterceptor.invokeLocal(InvokerInterceptor.java:206)
  | 	at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:192)
  | 	at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:61)
  | 	at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:70)
  | 	at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:112)
  | 	at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:100)
  | 	at $Proxy67.GetContactosDeUsuario(Unknown Source)
  | 	at org.apache.jsp.icmTest_jsp._jspService(icmTest_jsp.java:68)
  | 	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
  | 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
  | 	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
  | 	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
  | 	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
  | 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
  | 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
  | 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
  | 	at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
  | 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
  | 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
  | 	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
  | 	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
  | 	at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
  | 	at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
  | 	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
  | 	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
  | 	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
  | 	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
  | 	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
  | 	at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
  | 	at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
  | 	at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
  | 	at java.lang.Thread.run(Thread.java:595)
  | 10:47:44,572 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
  | javax.ejb.ObjectNotFoundException: No such entity!
  | 	at org.jboss.ejb.plugins.cmp.jdbc.JDBCFindEntityCommand.execute(JDBCFindEntityCommand.java:64)
  | 	at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.findEntity(JDBCStoreManager.java:604)
  | 	at org.jboss.ejb.plugins.CMPPersistenceManager.findEntity(CMPPersistenceManager.java:315)
  | 	at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.findEntity(CachedConnectionInterceptor.java:236)
  | 	at org.jboss.ejb.EntityContainer.findSingleObject(EntityContainer.java:1103)
  | 	at org.jboss.ejb.EntityContainer.findLocal(EntityContainer.java:669)
  | 	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:585)
  | 	at org.jboss.invocation.Invocation.performCall(Invocation.java:359)
  | 	at org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContainer.java:1130)
  | 	at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:105)
  | 	at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySynchronizationInterceptor.java:203)
  | 	at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:189)
  | 	at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:105)
  | 	at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:134)
  | 	at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:76)
  | 	at org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInterceptor.java:43)
  | 	at org.jboss.ejb.plugins.CallValidationInterceptor.invokeHome(CallValidationInterceptor.java:56)
  | 	at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:125)
  | 	at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)
  | 	at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:161)
  | 	at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:145)
  | 	at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:132)
  | 	at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryFinderInterceptor.java:107)
  | 	at org.jboss.ejb.EntityContainer.internalInvokeHome(EntityContainer.java:514)
  | 	at org.jboss.ejb.Container.invoke(Container.java:975)
  | 	at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invokeHome(BaseLocalProxyFactory.java:359)
  | 	at org.jboss.ejb.plugins.local.LocalHomeProxy.invoke(LocalHomeProxy.java:133)
  | 	at $Proxy57.findByUser(Unknown Source)
  | 	at mat.icm.ICMCoreBean.BuscarUsuario(ICMCoreBean.java:87)
  | 	at mat.icm.ICMCoreBean.GetContactosDeUsuario(ICMCoreBean.java:107)
  | 	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:585)
  | 	at org.jboss.invocation.Invocation.performCall(Invocation.java:359)
  | 	at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:237)
  | 	at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:158)
  | 	at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:169)
  | 	at org.jboss.ws.server.ServiceEndpointInterceptor.invoke(ServiceEndpointInterceptor.java:64)
  | 	at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)
  | 	at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)
  | 	at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)
  | 	at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
  | 	at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:168)
  | 	at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
  | 	at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:136)
  | 	at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:648)
  | 	at org.jboss.ejb.Container.invoke(Container.java:954)
  | 	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:585)
  | 	at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
  | 	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
  | 	at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
  | 	at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
  | 	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
  | 	at org.jboss.invocation.local.LocalInvoker$MBeanServerAction.invoke(LocalInvoker.java:169)
  | 	at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:118)
  | 	at org.jboss.invocation.InvokerInterceptor.invokeLocal(InvokerInterceptor.java:206)
  | 	at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:192)
  | 	at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:61)
  | 	at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:70)
  | 	at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:112)
  | 	at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:100)
  | 	at $Proxy67.GetContactosDeUsuario(Unknown Source)
  | 	at org.apache.jsp.icmTest_jsp._jspService(icmTest_jsp.java:68)
  | 	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
  | 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
  | 	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
  | 	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
  | 	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
  | 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
  | 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
  | 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
  | 	at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
  | 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
  | 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
  | 	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
  | 	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
  | 	at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
  | 	at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
  | 	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
  | 	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
  | 	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
  | 	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
  | 	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
  | 	at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
  | 	at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
  | 	at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
  | 	at java.lang.Thread.run(Thread.java:595)
  | 


I think it is because the project doesn't read the datasource correctly, because the data i'm trying to access exists on the database
  <datasources>
  | <local-tx-datasource>
  |   <jndi-name>mySQL-DS</jndi-name> 
  |   <connection-url>jdbc:mysql://localhost:3306/icm</connection-url> 
  |   <driver-class>com.mysql.jdbc.Driver</driver-class> 
  |   <user-name>root</user-name> 
  |   <password>root</password> 
  |      <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name> 
  | 
  |  <metadata>
  |   <type-mapping>mySQL</type-mapping> 
  |   </metadata>
  |   </local-tx-datasource>
  | </datasources>

and in the jbosscmp-jdbc.xml i've written this


  | <defaults>
  |       <datasource>mySQL-DS</datasource>
  |       <datasource-mapping>mySQL</datasource-mapping>
  |    </defaults>
  | 

Can anyone help me? best regards

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

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



More information about the jboss-user mailing list