Com.sun.tools.javac.Main: method compile errors

I had a working web project the other day, and something happened that caused every page to start throwing this error:
# javax.servlet.ServletException: com.sun.tools.javac.Main: method compile([Ljava/lang/String;Ljava/io/PrintWriter;)I not found
# at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.service(JspServlet.java:779)
# at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
# at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
# at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
# at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
# at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
# at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
# at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
# at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
# at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:978)
# at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:564)
# at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:200)
# at com.mayco.mvc.MVCServlet.processRequest(MVCServlet.java:426)
# at com.mayco.ldap.MayServlet.service(MayServlet.java:415)
# at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
# at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
# at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
# at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
# at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
# at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
# at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
# at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:76)
# at com.mayco.cy.filter.AuthenticateFilter.doFilter(AuthenticateFilter.java:167)
# at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:132)
# at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:71)
# at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:974)
# at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:564)
# at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:200)
# at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:119)
# at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:276)
# at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
# at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:182)
# at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
# at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
# at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:618)
# at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:439)
# at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:672)
I tried setting up a clean environment (server, EAR, web project), but haven't been able to re-solve the problem I had with the original project yet.  If I could get a starting point to look for how to solve this type of error it would be greatly appreciated!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

I checked my JDK compliance (1.4) and the installed JREs (Standard VM; WebSphere v5.1 EE JRE; C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51_stub\java\jre)
I did notice that it was using the JRE System LIbrary [WebSphere v5.1 JRE] and I changed it to the WebSphere v5.1 EE JRE like I think it should have been...
and the web server startup begins with:
*** Starting the server ***
************ Start Display Current Environment ************
WebSphere Platform 5.1 [BASE 5.1.0.3 cf30412.02] [JDK 1.4.1 b0344.02] running with process name localhost\localhost\server1 and process id 2692
Host Operating System is Windows XP, version 5.1
Java version = J2RE 1.4.1 IBM Windows 32 build cn1411-20031011 (JIT enabled: jitc), Java Compiler = jitc, Java VM name = Classic VM
was.install.root = C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51
user.install.root = C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51
Java Home = C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51\java\jre
ws.ext.dirs = C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51/java/lib;C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51/classes;C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51/classes;C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51/lib;C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51/lib/ext;C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51/web/help;C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51/deploytool/itp/plugins/com.ibm.etools.ejbdeploy/runtime;C:/Program Files/IBM/SQLLIB/java/db2java.zip;C:/Program Files/IBM/WebSphere Studio/Application Developer/v5.1.2/wstools/eclipse/plugins/com.ibm.etools.webservice_5.1.2/runtime/worf.jar
Classpath = C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51/properties;C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51/properties;C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51/lib/bootstrap.jar;C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51/lib/j2ee.jar;C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51/lib/lmproxy.jar;C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51/lib/urlprotocols.jar;C:\WebSphere\properties;C:\spi4j2.5.4_J2ee1.4\clientLib\XEES.jar;C:\spi4j2.5.4_J2ee1.4\clientLib\bcprov-jdk14-139.jar;C:\spi4j2.5.4_J2ee1.4\clientLib\config.jar;C:\spi4j2.5.4_J2ee1.4\clientLib\spi4jStub_2.5.4.jar;C:\spi4j2.5.4_J2ee1.4\clientLib\XEES100J.jar;C:\spi4j2.5.4_J2ee1.4\clientLib\XEES110J.jar;C:\spi4j2.5.4_J2ee1.4\clientLib\XEES120J.jar;C:\spi4j2.5.4_J2ee1.4\clientLib\XEES200J.jar;C:\spi4j2.5.4_J2ee1.4\clientLib\XTCP211.jar;C:\spi4j2.5.4_J2ee1.4\Demo\log4j-1.2.8.jar;C:\spi4j2.5.4_J2ee1.4\coreLib\spi4jCore_2.5.4.jar;C:\spi4j2.5.4_J2ee1.4\coreLib\axis-1.1.jar;C:\spi4j2.5.4_J2ee1.4\coreLib\xmlParserAPIs-2_2_1.jar;C:\spi4j2.5.4_J2ee1.4\coreLib\jaxrpc.jar;C:\spi4j2.5.4_J2ee1.4\coreLib\wsdl4j.jar;C:\spi4j2.5.4_J2ee1.4\coreLib\fsgWsif1.1.jar;C:\spi4j2.5.4_J2ee1.4\Demo\commons-logging.jar;C:\spi4j2.5.4_J2ee1.4\coreLib\tools.jar;C:\spi4j2.5.4_J2ee1.4\coreLib\commons-pool-1.2.jar;C:\spi4j2.5.4_J2ee1.4\coreLib\saaj.jar;C:\spi4j2.5.4_J2ee1.4\coreLib\commons-beanutils-core.jar;C:\spi4j2.5.4_J2ee1.4\coreLib\commons-collections-3.1.jar;C:\spi4j2.5.4_J2ee1.4\coreLib\commons-discovery.jar;C:\spi4j2.5.4_J2ee1.4\coreLib\commons-lang-2.1.jar;C:\spi4j2.5.4_J2ee1.4\coreLib\connector.jar;C:\spi4j2.5.4_J2ee1.4\coreLib\FEDRWSCHECKSTATUSAxisInfo.jar;C:\spi4j2.5.4_J2ee1.4\coreLib\fscontext.jar;C:\spi4j2.5.4_J2ee1.4\coreLib\IFSClassLoader1.2.jar;C:\spi4j2.5.4_J2ee1.4\coreLib\j2ee1.4.jar;C:\spi4j2.5.4_J2ee1.4\coreLib\jca.jar;C:\spi4j2.5.4_J2ee1.4\coreLib\jta.jar;C:\spi4j2.5.4_J2ee1.4\coreLib\mail.jar;C:\spi4j2.5.4_J2ee1.4\coreLib\providerutil.jar;C:\spi4j2.5.4_J2ee1.4\coreLib\qname.jar;C:\spi4j2.5.4_J2ee1.4\coreLib\soaprmi-1_1.jar;C:\spi4j2.5.4_J2ee1.4\coreLib\xalan.jar;C:\spi4j2.5.4_J2ee1.4\coreLib\xercesImpl-2_2_1.jar;C:/Program Files/IBM/WebSphere Studio/Application Developer/v5.1.2/wstools/eclipse/plugins/com.ibm.etools.websphere.tools.common_5.1.1.1/runtime/wteServers.jar;C:/Program Files/IBM/WebSphere Studio/Application Developer/v5.1.2/wstools/eclipse/plugins/com.ibm.etools.websphere.tools.common_5.1.1.1/runtime/wasToolsCommon.jar
Java Library path = C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51/bin;C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51/java/bin;C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51/java/jre/bin;C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\eclipse\jre\bin;.;C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\eclipse\jre\bin;C:\oracle\product\10.2.0\client_2\bin;C:\oracle\product\10.2.0\client_1\bin;Y:\oracle\ora92\BIN;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\PROGRA~1\CA\SHARED~1\SCANEN~1;C:\PROGRA~1\CA\ETRUST~1;C:\PROGRA~1\IBM\SQLLIB\BIN;C:\PROGRA~1\IBM\SQLLIB\FUNCTION;C:\Program Files\Microsoft SQL Server\80\Tools\BINN;C:\Program Files\Rational\common;C:\Program Files\Rational\ClearCase\bin;C:\Program Files\IBM\SDP70\jdk\bin
************* End Display Current Environment *************

