1 Reply Latest reply on Sep 10, 2003 3:42 PM by vincentchun

    MySQL CMP problem

    vincentchun Newbie

      I am using jboss-3.2.1_tomcat-4.1.24

      I have set mysql-ds.xml as follow:
      <jndi-name>MySqlDS</jndi-name>
      <connection-url>jdbc:mysql://localhost:3306/mydb
      </connection-url>
      <driver-class>org.gjt.mm.mysql.Driver</driver-class>

      and I have set jbosscmp-jdbc.xml as follow:
      java:/MySqlDS
      <datasource-mapping>mySQL</datasource-mapping>

      My ejb-jar.xml and jboss.xml is ok and I deploy the ear file successfully.

      I can access mysql database when I use servlet to test it.

      But when I use servlet with JBoss, the JBoss console show the following exception.

      13:57:59,145 ERROR [LogInterceptor] RuntimeException:
      java.lang.NullPointerException
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.createBeanClassInstan
      ce(JDBCStoreManager.java:555)
      at org.jboss.ejb.plugins.CMPPersistenceManager.createBeanClassInstance(C
      MPPersistenceManager.java:137)
      at org.jboss.ejb.EntityContainer.createBeanClassInstance(EntityContainer
      .java:226)
      at org.jboss.ejb.plugins.AbstractInstancePool.get(AbstractInstancePool.j
      ava:146)
      at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInst
      anceInterceptor.java:79)
      at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInte
      rceptor.java:61)
      at org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCrea
      tionInterceptor.java:28)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInte
      rceptor.java:88)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxIntercep
      torCMT.java:243)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.ja
      va:74)
      at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityIntercep
      tor.java:92)
      at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:1
      20)
      at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyF
      actoryFinderInterceptor.java:93)
      at org.jboss.ejb.EntityContainer.internalInvokeHome(EntityContainer.java
      :477)
      at org.jboss.ejb.Container.invoke(Container.java:694)
      at sun.reflect.GeneratedMethodAccessor120.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
      nDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:101)

      at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.jav
      a:83)
      at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.
      java:46)
      at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:4
      5)
      at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:173)
      at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:85)
      at $Proxy54.create(Unknown Source)
      at fyp.entity.UserServlet.doGet(UserServlet.java:47)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
      icationFilterChain.java:247)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
      ilterChain.java:193)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
      alve.java:256)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
      t.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
      a:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)

      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
      alve.java:191)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
      t.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve
      .java:246)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
      t.invokeNext(StandardPipeline.java:641)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
      a:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)

      at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:
      2415)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
      ava:180)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
      t.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatche
      rValve.java:171)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
      t.invokeNext(StandardPipeline.java:641)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
      ava:172)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
      t.invokeNext(StandardPipeline.java:641)
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:
      509)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
      t.invokeNext(StandardPipeline.java:641)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
      a:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)

      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
      ve.java:174)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
      t.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
      a:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)

      at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:22
      3)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
      :594)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
      ssConnection(Http11Protocol.java:392)
      at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java
      :565)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP
      ool.java:619)
      at java.lang.Thread.run(Thread.java:536)
      13:57:59,215 ERROR [STDERR] java.rmi.ServerException: RuntimeException; nested e
      xception is:
      java.lang.NullPointerException
      13:57:59,215 ERROR [STDERR] at org.jboss.ejb.plugins.LogInterceptor.handleEx
      ception(LogInterceptor.java:360)
      13:57:59,215 ERROR [STDERR] at org.jboss.ejb.plugins.LogInterceptor.invokeHo
      me(LogInterceptor.java:124)
      13:57:59,215 ERROR [STDERR] at org.jboss.ejb.plugins.ProxyFactoryFinderInter
      ceptor.invokeHome(ProxyFactoryFinderInterceptor.java:93)
      13:57:59,215 ERROR [STDERR] at org.jboss.ejb.EntityContainer.internalInvokeH
      ome(EntityContainer.java:477)
      13:57:59,215 ERROR [STDERR] at org.jboss.ejb.Container.invoke(Container.java
      :694)
      13:57:59,215 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor120.invoke
      (Unknown Source)
      13:57:59,215 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invo
      ke(DelegatingMethodAccessorImpl.java:25)
      13:57:59,215 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:3
      24)
      13:57:59,225 ERROR [STDERR] at org.jboss.mx.capability.ReflectedMBeanDispatc
      her.invoke(ReflectedMBeanDispatcher.java:284)
      13:57:59,225 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MB
      eanServerImpl.java:549)
      13:57:59,235 ERROR [STDERR] at org.jboss.invocation.local.LocalInvoker.invok
      e(LocalInvoker.java:101)
      13:57:59,235 ERROR [STDERR] at org.jboss.invocation.InvokerInterceptor.invok
      e(InvokerInterceptor.java:83)
      13:57:59,235 ERROR [STDERR] at org.jboss.proxy.TransactionInterceptor.invoke
      (TransactionInterceptor.java:46)
      13:57:59,235 ERROR [STDERR] at org.jboss.proxy.SecurityInterceptor.invoke(Se
      curityInterceptor.java:45)
      13:57:59,245 ERROR [STDERR] at org.jboss.proxy.ejb.HomeInterceptor.invoke(Ho
      meInterceptor.java:173)
      13:57:59,245 ERROR [STDERR] at org.jboss.proxy.ClientContainer.invoke(Client
      Container.java:85)
      13:57:59,245 ERROR [STDERR] at $Proxy54.create(Unknown Source)
      13:57:59,245 ERROR [STDERR] at fyp.entity.UserServlet.doGet(UserServlet.java
      :47)
      13:57:59,245 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpSe
      rvlet.java:740)
      13:57:59,245 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpSe
      rvlet.java:853)
      13:57:59,245 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterCha
      in.internalDoFilter(ApplicationFilterChain.java:247)
      13:57:59,245 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterCha
      in.doFilter(ApplicationFilterChain.java:193)
      13:57:59,245 ERROR [STDERR] at org.apache.catalina.core.StandardWrapperValve
      .invoke(StandardWrapperValve.java:256)
      13:57:59,245 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline$Sta
      ndardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      13:57:59,255 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline.inv
      oke(StandardPipeline.java:480)
      13:57:59,255 ERROR [STDERR] at org.apache.catalina.core.ContainerBase.invoke
      (ContainerBase.java:995)
      13:57:59,255 ERROR [STDERR] at org.apache.catalina.core.StandardContextValve
      .invoke(StandardContextValve.java:191)
      13:57:59,255 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline$Sta
      ndardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      13:57:59,255 ERROR [STDERR] at org.apache.catalina.valves.CertificatesValve.
      invoke(CertificatesValve.java:246)
      13:57:59,255 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline$Sta
      ndardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      13:57:59,255 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline.inv
      oke(StandardPipeline.java:480)
      13:57:59,255 ERROR [STDERR] at org.apache.catalina.core.ContainerBase.invoke
      (ContainerBase.java:995)
      13:57:59,255 ERROR [STDERR] at org.apache.catalina.core.StandardContext.invo
      ke(StandardContext.java:2415)
      13:57:59,265 ERROR [STDERR] at org.apache.catalina.core.StandardHostValve.in
      voke(StandardHostValve.java:180)
      13:57:59,265 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline$Sta
      ndardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      13:57:59,265 ERROR [STDERR] at org.apache.catalina.valves.ErrorDispatcherVal
      ve.invoke(ErrorDispatcherValve.java:171)
      13:57:59,265 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline$Sta
      ndardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      13:57:59,265 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.i
      nvoke(ErrorReportValve.java:172)
      13:57:59,265 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline$Sta
      ndardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      13:57:59,265 ERROR [STDERR] at org.apache.catalina.valves.AccessLogValve.inv
      oke(AccessLogValve.java:509)
      13:57:59,275 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline$Sta
      ndardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      13:57:59,275 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline.inv
      oke(StandardPipeline.java:480)
      13:57:59,275 ERROR [STDERR] at org.apache.catalina.core.ContainerBase.invoke
      (ContainerBase.java:995)
      13:57:59,275 ERROR [STDERR] at org.apache.catalina.core.StandardEngineValve.
      invoke(StandardEngineValve.java:174)
      13:57:59,275 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline$Sta
      ndardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      13:57:59,275 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline.inv
      oke(StandardPipeline.java:480)
      13:57:59,275 ERROR [STDERR] at org.apache.catalina.core.ContainerBase.invoke
      (ContainerBase.java:995)
      13:57:59,275 ERROR [STDERR] at org.apache.coyote.tomcat4.CoyoteAdapter.servi
      ce(CoyoteAdapter.java:223)
      13:57:59,285 ERROR [STDERR] at org.apache.coyote.http11.Http11Processor.proc
      ess(Http11Processor.java:594)
      13:57:59,285 ERROR [STDERR] at org.apache.coyote.http11.Http11Protocol$Http1
      1ConnectionHandler.processConnection(Http11Protocol.java:392)
      13:57:59,285 ERROR [STDERR] at org.apache.tomcat.util.net.TcpWorkerThread.ru
      nIt(PoolTcpEndpoint.java:565)
      13:57:59,285 ERROR [STDERR] at org.apache.tomcat.util.threads.ThreadPool$Con
      trolRunnable.run(ThreadPool.java:619)
      13:57:59,285 ERROR [STDERR] at java.lang.Thread.run(Thread.java:536)
      13:57:59,285 ERROR [STDERR] Caused by: java.lang.NullPointerException
      13:57:59,285 ERROR [STDERR] at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManag
      er.createBeanClassInstance(JDBCStoreManager.java:555)
      13:57:59,285 ERROR [STDERR] at org.jboss.ejb.plugins.CMPPersistenceManager.c
      reateBeanClassInstance(CMPPersistenceManager.java:137)
      13:57:59,285 ERROR [STDERR] at org.jboss.ejb.EntityContainer.createBeanClass
      Instance(EntityContainer.java:226)
      13:57:59,295 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractInstancePool.ge
      t(AbstractInstancePool.java:146)
      13:57:59,295 ERROR [STDERR] at org.jboss.ejb.plugins.EntityInstanceIntercept
      or.invokeHome(EntityInstanceInterceptor.java:79)
      13:57:59,295 ERROR [STDERR] at org.jboss.ejb.plugins.EntityLockInterceptor.i
      nvokeHome(EntityLockInterceptor.java:61)
      13:57:59,295 ERROR [STDERR] at org.jboss.ejb.plugins.EntityCreationIntercept
      or.invokeHome(EntityCreationInterceptor.java:28)
      13:57:59,295 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractTxInterceptor.i
      nvokeNext(AbstractTxInterceptor.java:88)
      13:57:59,295 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.runWit
      hTransactions(TxInterceptorCMT.java:243)
      13:57:59,295 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke
      Home(TxInterceptorCMT.java:74)
      13:57:59,295 ERROR [STDERR] at org.jboss.ejb.plugins.SecurityInterceptor.inv
      okeHome(SecurityInterceptor.java:92)
      13:57:59,295 ERROR [STDERR] at org.jboss.ejb.plugins.LogInterceptor.invokeHo
      me(LogInterceptor.java:120)
      13:57:59,295 ERROR [STDERR] ... 51 more

      Anyone can tell me what is the problem?
      Thank You Very Much!