2 Replies Latest reply: Feb 12, 2007 6:22 AM by 807606 RSS

    Main class not found exception - Java virtual machine error

    807606
      Hi,

      I tried executing the following cmds. Below are the errors obtained when i executed..

      <<command i executed>>
      C:\Program Files\Java\jre1.5.0_09\bin>javaw -classpath "C:\Program Files\Java\jre1.5.0_09\lib\javaws.jar" com.sun.javaws.Main https://<IPddr>:8443/sample.jnlp

      <<Error obtained>>
      Main class not found (Obtained in a dialog box)

      <<Command executed>>
      C:\Program Files\Java\jre1.5.0_09\bin>java -classpath "C:\Program Files\Java\jre1.5.0_09\lib\javaws.jar" com.sun.javaws.Main https://<IPddr>:8443/sample.jnlp

      <<Error obtained>>
      Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/deploy/securi
      ty/DeployAuthenticator
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClass(Unknown Source)
      at java.security.SecureClassLoader.defineClass(Unknown Source)
      at java.net.URLClassLoader.defineClass(Unknown Source)
      at java.net.URLClassLoader.access$100(Unknown Source)
      at java.net.URLClassLoader$1.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at java.lang.ClassLoader.loadClassInternal(Unknown Source)

      Can you pls let me know how it can be resolved?

      Thanks in advance
      -NGS
        • 1. Re: Main class not found exception - Java virtual machine error
          807606
          For starters, put all that stuff on one line.
          • 2. Re: Main class not found exception - Java virtual machine error
            807606
            am trying to call the class clas_name dynamically but it shows the following exception.. am u sing axis with jboss to deploy this program as a webservice also the calling class implements an interface called XMLParser can any one help me ..

            ***Request parameter obtainedes:class_name
            17:36:20,320 INFO [STDOUT] Request param is :class_name
            17:36:20,320 INFO [STDOUT] inside xmlhash class: request param recevied is:class_name
            17:36:20,340 INFO [STDOUT] ***The Class name to be called is class_name
            17:36:20,350 INFO [STDOUT] java.lang.ClassNotFoundException: class_name
            17:36:20,350 INFO [STDOUT] at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1332)
            17:36:20,350 INFO [STDOUT] at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1181)
            17:36:20,350 INFO [STDOUT] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
            17:36:20,350 INFO [STDOUT] at java.lang.Class.forName0(Native Method)
            17:36:20,350 INFO [STDOUT] at java.lang.Class.forName(Class.java:164)
            17:36:20,350 INFO [STDOUT] at parsing.Test.returnClassobject(Test.java:56)
            17:36:20,350 INFO [STDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            17:36:20,350 INFO [STDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            17:36:20,350 INFO [STDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

            17:36:20,350 INFO [STDOUT] at java.lang.reflect.Method.invoke(Method.java:585)
            17:36:20,350 INFO [STDOUT] at org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:397)
            17:36:20,350 INFO [STDOUT] at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:186)
            17:36:20,350 INFO [STDOUT] at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323)
            17:36:20,350 INFO [STDOUT] at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
            17:36:20,360 INFO [STDOUT] at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
            17:36:20,360 INFO [STDOUT] at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
            17:36:20,360 INFO [STDOUT] at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:454)
            17:36:20,360 INFO [STDOUT] at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)
            17:36:20,360 INFO [STDOUT] at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699)
            17:36:20,360 INFO [STDOUT] at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
            17:36:20,360 INFO [STDOUT] at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
            17:36:20,360 INFO [STDOUT] at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
            17:36:20,360 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterCha
            in.java:252)
            17:36:20,360 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:
            173)
            17:36:20,360 INFO [STDOUT] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
            17:36:20,360 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterCha
            in.java:202)
            17:36:20,360 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:
            173)
            17:36:20,360 INFO [STDOUT] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
            17:36:20,360 INFO [STDOUT] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
            17:36:20,360 INFO [STDOUT] at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:3
            9)
            17:36:20,360 INFO [STDOUT] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValv
            e.java:153)
            17:36:20,370 INFO [STDOUT] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
            17:36:20,370 INFO [STDOUT] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
            17:36:20,370 INFO [STDOUT] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
            17:36:20,370 INFO [STDOUT] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
            17:36:20,370 INFO [STDOUT] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
            17:36:20,370 INFO [STDOUT] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
            17:36:20,370 INFO [STDOUT] at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Htt
            p11Protocol.java:744)
            17:36:20,370 INFO [STDOUT] at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
            17:36:20,370 INFO [STDOUT] at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:1
            12)
            17:36:20,370 INFO [STDOUT] at java.lang.Thread.run(Thread.java:595)



            I doubt whether its because of am implementing the interface which is in a subfolder relative to the class to be called .. other wise it may be of security problem???