Similar Messages

  • Java.lang.NullPointerException at com.sun.tools.javac.jvm.ClassReader.fillI

    Hi,
    I got the following during build. Any ideas?
    Thanks in advance.
    javac An exception has occurred in the compiler (1.5.0_12). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport) after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report. Thank you.
    javac java.lang.*NullPointerException*
    javac at com.sun.tools.javac.jvm.*ClassReader.fillIn(ClassReader.java:1583)*
    javac at com.sun.tools.javac.jvm.ClassReader.complete(ClassReader.java:1535)
    javac at com.sun.tools.javac.code.Symbol.complete(Symbol.java:355)

    There is a bug in the compiler.
    You would need to localize the problem to the source file, class and specific code. Once you do that you can file a bug but do not count on a fix without updating to 1.6. However locating it would allow you to modify the code to get around this problem.

  • "java.lang.NoSuchMethodError: com.sun.tools..apt.Main.process"

    Hi,
    I am a new to Web Services and was following some site for implementing it.
    The link is as below:
    http://www.roseindia.net/webservices/netbeans/Web-Service.shtml
    However while doing the "build and deploy" -- I am getting the following error while doing a ::
    init:
    deps-module-jar:
    deps-ear-jar:
    deps-jar:
    Warning: MANIFEST.MF modified in the future.
    Copying 1 file to D:\WebServices-NB-Practice\webservice1\build\web\META-INF
    Warning: META-INF\context.xml modified in the future.
    Warning: WEB-INF\lib\jaxws-tools-2.1.7.jar modified in the future.
    Warning: WEB-INF\sun-jaxws.xml modified in the future.
    Warning: WEB-INF\web.xml modified in the future.
    Warning: index.jsp modified in the future.
    Warning: modified in the future.
    Warning: META-INF modified in the future.
    Copying 5 files to D:\WebServices-NB-Practice\webservice1\build\web
    library-inclusion-in-archive:
    Copying 1 file to D:\WebServices-NB-Practice\webservice1\build\web\WEB-INF\lib
    Copying 1 file to D:\WebServices-NB-Practice\webservice1\build\web\WEB-INF\lib
    Copying 1 file to D:\WebServices-NB-Practice\webservice1\build\web\WEB-INF\lib
    Copying 1 file to D:\WebServices-NB-Practice\webservice1\build\web\WEB-INF\lib
    Copying 1 file to D:\WebServices-NB-Practice\webservice1\build\web\WEB-INF\lib
    Copying 1 file to D:\WebServices-NB-Practice\webservice1\build\web\WEB-INF\lib
    Copying 1 file to D:\WebServices-NB-Practice\webservice1\build\web\WEB-INF\lib
    Copying 1 file to D:\WebServices-NB-Practice\webservice1\build\web\WEB-INF\lib
    Copying 1 file to D:\WebServices-NB-Practice\webservice1\build\web\WEB-INF\lib
    Copying 1 file to D:\WebServices-NB-Practice\webservice1\build\web\WEB-INF\lib
    Copying 1 file to D:\WebServices-NB-Practice\webservice1\build\web\WEB-INF\lib
    Copying 1 file to D:\WebServices-NB-Practice\webservice1\build\web\WEB-INF\lib
    Copying 1 file to D:\WebServices-NB-Practice\webservice1\build\web\WEB-INF\lib
    Copying 1 file to D:\WebServices-NB-Practice\webservice1\build\web\WEB-INF\lib
    Copying 1 file to D:\WebServices-NB-Practice\webservice1\build\web\WEB-INF\lib
    library-inclusion-in-manifest:
    Warning: modified in the future.
    wsgen-init-nonJSR109:
    wsgen-MyWebService-nonJSR109:
    *java.lang.NoSuchMethodError: com.sun.tools.apt.Main.process(Lcom/sun/mirror/apt/AnnotationProcessorFactory;[Ljava/lang/String;)I*
    BUILD FAILED (total time: 1 second)
    I am using netbeans version 5.5 for this.
    Although from the initial investigation I understand that this error is related to "jaxws-tools.jar".
    However I could not resolve this error.
    Can Somebody provide me with the steps to resolve this error.
    Regards,
    Avinash

    No, I put the 'main' method just to see if it solved the problem

  • Use of classes in com.sun.tools.doclets

    Hello -- What is the best practice recommendation wrt using the classes in com.sun.tools.doclets -- particularly with the planned refactoring?
    I'm writing a doclet that doesn't subclass, say, the standard doclet. There are obviously several very useful classes in this package (ClassTree, Util, MethodFinder, etc.) that I'd like to use. I can simply call their methods, but I'm curious to know if their active days are numbered.
    Would it be better to simply incorporate the source? What are the restrictions on using the source in my own doclet?
    If this is all covered somewhere (I've been hunting around a bit), please feel free to simply point me to the info.
    Thanks!
    Steve

    The Java 2 SDK license (which covers javadoc) allows you to only
    redistribute the code unmodified.
    In 1.5.0, the refactoring has renamed all of the packages and
    moved a lot of code around. We hope and plan to release
    the refactored code on java.net around the time 1.5.0 is
    released, and get an early access of it out. We'll notify
    people who are on the javadoc-announce email address which
    people can sign up as described at:
    http://java.sun.com/j2se/javadoc/#forum
    If you want more specific information now about how these will change,
    please let me know and we can answer those questions.
    -Doug Kramer
    Javadoc team

  • Failed to load Main Class: com.sun.enterprise.appclient.Main

    Hi,
    I use Sun Server 8.0 with Java 5.
    When I am running my application I find this error,
    Failed to load Main Class: com.sun.enterprise.appclient.Main
    This class is in file /home/jai/cts141/SUNWappserver/lib/appserv-rt.jar and I have this file Class in my CLASSPATH.
    The same works fiine with Java 1.4
    Please Clarify the reasons due to which this might happen.
    Thanks in Advance,
    Jay

    I use Sun Server 8.0 with Java 5.
    When I am running my application I find this error,
    Failed to load Main Class:
    com.sun.enterprise.appclient.Main
    This class is in file
    /home/jai/cts141/SUNWappserver/lib/appserv-rt.jar
    and I have this file Class in my CLASSPATH.
    The same works fiine with Java 1.4Check if there is any other jar in the SDK 5.0 distribution which has the same class.

  • Sun Studio 11 f90 INTERNAL COMPILER ERROR: "FWOutput"

    Hello SUN-Users,
    I am new here, so I don't know I am right here!?
    I have a w2100z with two opteron proc. With Sun Studio 11 I am trying to compile the new MUMPS (Ver. 4.6) package, but I get still the error message:
    f90 -I/opt/mpich/include -Dpord -I. -I../include -c dmumps_ooc.F
    1:LEN$1:1INTERNAL COMPILER ERROR near line 2494 in dmumps_ooc.F (phase FWOutput):
    FWOutput: no visit function for class 'SubscriptTriplet'
    *** Error code 1
    make: Fatal error: Command failed for target `dmumps_ooc.o'
    I search with google for "FWOutput" and I found out, that a similar problem already was recognized in Sun Studio 9 and fixed with the patch 115985-04 (6351156 f90 compiler internal error "FWOutput: no vist function for class 'SubscriptTriplet').
    Here is some code near line 2494 from file dmumps_ooc.F:
          SUBROUTINE DMUMPS_614(id)
          I=id%MYID
          J=id%OOC_NB_FILES
          K=id%KEEP(35)
          L=MOD(id%KEEP(204),3)
    TMP_DIR=TRIM(id%DMUMPS_OOC_TMPDIR)
          TMP_FILE=TRIM(id%DMUMPS_OOC_PREFIX)
          DIM_DIR=LEN(TRIM(id%DMUMPS_OOC_TMPDIR))
          DIM_FILE=LEN(TRIM(id%DMUMPS_OOC_PREFIX))
        END SUBROUTINE DMUMPS_614The bolded line is the line 2494.
    I can not see anything worng in this routine, but maybe I am already too tired for today.... :-)
    Realy it is important to me to compile the MUMPS package,
    so I hope somebody can help me?
    ****With best regards****

    I think the TRIM should remove last character of the
    string. (?)TRIM removes the trailing blanks in a string. String assignment then adds trailing blanks, so there's no point writing something like
    s1 = TRIM(s2)
    Can you say me where can I make a bug report? What is
    to do?
    Maybe next time I can do also a bug report?That's a good question. If you have a support contract, then you should be able to submit a bug report through that. Until recently, I believe that would have been the only way to do it. However, we now have an online support service:
    http://developers.sun.com/developer_help/
    I imagine you could get a bug filed through that channel as well.

  • Com.sun.security.auth.module.NTSystem compilation issues in Unix

    Hi ,
    I m using com.sun.security.auth.module.NTSystem in one my java application to get the current domain. The application and app server are running on windows OS.
    Now i want to switch my OS to Unix, where i m getting compilation issues with com.sun.security.auth.module.NTSystem ,
    1)Do i need to change the module from NTSystem to UnixSystem?
    2) I m developing the java application in Eclipse 3.2 with java 1.4 , when i m trying to import the below statment com.sun.security.auth.module.UnixSystem i couldn't? Could you please let me how i can import the UnixSystem or NTSystem will work?
    Appreciate your help!!!!
    Regards,
    Ravi.

    Unix, where i m getting compilation issues with com.sun.security.auth.module.NTSystemOf course.
    Do i need to change the module from NTSystem to UnixSystem?Of course.

  • Com.sun.kvem.midletsuite.InvalidJadException: Reason = 13 error!

    I get this error in WTK2.1 while trying to create package. Even the demos cannot be packaged.
    The exact error is:
    com.sun.kvem.midletsuite.InvalidJadException: Reason = 13
    The file C:\WTK21\apps\photoalbum\bin\MANIFEST.MF is missing the required attribute: MIDlet-Name
    The parameters are correctly set in Settings (the program above is a demo packaged with WTK2.1)
    Any help is appreciated. I use Windows XP.

    strange, check if the manifest looks like this one
    MIDlet-1: PhotoAlbum,, example.photoalbum.PhotoAlbum
    MIDlet-Data-Size: 256
    MIDlet-Description: Photoalbum of images
    MIDlet-Name: PhotoAlbum
    MIDlet-Permissions: javax.microedition.io.Connector.http
    MIDlet-Vendor: Sun Microsystems, Inc.
    MIDlet-Version: 2.0
    MicroEdition-Configuration: CLDC-1.0
    MicroEdition-Profile: MIDP-2.0
    if not, there is something wrong. These lines above are from my manifest and it works. Maybe you made some strange settings about the MIDlet-Name?
    hth
    Kay

  • Overloaded method compile error

    i have an inner class which has a method myMethod(boolean). the outer class also has a method of the same name (which the inner class's method overloads) myMethod( String, boolean ). if i try to call the outer class's method from the inner class, the compiler complains:
    myMethod(boolean) in MethodTest.PrivateMethodClass cannot be applied to (java.lang.String,boolean)
    it seems that the compiler doesn't realize that the outer method should be called, and is trying to use the inner one. naturally, if i change the name of the outer method, it works. is this a bug (which it seems like) or some "feature" of java?
    here is the testcase code:
    public class MethodTest
      public boolean myMethod( String s, boolean flag )
        System.out.println( s );
        return flag;
      private class PrivateMethodClass
        boolean value;
        public PrivateMethodClass()
          value = myMethod( false );
        public boolean myMethod( boolean flag )
          return myMethod( new String( "Inner myMethod" ), flag );
    }

    In particular, Java code can directly use all methods
    of all current instances. Class scoping does not
    influence overloading
    The above does not apply since you are not overloading.
    JLS Section 8.5 defines a member class declaration and refers to 6.3 for the scope. Section 8.1.5 says that if you use the same name in an inner class, the name is shadowed. 6.3.1 defines shadow-ing. Section 15.12.1 defines compile-time resolution of methods.
    From these sections, it seems to me that your inner class method is shadowing the outer class method. Shadowing is different from hiding, overriding, or overloading. The compiler is not going to look for a method with a different number of parameters because you are not overloading. The compiler finds the myMethod in the inner class because the name matches.
    A simple example of shadowing. Your code has the same issues with the added complexities of using an inner class and shadowing a method instead of a variable. public class Test  {
         String v = "hello";
         public static void main (String[] args) throws Exception {
              Test t = new Test();
              t.myMethod();
              System.out.println(t.v);
         public char myMethod() {
              int v;
              v = 5;
              return v.charAt(0); //compile time error int can't be dereferenced

  • Re run the main method while error..

    hi all
    i got a class which i use to decode pdf to image
    sometimes error happen(not all the time) ...and i dunno why it happens
    in my desperate condition i'm thinking, what about if error happen then i try to re run the class
    my questions are
    1. is java capable doing this? is it using try catch?
    2. how to re run the class?
    anybody has useful link where i can dig some info of them or sample code, that willing to be post here?
    thx in advance

    public void doSomething(){
      try{
        //something
      }catch(Exception e){
        e.printStackTrace();
        doSomething();
    }You should add a counter and only try a few times, otherwise you might run into an infinite loop with a out of memory exception.

  • JDK 1.5 compilation error !!!

    Hi all,
    My source code looks like this:
    * Test.java
    * Created on November 9, 2004, 6:20 PM
    package test;
    * @author Administrator
    public class Test
    /** Creates a new instance of Test */
    public Test()
    * @param args the command line arguments
    public static void main(String[] args)
    // TODO code application logic here
    I have tried to compile this source code using JDK1.5 in NetBeans 3.6 and then in console but I have the following errors:
    An exception has occurred in the compiler (1.5.0). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport) after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report. Thank you.
    java.lang.ClassFormatError: Invalid pc in LineNumberTable in class file com/sun/tools/javac/jvm/Code
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
    at com.sun.tools.javac.jvm.Gen.genMethod(Gen.java:859)
    at com.sun.tools.javac.jvm.Gen.visitMethodDef(Gen.java:844)
    at com.sun.tools.javac.tree.Tree$MethodDef.accept(Tree.java:482)
    at com.sun.tools.javac.jvm.Gen.genDef(Gen.java:651)
    at com.sun.tools.javac.jvm.Gen.genClass(Gen.java:2129)
    at com.sun.tools.javac.main.JavaCompiler.genCode(JavaCompiler.java:325)
    at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:474)
    at com.sun.tools.javac.main.Main.compile(Main.java:592)
    at com.sun.tools.javac.main.Main.compile(Main.java:544)
    at com.sun.tools.javac.Main.compile(Main.java:58)
    at com.sun.tools.javac.Main.main(Main.java:48)
    Errors compiling Test.
    How to solve this ?
    Thanks,
    /GFL

    Yes. I know, because in another day I have used JDK1.5 in order to compile another application and it worked fine.
    I have restarted the computer and now everything is ok . I do not know what the problem was.
    Anyway thanks for your answer.
    /Florian

  • Deployment problem on WLS8.1sp3: com.sun.javac.Main not found

    Hi,
    I have a curious problem, after adding some simple (logging) code to an Session Bean, the EAR file will not deploy. I get the message below concerning compilation problems. If however I restore the Session Bean to the previous state, and having build a new EAR file, the erro persists. What is this strange behaviour, has this to do with weblogic settings for the EAR file of whatever ?
    NB I also have tried to include the tool.lib jar in the projekt but that doesn't solve the problem.
    Any help would be appreciated,
    Harry van Rijn
    Exception:weblogic.management.ApplicationException: prepare failed for UasEJB.jar Module: UasEJB.jar Error: Exception preparing module: EJBModule(UasEJB.jar,status=NEW) Unable to deploy EJB: UasEJB.jar from UasEJB.jar: Compiler class: 'com.sun.tools.javac.Main', not found at weblogic.ejb20.ejbc.EJBCompiler.doCompile(EJBCompiler.java:274) at weblogic.ejb20.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:476) at weblogic.ejb20.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:407) at weblogic.ejb20.deployer.EJBDeployer.runEJBC(EJBDeployer.java:493) at weblogic.ejb20.deployer.EJBDeployer.compileJar(EJBDeployer.java:762) at weblogic.ejb20.deployer.EJBDeployer.compileIfNecessary(EJBDeployer.java:700) at weblogic.ejb20.deployer.EJBDeployer.prepare(EJBDeployer.java:1317) at weblogic.ejb20.deployer.EJBModule.prepare(EJBModule.java:498) at weblogic.j2ee.J2EEApplicationContainer.prepareModule

    hi,
    i am migrating my application from wls7.0sp2 to wls8.1 sp3. i am using weblogic.ejbc to make my ear in my ant build script.
    My Classpath settings are > C:\bea8.1\weblogic81\server\lib\weblogic.jar;C:\j2sdk1.4.2_08\lib\tools.jar;
    My Path Settings are > C:\j2sdk1.4.2_08\bin;C:\j2sdk1.4.2_08\jre\bin;
    i am getting the error message>>
    [java] Compiler class: 'com.sun.tools.javac.Main', not found
    [java] java.lang.ClassNotFoundException: com.sun.tools.javac.Main
    [java] at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
    [java] at java.security.AccessController.doPrivileged(Native Method)
    [java] at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
    [java] at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
    [java] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
    [java] at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
    [java] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
    [java] at java.lang.Class.forName0(Native Method)
    [java] at java.lang.Class.forName(Class.java:141)
    [java] at weblogic.utils.compiler.CompilerInvoker.compileMaybeExit(CompilerInvoker.java:406)
    [java] at weblogic.utils.compiler.CompilerInvoker.compile(CompilerInvoker.java:328)
    [java] at weblogic.utils.compiler.CompilerInvoker.compile(CompilerInvoker.java:336)
    [java] at weblogic.ejb20.ejbc.EJBCompiler.doCompile(EJBCompiler.java:270)
    [java] at weblogic.ejb20.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:476)
    [java] at weblogic.ejb20.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:397)
    [java] at weblogic.ejbc20.runBody(ejbc20.java:517)
    [java] at weblogic.utils.compiler.Tool.run(Tool.java:146)
    [java] at weblogic.utils.compiler.Tool.run(Tool.java:103)
    [java] at weblogic.ejbc.main(ejbc.java:29)
    [java] ERROR: Error from ejbc: Compiler class: 'com.sun.tools.javac.Main', not found
    [java] ERROR: ejbc couldn't invoke compiler

  • Problem wtih deploying EAR: com.sun.javac.Main NOT FOUND

    Hi,
    I have a curious problem, after adding some simple (logging) code to an Session Bean, the EAR file will not deploy. I get the message below concerning compilation problems. If however I restore the Session Bean to the previous state, and having build a new EAR file, the erro persists. What is this strange behaviour, has this to do with weblogic settings for the EAR file of whatever ?
    NB I also have tried to include the tool.lib jar in the projekt but that doesn't solve the problem.
    Any help would be appreciated,
    Harry van Rijn
    Exception:weblogic.management.ApplicationException: prepare failed for UasEJB.jar Module: UasEJB.jar Error: Exception preparing module: EJBModule(UasEJB.jar,status=NEW) Unable to deploy EJB: UasEJB.jar from UasEJB.jar: Compiler class: 'com.sun.tools.javac.Main', not found at weblogic.ejb20.ejbc.EJBCompiler.doCompile(EJBCompiler.java:274) at weblogic.ejb20.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:476) at weblogic.ejb20.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:407) at weblogic.ejb20.deployer.EJBDeployer.runEJBC(EJBDeployer.java:493) at weblogic.ejb20.deployer.EJBDeployer.compileJar(EJBDeployer.java:762) at weblogic.ejb20.deployer.EJBDeployer.compileIfNecessary(EJBDeployer.java:700) at weblogic.ejb20.deployer.EJBDeployer.prepare(EJBDeployer.java:1317) at weblogic.ejb20.deployer.EJBModule.prepare(EJBModule.java:498) at weblogic.j2ee.J2EEApplicationContainer.prepareModule

    hi,
    i am migrating my application from wls7.0sp2 to wls8.1 sp3. i am using weblogic.ejbc to make my ear in my ant build script.
    My Classpath settings are > C:\bea8.1\weblogic81\server\lib\weblogic.jar;C:\j2sdk1.4.2_08\lib\tools.jar;
    My Path Settings are > C:\j2sdk1.4.2_08\bin;C:\j2sdk1.4.2_08\jre\bin;
    i am getting the error message>>
    [java] Compiler class: 'com.sun.tools.javac.Main', not found
    [java] java.lang.ClassNotFoundException: com.sun.tools.javac.Main
    [java] at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
    [java] at java.security.AccessController.doPrivileged(Native Method)
    [java] at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
    [java] at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
    [java] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
    [java] at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
    [java] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
    [java] at java.lang.Class.forName0(Native Method)
    [java] at java.lang.Class.forName(Class.java:141)
    [java] at weblogic.utils.compiler.CompilerInvoker.compileMaybeExit(CompilerInvoker.java:406)
    [java] at weblogic.utils.compiler.CompilerInvoker.compile(CompilerInvoker.java:328)
    [java] at weblogic.utils.compiler.CompilerInvoker.compile(CompilerInvoker.java:336)
    [java] at weblogic.ejb20.ejbc.EJBCompiler.doCompile(EJBCompiler.java:270)
    [java] at weblogic.ejb20.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:476)
    [java] at weblogic.ejb20.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:397)
    [java] at weblogic.ejbc20.runBody(ejbc20.java:517)
    [java] at weblogic.utils.compiler.Tool.run(Tool.java:146)
    [java] at weblogic.utils.compiler.Tool.run(Tool.java:103)
    [java] at weblogic.ejbc.main(ejbc.java:29)
    [java] ERROR: Error from ejbc: Compiler class: 'com.sun.tools.javac.Main', not found
    [java] ERROR: ejbc couldn't invoke compiler

  • Urgent : Cannot Compile :Error :java.lang.NoClassDefFoundError: com/sun/too

    I reinstalled win2k and since then I cant get my javac prompt to work
    The error is :
    Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/tools/javac/Main
    But I can find the java.exe
    jar tools, etc.
    Is there some version problems associated with this;
    I am actually tring to run a compile script
    as below:
    COMPILE SCRIPT
    rmdir/s/q K:\MyProjects\class\com
    pause
    javac -classpath K:\MyProjects\class;%JAVAC_CLASSPATH%%J2EE_CLASSPATH% -d K:\MyProjects\class @Compiler.txt
    pause
    This script was working normally before I reinstalled Win2k.
    My CLASSPATH , PATH are below and my jdk is installed in K:\jdk1.3.0_02
    SystemRoot = K:\WINNT
    JAVAC_CLASSPATH:
    %JAVA_HOME%\bin;%JAVA_HOME%\lib;%JAVA_HOME%\lib\tools.jar;%JAVA_HOME%\lib\dt.jar;
    CLASSPATH
    %SystemRoot%;%SystemRoot%\system32;%SystemRoot%\system32\cmd.exe;JAVAC_CLASSPATH% %J2EE_CLASSPATH%%JRE_HOME%; %MY_PROJECT%\SQLConstant.txt;
    PATH
    %SystemRoot%\system32;%SystemRoot%\system32\WBEM;%JAVAC_CLASSPATH%;%J2EE_CLASSPATH%;K:\Oracle\bin;K:\Program Files\Oracle\jre\1.1.7\bin;C:\Inprise\AppServer\bin;K:\Program Files\Sybase\SQL Anywhere 7\win32;K:\Program Files\Sybase\Shared\win32;K:\Program Files\Sybase\Shared\Sybase Central 4.0\java;K:\Program Files\Microsoft SQL Server\80\Tools\BINN;K:\Program Files\Sybase\EAServer4.0\java\lib\easclient.jar;K:\Program Files\Sybase\EAServer4.0\java\lib\easserver.jar;K:\Program Files\Sybase\EAServer4.0\java\lib\easj2ee.jar;K:\BorlandEnterpriseServer\bin;K:\WebSphere\AppServer\bin;K:\Program Files\IBM\MQSeries\bin;K:\Program Files\IBM\MQSeries\Java\Lib;K:\Program Files\IBM\WebSphere MQ Publish and Subscribe\bin
    I cant notice any difference between the old classpath settings.
    Could somebody help me out in this issue
    Thanks
    manoj

    Hi Manoj,
    I had the same problem.
    This is what worked for me:
    I'm running Win2k.
    So, in C:\WINNT\system32 I found the following files
    javac.exe
    javaw.exe
    java.exe
    I removed them all, since I have the jdk pointed in the right classpath in my environment variables.
    Once this was deleted. It worked fine!
    I hope this helps.

  • OC4J Compiler error

    I have installed OC4j.9.0.3 in my machine. I have already JDK1.3.1 installed in my machine.
    I have written a CMP EJB. First time the EJB is deploying fine from Jdeveloper (9.0.3). When i change my EJB (i.e add some field in my EJB) and try to deploy OC4j.9.0.3 standalone server it is give following error.
    An exception has occurred in the compiler (1.3.1_01). Please file a bug at the Java Developer Connection (http://java.sun.com/cgi-bin/bugreport.cgi). Include your program and the following diagnostic in your report. Thank you.
    java.lang.InternalError: jzentry == 0
         at java.util.zip.ZipFile$2.nextElement(Unknown Source)
         at com.sun.tools.javac.v8.code.ClassReader.openArchive(ClassReader.java:893)
         at com.sun.tools.javac.v8.code.ClassReader.list(ClassReader.java:1095)
         at com.sun.tools.javac.v8.code.ClassReader.listAll(ClassReader.java:1191)
         at com.sun.tools.javac.v8.code.ClassReader.fillIn(ClassReader.java:1211)
         at com.sun.tools.javac.v8.code.ClassReader.complete(ClassReader.java:955)
         at com.sun.tools.javac.v8.code.Symbol.complete(Symbol.java:366)
         at com.sun.tools.javac.v8.comp.Enter._case(Enter.java:424)
         at com.sun.tools.javac.v8.tree.Tree$Fatal Error: Syntax error in source
    TopLevel.visit(Tree.java:349)
         at com.sun.tools.javac.v8.comp.Enter.classEnter(Enter.java:392)
         at com.sun.tools.javac.v8.comp.Enter.classEnter(Enter.java:410)
         at com.sun.tools.javac.v8.comp.Enter.main(Enter.java:540)
         at com.sun.tools.javac.v8.JavaCompiler.compile(JavaCompiler.java:357)
         at com.sun.tools.javac.v8.Main.compile(Main.java:247)
         at com.sun.tools.javac.Main.compile(Main.java:26)
         at java.lang.reflect.Method.invoke(Native Method)
         at com.evermind.compiler.Javac.invokeCompiler(Javac.java:125)
         at com.evermind.compiler.FileLinkedCompilation.run(FileLinkedCompilation.java:102)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.evermind.compiler.FileLinkedCompiler.compile(FileLinkedCompiler.java:20)
         at com.evermind.compiler.Javac.compile(Javac.java:42)
         at com.evermind.server.ejb.compilation.Compilation.compileClasses(Compilation.java:422)
         at com.evermind.server.ejb.compilation.Compilation.compile(Compilation.java:306)
         at com.evermind.server.administration.ServerApplicationInstallation.finish(ServerApplicationInstallation.java:526)
         at java.lang.reflect.Method.invoke(Native Method)
         at com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:119)
         at com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:48)
         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
         at java.lang.Thread.run(Unknown Source)
    com.evermind.compiler.CompilationException: Syntax error in source
         at com.evermind.compiler.FileLinkedCompilation.run(FileLinkedCompilation.java:118)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.evermind.compiler.FileLinkedCompiler.compile(FileLinkedCompiler.java:20)
         at com.evermind.compiler.Javac.compile(Javac.java:42)
         at com.evermind.server.ejb.compilation.Compilation.compileClasses(Compilation.java:422)
         at com.evermind.server.ejb.compilation.Compilation.compile(Compilation.java:306)
         at com.evermind.server.administration.ServerApplicationInstallation.finish(ServerApplicationInstallation.java:526)
         at java.lang.reflect.Method.invoke(Native Method)
         at com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:119)
         at com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:48)
         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
         at java.lang.Thread.run(Unknown Source)
    Exit status of OC4J admin tool (-deploy): 0
    Elapsed time for deployment: 49 seconds
    ---- Deployment finished. ---- Jul 16, 2003 4:36:59 PM
    i am enclosing my code for your feference.
    import javax.ejb.EntityBean;
    import javax.ejb.EntityContext;
    import javax.ejb.CreateException;
    public abstract class CustBean implements EntityBean
    private EntityContext context;
    public Integer id;
    public Integer ejbCreate(Integer id) throws CreateException
    return null;
    public void ejbPostCreate(Integer id)
    public void ejbActivate()
    public void ejbLoad()
    public void ejbPassivate()
    public void ejbRemove()
    public void ejbStore()
    public void setEntityContext(EntityContext ctx)
    this.context = ctx;
    public void unsetEntityContext()
    this.context = null;
    public abstract Integer getId();
    public abstract void setId(Integer newId);
    package customer;
    import javax.ejb.EJBHome;
    import java.rmi.RemoteException;
    import javax.ejb.CreateException;
    import javax.ejb.FinderException;
    import java.util.Collection;
    public interface CustHome extends EJBHome
    Cust create(Integer id) throws RemoteException, CreateException;
    Cust findByPrimaryKey(Integer primaryKey) throws RemoteException, FinderException;
    Collection findAll() throws RemoteException, FinderException;
    package customer;
    import javax.ejb.EJBObject;
    import java.rmi.RemoteException;
    public interface Cust extends EJBObject
    Integer getId() throws RemoteException;
    void setId(Integer newId) throws RemoteException;
    orion-ejb-jar.xml
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <!DOCTYPE orion-ejb-jar PUBLIC "-//Evermind//DTD Enterprise JavaBeans 1.1 runtime//EN" "http://xmlns.oracle.com/ias/dtds/orion-ejb-jar.dtd">
    <orion-ejb-jar>
    <enterprise-beans>
    <entity-deployment max-instances="-1" name="Cust" copy-by-value="false" data-source="jdbc/ConDS" exclusive-write-access="false" table="CUST">
    <primkey-mapping>
    <cmp-field-mapping name="id" persistence-name="ID" persistence-type="NUMBER(3)"/>
    </primkey-mapping>
    <cmp-field-mapping name="id" persistence-name="ID" persistence-type="NUMBER(3)"/>
    </entity-deployment>
    </enterprise-beans>
    <assembly-descriptor>
    <default-method-access>
    <security-role-mapping impliesAll="true" name="&lt;default-ejb-caller-role>"/>
    </default-method-access>
    </assembly-descriptor>
    </orion-ejb-jar>

    Oc4J is not yet certified with JDK 1.4. However you can use the work suggested by me in a thread in this forum. Please take a look at http://forums.oracle.com/forums/message.jsp?id=767439
    regards
    Debu Panda
    Oracle

Maybe you are looking for

  • [SOLVED]Xorg crash with some applications when using double screen

    Hi, I have a TV that I often use to watch dvd from my computer, and to do that I've set it up as a second screen in my xorg.conf, but on a daily basis I use a xorg.conf file with only my main screen. Up until last week I was able to use my second scr

  • Queries related to databasr 11g .

    We are upgrading our database to 11g . There some programs that have queries using the below hints. all_rows first_rows choose rule full rowid index parallel Please let us know which hints 11g query optmizer will consider.Which of them will not be co

  • ILife '11 turns iPhoto into useless junk

    So $50 well spent!!!!! iPhoto started and just shows a spinning icon. When you click on anything in the menu it fails with the error below. This was before and after the software update for iPhoto. Joy!!! Process: iPhoto [212] Path: /Applications/iPh

  • Problem installing CS2

    I have a purchased version of CS2. I have followed the instructions to download the product again and used the license key given so that activation is not need. I have extracted the files to the appropriate hard drive folders. BUT the installation pr

  • Not in GZip Format Exception

    Hi All, When decompressing zipped data using GZIPInput stream, i get this exception "Not in GZip Format Exception". I am not quite sure what to do on this. I have been through forums and all but din get any answer for this. So any help on this is hig