7 Replies Latest reply on Aug 12, 2011 10:44 AM by peterj

    ClassNotFoundException while Jboss server starting

    msurenderforu

      Hi,

       

      When I paste my application (excted as folders) DirectAXs-Admin.war folder in \jboss-6.0.0.Final\server\default\deploy folder,

      Jboss6 server is running fine.

       

      But When I paste my application as war DirectAXs-Admin.war war file in \jboss-6.0.0.Final\server\default\deploy folder,

       

      While starting Jboss6 server, It is giving ClassNotFoundException in console as below.

       

      But MYSQL.xmd file is available in the E:\SUCHOS_PROJECT\jboss-6.0.0.Final\server\default\deploy\DirectAXs-Admin.war\WEB-INF\classes path. (i,e. MYSQL.xmd file available in war file)

       

       

      11:23:50,734 INFO  [STDOUT] SUCHOS_HOME=E:\SUCHOS_PROJECT\SUCHOS_HOME

      11:23:50,812 ERROR [STDERR] java.io.FileNotFoundException: E:\SUCHOS_PROJECT\jbo

      ss-6.0.0.Final\server\default\deploy\DirectAXs-Admin.war\WEB-INF\classes\MYSQL.x

      md (The system cannot find the path specified)

      11:23:50,843 ERROR [STDERR]     at java.io.FileInputStream.open(Native Method)

      11:23:50,843 ERROR [STDERR]     at java.io.FileInputStream.<init>(FileInputStrea

      m.java:106)

      11:23:50,843 ERROR [STDERR]     at org.jboss.vfs.spi.RootFileSystem.openInputStr

      eam(RootFileSystem.java:55)

      11:23:50,843 ERROR [STDERR]     at org.jboss.vfs.protocol.FileURLConnection.getI

      nputStream(FileURLConnection.java:73)

      11:23:50,843 ERROR [STDERR]     at org.apache.xerces.impl.XMLEntityManager.setup

      CurrentEntity(Unknown Source)

      11:23:50,843 ERROR [STDERR]     at org.apache.xerces.impl.XMLVersionDetector.det

      ermineDocVersion(Unknown Source)

      11:23:50,843 ERROR [STDERR]     at org.apache.xerces.parsers.XML11Configuration.

      parse(Unknown Source)

      11:23:50,843 ERROR [STDERR]     at org.apache.xerces.parsers.XML11Configuration.

      parse(Unknown Source)

      11:23:50,843 ERROR [STDERR]     at org.apache.xerces.parsers.XMLParser.parse(Unk

      nown Source)

      11:23:50,843 ERROR [STDERR]     at org.apache.xerces.parsers.DOMParser.parse(Unk

      nown Source)

      11:23:50,843 ERROR [STDERR]     at org.apache.xerces.jaxp.DocumentBuilderImpl.pa

      rse(Unknown Source)

      11:23:50,843 ERROR [STDERR]     at javax.xml.parsers.DocumentBuilder.parse(Docum

      entBuilder.java:208)

      11:23:50,843 ERROR [STDERR]     at com.directaxs.adminconsole.util.xml.DOMUtils.

      parse(DOMUtils.java:82)

      11:23:50,843 ERROR [STDERR]     at com.directaxs.adminconsole.util.config.DBConf

      ig.loadDBConfig(DBConfig.java:334)

      11:23:50,843 ERROR [STDERR]     at com.directaxs.adminconsole.util.config.DBConf

      ig.getInstance(DBConfig.java:192)

      11:23:50,843 ERROR [STDERR]     at com.directaxs.adminconsole.webui.util.InitCon

      nectionPool.initialize(InitConnectionPool.java:71)

      11:23:50,843 ERROR [STDERR]     at com.directaxs.adminconsole.webui.util.InitCon

      nectionPool.<init>(InitConnectionPool.java:46)

      11:23:50,859 ERROR [STDERR]     at sun.reflect.NativeConstructorAccessorImpl.new

      Instance0(Native Method)

      11:23:50,859 ERROR [STDERR]     at sun.reflect.NativeConstructorAccessorImpl.new

      Instance(NativeConstructorAccessorImpl.java:39)

       

       

      Is there any configurations to extract my application as folders?

      (or)

      Is there any configurations to extract my application war into tmp folder/any other folder?

       

       

      Please guide me.

       

      Help is highly appreciated.

        • 1. Re: ClassNotFoundException while Jboss server starting
          peterj

          Exactly how are you referencing this file? Please post the code for the com.directaxs.adminconsole.util.xml.DOMUtils.parse() method and highlight line 82.

          • 2. Re: ClassNotFoundException while Jboss server starting
            msurenderforu

            Hi Peter,

             

            DOMUtils file is called from InitConnectionPool.java class to read path of MYSQL.xmd.

             

            Finally I am reading real path of MYSQL.xmd file of DirectAXs-Admin.war as below (or) final read path is below

             

            E:\SUCHOS_PROJECT\jboss-6.0.0.Final\server\default\deploy\DirectAXs-Admin.war\WEB-INF\classes\MYSQL.xmd

             

             

            Please guide me.

             

            Thanks in Advance.

             

             

             

             

             

             

             

            • 3. Re: ClassNotFoundException while Jboss server starting
              peterj

              That path will only work if the file exists on the hard drive, and when packaged as a WAR file, that xmd file does not exist on the hard drive. Instead, you should be opening the file as a resource, like this:

               

              InputStream xmd = Thread.currentThread().getContextClassLoader().getResourceAsStream("MYSQL.xmd");

               

              What this does is open the file based on the classpath, and since MYSQL.xmd is in the classpath (WEB-INF/classes is always in the classpath), it will find the file.

              • 4. Re: ClassNotFoundException while Jboss server starting
                msurenderforu

                Thank you Peter for for giving reply.

                 

                The same war file is running fine with jboss-4.0.5.GA but Exception in console with Jboss6.0.0.Final.

                 

                Is any where/any location, is the deployed war file extracted as folders? (like in tmp folder (or) any other folder )

                I am not able to find war extracted path?

                 

                Could you Please tell war extracted path?

                (and)

                To Extract war file as folders, Should I need to do any configurations in Jboss6.0.0.Final?

                 

                 

                Please guide me.

                 

                Thanks in Advance.

                • 5. Re: ClassNotFoundException while Jboss server starting
                  peterj

                  There will be a location in a temp directory where the war is extracted, but that locatrion will be idfferent any time that you run. And using a hard-coded full path is NOT the correct way to do this; you really should be using one of the ClassLoader.getResource* methods.

                  • 6. Re: ClassNotFoundException while Jboss server starting
                    msurenderforu

                    Hi Peter,

                    Thanks for your reply.

                     

                    I think it is extracting in tmp/vfs with unique name everytime.

                     

                    But how same war is working with Jboss4.0.5.GA, I am not able to understand.

                     

                    Should I do any other configurations in Jboss6.0.0.Final server?

                     

                    Please guide me.

                     

                    Thanks in Advance.

                    • 7. Re: ClassNotFoundException while Jboss server starting
                      peterj

                      Relying on quirks within the application server is never the right thing to do, the quirks will change from release to release. You should always do things the correct way.