I am not able to compile my java file

i am getting error of package not found. i have added all the .java & .class files in the package folder. can any one tell me how to compile that file

What is the error you are getting?

Similar Messages

  • Not able to compile an xml file using jasper reports through jsp page

    hi,
    i have compiled an xml file and got html,pdf etc using jasperreports but that was from an java application and now i want to convert this application to an jsp page so i have copied these jar files "commons-beanutils-1.5.jar","commons-collections-2.1.jar","commons-digester-1.3.jar","itext-1.01.jar","jasperreports-0.5.2.jar" to the folder "C:\Program Files\Apache Tomcat 4.0\webapps\examples\WEB-INF\lib" and have set classpath to these jar files.
    my application(java class invoked by a servlet) is in C:\Program Files\Apache Tomcat 4.0\webapps\examples\WEB-INF\classes.
    i m using this API "JasperCompileManager.compileReportToFile(fileName);"
    but i m getting following error:
    type Exception report
    message Internal Server Error
    description The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: Invoker service() exception
         at org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:504)
         at org.apache.catalina.servlets.InvokerServlet.doGet(InvokerServlet.java:180)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at filters.ExampleFilter.doFilter(ExampleFilter.java:149)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at filters.ExampleFilter.doFilter(ExampleFilter.java:149)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:201)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2312)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:163)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1011)
         at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1106)
         at java.lang.Thread.run(Thread.java:536)
    root cause
    java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
         at org.apache.commons.digester.Digester.(Digester.java:345)
         at dori.jasper.engine.xml.JRXmlDigester.(JRXmlDigester.java:115)
         at dori.jasper.engine.xml.JRXmlLoader.prepareDigester(JRXmlLoader.java:446)
         at dori.jasper.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:384)
         at dori.jasper.engine.xml.JRXmlLoader.load(JRXmlLoader.java:371)
         at dori.jasper.engine.xml.JRXmlLoader.load(JRXmlLoader.java:339)
         at dori.jasper.engine.xml.JRXmlLoader.load(JRXmlLoader.java:323)
         at dori.jasper.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:102)
         at jasper_interact.file_exporter(jasper_interact.java:44)
         at reportcontroller.doGet(reportcontroller.java:59)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:446)
         at org.apache.catalina.servlets.InvokerServlet.doGet(InvokerServlet.java:180)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at filters.ExampleFilter.doFilter(ExampleFilter.java:149)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at filters.ExampleFilter.doFilter(ExampleFilter.java:149)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:201)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2312)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:163)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1011)
         at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1106)
         at java.lang.Thread.run(Thread.java:536)
    i have one folder "C:\Program Files\Apache Tomcat 4.0\org\apache\commons\logging" containing some LogFactory calsses but i dont know where to put this folder so that tomcat can find them.
    please help me..
    i know i may not be clear to u but plz give me some way out i m totally stucked.
    manish

    hi,
    thanx for your reply.
    ya i have "commons-logging-1.0.2.jar" file but when i tried to put it with other jar files and set the class path and run the application thru tomcat then it automatically stops the tomact.and when i removed this perticular logging jar file then tomcat works normally but gives the error which i mentioned before.
    i have also tried the second option u suggested, by putting the LogFactory class files in "C:\Program Files\Apache Tomcat 4.0\webapps\examples\WEB-INF\classes\org\apache\commons\logging" but that was not working.shud i set some classpath for them? or shud i have to import these packages........ but when i copied this folder "org" to C:\Program Files\Apache Tomcat 4.0\webapps\examples\WEB-INF\classes and in program wrote import org.* then copilation error occured "no such package found.
    what to do now.
    manish

  • I am able to compile a java file in eclipse inspite of compilation errors shown in eclipse and a .class file is generated

    Hi,
    I had a java file with compilation errors as shown in eclipse IDE.
    But the class file is still generated in the classes folder on building and pressing clean the project.
    I confirmed that the class file has an updated time stamp and also that a System.out.println() statement that i added was indeed printed out when this class was encountered during the running of a web application in which this class was called somewhere.
    (The java class has no subclasses and it is a single class with public modifier).
    How does it happen so?
    Regards,
    Karthik.

    As far as I know, the java code is compiled in Eclipse as soon as you save it. i.e. press CTRL+SHIFT+s
    as far as the build is concerned, in case you have a build file where you specify how to make a jar file, the location the jsr file is to be placed, only then you have to build the project. However again, as far as just simple compile is concerned as soon as you save the files are compiled. And show you the errors if any in the tasks window.

  • NOT able to compile servlet and EE java files

    hi
    i am not able to compile java files of servlet
    it is showing cannot resolve symbol for servlet classes
    since i have installed tomcat j2sdk1.4.2_06 and also facing problem with the classpath since i have to set the classpath everytime as i have already created it in environment variables
    show me the way out

    **MAJOR SPAMMING SCUM BAG ALERT**
    I was puzzled in that you asked a SQL Server question in one post and then in another thread asked a Oracle related question... and then I noticed you had cross posted one of your questions at JavaRanch and I was more annoyed....
    and then I found this....
    http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=10&t=002447
    You sir -> Michael Byrd -> are a scum sucking dirtbag.
    To quickly explain. Mr. Byrd posts his messages (which he copies wholesale from other posters) so that he can get better google caching for the website listed in his profile.
    This is such scummy behaviour I don't even know what to say. Other than basically everyone that has ever helped you had totally wasted their time.
    You are scum. Your company is scum. I hope you rot in hell.

  • Not Able  to Compile Java code

    Hi Java Gurus
    I am not able to compile this code Pl help
    class For {
    public static void main (String [] args) {
    int I = 0;
    show:
         if (I < 2) {
    System.out.print("I is " + I);
    I++;
    continue show;
    }

    class For {
    public static void main (String [] args) {
          for(int i = 0; i < 2; i++){
                  System.out.print("I is " + i);
    }this does the same as your program: the for loop is the best for this, but i agree with the others read some tutorials on loops in java. As posted before java has no concept of the GoTo syntax, loops or recursion are your only options

  • Java Mapping - Not able to compile .Java file

    Hi Experts,
    I am working with a sample scenario which involves Java Mapping. For this I created MappingClass.java file, After compiling the .Java file .Jar file would be used for Java Mapping by using Imported Archives.
    After compiling the MappingClass.java file, I am getting the errors as below.
    --> Java errors after compilation
    C:\j2sdk1.4.2_13\bin>javac MappingClass.java
    MappingClass.java:4: package com.sap.aii.mapping.api does not exist
    import com.sap.aii.mapping.api.AbstractTrace;
                                   ^
    MappingClass.java:5: package com.sap.aii.mapping.api does not exist
    import com.sap.aii.mapping.api.StreamTransformationConstants;
    --> End of java errors
    In the MappingClass.java file, I had given followed imports.
    import java.util.*;
    import com.sap.aii.mapping.api.AbstractTrace;
    import com.sap.aii.mapping.api.StreamTransformationConstants;
    Could some one please guide me to resolve this issue.
    Thanks in advance.
    ..Sree

    Hi
    I had copied " aii_map_api.jar " file in my Java Class path folder.. i.e " C:\j2sdk1.4.2_08\bin "     AND    " C:\j2sdk1.4.2_08\lib " folders too.. and even in C:\ i.e Root Drive also.
    After trying to Compile my java file (ex : MappingClass.java), still I am getting the errors.
    Errors shown as below.
    --> Errors
    C:\mytest>javac MappingClass.java
    MappingClass.java:2: package com.sap.aii.mapping.api does not exist
    import com.sap.aii.mapping.api.AbstractTrace;
                                   ^
    MappingClass.java:3: package com.sap.aii.mapping.api does not exist
    import com.sap.aii.mapping.api.StreamTransformationConstants;
                                   ^
    MappingClass.java:6: cannot resolve symbol
    symbol  : class AbstractTrace
    location: class MappingClass
        private static AbstractTrace trace = null;
                       ^
    MappingClass.java:12: cannot resolve symbol
    symbol  : class AbstractTrace
    location: class MappingClass
            trace = (AbstractTrace)inputparam.get(
                     ^
    MappingClass.java:13: cannot resolve symbol
    symbol  : variable StreamTransformationConstants
    location: class MappingClass
                       StreamTransformationConstants.MAPPING_TRACE );
                       ^
    5 errors
    --> End of Errors
    Could some one please guide me to resolve this issue.
    Thanks in advance.
    ..Sree

  • I am not able to run the java Program

    Hi All,
    I am not able to run a java program... I am able to complie the program sucessfully when i am trying to run it i am getting a error:
    Exception  in thread "main" java.lang.NoClassFoundError : filename
    i have complie and run my programs frequently but now i am not able run my prevoius examples also ...
    Can u any body help me out...... I have also update the latest version of JRE but still my problem is not sloved.
    Thanks & Regards,
    Ravi

    Make sure you take package structure into account.
    If you have say
    package testing.things;
    public class Test
        public static void main(String[] args)
            System.out.println("World Hello");
    }in file Test.java, you compile it with (assuming your current working directory is at the folder in which the source file is located).
    javac -d . Test.javaand run it with
    java testing.things.TestThe -d . option creates the output at the current directory (with a folder structure matching your package structure).
    #

  • I am not able to compile a program  on my mac...

    I am not able to compile a program  on my mac; i am getting the following message :"Class names, 'ClassName.Java', are only accepted if annotation processing is explicitly requested".  I am new to programming, and I am using a MAC. Any suggestions?  I am typing: "Javac ClassName.Java" at the command prompt.

    You might want to be posting to the developer forum here:
    https://discussions.apple.com/community/developer_forums

  • Not able to compile servlet

    Hello
    I would like some one to help me.
    I have WindowsXp professional on my Laptop. I downloaded jdk and I am able to compile and run the core java files.
    I downloaded j2sdk1.4.2_10 from the website www.java.sun.com. and then set the path in the environment variables. But in the command promt I was not able to compile the servlet.
    Could you please guide me about what more has to be done so that The servlet can compile.
    Thanking you

    **MAJOR SPAMMING SCUM BAG ALERT**
    I was puzzled in that you asked a SQL Server question in one post and then in another thread asked a Oracle related question... and then I noticed you had cross posted one of your questions at JavaRanch and I was more annoyed....
    and then I found this....
    http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=10&t=002447
    You sir -> Michael Byrd -> are a scum sucking dirtbag.
    To quickly explain. Mr. Byrd posts his messages (which he copies wholesale from other posters) so that he can get better google caching for the website listed in his profile.
    This is such scummy behaviour I don't even know what to say. Other than basically everyone that has ever helped you had totally wasted their time.
    You are scum. Your company is scum. I hope you rot in hell.

  • Not Able to compile Servlet from ?

    Hi All,
    I am not able to compile Servlet from my package:
    1) I Have set the CLASSPATH Variable using below line in System Variables:
    C:\CC4\prog\jakarta-tomcat-4.1.30\common\lib\servlet.jar
    2) Also Set the CATALINA_HOME with value
    C:\CC4\prog\jakarta-tomcat-4.1.30
    as per above setting servlet should be compiled but still i m getting error message:
    1) C:\CC4\prog\jakarta-tomcat-4.1.30\project\classes\com\example>javac ListenerTest
    er.java
    ListenerTester.java:17: cannot resolve symbol
    symbol : class Dog
    location: class com.example.ListenerTester
    Dog dog = (Dog) getServletContext().getAttribute("dog");
    ^
    ListenerTester.java:17: cannot resolve symbol
    symbol : class Dog
    location: class com.example.ListenerTester
    Dog dog = (Dog) getServletContext().getAttribute("dog");
    ^
    2 errors
    2) Error while compiling other file:
    C:\CC4\prog\jakarta-tomcat-4.1.30\project\classes\com\example>javac MyServletCon
    textListener.java
    MyServletContextListener.java:12: cannot resolve symbol
    symbol : class Dog
    location: class com.example.MyServletContextListener
    Dog d = new Dog(dogBreed);
    ^
    MyServletContextListener.java:12: cannot resolve symbol
    symbol : class Dog
    location: class com.example.MyServletContextListener
    Dog d = new Dog(dogBreed);
    ^
    2 errors
    So what could be the posible solution here :
    do reply !!!
    please
    Thanks
    prabhat

    I have added servlet.jar in the classpath. But the program is not compiling.The error message says that it can not find classes like ServletConfig, ServletException, Cookie etc. Please help.

  • Not able to compile wrapped package bodies.

    Hi All
    Can anybody pls help me finding me the reason why I m not able to compile .plb (wrapped package body). There are no compilation errors. But when I run the .plb file (as @xyz.plb), sqlplus window hangs. No error shown. Everytime I had to close the window after waiting for 8-10 minutes.
    This is happening only with 11 files out of 200.Rest were compiled.
    Any ideas? Do we have any other way to wrap than using pl/sql wrap utility or pl/sql plug-in for wrapping(which is actually the same as former)??
    ThanksInAdvance!!
    Keep striking the iron until it's hot!

    yes, I did check for locks from pl/sql developer only. No Locks.
    I waited for 10 minutes for a 6 kb .plb file to get compiled. But had to close the session after that.
    I am using oracle 10g, pl/sql developer 7.1.0.1337
    sql*plus Release 10.2.0.2.0

  • How to compile a java file which is in memory?

    how to compile a java file which is in memory?
    such as:
    String s="class MyClass {....}";
    how to compile the string?
    thx

    come on ...That was a perfectly valid solution.
    Do you know how to call the sun.* compiler? If not then search the forums for it. If that interface still exists (which it might not in newer versions) you then will create a string stream from your class and pass it to that.

  • Urgent! Pls help me! Can't compile any *.java files

    I am a new user to Java2SDK. I am using Win2K sever and I have installed Java2SDK1.4.0 in D drive. When I compile any *.java files, a message " 'javac' is not recognized as an internal or external command, operable program or batch file" appears. How can I solve this problem?
    Please help me. I am busy with my homework. Thank you very much.

    In your PATH variable include %JAVA_HOME%\bin;
    For example:
    C:\jdk1.4\bin;

  • Not able to execute startEclipse.bat file in Eclipse (Oracle utilities SDK)

    In Eclipse installation, i am not able to run "startEclipse.bat" file in this path "C:\SPLSDK\SDK\shortcuts" which comes under Oracle Utilities Software Development Kit 4.0.0.
    once i start installing startEclipse.bat, i get a error message "windows cannot find /eclipse.exe, make sure you typed correctly and try again"
    and how do i find the eclipse.exe on the installables? also in error message it shows backslash "/"eclipse.exe while executing "startEclipse.bat" file.
    jdk and hibernate paths are located in "c:\spl". Is that fine?
    And When I click “eclipse” in this path “C:\SPLSDK\SDK4.0.0.4\eclipse\eclipse-jee-galileo-SR2-win32\eclipse”, I get error "java runtime or jdk should be available in order to run eclipse. and no JVM was found after searching for the folder "C:\SPLSDK\SDK\4.0.0.4\_jvm\bin\javaw.exe" ". I have installed Jdk in “C:\spl\jdk1.6.0_18”. And to install Eclipse, should I change the path of installing jdk to support Eclipse installation?
    what could be the reason?
    Please give me suggession that how to install eclipse?
    Regards
    Vijaya

    Please help. Its urgent.

  • While Compiling AMImple.java file

    Hi All,
    I am very new to OAF and am developed page and imported successfully into the server.
    While compiling AMImple.java file it is giving the like
    AgingAMImpl.java:30: cannot resolve symbol
    symbol : class AgingVOImpl
    location: class wnsgs.oracle.apps.ap.buckets.server.AgingAMImpl
    public AgingVOImpl getAgingVO1()
    ^
    AgingAMImpl.java:32: cannot resolve symbol
    symbol : class AgingVOImpl
    location: class wnsgs.oracle.apps.ap.buckets.server.AgingAMImpl
    return (AgingVOImpl)findViewObject("AgingVO1");
    Plz help me on this issue am very close to my target.
    Thanks
    Surya

    hi gyan,
    I have.t implemented the code in the AM but I implemented the code in CO.
    I am pasting the AMImple code below
    public class AgingAMImpl extends OAApplicationModuleImpl
    * This is the default constructor (do not remove)
    public AgingAMImpl()
    // OAViewObject objAssessmentVO = (OAViewObject)AgingAM.findViewObject("AgingVO1");
    * Sample main for debugging Business Components code using the tester.
    public static void main(String[] args)
    launchTester("wnsgs.oracle.apps.ap.buckets.server", "AgingAMLocal");
    * Container's getter for AgingVO1
    public OAViewObjectImpl getAgingVO1()
    return (OAViewObjectImpl)findViewObject("AgingVO1");
    Thanks
    Surya

Maybe you are looking for