1 2 Previous Next 15 Replies Latest reply on Nov 23, 2006 4:06 AM by bobicyao

    The JNDI problem when deploying the JPetStore with jboss-4.0

    jzhuqlfeixia

      Hi,bodies:)
      I'm study the J2EE recently. I choosed the JPetStore-5.0, and I want to deploy it with the JBoss. But I got this error:

      --- MBeans waiting for other MBeans ---

      ObjectName: jboss.web.deployment:war=jpetstore.war,id=255707780
      State: FAILED
      Reason: org.jboss.deployment.DeploymentException: Error during deploy; - neste
      d throwable: (javax.naming.NamingException: resource-ref: jdbc/jpetstore1 has no
      valid JNDI binding. Check the jboss-web/resource-ref.)

      But I have already done some config follow the guide in some articles:
      Beacuse I use the MySql,so I modified the file "JPetStore-5.0\src\properties\database.properties" as follow :
      driver=com.mysql.jdbc.Driver
      url=jdbc:mysql://localhost:3306/jpetstore
      username=root
      password=password

      Then I rebuilded the JPetStore with ant, and then copied the new "jpetstore.war" to %JBOSS_HOME%\server\default\deploy.

      Then I copied the mysql-connector-java-3.1.12-bin.jar to the ?JBOSS_HOME?\server\default\lib.
      I also copied a "mssql-ds.xml" to %JBOSS_HOME%\server\default\deploy and modified it as follow:

      <local-tx-datasource>
      <jndi-name>jpetstore1</jndi-name> //(or JDBC:jpetstore1)
      <connection-url>jdbc:mysql://127.0.0.1:3306/jpetstore</connection-url>
      <driver-class>com.mysql.jdbc.Driver</driver-class>
      <user-name>root</user-name>
      password
      ...
      </local-tx-datasource>



      I config the JNDI name time and time again, but it always gets error.
      Could some one tell me what should I do?
      Thanks!

        • 1. Re: The JNDI problem when deploying the JPetStore with jboss
          jzhuqlfeixia

          No body could help me?.....

          • 2. Re: The JNDI problem when deploying the JPetStore with jboss
            jzhuqlfeixia

            Is this problem too easy? Or nobody try the JPetSotre? Help me...wa wa wa ??

            • 3. Re: The JNDI problem when deploying the JPetStore with jboss
              jaikiran

              Please post the contents of your jboss-web.xml. Also, if there is any other exception stacktrace that you have not posted, please post that too.

              Remember to use the "Code" button to wrap the xml contents and the stacktrace in a code block, while posting.

              • 4. Re: The JNDI problem when deploying the JPetStore with jboss
                jzhuqlfeixia

                Oh, I'm sorry:)
                I'm a new man, so I don't know which jboss-web.xml do you mean. There is four:
                \%JBOSS_HOME%\server\default\deploy\jmx-console.war\WEB-INF
                \%JBOSS_HOME%\\server\default\deploy\http-invoker.sar\invoker.war\WEB-INF

                \%JBOSS_HOME%\server\default\deploy\jms\jbossmq-httpil.sar\jbossmq-httpil.war\WEB-INF

                \%JBOSS_HOME%\server\default\deploy\management\console-mgr.sar\web-console.war\WEB-INF

                Should I create a jboss-web.xml for the JPetStore? I don't know...I also don't know how to write it... Help me!! .....

                • 5. Re: The JNDI problem when deploying the JPetStore with jboss
                  jaikiran

                  I havent used JPetStore myself and the reason why i asked you to post the jboss-web.xml was the exception stacktrace that you had posted which mentioned something on similar lines. Can you post the entire exception stacktrace that you are seeing? Better still, can you post the file which contains a resource-ref entry for jdbc/petstore1.

                  • 6. Re: The JNDI problem when deploying the JPetStore with jboss
                    jzhuqlfeixia

                    I'm so sorry that the network in my office is so bad that I'can get on the JBoss's website recetly. ??
                    The entire exception stacktrace is as follow:

                    eanSupport.java:245)
                     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                     at sun.reflect.NativeMethodAccessorImpl.invoke
                    
                    (NativeMethodAccessorImpl.
                    java:39)
                     at sun.reflect.DelegatingMethodAccessorImpl.invoke
                    
                    (DelegatingMethodAcces
                    sorImpl.java:25)
                     at java.lang.reflect.Method.invoke(Method.java:585)
                     at org.jboss.mx.interceptor.ReflectedDispatcher.invoke
                    
                    (ReflectedDispatch
                    er.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.system.ServiceController$ServiceProxy.invoke
                    
                    (ServiceControl
                    ler.java:978)
                     at $Proxy0.start(Unknown Source)
                     at org.jboss.system.ServiceController.start
                    
                    (ServiceController.java:417)
                     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                     at sun.reflect.NativeMethodAccessorImpl.invoke
                    
                    (NativeMethodAccessorImpl.
                    java:39)
                     at sun.reflect.DelegatingMethodAccessorImpl.invoke
                    
                    (DelegatingMethodAcces
                    sorImpl.java:25)
                     at java.lang.reflect.Method.invoke(Method.java:585)
                     at org.jboss.mx.interceptor.ReflectedDispatcher.invoke
                    
                    (ReflectedDispatch
                    er.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.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
                     at $Proxy4.start(Unknown Source)
                     at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
                     at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1007)
                     at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:808)
                     at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:771)
                     at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:755)
                     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                     at sun.reflect.NativeMethodAccessorImpl.invoke
                    
                    (NativeMethodAccessorImpl.
                    java:39)
                     at sun.reflect.DelegatingMethodAccessorImpl.invoke
                    
                    (DelegatingMethodAcces
                    sorImpl.java:25)
                     at java.lang.reflect.Method.invoke(Method.java:585)
                     at org.jboss.mx.interceptor.ReflectedDispatcher.invoke
                    
                    (ReflectedDispatch
                    er.java:155)
                     at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                     at org.jboss.mx.interceptor.AbstractInterceptor.invoke
                    
                    (AbstractIntercept
                    or.java:133)
                     at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                     at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke
                    
                    (ModelM
                    BeanOperationInterceptor.java:142)
                     at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                     at org.jboss.mx.server.AbstractMBeanInvoker.invoke
                    
                    (AbstractMBeanInvoker.
                    java:264)
                     at org.jboss.mx.server.MBeanServerImpl.invoke
                    
                    (MBeanServerImpl.java:659)
                     at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
                     at $Proxy5.deploy(Unknown Source)
                     at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
                     at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
                     at org.jboss.Main.boot(Main.java:200)
                     at org.jboss.Main$1.run(Main.java:464)
                     at java.lang.Thread.run(Thread.java:595)
                    Caused by: javax.naming.NamingException: resource-ref: jdbc/jpetstore1 has
                    
                    no va
                    lid JNDI binding. Check the jboss-web/resource-ref.
                     at org.jboss.web.AbstractWebDeployer.linkResourceRefs
                    
                    (AbstractWebDeploye
                    r.java:610)
                     at org.jboss.web.AbstractWebDeployer.parseWebAppDescriptors
                    
                    (AbstractWebD
                    eployer.java:508)
                     at
                    
                    org.jboss.web.AbstractWebDeployer$DescriptorParser.parseWebAppDescrip
                    tors(AbstractWebDeployer.java:865)
                     at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeployInternal
                    
                    (TomcatD
                    eployer.java:157)
                     at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeploy
                    
                    (TomcatDeployer.
                    java:103)
                     at org.jboss.web.AbstractWebDeployer.start
                    
                    (AbstractWebDeployer.java:371)
                    
                     ... 114 more
                    16:53:47,447 ERROR [MainDeployer] Could not start deployment:
                    
                    file:/D:/Program F
                    iles/jboss-4.0.4.GA/server/default/deploy/jpetstore.war
                    org.jboss.deployment.DeploymentException: Error during deploy; - nested
                    
                    throwabl
                    e: (javax.naming.NamingException: resource-ref: jdbc/jpetstore1 has no valid
                    
                    JND
                    I binding. Check the jboss-web/resource-ref.)
                     at org.jboss.web.AbstractWebDeployer.start
                    
                    (AbstractWebDeployer.java:380)
                    
                     at org.jboss.web.WebModule.startModule(WebModule.java:83)
                     at org.jboss.web.WebModule.startService(WebModule.java:61)
                     at org.jboss.system.ServiceMBeanSupport.jbossInternalStart
                    
                    (ServiceMBeanS
                    upport.java:289)
                     at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle
                    
                    (ServiceMB
                    eanSupport.java:245)
                     at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
                     at sun.reflect.DelegatingMethodAccessorImpl.invoke
                    
                    (DelegatingMethodAcces
                    sorImpl.java:25)
                     at java.lang.reflect.Method.invoke(Method.java:585)
                     at org.jboss.mx.interceptor.ReflectedDispatcher.invoke
                    
                    (ReflectedDispatch
                    er.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.system.ServiceController$ServiceProxy.invoke
                    
                    (ServiceControl
                    ler.java:978)
                     at $Proxy0.start(Unknown Source)
                     at org.jboss.system.ServiceController.start
                    
                    (ServiceController.java:417)
                     at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
                     at sun.reflect.DelegatingMethodAccessorImpl.invoke
                    
                    (DelegatingMethodAcces
                    sorImpl.java:25)
                     at java.lang.reflect.Method.invoke(Method.java:585)
                     at org.jboss.mx.interceptor.ReflectedDispatcher.invoke
                    
                    (ReflectedDispatch
                    er.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.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
                     at $Proxy41.start(Unknown Source)
                     at org.jboss.web.AbstractWebContainer.start
                    
                    (AbstractWebContainer.java:46
                    6)
                     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                     at sun.reflect.NativeMethodAccessorImpl.invoke
                    
                    (NativeMethodAccessorImpl.
                    java:39)
                     at sun.reflect.DelegatingMethodAccessorImpl.invoke
                    
                    (DelegatingMethodAcces
                    sorImpl.java:25)
                     at java.lang.reflect.Method.invoke(Method.java:585)
                     at org.jboss.mx.interceptor.ReflectedDispatcher.invoke
                    
                    (ReflectedDispatch
                    er.java:155)
                     at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                     at org.jboss.mx.interceptor.AbstractInterceptor.invoke
                    
                    (AbstractIntercept
                    or.java:133)
                     at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                     at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke
                    
                    (ModelM
                    BeanOperationInterceptor.java:142)
                     at org.jboss.mx.interceptor.DynamicInterceptor.invoke
                    
                    (DynamicInterceptor
                    .java:97)
                     at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext
                    
                    (Intercepto
                    rServiceMBeanSupport.java:238)
                     at org.jboss.ws.server.WebServiceDeployer.start
                    
                    (WebServiceDeployer.java:
                    117)
                     at
                    
                    org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.
                    start(SubDeployerInterceptorSupport.java:188)
                     at org.jboss.deployment.SubDeployerInterceptor.invoke
                    
                    (SubDeployerInterce
                    ptor.java:95)
                     at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                     at org.jboss.mx.server.AbstractMBeanInvoker.invoke
                    
                    (AbstractMBeanInvoker.
                    java:264)
                     at org.jboss.mx.server.MBeanServerImpl.invoke
                    
                    (MBeanServerImpl.java:659)
                     at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
                     at $Proxy42.start(Unknown Source)
                     at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1007)
                     at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:808)
                     at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:771)
                     at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
                     at sun.reflect.DelegatingMethodAccessorImpl.invoke
                    
                    (DelegatingMethodAcces
                    sorImpl.java:25)
                     at java.lang.reflect.Method.invoke(Method.java:585)
                     at org.jboss.mx.interceptor.ReflectedDispatcher.invoke
                    
                    (ReflectedDispatch
                    er.java:155)
                     at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                     at org.jboss.mx.interceptor.AbstractInterceptor.invoke
                    
                    (AbstractIntercept
                    or.java:133)
                     at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                     at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke
                    
                    (ModelM
                    BeanOperationInterceptor.java:142)
                     at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                     at org.jboss.mx.server.AbstractMBeanInvoker.invoke
                    
                    (AbstractMBeanInvoker.
                    java:264)
                     at org.jboss.mx.server.MBeanServerImpl.invoke
                    
                    (MBeanServerImpl.java:659)
                     at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
                     at $Proxy6.deploy(Unknown Source)
                     at org.jboss.deployment.scanner.URLDeploymentScanner.deploy
                    
                    (URLDeploymen
                    tScanner.java:421)
                     at org.jboss.deployment.scanner.URLDeploymentScanner.scan
                    
                    (URLDeploymentS
                    canner.java:634)
                     at
                    
                    org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
                    doScan(AbstractDeploymentScanner.java:263)
                     at
                    
                    org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(A
                    bstractDeploymentScanner.java:336)
                     at org.jboss.system.ServiceMBeanSupport.jbossInternalStart
                    
                    (ServiceMBeanS
                    upport.java:289)
                     at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle
                    
                    (ServiceMB
                    eanSupport.java:245)
                     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                     at sun.reflect.NativeMethodAccessorImpl.invoke
                    
                    (NativeMethodAccessorImpl.
                    java:39)
                     at sun.reflect.DelegatingMethodAccessorImpl.invoke
                    
                    (DelegatingMethodAcces
                    sorImpl.java:25)
                     at java.lang.reflect.Method.invoke(Method.java:585)
                     at org.jboss.mx.interceptor.ReflectedDispatcher.invoke
                    
                    (ReflectedDispatch
                    er.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.system.ServiceController$ServiceProxy.invoke
                    
                    (ServiceControl
                    ler.java:978)
                     at $Proxy0.start(Unknown Source)
                     at org.jboss.system.ServiceController.start
                    
                    (ServiceController.java:417)
                     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                     at sun.reflect.NativeMethodAccessorImpl.invoke
                    
                    (NativeMethodAccessorImpl.
                    java:39)
                     at sun.reflect.DelegatingMethodAccessorImpl.invoke
                    
                    (DelegatingMethodAcces
                    sorImpl.java:25)
                     at java.lang.reflect.Method.invoke(Method.java:585)
                     at org.jboss.mx.interceptor.ReflectedDispatcher.invoke
                    
                    (ReflectedDispatch
                    er.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.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
                     at $Proxy4.start(Unknown Source)
                     at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
                     at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1007)
                     at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:808)
                     at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:771)
                     at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:755)
                     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                     at sun.reflect.NativeMethodAccessorImpl.invoke
                    
                    (NativeMethodAccessorImpl.
                    java:39)
                     at sun.reflect.DelegatingMethodAccessorImpl.invoke
                    
                    (DelegatingMethodAcces
                    sorImpl.java:25)
                     at java.lang.reflect.Method.invoke(Method.java:585)
                     at org.jboss.mx.interceptor.ReflectedDispatcher.invoke
                    
                    (ReflectedDispatch
                    er.java:155)
                     at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                     at org.jboss.mx.interceptor.AbstractInterceptor.invoke
                    
                    (AbstractIntercept
                    or.java:133)
                     at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                     at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke
                    
                    (ModelM
                    BeanOperationInterceptor.java:142)
                     at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                     at org.jboss.mx.server.AbstractMBeanInvoker.invoke
                    
                    (AbstractMBeanInvoker.
                    java:264)
                     at org.jboss.mx.server.MBeanServerImpl.invoke
                    
                    (MBeanServerImpl.java:659)
                     at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
                     at $Proxy5.deploy(Unknown Source)
                     at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
                     at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
                     at org.jboss.Main.boot(Main.java:200)
                     at org.jboss.Main$1.run(Main.java:464)
                     at java.lang.Thread.run(Thread.java:595)
                    Caused by: javax.naming.NamingException: resource-ref: jdbc/jpetstore1 has
                    
                    no va
                    lid JNDI binding. Check the jboss-web/resource-ref.
                     at org.jboss.web.AbstractWebDeployer.linkResourceRefs
                    
                    (AbstractWebDeploye
                    r.java:610)
                     at org.jboss.web.AbstractWebDeployer.parseWebAppDescriptors
                    
                    (AbstractWebD
                    eployer.java:508)
                     at
                    
                    org.jboss.web.AbstractWebDeployer$DescriptorParser.parseWebAppDescrip
                    tors(AbstractWebDeployer.java:865)
                     at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeployInternal
                    
                    (TomcatD
                    eployer.java:157)
                     at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeploy
                    
                    (TomcatDeployer.
                    java:103)
                     at org.jboss.web.AbstractWebDeployer.start
                    
                    (AbstractWebDeployer.java:371)
                    
                     ... 114 more
                    16:53:47,463 ERROR [URLDeploymentScanner] Incomplete Deployment listing:
                    
                    --- Incompletely deployed packages ---
                    org.jboss.deployment.DeploymentInfo@f3dca84 { url=file:/D:/Program
                    
                    Files/jboss-4
                    .0.4.GA/server/default/deploy/jpetstore.war }
                     deployer: MBeanProxyExt[jboss.web:service=WebServer]
                     status: Deployment FAILED reason: Error during deploy; - nested throwable:
                    
                    (ja
                    vax.naming.NamingException: resource-ref: jdbc/jpetstore1 has no valid JNDI
                    
                    bind
                    ing. Check the jboss-web/resource-ref.)
                     state: FAILED
                     watch: file:/D:/Program Files/jboss-
                    
                    4.0.4.GA/server/default/deploy/jpetstore.w
                    ar
                     altDD: null
                     lastDeployed: 1162716827416
                     lastModified: 1162716827400
                     mbeans:
                    
                    --- MBeans waiting for other MBeans ---
                    ObjectName: jboss.web.deployment:war=jpetstore.war,id=255707780
                     State: FAILED
                     Reason: org.jboss.deployment.DeploymentException: Error during deploy; -
                    
                    neste
                    d throwable: (javax.naming.NamingException: resource-ref: jdbc/jpetstore1
                    
                    has no
                     valid JNDI binding. Check the jboss-web/resource-ref.)
                    
                    --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
                    ObjectName: jboss.web.deployment:war=jpetstore.war,id=255707780
                     State: FAILED
                     Reason: org.jboss.deployment.DeploymentException: Error during deploy; -
                    
                    neste
                    d throwable: (javax.naming.NamingException: resource-ref: jdbc/jpetstore1
                    
                    has no
                     valid JNDI binding. Check the jboss-web/resource-ref.)
                    
                    
                    16:53:47,510 INFO [Http11BaseProtocol] Starting Coyote HTTP/1.1 on http-
                    
                    0.0.0.0
                    -8080
                    16:53:47,603 INFO [ChannelSocket] JK: ajp13 listening on /0.0.0.0:8009
                    16:53:47,603 INFO [JkMain] Jk running ID=0 time=0/31 config=null
                    16:53:47,619 INFO [Server] JBoss (MX MicroKernel) [4.0.4.GA (build:
                    
                    CVSTag=JBos
                    s_4_0_4_GA date=200605151000)] Started in 12s:141ms
                    


                    And the only file that contains the string "jdbc/petstore1" is the web.xml :
                    <?xml version="1.0" encoding="UTF-8"?>
                    
                    <!DOCTYPE web-app
                     PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
                     "http://java.sun.com/dtd/web-app_2_3.dtd">
                    
                    <web-app>
                    
                     <display-name>JPetStore</display-name>
                     <description>Online Pet Store Sample Application</description>
                    
                     <servlet>
                     <servlet-name>action</servlet-name>
                     <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
                     <init-param>
                     <param-name>config</param-name>
                     <param-value>/WEB-INF/struts-config.xml</param-value>
                     </init-param>
                     <init-param>
                     <param-name>debug</param-name>
                     <param-value>2</param-value>
                     </init-param>
                     <init-param>
                     <param-name>detail</param-name>
                     <param-value>2</param-value>
                     </init-param>
                     <load-on-startup>2</load-on-startup>
                     </servlet>
                    
                     <servlet-mapping>
                     <servlet-name>action</servlet-name>
                     <url-pattern>*.shtml</url-pattern>
                     </servlet-mapping>
                    
                     <session-config>
                     <session-timeout>30</session-timeout>
                     </session-config>
                    
                     <welcome-file-list>
                     <welcome-file>index.html</welcome-file>
                     </welcome-file-list>
                    
                     <taglib>
                     <taglib-uri>struts-bean</taglib-uri>
                     <taglib-location>/WEB-INF/tld/struts-bean.tld</taglib-location>
                     </taglib>
                    
                     <taglib>
                     <taglib-uri>struts-html</taglib-uri>
                     <taglib-location>/WEB-INF/tld/struts-html.tld</taglib-location>
                     </taglib>
                    
                     <taglib>
                     <taglib-uri>struts-logic</taglib-uri>
                     <taglib-location>/WEB-INF/tld/struts-logic.tld</taglib-location>
                     </taglib>
                    
                     <resource-ref>
                     <description>
                     JPetStore DataSource
                     </description>
                     <res-ref-name>
                     jdbc/jpetstore1
                     </res-ref-name>
                     <res-type>
                     javax.sql.DataSource
                     </res-type>
                     <res-auth>
                     Container
                     </res-auth>
                     </resource-ref>
                    
                     <security-constraint>
                     <web-resource-collection>
                     <web-resource-name>
                     Restrict access to JSP pages
                     </web-resource-name>
                     <url-pattern>*.jsp</url-pattern>
                     </web-resource-collection>
                     <auth-constraint>
                     <description>
                     With no roles defined, no access granted
                     </description>
                     </auth-constraint>
                     </security-constraint>
                    
                    </web-app>
                    



                    Please help me, go on ,Thanks!


                    • 7. Re: The JNDI problem when deploying the JPetStore with jboss
                      jaikiran

                      You will have to map the resource ref with the jndi name of your datasource. Here's the jboss-web.xml file that you will have to create(if its not already there in your JPetStore's WEB-INF folder):

                      <?xml version="1.0" encoding="UTF-8"?>
                      <!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.2//EN" "http://www.jboss.org/j2ee/dtd/jboss-web.dtd">
                      
                      <jboss-web>
                      
                       <resource-ref>
                       <res-ref-name>jdbc/jpetstore1</res-ref-name>
                       <jndi-name>java:/jpetstore1</jndi-name>
                       </resource-ref>
                      
                      
                      </jboss-web>


                      Place this jboss-web.xml in the WEB-INF folder of your jpetstore.war file.

                      • 8. Re: The JNDI problem when deploying the JPetStore with jboss
                        jzhuqlfeixia

                        Thanks!!!!! It's so nice of you. There is no JNDI problem any more??
                        But but but there is a new problem?? Could you go on to help me....
                        When I use the JPetStore. For example, I went into the "Fish" item, then I

                        went to a Product ID, and then I went into a Item ID, then I appeared the

                        problem as follow:

                        Error!
                        org.apache.struts.beanaction.BeanActionException
                        Error dispatching bean action via URL pattern ('viewItem'). Cause:
                        
                        org.apache.struts.beanaction.BeanActionException: Error invoking Action.
                        
                        Cause: java.lang.reflect.InvocationTargetException
                        
                        
                        Stack
                         org.apache.struts.beanaction.BeanActionException: Error dispatching bean
                        
                        action via URL pattern ('viewItem'). Cause:
                        
                        org.apache.struts.beanaction.BeanActionException: Error invoking Action.
                        
                        Cause: java.lang.reflect.InvocationTargetException
                         at org.apache.struts.beanaction.BeanAction.execute
                        
                        (BeanAction.java:249)
                         at org.apache.struts.action.RequestProcessor.processActionPerform
                        
                        (RequestProcessor.java:419)
                         at org.apache.struts.action.RequestProcessor.process
                        
                        (RequestProcessor.java:224)
                         at org.apache.struts.action.ActionServlet.process
                        
                        (ActionServlet.java:1194)
                         at org.apache.struts.action.ActionServlet.doGet
                        
                        (ActionServlet.java:414)
                         at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
                         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.apache.catalina.authenticator.AuthenticatorBase.invoke
                        
                        (AuthenticatorBase.java:432)
                         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.processC
                        
                        onnection(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)
                        Caused by: org.apache.struts.beanaction.BeanActionException: Error invoking
                        
                        Action. Cause: java.lang.reflect.InvocationTargetException
                         at org.apache.struts.beanaction.ActionInvoker.invoke
                        
                        (ActionInvoker.java:18)
                         at org.apache.struts.beanaction.DefaultActionInterceptor.intercept
                        
                        (DefaultActionInterceptor.java:5)
                         at org.apache.struts.beanaction.BeanAction.execute
                        
                        (BeanAction.java:246)
                         ... 25 more
                        Caused by: java.lang.reflect.InvocationTargetException
                         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.apache.struts.beanaction.ActionInvoker.invoke
                        
                        (ActionInvoker.java:16)
                         ... 27 more
                        Caused by: com.ibatis.dao.client.DaoException: Failed to execute
                        
                        queryForObject - id [getItem], parameterObject [EST-4]. Cause:
                        
                        com.ibatis.common.jdbc.exception.NestedSQLException:
                        --- The error occurred in
                        
                        com/ibatis/jpetstore/persistence/sqlmapdao/sql/Item.xml.
                        --- The error occurred while applying a parameter map.
                        --- Check the getItem-InlineParameterMap.
                        --- Check the statement (query failed).
                        --- Cause: java.sql.SQLException: Column 'ITEMID' in field list is ambiguous
                        Caused by: java.sql.SQLException: Column 'ITEMID' in field list is ambiguous
                        Caused by: com.ibatis.common.jdbc.exception.NestedSQLException:
                        --- The error occurred in
                        
                        com/ibatis/jpetstore/persistence/sqlmapdao/sql/Item.xml.
                        --- The error occurred while applying a parameter map.
                        --- Check the getItem-InlineParameterMap.
                        --- Check the statement (query failed).
                        --- Cause: java.sql.SQLException: Column 'ITEMID' in field list is ambiguous
                        Caused by: java.sql.SQLException: Column 'ITEMID' in field list is ambiguous
                         at com.ibatis.dao.client.template.SqlMapDaoTemplate.queryForObject
                        
                        (SqlMapDaoTemplate.java:164)
                         at com.ibatis.jpetstore.persistence.sqlmapdao.ItemSqlMapDao.getItem
                        
                        (ItemSqlMapDao.java:42)
                         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 com.ibatis.dao.engine.impl.DaoProxy.invoke(DaoProxy.java:72)
                         at $Proxy53.getItem(Unknown Source)
                         at com.ibatis.jpetstore.service.CatalogService.getItem
                        
                        (CatalogService.java:59)
                         at com.ibatis.jpetstore.presentation.CatalogBean.viewItem
                        
                        (CatalogBean.java:141)
                         ... 32 more
                        Caused by: com.ibatis.common.jdbc.exception.NestedSQLException:
                        --- The error occurred in
                        
                        com/ibatis/jpetstore/persistence/sqlmapdao/sql/Item.xml.
                        --- The error occurred while applying a parameter map.
                        --- Check the getItem-InlineParameterMap.
                        --- Check the statement (query failed).
                        --- Cause: java.sql.SQLException: Column 'ITEMID' in field list is ambiguous
                        Caused by: java.sql.SQLException: Column 'ITEMID' in field list is ambiguous
                         at
                        
                        com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWith
                        
                        Callback(GeneralStatement.java:185)
                         at
                        
                        com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForO
                        
                        bject(GeneralStatement.java:104)
                         at
                        
                        com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject
                        
                        (SqlMapExecutorDelegate.java:561)
                         at
                        
                        com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject
                        
                        (SqlMapExecutorDelegate.java:536)
                         at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForObject
                        
                        (SqlMapSessionImpl.java:93)
                         at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForObject
                        
                        (SqlMapClientImpl.java:70)
                         at com.ibatis.dao.client.template.SqlMapDaoTemplate.queryForObject
                        
                        (SqlMapDaoTemplate.java:162)
                         ... 41 more
                        Caused by: java.sql.SQLException: Column 'ITEMID' in field list is ambiguous
                         at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2928)
                         at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1571)
                         at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1666)
                         at com.mysql.jdbc.Connection.execSQL(Connection.java:2994)
                         at com.mysql.jdbc.PreparedStatement.executeInternal
                        
                        (PreparedStatement.java:936)
                         at com.mysql.jdbc.PreparedStatement.execute
                        
                        (PreparedStatement.java:773)
                         at sun.reflect.GeneratedMethodAccessor106.invoke(Unknown Source)
                         at sun.reflect.DelegatingMethodAccessorImpl.invoke
                        
                        (DelegatingMethodAccessorImpl.java:25)
                         at java.lang.reflect.Method.invoke(Method.java:585)
                         at com.ibatis.common.jdbc.logging.PreparedStatementLogProxy.invoke
                        
                        (PreparedStatementLogProxy.java:62)
                         at $Proxy60.execute(Unknown Source)
                         at com.ibatis.sqlmap.engine.execution.SqlExecutor.executeQuery
                        
                        (SqlExecutor.java:180)
                         at
                        
                        com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.sqlExecuteQuery
                        
                        (GeneralStatement.java:205)
                         at
                        
                        com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWith
                        
                        Callback(GeneralStatement.java:173)
                         ... 47 more
                        
                        


                        I google for it. But I can't find the answer. Help me...

                        • 9. Re: The JNDI problem when deploying the JPetStore with jboss
                          jaikiran

                           

                          Cause: java.sql.SQLException: Column 'ITEMID' in field list is ambiguous


                          Just a guess - the query that is getting generated out of the Item.xml file is reffering to the ITEMID column which is present in more than one tables in that query. Please post that query which is getting generated.

                          • 10. Re: The JNDI problem when deploying the JPetStore with jboss
                            jzhuqlfeixia

                            There are two tables using the 'ITEMID', I can't find where the problem is...

                            There are two Item.xml one is under %JPESTORE_HOME%\build\webapp\WEB-INF\classes\com\ibatis\jpetstore\persistence\sqlmapdao\sql

                            the content is:

                            <?xml version="1.0" encoding="UTF-8" ?>
                            
                            <!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
                             "http://ibatis.apache.org/dtd/sql-map-2.dtd">
                            
                            <sqlMap namespace="Item">
                            
                             <typeAlias alias="item" type="com.ibatis.jpetstore.domain.Item"/>
                            
                             <cacheModel id="itemCache" type="LRU">
                             <flushInterval hours="24"/>
                             <property name="size" value="100"/>
                             </cacheModel>
                            
                             <cacheModel id="quantityCache" type="LRU">
                             <flushInterval hours="24"/>
                             <flushOnExecute statement="updateInventoryQuantity"/>
                             <property name="size" value="100"/>
                             </cacheModel>
                            
                             <select id="getItemListByProduct" resultClass="item" parameterClass="string" cacheModel="itemCache">
                             SELECT
                             ITEMID,
                             LISTPRICE,
                             UNITCOST,
                             SUPPLIER AS supplierId,
                             I.PRODUCTID AS "product.productId",
                             NAME AS "product.name",
                             DESCN AS "product.description",
                             CATEGORY AS "product.categoryId",
                             STATUS,
                             ATTR1 AS attribute1,
                             ATTR2 AS attribute2,
                             ATTR3 AS attribute3,
                             ATTR4 AS attribute4,
                             ATTR5 AS attribute5
                             FROM ITEM I, PRODUCT P
                             WHERE P.PRODUCTID = I.PRODUCTID
                             AND I.PRODUCTID = #value#
                             </select>
                            
                             <select id="getItem" resultClass="item" parameterClass="string" cacheModel="quantityCache">
                             select
                             ITEMID,
                             LISTPRICE,
                             UNITCOST,
                             SUPPLIER AS supplierId,
                             I.PRODUCTID AS "product.productId",
                             NAME AS "product.name",
                             DESCN AS "product.description",
                             CATEGORY AS "product.categoryId",
                             STATUS,
                             ATTR1 AS attribute1,
                             ATTR2 AS attribute2,
                             ATTR3 AS attribute3,
                             ATTR4 AS attribute4,
                             ATTR5 AS attribute5,
                             QTY AS quantity
                             from ITEM I, INVENTORY V, PRODUCT P
                             where P.PRODUCTID = I.PRODUCTID
                             and I.ITEMID = V.ITEMID
                             and I.ITEMID = #value#
                             </select>
                            
                             <select id="getInventoryQuantity" resultClass="int" parameterClass="string">
                             SELECT QTY AS value
                             FROM INVENTORY
                             WHERE ITEMID = #itemId#
                             </select>
                            
                             <update id="updateInventoryQuantity" parameterClass="map">
                             UPDATE INVENTORY SET
                             QTY = QTY - #increment#
                             WHERE ITEMID = #itemId#
                             </update>
                            
                            </sqlMap>
                            
                            



                            The other one is under %JPETSTORE_HOME%\src\com\ibatis\jpetstore\persistence\sqlmapdao\sql
                            the content is :
                            <?xml version="1.0" encoding="UTF-8" ?>
                            
                            <!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
                             "http://ibatis.apache.org/dtd/sql-map-2.dtd">
                            
                            <sqlMap namespace="Item">
                            
                             <typeAlias alias="item" type="com.ibatis.jpetstore.domain.Item"/>
                            
                             <cacheModel id="itemCache" type="LRU">
                             <flushInterval hours="24"/>
                             <property name="size" value="100"/>
                             </cacheModel>
                            
                             <cacheModel id="quantityCache" type="LRU">
                             <flushInterval hours="24"/>
                             <flushOnExecute statement="updateInventoryQuantity"/>
                             <property name="size" value="100"/>
                             </cacheModel>
                            
                             <select id="getItemListByProduct" resultClass="item" parameterClass="string" cacheModel="itemCache">
                             SELECT
                             ITEMID,
                             LISTPRICE,
                             UNITCOST,
                             SUPPLIER AS supplierId,
                             I.PRODUCTID AS "product.productId",
                             NAME AS "product.name",
                             DESCN AS "product.description",
                             CATEGORY AS "product.categoryId",
                             STATUS,
                             ATTR1 AS attribute1,
                             ATTR2 AS attribute2,
                             ATTR3 AS attribute3,
                             ATTR4 AS attribute4,
                             ATTR5 AS attribute5
                             FROM ITEM I, PRODUCT P
                             WHERE P.PRODUCTID = I.PRODUCTID
                             AND I.PRODUCTID = #value#
                             </select>
                            
                             <select id="getItem" resultClass="item" parameterClass="string" cacheModel="quantityCache">
                             select
                             ITEMID,
                             LISTPRICE,
                             UNITCOST,
                             SUPPLIER AS supplierId,
                             I.PRODUCTID AS "product.productId",
                             NAME AS "product.name",
                             DESCN AS "product.description",
                             CATEGORY AS "product.categoryId",
                             STATUS,
                             ATTR1 AS attribute1,
                             ATTR2 AS attribute2,
                             ATTR3 AS attribute3,
                             ATTR4 AS attribute4,
                             ATTR5 AS attribute5,
                             QTY AS quantity
                             from ITEM I, INVENTORY V, PRODUCT P
                             where P.PRODUCTID = I.PRODUCTID
                             and I.ITEMID = V.ITEMID
                             and I.ITEMID = #value#
                             </select>
                            
                             <select id="getInventoryQuantity" resultClass="int" parameterClass="string">
                             SELECT QTY AS value
                             FROM INVENTORY
                             WHERE ITEMID = #itemId#
                             </select>
                            
                             <update id="updateInventoryQuantity" parameterClass="map">
                             UPDATE INVENTORY SET
                             QTY = QTY - #increment#
                             WHERE ITEMID = #itemId#
                             </update>
                            
                            </sqlMap>
                            
                            


                            • 11. Re: The JNDI problem when deploying the JPetStore with jboss
                              jzhuqlfeixia

                              There are two tables using the 'ITEMID', I can't find where the problem is...

                              There are two Item.xml one is under %JPESTORE_HOME%\build\webapp\WEB-INF\classes\com\ibatis\jpetstore\persistence\sqlmapdao\sql

                              the content is:

                              <?xml version="1.0" encoding="UTF-8" ?>
                              
                              <!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
                               "http://ibatis.apache.org/dtd/sql-map-2.dtd">
                              
                              <sqlMap namespace="Item">
                              
                               <typeAlias alias="item" type="com.ibatis.jpetstore.domain.Item"/>
                              
                               <cacheModel id="itemCache" type="LRU">
                               <flushInterval hours="24"/>
                               <property name="size" value="100"/>
                               </cacheModel>
                              
                               <cacheModel id="quantityCache" type="LRU">
                               <flushInterval hours="24"/>
                               <flushOnExecute statement="updateInventoryQuantity"/>
                               <property name="size" value="100"/>
                               </cacheModel>
                              
                               <select id="getItemListByProduct" resultClass="item" parameterClass="string" cacheModel="itemCache">
                               SELECT
                               ITEMID,
                               LISTPRICE,
                               UNITCOST,
                               SUPPLIER AS supplierId,
                               I.PRODUCTID AS "product.productId",
                               NAME AS "product.name",
                               DESCN AS "product.description",
                               CATEGORY AS "product.categoryId",
                               STATUS,
                               ATTR1 AS attribute1,
                               ATTR2 AS attribute2,
                               ATTR3 AS attribute3,
                               ATTR4 AS attribute4,
                               ATTR5 AS attribute5
                               FROM ITEM I, PRODUCT P
                               WHERE P.PRODUCTID = I.PRODUCTID
                               AND I.PRODUCTID = #value#
                               </select>
                              
                               <select id="getItem" resultClass="item" parameterClass="string" cacheModel="quantityCache">
                               select
                               ITEMID,
                               LISTPRICE,
                               UNITCOST,
                               SUPPLIER AS supplierId,
                               I.PRODUCTID AS "product.productId",
                               NAME AS "product.name",
                               DESCN AS "product.description",
                               CATEGORY AS "product.categoryId",
                               STATUS,
                               ATTR1 AS attribute1,
                               ATTR2 AS attribute2,
                               ATTR3 AS attribute3,
                               ATTR4 AS attribute4,
                               ATTR5 AS attribute5,
                               QTY AS quantity
                               from ITEM I, INVENTORY V, PRODUCT P
                               where P.PRODUCTID = I.PRODUCTID
                               and I.ITEMID = V.ITEMID
                               and I.ITEMID = #value#
                               </select>
                              
                               <select id="getInventoryQuantity" resultClass="int" parameterClass="string">
                               SELECT QTY AS value
                               FROM INVENTORY
                               WHERE ITEMID = #itemId#
                               </select>
                              
                               <update id="updateInventoryQuantity" parameterClass="map">
                               UPDATE INVENTORY SET
                               QTY = QTY - #increment#
                               WHERE ITEMID = #itemId#
                               </update>
                              
                              </sqlMap>
                              
                              



                              The other one is under %JPETSTORE_HOME%\src\com\ibatis\jpetstore\persistence\sqlmapdao\sql
                              the content is :
                              <?xml version="1.0" encoding="UTF-8" ?>
                              
                              <!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
                               "http://ibatis.apache.org/dtd/sql-map-2.dtd">
                              
                              <sqlMap namespace="Item">
                              
                               <typeAlias alias="item" type="com.ibatis.jpetstore.domain.Item"/>
                              
                               <cacheModel id="itemCache" type="LRU">
                               <flushInterval hours="24"/>
                               <property name="size" value="100"/>
                               </cacheModel>
                              
                               <cacheModel id="quantityCache" type="LRU">
                               <flushInterval hours="24"/>
                               <flushOnExecute statement="updateInventoryQuantity"/>
                               <property name="size" value="100"/>
                               </cacheModel>
                              
                               <select id="getItemListByProduct" resultClass="item" parameterClass="string" cacheModel="itemCache">
                               SELECT
                               ITEMID,
                               LISTPRICE,
                               UNITCOST,
                               SUPPLIER AS supplierId,
                               I.PRODUCTID AS "product.productId",
                               NAME AS "product.name",
                               DESCN AS "product.description",
                               CATEGORY AS "product.categoryId",
                               STATUS,
                               ATTR1 AS attribute1,
                               ATTR2 AS attribute2,
                               ATTR3 AS attribute3,
                               ATTR4 AS attribute4,
                               ATTR5 AS attribute5
                               FROM ITEM I, PRODUCT P
                               WHERE P.PRODUCTID = I.PRODUCTID
                               AND I.PRODUCTID = #value#
                               </select>
                              
                               <select id="getItem" resultClass="item" parameterClass="string" cacheModel="quantityCache">
                               select
                               ITEMID,
                               LISTPRICE,
                               UNITCOST,
                               SUPPLIER AS supplierId,
                               I.PRODUCTID AS "product.productId",
                               NAME AS "product.name",
                               DESCN AS "product.description",
                               CATEGORY AS "product.categoryId",
                               STATUS,
                               ATTR1 AS attribute1,
                               ATTR2 AS attribute2,
                               ATTR3 AS attribute3,
                               ATTR4 AS attribute4,
                               ATTR5 AS attribute5,
                               QTY AS quantity
                               from ITEM I, INVENTORY V, PRODUCT P
                               where P.PRODUCTID = I.PRODUCTID
                               and I.ITEMID = V.ITEMID
                               and I.ITEMID = #value#
                               </select>
                              
                               <select id="getInventoryQuantity" resultClass="int" parameterClass="string">
                               SELECT QTY AS value
                               FROM INVENTORY
                               WHERE ITEMID = #itemId#
                               </select>
                              
                               <update id="updateInventoryQuantity" parameterClass="map">
                               UPDATE INVENTORY SET
                               QTY = QTY - #increment#
                               WHERE ITEMID = #itemId#
                               </update>
                              
                              </sqlMap>
                              
                              


                              • 12. Re: The JNDI problem when deploying the JPetStore with jboss
                                jzhuqlfeixia

                                sorry, I sumit too copies of the same content.

                                • 13. Re: The JNDI problem when deploying the JPetStore with jboss
                                  jaikiran

                                   

                                  There are two Item.xml one is under %JPESTORE_HOME%\build\webapp\WEB-INF\classes\com\ibatis\jpetstore\persistence\sqlmapdao\sql


                                  Both the files are the same. One is in the deployed application and one is a part of the source. If you are aware of how to build the JPetStore then do the below mentioned changes to
                                  The other one is under %JPETSTORE_HOME%\src\com\ibatis\jpetstore\persistence\sqlmapdao\sql


                                  Else do it under the other one.

                                  Here's the change that you can try:

                                  Try changing the queries to:

                                  <select id="getItemListByProduct" resultClass="item" parameterClass="string" cacheModel="itemCache">
                                   SELECT
                                   I.ITEMID,
                                   LISTPRICE,
                                   UNITCOST,
                                   SUPPLIER AS supplierId,
                                   I.PRODUCTID AS "product.productId",
                                   NAME AS "product.name",
                                   DESCN AS "product.description",
                                   CATEGORY AS "product.categoryId",
                                   STATUS,
                                   ATTR1 AS attribute1,
                                   ATTR2 AS attribute2,
                                   ATTR3 AS attribute3,
                                   ATTR4 AS attribute4,
                                   ATTR5 AS attribute5
                                   FROM ITEM I, PRODUCT P
                                   WHERE P.PRODUCTID = I.PRODUCTID
                                   AND I.PRODUCTID = #value#
                                   </select>
                                  
                                   <select id="getItem" resultClass="item" parameterClass="string" cacheModel="quantityCache">
                                   select
                                   I.ITEMID,
                                   LISTPRICE,
                                   UNITCOST,
                                   SUPPLIER AS supplierId,
                                   I.PRODUCTID AS "product.productId",
                                   NAME AS "product.name",
                                   DESCN AS "product.description",
                                   CATEGORY AS "product.categoryId",
                                   STATUS,
                                   ATTR1 AS attribute1,
                                   ATTR2 AS attribute2,
                                   ATTR3 AS attribute3,
                                   ATTR4 AS attribute4,
                                   ATTR5 AS attribute5,
                                   QTY AS quantity
                                   from ITEM I, INVENTORY V, PRODUCT P
                                   where P.PRODUCTID = I.PRODUCTID
                                   and I.ITEMID = V.ITEMID
                                   and I.ITEMID = #value#
                                   </select>





                                  • 14. Re: The JNDI problem when deploying the JPetStore with jboss
                                    jzhuqlfeixia

                                    :):):):) It's so nice of you. All the problems have been solved!! Thanks a lot!!!
                                    Why there are these problems in the jboss? When I deploy the jpetstore with Tomcat, I just put it in the right place, then it succeeded...
                                    I really want to make friends with you:) Could give me your MSN or email.
                                    Or there is mine: zhuqlfeixia@163.com
                                    I didn't use the hotmail :)

                                    1 2 Previous Next