9 Replies Latest reply on Jan 23, 2003 6:47 PM by rossmills

    Apple bug report

    rossmills

      Hi,

      After banging my head against the wall for weeks trying to get JBoss to run on Mac OS X 10.2.2 with no success. I cannot get versions 3.0.3 or newer to run on OS X. Version 3.0.2 or older have proven to have too many bugs. I've posted the following bug report to Apple.

      (I haven't gotten any responses from these forums. This is my last ditch attempt at finding a way to get JBoss to run on OS X. I'm currently developing an app for a well known institution. I'd really like to see JBoss succeed, but if I cannot make it work, I'll have no choice but to abandon it.)

      ---

      PROBLEM...

      Unable to run JBoss versions 3.0.3 or newer on the Apple OS X server 10.2.2 using Java 1.4.1. JBoss reports the following error...

      java.lang.NoClassDefFoundError: javax/servlet/ServletException



      STEPS TO DUPLICATE PROBLEM...

      (1) Set a JAVA_HOME environment variable
      setenv JAVA_HOME /System/Library/Frameworks/JavaVM.framework/Versions/1.4.1/Home

      (2) Create a /usr/local/jboss directory...

      (3) Download any one of the following versions of JBoss from www.jboss.org and place it in the /usr/local/jboss directory...
      jboss-3.2.0beta2_tomcat-4.1.12.zip
      jboss-3.0.4_tomcat-4.1.12.zip
      jboss-3.0.3_tomcat-4.1.12.zip

      (4) unzip the file with the following command...
      jar -xvf jboss-3.2.0beta2_tomcat-4.1.12.zip

      (5) goto to the JBoss bin directory
      cd jboss-3.2.0beta2_tomcat-4.1.12/bin

      (6) make the scripts executable
      chmod a+x *.sh

      (7) you will need to make the following changes to run.sh

      replace JAVAC_JAR="$JAVA_HOME/lib/tools.jar"
      with JAVAC_JAR="$JAVA_HOME/../Classes/classes.jar"

      (8) start jboss
      ./run.sh

      (9) lots of messages will be generated to the screen. When the messages stop, hit CTRL-C to stop JBoss.

      (10) view the log file
      vi /usr/local/jboss/jboss-3.2.0beta2_tomcat-4.1.12/server/default/log/server.log

      (11) do a search on ERROR
      /ERROR

      (12) You should see the following error message...
      java.lang.NoClassDefFoundError: javax/servlet/ServletException

      Notes:
      (a) If you install JBoss on Windows, you will not encounter this problem
      (b) We have been searching the jboss forums and the web for possible solutions. No solution could be found. We suspect that there is problem with classloading on the OS X server.
      (c) JBoss is open-source and the source code is available from www.jboss.org
      (d) javax.servlet.ServletException can be found in /usr/local/jboss/jboss-3.2.0beta2_tomcat-4.1.12/tomcat-4.1.x/common/lib/servlet.jar.
      (e) if you look in the server.log file before the error, you will see that servlet.jar was loaded
      (f) JBoss versions 3.0.2 and earlier do not have this problem on the OS X server.
      (g) If you install JBoss that uses Jetty instead of Tomcat a similar problem will occur, but only after a J2EE application has been deployed to it. (I would be happy to provide you with the application and instructions on how to deploy

        • 1. Re: Apple bug report
          tbauer

          First off, I have been using JBoss on Mac OS X for almost a year and a half ever since X came out. Yes, there is a large configuration change from 2.4.x to 3.0.x but it has always run "fairly" well, depsite what I feel are serious transaction managment issues.....

          1. Where did you get 1.4.1 or why are you using it...it is my understanding it is not 100% GM...its preview release.

          2. Why are you only trying the build with Tomcat. I use 3.0.4 with the built in Jetty web servlet container and have NO Problems!! The JBoss with Jetty DOES work properly, I really suspect it is something in your classpath...just guessing...

          Here's another question....When you downloaded the JBoss .zip file, what did you use to unpack the zip...If you are using older version of Stuffit, it has a nasty bug that TRUNCATES class names longer than 32 characters....

          I'd have to look at your configuration, and would be willing to expose mine if you want to contact me privately at "tbauer@mac.com"....

          cheers,

          tim

          • 2. Re: Apple bug report
            davidjencks

            Tim, could you be more specific about the transaction management issues you know of?

            The ones I am aware of and are implemented at a pre-alpha level in jboss 4 are:

            --tx logging/recovery

            --distributed transactions


            Thanks
            david jencks

            • 3. Re: Apple bug report
              tbauer

              David,

              I'm refering to the problems I'm having as outlined in thread:

              http://www.jboss.org/modules/bb/index.html?module=bb&op=viewtopic&t=forums/ call me a stupid novice, but I would assume that a direct SQL session should conform to a clean transaction model.

              1. Open a db connection (from container)
              2. call a method to fetch some rows (this method calls others in the same session bean to fetch other rows).
              3. Close the connection.

              During the course of step 2 above, I often fetch a bean by primary key to stuff it in a model (I'm not going to update anything).

              When three users hit the application I start getting errors like:

              at java.lang.Thread.run(Thread.java:491)
              14:47:56,222 INFO [LocalTxConnectionManager] Could not enlist in transaction on entering meta-aware object!
              javax.transaction.SystemException: Could not enlist XAResource!javax.transaction.RollbackException: Already marked for rollback

              The link you supplied me about reading up on resource ordering made no sense to me in relation to this problem. There is always going to be a time when 2 or 3 users read a record (bean) and don't want to update (they just want to read it), so why should I get a deadlock error.

              Not everyone is so intimately involved in the development of JBoss, and not everyone is an expert on the intricacies of how these things work, so when you give advice on how to fix things, please be very specific.

              I wish I had $6000-$10000 available to pay one of your consultants to help me with my problems but I don't. I will probably spring for the doc subscription, provided I feel its more substance than theory.

              • 4. Re: Apple bug report
                davidjencks

                The docs would probably be a good investment. I think there is a discussion of locking and deadlocks.

                In your original stack trace, there was a really prominent "deadlock detected" message. I strongly suggest you figure out why before trying anything else to fix these problems.

                Here's an easy way to get this, using the outline of your session bean you provided:

                thread 1

                find(pk1);
                find(pk2);

                thread 2 simultaneously

                find(pk2);
                find(pk1);

                With standard locking, each thread has locked a resource needed by the other, and neither can proceed. Deadlock detection picks one to rollback.

                You can fix this by relaxing the locking, making the entities read-only(I think), or resource ordering, which in this case means the session always finds entities in some consistent defined order (pk1 before pk2 for example).

                • 5. Re: Apple bug report
                  jgrafix

                  Hope you have your answer by now, but I thought I'd post this any way. I've found that you have to be in the JBOSS_HOME directory when you start JBoss. If you are in the /Bin directory it won't run. So your command should be something like ./bin/run.sh. Then it will run fine.

                  • 6. Re: Apple bug report
                    rossmills

                    Tim,

                    I just read your response to my message. If you are able to run JBoss 3.0.4 on OS X, then there is hope that I will be able to do the same.

                    Here's some answers to your questions...

                    >> Where did you get 1.4.1 ...

                    You can download 1.4.1 from the Apple Developer Connection. I was not having much luck with 1.3.1 so I gave 1.4.1 a try.


                    >> Why are you only trying the build with Tomcat. I use 3.0.4 with the built in Jetty web servlet container and have NO Problems!! ...

                    I have tried running with Jetty. However, whether I run JBoss using Tomcat or Jetty, I get similar problems. In both cases, JBoss cannot seem to load the webserver classes.


                    >> Here's another question....When you downloaded the JBoss .zip file, what did you use to unpack the zip...If you are using older version of Stuffit, it has a nasty bug that TRUNCATES class names longer than 32 characters....

                    I used jar to unzip JBoss.zip.


                    >> I'd have to look at your configuration, and would be willing to expose mine if you want to contact me privately at tbauer@mac.com....

                    I'd really appreciate that. I've run out of options. Thank you.


                    Ross

                    • 7. Re: Apple bug report
                      davidjencks

                      I have been doing about half of my jboss development on osx for the last year, on jdk 1.3.1 and 1.4.1, with absolutely no problems (I had to use the command line property to disable ipv6 stack with 1.4.1, as documented in the apple release notes for 1.4.1 preview 6).

                      The only things I can think of that might be significant differences are that I have xfree86 installed using fink and always compile jboss from source. You might try compiling from source and see if it makes any difference.

                      • 8. Re: Apple bug report
                        rossmills

                        I took your suggestion to try building JBoss from source. Here's what I ran into...

                        -- jboss-3.2beta2-src.tgz --
                        I encounter a build error because the compiler cannot find class RelationServiceNotRegisteredException

                        -- jboss-3.0.4-src.tgz --
                        -- jboss-3.0.3-src.tgz --
                        -- jboss-3.2.beta2src.tgz --
                        I encounter a build error because the compiler cannot find class RMIClientNorificationListenerInterface

                        -- CVS versions of jboss-head and jboss-3.0 --
                        I get the following compile errors...

                        compile-classes:
                        [javac]Compiling 447 source files to /usr/local/jboss-cvs/jboss-3.0/server/output/classes
                        /usr/local/jboss-cvs/jboss-3.0/server/src/main/org/jboss/ejb/plugins/AbstractInstancePool.java:212: cannot resolve symbol
                        symbol : constructor EJBException (java.lang.String,java.lang.InstantiationException)
                        location: class javax.ejb.EJBException
                        throw new EJBException("Could not instantiate bean", e);
                        ^
                        /usr/local/jboss-cvs/jboss-3.0/server/src/main/org/jboss/ejb/plugins/AbstractInstancePool.java:215: cannot resolve symbol
                        symbol : constructor EJBException (java.lang.String,java.lang.IllegalAccessException)
                        location: class javax.ejb.EJBException
                        throw new EJBException("Could not instantiate bean", e);
                        ^
                        /usr/local/jboss-cvs/jboss-3.0/server/src/main/org/jboss/ejb/plugins/cmp/bridge/EntityBridgeInvocationHandler.java:103: cannot
                        resolve symbol
                        symbol : constructor EJBException (java.lang.String,java.lang.Exception)
                        location: class javax.ejb.EJBException
                        throw new EJBException("Internal error", e);
                        ^

                        ... (and so on with over variations of the EJBException constructor) ...


                        (1) I have JAVA_HOME set to /System/Library/Frameworks/JavaVM.framework/Versions/1.3.1/Home
                        (2) I have CLASSPATH set to ${JAVA_HOME}/../Classes/classes.jar

                        I'm sure I'm doing something really stupid. I just don't know what it is?

                        Ross


                        • 9. Re: Apple bug report
                          rossmills

                          (I posted this message on Jan 13th, but somehow it got
                          blown away.)

                          I finally got JBoss to run on my Xserve by deploying jboss-3.2.0beta3. I don't know why this version works while all versions going back to 3.0.3 do not. Also I do not understand why some OS X users had absolutely no problem. But I have heard from other OS X users who encountered the problem I described above.

                          Anyway, thanks to the JBoss development team for whatever you did to get this thing running again. Thanks to all the people who took the time to read my problem and offer advice.

                          Ross