1 2 Previous Next 18 Replies Latest reply on Mar 5, 2004 2:23 PM by davekohr

    JBoss 3.2.0 - A quick guide to changes

    jonlee

      Having had to do things the hard way, here are a few tips about getting things moved over. And to think, I'd just got 3.0.6 operating on Thursday.

      This text is more or less a copy of a post in Installation/configuration but I was asked to put this in the FAQ. It is intended to be a migration viewpoint of the changes rather than a detailed developer's view.

      For starters, you will probably need to revisit all your EJB deployment descriptors. ejb-jar.xml now needs a DOCTYPE in it for JBoss to accept it. That was about 2 hours work in our case to go through all the descriptors - I guess it is reasonable but a big pain. The jboss.xml container definitions have also changed so you will need to revisit these if you have local definitions in your deployment descriptors. Otherwise you get IllegalState messages when you try to call your EJBs. We use jboss.xml mainly because we want to throttle the maximum number of beans created.

      If you have MBeans that use the CategoryWriter, the Logger now drops the getCategoryWriter method so check on your use of that.

      The data source configuration has also changed. In our case, the postgres-service.xml has disappeared to be replaced with postgres-ds.xml. It is simpler but some of the standard definitions supplied don't cover the minimum and maximum connection specs. Fill these in with <min-pool-size>1</min-pool-size> and <max-pool-size>10</max-pool-size> or whatever are your preferences.

      The JMS configuration does not seem to have changed in any way. So that is one less migration headache.

      The Tomcat and JBoss integration works fairly well. However, it doesn't support a ROOT context. Static content one directory down can be supported by putting the content in the deploy directory with a subdirectory of dirname.war, that also contains the WEB-INF directory and contents that you would expect for a proper WAR unpack for Tomcat. Your URL for the content will be http://yourserver:8080/dirname depending on whether you have the standard Tomcat port configuration.

      Application response is faster with the integrated Tomcat-JBoss and at least the distribution is with a current Tomcat release. The tradeoff is that on startup, the system takes up much more physical memory (at least measured on a Linux system) than a separated JBoss 3.0.6 and Tomcat 4.1.24. I measured an RSS of 120Mb on start. After half a day of operation, this had dropped to 91Mb. The steady-state memory consumption is comparable with a separated configuration - however that initial Memory hump on startup does not occur with a separated installation. Anyway, I can still run this release reasonably with Redhat Linux 7.2 on a Pentium II 600MHz with 192M - unlike some commercial application servers. I hope JBoss doesn't become bloatware - the charter echoes the sentiments so I remain hopeful.

      To configure your embedded Tomcat, the "server.xml" is in the jbossweb-tomcat.sar/META-INF/jboss-service.xml file. Most Tomcat server.xml tags work except for the Context definition. For your Tomcat certificate service, use something like keystoreFile="/conf/tomcat-cert.key" so that the certificate exists under your JBoss server instance's conf directory.

      As of Tomcat 4.1.12, the default servlet context that serves unmapped servlets at http://myserver:8080/servlet/myunmappedservlet has been disabled. You can re-enable it if you wish but it does provide some possible security holes. This is all a bit beyond the scope of this document to cover but you can find more information here - http://www.fawcette.com/javapro/2002_11/online/servletsjsp_bkurniawan_11_08_02/default_pf.asp.

      Remember to put an INFO threshold for your server.log appender in production - in log4j.xml. We generated 6 Mb of server.log output on startup with the default settings. After configuration, this dropped to 170Kb. It may not be much if you don't find yourself disk IO bound but our little demo server was struggling to get running.

      One final thing - JBoss 3.2.0 complains if you don't properly close off your JDBC statements before you release connections back to the pool. This is a good thing. We picked up a possible bug with one of our more complex EJBs this way - well at least the code didn't look balanced and internally complete. So remember to close your statements/prepared statements, etc before you close your pooled connection (release it back to the pool).

        • 1. 3772843
          jzhuo

          I have downloaded JBoss. But when I run run.bat, I got the message "Out of Environment space". What should I do? What is the general procedure for configuring the setup of JBoss on Win98?

          • 2. Re: JBoss 3.2.0 - A quick guide to changes
            jzhuo

            I used 3.0.7 ago, now i want to transfer to 3.2.1. But when i deploy a examples that is well-run in 3.0.7, the console display as following:

            20:47:24,786 ERROR [MainDeployer] could not create deployment: file:/C:/opensour
            ce/jboss/server/default/deploy/Hello.jar
            org.jboss.deployment.DeploymentException: Verification of Enterprise Beans faile
            d, see above for error messages.
            at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:487)
            at org.jboss.deployment.MainDeployer.create(MainDeployer.java:784)
            at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:639)
            at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:613)
            at sun.reflect.GeneratedMethodAccessor36.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.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
            at $Proxy7.deploy(Unknown Source)
            at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymen
            tScanner.java:302)
            at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentS
            canner.java:476)
            at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
            doScan(AbstractDeploymentScanner.java:200)
            at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
            loop(AbstractDeploymentScanner.java:211)
            at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
            run(AbstractDeploymentScanner.java:190)
            20:47:24,796 ERROR [URLDeploymentScanner] Failed to deploy: org.jboss.deployment
            .scanner.URLDeploymentScanner$DeployedURL@8c905fd3{ url=file:/C:/opensource/jbos
            s/server/default/deploy/Hello.jar, deployedLastModified=0 }
            org.jboss.deployment.DeploymentException: Verification of Enterprise Beans faile
            d, see above for error messages.
            at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:487)
            at org.jboss.deployment.MainDeployer.create(MainDeployer.java:784)
            at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:639)
            at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:613)
            at sun.reflect.GeneratedMethodAccessor36.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.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
            at $Proxy7.deploy(Unknown Source)
            at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymen
            tScanner.java:302)
            at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentS
            canner.java:476)
            at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
            doScan(AbstractDeploymentScanner.java:200)
            at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
            loop(AbstractDeploymentScanner.java:211)
            at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
            run(AbstractDeploymentScanner.java:190)



            Who can help me?

            BTW, if i want some new descriptions of configuration xml files, where can i get it?

            Thanks.

            • 3. Errata: Certificate file location
              jonlee

              For Tomcat, your keyfile definition should be something like:
              keystoreFile="${jboss.server.home.dir}/conf/tomcat-cert.key" as this specifies that it should find the file tomcat-cert.key under the conf directory of your JBoss server instance.

              Sorry, my bad. I hope this makes more sense now.

              • 4. Re: Errata: Certificate file location
                kryptontri

                Hi jonlee,

                Thanks for the posting :-) BTW are order by clauses broken in 3.2.0 ? The deploy works fine, except the queriy results are not ordered :-( I will probably try to deploy on 3.0.4 and see if they work. I am *pretty* sure its not a coding issue on my end, but i could be wrong, as i have made silly mistakes in the past.

                Thanks

                K

                • 5. Re: Errata: Certificate file location
                  smurf9

                  Hi,

                  i experienced the same with a "findAll()" - Finder after upgrading from 2.4.10 to 3.2.0 : Order by seems not to work.
                  I recreated the finder with another name, then it was OK.

                  Else everything seems to be OK, even both version can run the same ejbeans without recompilation.

                  • 6. Re: JBoss 3.2.0 - context roots
                    jonlee

                    There is a way to override contexts and apply virtual hosts. So you can achieve a ROOT context. To do this, you are required to add a jboss-web.xml file to the WEB-INF directory of your WAR whether it is packed or unpacked.

                    So for example, you can do the following with your jboss-web.xml file to create a root context for virtual host www.acme.com:

                    <jboss-web>
                    <context-root>/</context-root>
                    <virtual-host>www.acme.com</virtual-host>
                    </jboss-web>

                    This comes from the following thread so thanks guys.
                    http://www.jboss.org/modules/bb/index.html?module=bb&op=viewtopic&t=

                    • 7. Default servlet context
                      trilcejf

                      The default servlet context that serves unmapped servlets at http://myserver:8080/servlet/myunmappedservlet has been disabled.
                      How can i re-enable it ?

                      Thanks in advance

                      • 8. Default servlet context
                        trilcejf

                        The default servlet context that serves unmapped servlets at http://myserver:8080/servlet/myunmappedservlet has been disabled.
                        How can i re-enable it ?

                        Thanks in advance

                        • 9. Re: Default servlet context
                          jonlee

                          This has been disabled in Tomcat for security reasons. This reference tells you why and how to re-enable it. http://www.mail-archive.com/tomcat-dev@jakarta.apache.org/msg33723.html//www.mail-archive.com/tomcat-dev@jakarta.apache.org/msg33723.html. If you follow these instructions and apply it to the file, server/instance/deploy/jbossweb-tomcat.sar/web.xml where instance is the JBoss instance you run, for example default.

                          • 10. Deploy EJB Error
                            jzhuo

                            I used 3.0.7 ago, now i want to transfer to 3.2.1. But when i deploy a examples that is well-run in 3.0.7, the console display as following:

                            20:47:24,786 ERROR [MainDeployer] could not create deployment: file:/C:/opensour
                            ce/jboss/server/default/deploy/Hello.jar
                            org.jboss.deployment.DeploymentException: Verification of Enterprise Beans faile
                            d, see above for error messages.
                            at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:487)
                            at org.jboss.deployment.MainDeployer.create(MainDeployer.java:784)
                            at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:639)
                            at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:613)
                            at sun.reflect.GeneratedMethodAccessor36.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.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
                            at $Proxy7.deploy(Unknown Source)
                            at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymen
                            tScanner.java:302)
                            at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentS
                            canner.java:476)
                            at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
                            doScan(AbstractDeploymentScanner.java:200)
                            at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
                            loop(AbstractDeploymentScanner.java:211)
                            at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
                            run(AbstractDeploymentScanner.java:190)
                            20:47:24,796 ERROR [URLDeploymentScanner] Failed to deploy: org.jboss.deployment
                            .scanner.URLDeploymentScanner$DeployedURL@8c905fd3{ url=file:/C:/opensource/jbos
                            s/server/default/deploy/Hello.jar, deployedLastModified=0 }
                            org.jboss.deployment.DeploymentException: Verification of Enterprise Beans faile
                            d, see above for error messages.
                            at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:487)
                            at org.jboss.deployment.MainDeployer.create(MainDeployer.java:784)
                            at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:639)
                            at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:613)
                            at sun.reflect.GeneratedMethodAccessor36.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.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
                            at $Proxy7.deploy(Unknown Source)
                            at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymen
                            tScanner.java:302)
                            at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentS
                            canner.java:476)
                            at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
                            doScan(AbstractDeploymentScanner.java:200)
                            at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
                            loop(AbstractDeploymentScanner.java:211)
                            at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
                            run(AbstractDeploymentScanner.java:190)



                            Who can help me?

                            BTW, if i want some new descriptions of configuration xml files, where can i get it?

                            Thanks.

                            • 11. Re: JBoss 3.2.0 - A quick guide to changes
                              jzhuo

                              Sorry, but when i post a reply message, i can not see new message in topic immidiatly, so i send two times and three ...

                              I am very sorry!

                              • 12. Re: JBoss 3.2.0 - A quick guide to changes
                                joe543

                                Hi

                                I am about to embark on an upgrade of 308RC1 to 321.

                                Did you follow the instructions and pointers in the first post of this thread?

                                • 13. Re: JBoss 3.2.0 - A quick guide to changes
                                  nfrank

                                  You have : Verification of Enterprise Beans faile
                                  d, see above for error messages.
                                  So read what is just before this message (and that you didn't post) !

                                  Usally this is because you have a spec violation (for exemple a local finder throwing RemoteException...).

                                  While 3.0 did not failed by default, 3.2 does. You can change it into the conf/jboss-config.xml, to change the behaviour on fail, but the best thing is to fix it !

                                  • 14. Re: JBoss 3.2.0 - A quick guide to changes
                                    nfrank

                                    Here is an extract of the new stuff in 3.2 :

                                    Strict Verification of EJB .jar Files

                                    The EJBDeployer has a new boolean flag called "StrictVerifier" which
                                    can be set both in jboss-service.xml as well as via JMX.

                                    Setting this to 'true' (currently the default) will cause all EJB
                                    Deployments which do *not* pass the Verifier mechanism to throw a
                                    DeploymentException (and thus they will not be deployed ... .

                                    If this causes too many problems we might change this to 'false' for
                                    the 3.2 branch but methinks that this should be defaulted to 'true'
                                    for 4.0 and later.

                                    1 2 Previous Next