14 Replies Latest reply on Jan 16, 2009 7:50 AM by jaikiran pai

    Error Could not initialise deployment jbossws.sar on running

    Shailesh Tyagi Newbie

      Hi, I am new to JBOSS, I downloaded jboss-4.2.3.GA-jdk6.zip file and extracted it. Now when running C:\jboss-4.2.3.GA-jdk6\jboss-4.2.3.GA\bin\run.bat .. its throwing following error.

      JAVA_HOME is not set. Unexpected results may occur.
      Set JAVA_HOME to the directory of your local JDK to avoid this message.
      ===============================================================================

      JBoss Bootstrap Environment

      JBOSS_HOME: C:\jboss-4.2.3.GA-jdk6\jboss-4.2.3.GA

      JAVA: java

      JAVA_OPTS: -Dprogram.name=run.bat -Xms128m -Xmx512m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000

      CLASSPATH: C:\jboss-4.2.3.GA-jdk6\jboss-4.2.3.GA\bin\run.jar

      ===============================================================================

      16:00:22,859 INFO [Server] Starting JBoss (MX MicroKernel)...
      16:00:22,875 INFO [Server] Release ID: JBoss [Trinity] 4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181439)
      16:00:22,875 INFO [Server] Home Dir: C:\jboss-4.2.3.GA-jdk6\jboss-4.2.3.GA
      16:00:22,875 INFO [Server] Home URL: file:/C:/jboss-4.2.3.GA-jdk6/jboss-4.2.3.GA/
      16:00:22,875 INFO [Server] Patch URL: null
      16:00:22,875 INFO [Server] Server Name: default
      16:00:22,875 INFO [Server] Server Home Dir: C:\jboss-4.2.3.GA-jdk6\jboss-4.2.3.GA\server\default
      16:00:22,875 INFO [Server] Server Home URL: file:/C:/jboss-4.2.3.GA-jdk6/jboss-4.2.3.GA/server/default/
      16:00:22,875 INFO [Server] Server Log Dir: C:\jboss-4.2.3.GA-jdk6\jboss-4.2.3.GA\server\default\log
      16:00:22,875 INFO [Server] Server Temp Dir: C:\jboss-4.2.3.GA-jdk6\jboss-4.2.3.GA\server\default\tmp
      16:00:22,875 INFO [Server] Root Deployment Filename: jboss-service.xml
      16:00:23,109 INFO [ServerInfo] Java version: 1.5.0_06,Sun Microsystems Inc.
      16:00:23,109 INFO [ServerInfo] Java VM: Java HotSpot(TM) Client VM 1.5.0_06-b05,Sun Microsystems Inc.
      16:00:23,109 INFO [ServerInfo] OS-System: Windows XP 5.1,x86
      16:00:23,515 INFO [Server] Core system initialized
      16:00:25,093 INFO [WebService] Using RMI server codebase: http://127.0.0.1:8083/
      16:00:25,093 INFO [Log4jService$URLWatchTimerTask] Configuring from URL: resource:jboss-log4j.xml
      16:00:25,562 INFO [TransactionManagerService] JBossTS Transaction Service (JTA version) - JBoss Inc.
      16:00:25,562 INFO [TransactionManagerService] Setting up property manager MBean and JMX layer
      16:00:25,734 INFO [TransactionManagerService] Starting recovery manager
      16:00:25,812 INFO [TransactionManagerService] Recovery manager started
      16:00:25,812 INFO [TransactionManagerService] Binding TransactionManager JNDI Reference
      16:00:27,937 INFO [EJB3Deployer] Starting java:comp multiplexer
      16:00:28,531 ERROR [MainDeployer] Could not initialise deployment: file:/C:/jboss-4.2.3.GA-jdk6/jboss-4.2.3.GA/server/default/deploy/jbossws.sar/
      java.lang.NoClassDefFoundError: javax/ejb/Stateless
      at org.jboss.ejb3.EJB3Util.isStateless(EJB3Util.java:42)
      at org.jboss.ejb3.EJB3Deployer.hasEjbAnnotation(EJB3Deployer.java:219)
      at org.jboss.ejb3.EJB3Deployer.accepts(EJB3Deployer.java:271)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)

      -------


      I need to integrate one custom application on JBOSS. I am not having good knowledge of JBOSS startup but trying to learn it step by step. Anyone can please assist me for possible cause of this error.

      Any help is highly appreciated.
      Thanks.

      Leo

        • 1. Re: Error Could not initialise deployment jbossws.sar on run
          Peter Johnson Master

          1) You are using an old JDK - 1.5.0_06. Please download and install the latest 1.5 JDK. (Hold it, read and do step 2 instead.)

          2) It also appears that you downloaded the JDK6 version of JBossAS. In that case you should download and install the latest JDK6. (Do not install it into Program Files, I have mine installed at c:/apps/jdk-1.6.0_07

          3) It appears that you do not have JAVA_HOME set. You need to set it to where you installed you JDK. Example:

          set JAVA_HOME=c:\apps\jdk-1.6.0_07

          • 2. Re: Error Could not initialise deployment jbossws.sar on run
            Andre Fritsch Newbie

            I am facing the same problem. Did you resolve it?

            I downloaded 4.2.3 Source to my windows xp installation and ran the build.bat. Bevor I added the following Parameters to the <jboss-src-folder>/build/build.bat:

            set JAVA_HOME=C:\Program Files\Java\jdk1.5.0_15
            set ANT_HOME=D:\Libs\apache-ant-1.6.5-bin\apache-ant-1.6.5
            set PATH=%ANT_HOME%\bin;%JAVA_HOME%\bin
            


            The build succeds with no errors. Afterwards i ran the run.bat in which i also added the same JAVA_HOME and PATH settings. On startup after a few seconds i get the same error.



            ERROR [MainDeployer] Could not initialise deployment: file:/D:/ProgramFiles/jboss-4.2.3.GA-src/build/output/jboss-4.2.3.GA/server/default/deploy/jbossws.sar/
            java.lang.NoClassDefFoundError: javax/ejb/Stateless


            i checked the file system. there is a jbossws.sar in the folder specified in the error message.

            to my understanding i did everything needed to compile and start jboss 4.2.3. What am i doing wrong or where is my understanding of the build process wrong?

            Defrian

            • 3. Re: Error Could not initialise deployment jbossws.sar on run
              jaikiran pai Master

              Where did you download the source from? Going by the stacktrace, it looks like the source was built using a patch and JDK 6 and is now being run using JDK 5.

              • 4. Re: Error Could not initialise deployment jbossws.sar on run
                Andre Fritsch Newbie

                Hi,

                I downloaded the source-zip-package from jboss.org. to be sure, that the source is compiled an run by jdk1.5 i added the following lines to the build.bat and run.bat to assure that it is compiled and run by my jdk 1.5

                set JAVA_HOME=C:\Program Files\Java\jdk1.5.0_15
                set PATH=%JAVA_HOME%\bin;%PATH%
                

                when i start jboss i get the following log output

                ===============================================================================
                
                 JBoss Bootstrap Environment
                
                 JBOSS_HOME: D:\ProgramFiles\jboss-4.2.3.GA-src\build\output\jboss-4.2.3.GA
                
                 JAVA: C:\Program Files\Java\jdk1.5.0_15\bin\java
                
                 JAVA_OPTS: -Dprogram.name=run.bat -server -Xms128m -Xmx512m -Dsun.rmi.dgc.cl
                ent.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000
                
                 CLASSPATH: C:\Program Files\Java\jdk1.5.0_15\lib\tools.jar;D:\ProgramFiles\jb
                ss-4.2.3.GA-src\build\output\jboss-4.2.3.GA\bin\run.jar
                
                ===============================================================================



                for my understanding it is started by a jdk 1.5.

                i also tried to compile the source with a java 1.6 jdk. doing this i get warning messages in the build log althoug the build seem to work (last log message: success). but i also get the same error when i start the jdk 1.6 compiled jboss.

                so at the moment i am pretty helpless...

                • 5. Re: Error Could not initialise deployment jbossws.sar on run
                  jaikiran pai Master

                   

                  "Defrian" wrote:
                  i added the following lines to the build.bat and run.bat to assure that it is compiled and run by my jdk 1.5
                  set JAVA_HOME=C:\Program Files\Java\jdk1.5.0_15
                  set PATH=%JAVA_HOME%\bin;%PATH%
                  



                  I think i know what the problem is. You are setting JAVA_HOME to C:\Program Files\Java\jdk1.5.0_15.
                  Java (and JBoss too) does not like space in the folder names. It always recommended to install Java and JBoss in a folder without a space in its path name.

                  In your case, you then set the PATH as
                  set PATH=%JAVA_HOME%\bin;%PATH%


                  Later on during the build when a java command is issued, the PATH is checked. Since the JAVA_HOME has a space in its path, that folder will be completely ignored during this check and the rest of the PATH will be checked for "java.exe". I believe, your PATH already has a reference to the bin folder of JDK6. As a result, the build process uses JDK6 for building the server. Later on when you start the server with JDK5, it throws those errors.

                  Just to verify that this is what is happening, you can add the following statement just after setting the JAVA_HOME and PATH in the build.bat :
                  set JAVA_HOME=C:\Program Files\Java\jdk1.5.0_15
                  set PATH=%JAVA_HOME%\bin;%PATH%
                  
                  java -version


                  Then you can check the output in the build.log file.

                  To fix this, i would recommend that you move your JDK installation to a folder which does not have a space in its path name. I have it installed at C:\jdk1.5.0_10.





                  • 6. Re: Error Could not initialise deployment jbossws.sar on run
                    Andre Fritsch Newbie

                    Hi jaikiran,

                    thanks for your reply. i also thought about it could relate to the blank in the system path definition.

                    i now added the following code to the build.bat just behind my PATH definition:

                    echo JAVA VERSION:
                    java -version
                    


                    when i run bulid. bat i get this output:

                    JAVA VERSION:
                    java version "1.5.0_15"
                    Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_15-b04)
                    Java HotSpot(TM) Client VM (build 1.5.0_15-b04, mixed mode, sharing)
                    Calling ..\tools\bin\ant.bat
                    


                    But due to your advice then i masked the blank in build.bat and run.bat by this definition:

                    set JAVA_HOME=C:\PROGRA~1\JAVA\jdk1.5.0_15
                    
                    set PATH=%ANT_HOME%\bin;%JAVA_HOME%\bin;%PATH%
                    


                    Then i rebuilded jboss. when i start it get the same error message...

                    Java is 1.5, Ant 1.6.5, the jbossws.sar is where it should be...to me it is quite nebulous why a build form source of jboss 4.2.3 does not work on my windows xp pc.

                    • 7. Re: Error Could not initialise deployment jbossws.sar on run
                      jaikiran pai Master

                      Okay, now that you have tried the possible options and ruled out some obvious errors, let me download the source and see if it works on my setup.

                      • 8. Re: Error Could not initialise deployment jbossws.sar on run
                        jaikiran pai Master

                        Works for me. So no issues with the source available on jboss.org.

                        Now try this (after you have set the path and the java_home appropriately to point to JDK5):

                        set JAVA_HOME=C:\PROGRA~1\JAVA\jdk1.5.0_15
                        
                        set PATH=%JAVA_HOME%\bin;%PATH%
                        


                        1) cd to the build folder of JBoss and run the following command:

                        build.bat clean


                        This will clean any previously compiled JDK6 classes.

                        2) Now run the following command:

                        build.bat



                        • 9. Re: Error Could not initialise deployment jbossws.sar on run
                          Andre Fritsch Newbie

                          That´s it! Thank you so much! After the build clean it worked like magic!

                          Before each build i deleted the output folder and there for tought that i did a fresh new build. do you know where ant stores previous build configurations?

                          • 10. Re: Error Could not initialise deployment jbossws.sar on run
                            jaikiran pai Master

                             

                            "Defrian" wrote:
                            That´s it! Thank you so much! After the build clean it worked like magic!

                            Before each build i deleted the output folder and there for tought that i did a fresh new build. do you know where ant stores previous build configurations?


                            Each module has its own output folder. Ex: src/connector/output. I guess, you deleted only the build/output folder (where the JBoss AS is generated). The best way to clean everything is using the clean target as you did through the build.bat


                            • 11. Re: Error Could not initialise deployment jbossws.sar on run
                              Tommy Zed Newbie

                              I guess as a MacOS 10.4 user, I am just screwed? It doesn't look like there's a 1.6 Java port for MacOS 10.4 (they force you to upgrade to 10.5). What's the best version of JBoss I can use? I am stuck on Java 1.5.0_13

                              Thanks,
                              tom

                              • 12. Re: Error Could not initialise deployment jbossws.sar on run
                                Peter Johnson Master

                                tommyzed, why do you say that? The 4.2.3 version comes with two variations - one for JDK 5, the other for JDK 6. Earlier 4.2.x versions and the 4.0.x versions were for JDK 5 only. Also, I have been using the 5.0 release candidates with both JDK 5 and JDK 6.

                                By the way, you should have started a new topic because you issue is not the same as the one tackled in this topic.

                                • 13. Re: Error Could not initialise deployment jbossws.sar on run
                                  Praveen Newbie

                                  Me too facing the same issue . Its happening for me in jboss-4.2.3.GA version.What might be the reason ?

                                  • 14. Re: Error Could not initialise deployment jbossws.sar on run
                                    jaikiran pai Master

                                    Praveen,

                                    You should have opened a separate thread to discuss your issue.

                                    Me too facing the same issue .

                                    What issue?


                                    Its happening for me in jboss-4.2.3.GA version


                                    Are you building from source or have you downloaded the binary? If you have downloaded the binary zip, where did you download it from and what is the name of the file? There are 2 variants of JBoss-4.2.3 - one for JDK5 and one for JDK6. Which one did you download? And which JDK version are you using when starting JBoss?