12 Replies Latest reply on Jul 14, 2008 4:52 AM by baz

    Problem with JBoss AS 5.0.0CR1

    baz

      I do have a problem with JBoss AS5.
      datasource is accessed via JNDI before it is even bound

      My environment
      Win XP SP2
      Java 1.5.0 10
      Seam 2.0.3.CR1 (This should include compatibility patches for AS5.0)
      richfaces-ui-3.2.1.GA
      JBT 2.1.1

      The story:
      Created a Seam project with JBT 2.1.1 (mysql database)
      and deployed it successfully to JB AS 4.2.2GA

      Created a server for 5.0.0.CR1
      Deployed the above mentioned project to it.

      The problem is a kind of ordering:

      07:15:58,703 INFO [Contexts] starting up: prunusEntityManagerFactory
      07:15:58,859 INFO [Version] Hibernate Annotations 3.4.0.CR1
      07:15:58,890 INFO [Environment] Hibernate 3.3.0.CR1
      07:15:58,906 INFO [Environment] hibernate.properties not found
      07:15:58,921 INFO [Environment] Bytecode provider name : javassist
      07:15:58,937 INFO [Environment] using JDK 1.4 java.sql.Timestamp handling
      07:15:59,125 INFO [Version] Hibernate Commons Annotations 3.1.0.CR1
      07:15:59,125 INFO [Version] Hibernate EntityManager 3.4.0.CR1
      07:15:59,515 INFO [NamingHelper] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interf
      aces}
      07:15:59,515 ERROR [DatasourceConnectionProvider] Could not find datasource: java:/prunusDatasource
      javax.naming.NameNotFoundException: prunusDatasource not bound
      
      07:16:00,421 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=prunusDatasource' to JNDI name 'java:prunusDatasource'
      

      As you see, the datasource is accessed via JNDI before it is even bound:-(

      Can someone reproduce this behaviour?

        • 1. Re: Problem with JBoss AS 5.0.0CR1
          baz

          Have tried it now with JBT 2.1.2

          Created a new seam project in the workspace where i have already defined an as5 server and the datasource
          Target Runtime JBoss 5.0 Runtime
          Target Server JBoss 5.0 Server
          Configurations Dynamic Web Project with Seam 2.0
          Seam runtime 2.0.3CR1

          After generation of this project i run Seam generate Entities

          Starting the server yields the same behaviour:-(
          Any idea what the reason is for this issue ?

          07:46:30,343 INFO [ServerImpl] Home Dir: E:\IDE\jboss-5.0.0.CR1
          07:49:24,781 INFO [StandardService] Starting service jboss.web
          07:49:24,781 INFO [StandardEngine] Starting Servlet Engine: JBoss Web/2.1.1.CR3
          07:49:24,875 INFO [Catalina] Server startup in 93 ms
          07:49:27,109 INFO [NativeServerConfig] 3.0.2.GA
          07:49:30,375 INFO [TomcatDeployment] deploy, ctxPath=/web-console, vfsUrl=management/console-mgr.sar/web-console.war
          07:49:31,640 INFO [TomcatDeployment] deploy, ctxPath=/jmx-console, vfsUrl=jmx-console.war
          07:49:31,750 INFO [TomcatDeployment] deploy, ctxPath=/jbossws, vfsUrl=jbossws.sar/jbossws-management.war
          07:49:31,890 INFO [TomcatDeployment] deploy, ctxPath=/, vfsUrl=ROOT.war
          07:49:31,937 INFO [TomcatDeployment] deploy, ctxPath=/jbas5, vfsUrl=jbas5.war
          07:49:31,984 WARN [WebResourceHandler] Ignoring invalid TimerService resource-env-ref
          07:49:32,125 WARN [WebResourceHandler] Ignoring invalid TimerService resource-env-ref
          07:49:34,453 INFO [ServletContextListener] Welcome to Seam 2.0.3.CR1
          07:49:42,906 INFO [Contexts] starting up: jbas5EntityManagerFactory
          07:49:43,062 INFO [Version] Hibernate Annotations 3.4.0.CR1
          07:49:43,093 INFO [Environment] Hibernate 3.3.0.CR1
          07:49:43,109 INFO [Environment] hibernate.properties not found
          07:49:43,125 INFO [Environment] Bytecode provider name : javassist
          07:49:43,140 INFO [Environment] using JDK 1.4 java.sql.Timestamp handling
          07:49:43,359 INFO [Version] Hibernate Commons Annotations 3.1.0.CR1
          07:49:43,359 INFO [Version] Hibernate EntityManager 3.4.0.CR1
          07:49:44,671 INFO [NamingHelper] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
          07:49:44,671 ERROR [DatasourceConnectionProvider] Could not find datasource: java:/jbas5Datasource
          javax.naming.NameNotFoundException: jbas5Datasource not bound
          07:49:44,703 INFO [TomcatDeployment] deploy, ctxPath=/invoker, vfsUrl=http-invoker.sar/invoker.war
          07:49:44,953 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=jbas5Datasource' to JNDI name 'java:jbas5Datasource'
          


          • 2. Re: Problem with JBoss AS 5.0.0CR1
            jaikiran

            I dont know how the JBoss Tools works. How are you deploying the application? Does it work if you manually copy the datasource and the application to the deploy folder of JBoss and start the server? If yes, then it looks like this is a problem with the order in which the JBoss Tools is deploying the application and the datasource.

            • 3. Re: Problem with JBoss AS 5.0.0CR1
              baz

              Thanks for the reply.
              The ordering is not the problem, at least in respect to the tool.
              The server is stopped, application and datasource are "copied" to the server.
              The server is manually started.

              • 4. Re: Problem with JBoss AS 5.0.0CR1
                jaikiran

                What is the filename of the datasource and the filename of your application (from the logs i see its jbas5.war, right?)

                • 5. Re: Problem with JBoss AS 5.0.0CR1
                  jaikiran

                  Tried a few things on JBoss-5 CR1 and JBoss-4.2.2 GA. There are changes in the way the deployers are working in CR1. Earlier in JBoss-4.2.2 there was a jboss-web.deployer in the deploy folder. Only the ROOT.war which was inside this jboss-web.deployer would be first deployed, then the datasources (present in the deploy folder) and then the war files in the deploy folder.

                  In CR1, the deployers have been moved to %JBOSS_HOME%\server\< serverName>\deployers folder. And the war files in the deploy folder are always deployed first and then the datasources. So yes, the ordering has changed and hence the issue that you are seeing.

                  I will have to look into the documentation or the deployers folder to see if the order of the deployers can be changed to deploy the datasources first.

                  • 6. Re: Problem with JBoss AS 5.0.0CR1
                    baz

                    Thanks for looking into this.

                    In CR1, the deployers have been moved to %JBOSS_HOME%\server\< serverName>\deployers folder. And the war files in the deploy folder are always deployed first and then the datasources.

                    Does this mean that, with this default config, no *.war can access a datasource?


                    • 7. Re: Problem with JBoss AS 5.0.0CR1
                      jaikiran

                      This was just based on what i have been seeing so far with CR1. I will have to go through the documentation to understand what is the expected deployment order. One other user has asked a similar question here http://www.jboss.com/index.html?module=bb&op=viewtopic&t=138587. JBoss developers will be able to answer this better. I'll keep an watch on that thread.

                      • 8. Re: Problem with JBoss AS 5.0.0CR1
                        jaikiran

                        By the way, if your application was an EAR, i would have recommended you to package the -ds.xml in the EAR and add a "module" entry in jboss-app.xml to avoid any deployment ordering issues. But i don't see anything similar for a WAR.

                        • 9. Re: Problem with JBoss AS 5.0.0CR1
                          baz

                          Ok, thanks again.

                          I have tried to create an ear project, but the tool does not deploy this correctly, but this is another issue

                          • 10. Re: Problem with JBoss AS 5.0.0CR1
                            baz

                            After successfully deployed the ear it does work. Even with an external *-ds.xml file.

                            So the only problem is war deployment.
                            Ciao,
                            Carsten

                            • 11. Re: Problem with JBoss AS 5.0.0CR1
                              maxandersen

                              Guys, please report this in jboss tools jira asap; AS5 and Seam war deployment is something we need to make sure is working for JBT 3.

                              Need to figure out if it is a AS5 issue or something we need to change in our deployment....

                              • 12. Re: Problem with JBoss AS 5.0.0CR1
                                baz

                                Hello Max,
                                please take a look at http://www.jboss.com/index.html?module=bb&op=viewtopic&t=138587

                                The problem seems to solved by the JBoss AS5 guys.

                                After downloading a nightly build (from 9.07.2008) the deployment works.
                                But i ran into a jsf bug. The nightly contains jsf 1.2_08 which is known to NOT work well with richfaces. So i can not test further until this is solved.

                                Ciao,
                                Carsten