How to know while a class doesnt compile

Hi, I'm loading some classes in to oracle but for some reason some of them wont compile and I dont know why, when I run 'ALTER JAVA CLASS SIMAC."com/ibm/mq/MQSESSIONClient$3" COMPILE' I just get this message: 'Warning: compiled but with compilation errors' but it doesnt give me the compilation error, is there a way to get the reason why it is not being compiled? thanks.

Hi:
AFAIK you can compile and see errors on java source, not classes.
SQL> alter java source schem."cc/xx/Zz" compile;
SQL> show err
Classes can be resolved, it means look for dependencies on classes and methods to see if they are valid against his signature.
Best regards, Marcelo.

Similar Messages

  • How I know what methpd, class and pkg called a obj.methd

    Hi there,
    Using the following code, I can know the name, class, and package of a method in runtime:
    Class cls = this.getClass();
    Package pkg = cls.getPackage();
    String name = pkg.getName();
    log.info(name);
    Is there a way to know the name of the method (name, class, and package) , external or internal, that is calling a object, like:
    log.info("Your method is: " + name);
    log.info("Your method is called by" + external_name);
    Thanks,
    Lorenzo Jim�nez

    One way is to place identifiers in the passed parameters.
    But an object that depends on knowing who is calling it is a crippled object, imo.

  • How to know the message class and message number

    When the web client show warnning message,
    How can i to find the message class and message number?
    Thnaks
    Kevin

    Hi,
    You can goto tcode SAAB and activate the log for Checkpoint group BSP_WD_EXCEPTION_DISPLAY. whenever you log into Web UI you can see the details of the message.
    To troubleshoot teh message goto SE91 and enter the message class and message number. Select the message and then click on whereused. You will see all programs where this message is used.
    Hope this helps.
    Regards,
    Chandrakant

  • How to determine if class was compiled with debugging information?

    How may I determine if class was compiled with debugging information? Aside from actually executing the class in a debugger.

    As known, when compiling "javac -g ..." the class
    files contain debugging information.
    my Naive question is WHAT is this information?
    could you please add any links to articles about this
    debugging information?http://java.sun.com/docs/books/vmspec/2nd-edition/html/ClassFile.doc.html#22856
    http://java.sun.com/docs/books/vmspec/2nd-edition/html/ClassFile.doc.html#5956

  • How to know the class method behind an enterprise service

    Hi,
    SAP has provided enterprise services for Room booking in Real Estate module. They are even shipping the complete application for a nominal price. But the standard version is not suitable for our client requirement so they want to develop this application inhouse.
    Now my question is:  I know the enterprise services used in this application. How to know the implementing methods behind these enterprise services ?
    If possible suggest which approach will be a better option for the inhouse development.
    1. Webdynpro ABAP and use directly methods behind the enterprise services.
    2. Webdynpro ABAP and create client proxy class for the enterprise services.
    3. Webdynpro JAVA and use the enterprise services.
    4. Using visual composer modelling the application.
    Please suggest the best alternative.
    Best Regards,
    Aleem Mohiuddin.

    Hi
    They are even shipping the complete application for a nominal price. But the standard version is not suitable for our client requirement so they want to develop this application inhouse.
    I assume you are talking about xApps.
    How to know the implementing methods behind these enterprise services ?
    In sproxy transaction you can search service and then you can see class and method implemented behind that particular service.
    1. Webdynpro ABAP and use directly methods behind the enterprise services.
    In my opinion not recommended to bypass ES and use method behind it.
    2. Webdynpro ABAP and create client proxy class for the enterprise services.
    Not sure why you want to create proxy of ES.
    3. Webdynpro JAVA and use the enterprise services.
    4. Using visual composer modelling the application.
    You can use either Webdynpro (ABAP or Java) or VC to model your application which consume ES in backend. Both options are good, you can chose Java or ABAP flavor of dynpro based on skill available in team. VC is very effective in rapid modelling and can be used in protyping or in development of complete application.
    Regards,
    Gourav

  • How to know whether the javascript is disabled or not while loading the jsp

    Hi,
    My query is like how to know whether the javascript is disabled or not while loading the Application main JSP in Mozilla browser.
    I want some Java code or JavaScript code.

    To the point, just let JS fire a specific HTTP request inside the same session.
    This can be done in several ways. 1) Create a hidden <img> element and set the `src` attribute so that it will request a (fake) image from the server. The server just have to intercept on this specific request. 2) Fire an ajaxical request and let the server intercept on it. You can use a Filter for this which sets a token in the session scope to inform that the client has JS enabled.

  • How to tell what java version classes where compiled?

    Is it possible to get the version of the Java SDK the classes were compiled with from within a Java application? I think about something like:
    System.out.println("Application classes compiled/compatible with "+getClassCompilationVersion());

    For the minimum check, the point is that i get the following exception when i try to run a application that was compiled with/for 1.4 is tried to be started with a 1.3 JRE:
    Exception in thread "main" java.lang.UnsupportedClassVersionError: de/icomps/pro
    totypes/Test (Unsupported major.minor version 48.0)
            at java.lang.ClassLoader.defineClass0(Native Method)
            at java.lang.ClassLoader.defineClass(ClassLoader.java:488)
            at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:10
    6)
            at java.net.URLClassLoader.defineClass(URLClassLoader.java:243)
            at java.net.URLClassLoader.access$100(URLClassLoader.java:51)
            at java.net.URLClassLoader$1.run(URLClassLoader.java:190)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(URLClassLoader.java:183)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:294)
            at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:281)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:250)
            at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:310)I hoped to somehow catch this and print a clean error message. But it seems, that the new classes can't be used ... even though the main() method doesn't use any 1.4 specific API. The JVM rejects the classes just because of the newer class file format versions.

  • Error while defining class: com.crystaldecisions.data.xml.CRDB_XMLImpl This error indicates that the class: OCA.OCAdbdll.DbDLLOperations could not be located while defining the class: com.crystaldecisions.data.xml.CR...

    Post Author: lkamesam
    CA Forum: Integrated Solutions
    Hi,
            I am running Crystal Reports version 10 from IBM Rational 6.0.1  build 20050725_1800 XML data source. When I try to run the report under WAS 6.0.1 I get the following error:
    Does any body have any clue how to resolve my problem? Thanks
    Error 500: Error while defining class: com.crystaldecisions.data.xml.CRDB_XMLImpl This error indicates that the class: OCA.OCAdbdll.DbDLLOperations could not be located while defining the class: com.crystaldecisions.data.xml.CRDB_XMLImpl This is often caused by having the class at a higher point in the classloader hierarchy Dumping the current context classloader hierarchy: ==> indicates defining classloader *** indicates classloader where the missing class could have been found ==>&#91;0&#93; com.ibm.ws.classloader.CompoundClassLoader@163dd786 Local ClassPath: C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\classes;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\bobj_platform_jsf.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\cecore.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\celib.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\ceplugins.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\cereports.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\cesession.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\clientlogic.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\Concurrent.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\CorbaIDL.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\CRDBXMLExternal.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\CRDBXMLServer.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\CrystalCharting.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\CrystalCommon.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\CrystalContentModels.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\CrystalExporters.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\CrystalExportingBase.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\CrystalFormulas.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\CrystalQueryEngine.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\CrystalReportEngine.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\CrystalReportingCommon.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\ebus405.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\icu4j.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\jrcerom.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\jsf_common.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\keycodeDecoder.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\log4j.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\MetafileRenderer.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\rasapp.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\rascore.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\rpoifs.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\serialization.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\URIUtil.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\webreporting-jsf.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\webreporting.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\xercesImpl.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent\WEB-INF\lib\xmlParserAPIs.jar;C:\Documents and Settings\Administrator\IBM\rationalsdp6.0\workspace\sample1\WebContent; Delegation Mode: PARENT_FIRST &#91;1&#93; com.ibm.ws.classloader.JarClassLoader@338761606 Local Classpath: Delegation mode: PARENT_FIRST &#91;2&#93; com.ibm.ws.classloader.ProtectionClassLoader@38e75786 &#91;3&#93; com.ibm.ws.bootstrap.ExtClassLoader@7e475784 &#91;4&#93; sun.misc.Launcher$AppClassLoader@7e5a5784 &#91;5&#93; sun.misc.Launcher$ExtClassLoader@7e565784 -Original exception- java.lang.NoClassDefFoundError: OCA/OCAdbdll/DbDLLOperations at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java(Compiled Code)) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java(Compiled Code)) at com.ibm.ws.classloader.CompoundClassLoader._defineClass(CompoundClassLoader.java:576) at com.ibm.ws.classloader.CompoundClassLoader.findClass(CompoundClassLoader.java(Compiled Code)) at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java(Compiled Code)) at java.lang.ClassLoader.loadClass(ClassLoader.java(Compiled Code)) at com.crystaldecisions.reports.queryengine.driver.i.<init>(Unknown Source) at com.crystaldecisions.reports.queryengine.driver.i.case(Unknown Source) at com.crystaldecisions.reports.queryengine.av.ak(Unknown Source) at com.crystaldecisions.reports.queryengine.av.else(Unknown Source) at com.crystaldecisions.reports.queryengine.av.byte(Unknown Source) at com.crystaldecisions.reports.queryengine.av.do(Unknown Source) at com.crystaldecisions.reports.queryengine.as.new(Unknown Source) at com.crystaldecisions.reports.queryengine.at.long(Unknown Source) at com.crystaldecisions.reports.reportdefinition.datainterface.j.a(Unknown Source) at com.crystaldecisions.reports.reportdefinition.datainterface.j.a(Unknown Source) at com.crystaldecisions.reports.reportdefinition.datainterface.j.a(Unknown Source) at com.crystaldecisions.reports.reportdefinition.cy.b(Unknown Source) at com.crystaldecisions.reports.reportdefinition.cy.long(Unknown Source) at com.crystaldecisions.reports.reportdefinition.a1.o(Unknown Source) at com.crystaldecisions.reports.reportdefinition.a1.a(Unknown Source) at com.crystaldecisions.reports.common.ab.a(Unknown Source) at com.crystaldecisions.reports.common.ab.if(Unknown Source) at com.crystaldecisions.reports.reportdefinition.a1.if(Unknown Source) at com.crystaldecisions.reports.reportdefinition.a1.o(Unknown Source) at com.crystaldecisions.reports.reportengineinterface.a.a(Unknown Source) at com.crystaldecisions.reports.reportengineinterface.JPEReportSource.a(Unknown Source) at com.crystaldecisions.reports.reportengineinterface.JPEReportSourceFactory.createReportSource(Unknown Source) at com.crystaldecisions.report.web.a.a.K(Unknown Source) at com.crystaldecisions.report.web.event.aa.a(Unknown Source) at com.crystaldecisions.report.web.event.aa.a(Unknown Source) at com.crystaldecisions.report.web.event.bx.a(Unknown Source) at com.crystaldecisions.report.web.event.b1.broadcast(Unknown Source) at com.crystaldecisions.report.web.event.as.a(Unknown Source) at com.crystaldecisions.report.web.WorkflowController.if(Unknown Source) at com.crystaldecisions.report.web.WorkflowController.doLifecycle(Unknown Source) at com.crystaldecisions.report.web.ServerControl.a(Unknown Source) at com.crystaldecisions.report.web.ServerControl.processHttpRequest(Unknown Source) at com.crystaldecisions.report.web.viewer.taglib.ServerControlTag.doEndTag(Unknown Source) at com.crystaldecisions.report.web.viewer.taglib.ReportServerControlTag.doEndTag(Unknown Source) at com.ibm._jsp._sample._jspx_meth_crviewer_viewer_0(_sample.java:135) at com.ibm._jsp._sample._jspService(_sample.java:77) at com.ibm.ws.jsp.runtime.HttpJspBase.service(HttpJspBase.java:88) at javax.servlet.http.HttpServlet.service(HttpServlet.java:856) at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1212) at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:629) at com.ibm.wsspi.webcontainer.servlet.GenericServletWrapper.handleRequest(GenericServletWrapper.java:117) at com.ibm.ws.jsp.webcontainerext.JSPExtensionServletWrapper.handleRequest(JSPExtensionServletWrapper.java:171) at com.ibm.ws.jsp.webcontainerext.JSPExtensionProcessor.handleRequest(JSPExtensionProcessor.java:230) at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:2837) at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:220) at com.ibm.ws.webcontainer.VirtualHost.handleRequest(VirtualHost.java:204) at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1681) at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:77) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:421) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:367) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:276) at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminaters(NewConnectionInitialReadCallback.java:201) at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:103) at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java:548) at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java:601) at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java:934) at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java:1021) at

    For those who would have the same problem, here is how I could eventually fix it.
    Since the Flex Test Drive is sometimes out of sync with flash builder 4, I recreated a project using other help pages on Adobe site :
    Entry point :
    http://help.adobe.com/en_US/Flex/4.0/AccessingData/WSbde04e3d3e6474c4-668f02f4120d422cf08- 7ffd.html
    As suggested, I used the New Project wizard to create a new project, with :
    Application server type : J2EE
    Check the radio button "Use remote object access service : BlazeDS"
    Then, as indicated in following pages (section "Accessing BlazeDS")... :
    file:///C:/Mes%20documents%20C/Commun/Developpement/Documentation/HT-Tracks/AccessingData/ help.adobe.com/en_US/Flex/4.0/AccessingData/WSbde04e3d3e6474c4-668f02f4120d422cf08-7ffe.ht ml#WSbde04e3d3e6474c4-19a3f0e0122be55e1b7-8000
    ...I selected the "Data / Connect to Data/Services..." menu option, which started the Data/service connection wizard.
    There, I selected a BlazeDS (and not Web Services) service type, and everything went fine.
    Suggestion to adobe staff : maybe it would be useful to update the Flex Test Drive to reflect Flash Builder 4 ?
    Very nice product anyway, so far, congratulations...
    Rgds
    Marc.

  • My class only compiles in Java 1.6 and not in Java 1.5

    Hi, my java class wont compile in java 1.5, it only compiles in Java 1.6. How can i compile the following?
    import java.util.*;
    public class ShoppingBasket
         Vector products;
         public ShoppingBasket() { products = new Vector(); }
         public void addProduct(Product product)
         boolean flag = false;
         for(Enumeration e = getProducts(); e.hasMoreElements();)
              { Product item = (Product)e.nextElement();
                   if(item.getId().equals(product.id))
                   {flag = true; item.quantity++; break; }
              if(!flag){ products.addElement(product);}
         public void deleteProduct(String str)
              for(Enumeration e=getProducts();
              e.hasMoreElements();)
              { Product item = (Product)e.nextElement();
                   if(item.getId().equals(str))
                   {products.removeElement(item); break; }
         public void emptyBasket(){products = new Vector();}
         public int getProductNumber(){ return products.size();}
         public Enumeration getProducts() { return products.elements(); }
         public double getTotal()
         Enumeration e = getProducts();
         double total; Product item;
         for(total=0.0D;e.hasMoreElements();     total+= item.getTotal())
         {item = (Product)e.nextElement(); }
         return total;
    }It should link with a class called Product which compiles fine... the errors i get are below:
    K:\jakarta-tomcat-5.0.18\webapps\ROOT\WEB-INF\classes\ShoppingBasket\ShoppingBas
    ket.java:6: cannot find symbol
    symbol  : class Product
    location: class ShoppingBasket
            public void addProduct(Product product)
                                   ^
    K:\jakarta-tomcat-5.0.18\webapps\ROOT\WEB-INF\classes\ShoppingBasket\ShoppingBas
    ket.java:10: cannot find symbol
    symbol  : class Product
    location: class ShoppingBasket
                    { Product item = (Product)e.nextElement();
                      ^
    K:\jakarta-tomcat-5.0.18\webapps\ROOT\WEB-INF\classes\ShoppingBasket\ShoppingBas
    ket.java:10: cannot find symbol
    symbol  : class Product
    location: class ShoppingBasket
                    { Product item = (Product)e.nextElement();
                                      ^
    K:\jakarta-tomcat-5.0.18\webapps\ROOT\WEB-INF\classes\ShoppingBasket\ShoppingBas
    ket.java:20: cannot find symbol
    symbol  : class Product
    location: class ShoppingBasket
                    { Product item = (Product)e.nextElement();
                      ^
    K:\jakarta-tomcat-5.0.18\webapps\ROOT\WEB-INF\classes\ShoppingBasket\ShoppingBas
    ket.java:20: cannot find symbol
    symbol  : class Product
    location: class ShoppingBasket
                    { Product item = (Product)e.nextElement();
                                      ^
    K:\jakarta-tomcat-5.0.18\webapps\ROOT\WEB-INF\classes\ShoppingBasket\ShoppingBas
    ket.java:35: cannot find symbol
    symbol  : class Product
    location: class ShoppingBasket
            double total; Product item;
                          ^
    K:\jakarta-tomcat-5.0.18\webapps\ROOT\WEB-INF\classes\ShoppingBasket\ShoppingBas
    ket.java:36: inconvertible types
    found   : <nulltype>
    required: double
            for(total=0.0D;e.hasMoreElements();     total+= item.getTotal())
                                                                         ^
    K:\jakarta-tomcat-5.0.18\webapps\ROOT\WEB-INF\classes\ShoppingBasket\ShoppingBas
    ket.java:37: cannot find symbol
    symbol  : class Product
    location: class ShoppingBasket
            {item = (Product)e.nextElement(); }
                     ^
    8 errors

    fahafiz wrote:
    ah, so should i put the classes into the folder which the classpath is assigned to?More likely you should assign your classpath to whatever folder your classes are in.
    Put your files where they make sense, and then fill in classpath accordingly:
    javac -classpath classpath MyFile.java(I think, it's been a while since I compiled from the command-line, see http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/javac.html)

  • How to know a line of text file is ending with line feed or return?

    hi all, i have a program that read log file that generated by other service (apache http server for example), i want to know that each line is ending with "\r", "\n" or "\r\n" so i can skip them in the next time, like this:
    int char_counter=0;
    BufferedReader reader = new BufferedReader(new FileReader(logFileName));
    while((line=reader.readLine())!=null){
           char_counter+=line.length()+x_value;
    }and the next time read the log file, i will skip all the lines that read in previous time.
    BufferedReader reader = new BufferedReader(new FileReader(logFileName));
    reader.skip(char_counter);
    while((line=reader.readLine())!=null){
           char_counter+=line.length()+x_value;
    }with x_value is 1 or 2 depended on line end with "\n" or "\r\n".
    so, how to know which is the char line ending with?
    Edited by: secmask on Feb 21, 2009 5:46 AM

    Alright, the BufferedReader method readLine() reads all text until it finds a \n character. And then next time you call it it will automatically continue from where it left out.
    try this out it should show it as an example
    import java.io.*;
    public class readLineTest {
        static FileOutputStream filename;
        static BufferedReader input;
        public static void main(String[] args)
            try
                filename = new FileOutputStream("logFile.txt", false);
            catch (IOException e)
                //blank
            PrintStream output = new PrintStream(filename);
            output.println("this is the first line");
            output.println("this is the second line");
            output.println("this is the third line");
            try
                input = new BufferedReader(new FileReader("logFile.txt"));
            catch(IOException e)
                //blank
            for(int i = 0; i < 3; i++)
                try
                    System.out.println(input.readLine());
                catch(IOException e)
                    //blank
    }

  • How to know the type of a variable??

    how to know the type of a variable??
    For example, give you a variable s, how to determine if it is
    a primitive type, of an object?? If this is primitive type,
    any ways to determine if it is integer, boolean, double, ...??

    I am currently working on a project where this happens. I have a main type of object that all of my other types extend. While working on the objects in a method, any type of other object could be coming through. To test I try to cast the object and catch class cast exceptions. This only works because I know the different type that will be coming through....
    public void testObject(classX object){
      try{
        classY object = (classY)object;
      }catch(ClassCastException CC){
        try{
          classZ object = (classZ)object;
        }catch(ClassCastException CCC){
          /// the object fails to be cast as the types I tested for.
    }

  • How to know current speed of connection in Kbps?

    Does anyone know how to know the speed of network/internet connection? I couldn't find any member method of JAVA's class that returns this value. Very appreciate for all your hints.

    Try something like this:public class Test
      public static void main(String[] argv)
        try
          URL url = new URL("http://java.sun.com"); /* put a pointer to some big image here */
          InputStream is = url.openConnection().getInputStream();
          int bytes = 0;
          long ms = System.currentTimeMillis();
          while(is.read() != -1) bytes++;
          ms = System.currentTimeMillis() - ms;
          double kbps = ((double)bytes / ((double)ms / 1000)) / 1024;
          System.out.println("kbps = " + (long)kbps);
          System.exit(0);
        catch(Throwable t)
          t.printStackTrace();
          System.exit(-1);
    }I suggest you repeat this test for several pointers and take the average...

  • How to link an existing class in my Java project ?

    Hy,
    I am using 2 classes of a package that contain a lot of classes. I only use 2 of them, and I would like to know how to do to make those 2 classes available in my jar file (my project compiled in a jar file).
    I am now using the following line :
    import com.stevesoft.pat.*;
    but it doesn't work when I launch the applet with my browser (the applet stops when it reaches the 1st line that needs 1 of the 2 external classes).
    (the applet works correctly when launched with Eclipse, because I added the package stevesoft in my working directory). But when i create my jar file, I would like to know how to put the 2 classes in it, and how to refer to it.
    Thanks a lot ;-)

    This has nothing to do with Native Methods; it is also a duplicate of this post:
    http://forum.java.sun.com/thread.jspa?threadID=706814&messageID=4095214#4095214
    Please post correctly and don't duplicate.

  • How to close NetStream in class script

    How to close NetStream in class script
    I use NetStream action to play the video. It’s working perfectly. Want to know how I can close my NetStream video to clicking on the button as in class scrip. I tray this
    ns.close();
    but got error
    NetStream class action
    package {
        import flash.display.SimpleButton;
        import flash.events.MouseEvent;
        import flash.media.Video;
        import flash.net.NetConnection;
        import flash.net.NetStream;
        import flash.media.SoundTransform;
        import flash.display.MovieClip;
        public class clickbutton extends SimpleButton {
              var ns:NetStream;
              var previousVolume:Number = 1;
              public function clickbutton() {
                    this.addEventListener(MouseEvent.CLICK, clickF);
              private function clickF(e:MouseEvent):void{
                   MovieClip(this.root).gotoAndStop(2, "Scene 1");
                   var nc:NetConnection=new NetConnection();
                   nc.connect(null);
                   ns=new NetStream(nc);
                   var video:Video=new Video(320, 200);
                   video.x=(stage.stageWidth-320)/2;
                   video.y=(stage.stageHeight-200)/2;
                   ns.client=this;
                   this.parent.addChild(video);
                   video.attachNetStream(ns);
                   ns.play("video_test.flv");
                   controlsF();
                   this.removeEventListener(MouseEvent.CLICK, clickF);
                   this.parent.removeChild(this);
          private function controlsF():void{
              MovieClip(root).play_btn.addEventListener(MouseEvent.CLICK,playF);
              MovieClip(root).pause_btn.addEventListener(MouseEvent.CLICK,pauseF);
              MovieClip(root).muteToggle_btn.addEventListener(MouseEvent.CLICK,muteF);
              // add volume listener here.  you'll need to decide how you want to control volume.
                                                    function playF(e:MouseEvent):void{
                                                                    ns.resume();
                                                    function pauseF(e:MouseEvent):void{
                                                                    ns.pause();
                                                    function muteF(e:MouseEvent):void{
                                                                    if(ns.soundTransform.volume>0){
                                                                    var st:SoundTransform=ns.soundTransform;
                                                                    previousVolume=st.volume;
                                                                    st.volume=0;
                                                                    ns.soundTransform=st;
                                                    } else {
                                                                    st=ns.soundTransform;
                                                                    st.volume=previousVolume;
                                                                    ns.soundTransform=st;
                                    public function onMetaData(eobj:Object): void {
                                                    // this needs to be in the scope of your loader
                                    public function onPlayStatus(eObj: Object): void {
                                    public function onXMPData(eobj:Object):void{

    I make to keyfram in my time line.
    In 1st keyfram on the video button I use this code
    package {
         import flash.display.SimpleButton;
         import flash.events.MouseEvent;
         import flash.media.Video;
         import flash.net.NetConnection;
         import flash.net.NetStream;
         import flash.media.SoundTransform;
         import flash.display.MovieClip;
              public class palyvideo extends SimpleButton {
                   var ns:NetStream;
                   var previousVolume:Number = 1;
                        public function palyvideo() {
                             this.addEventListener(MouseEvent.CLICK, clickF);
                        private function clickF(e:MouseEvent):void{
                             MovieClip(this.root).gotoAndStop(2, "Scene 1");
                             var nc:NetConnection=new NetConnection();
                             nc.connect(null);
                             ns=new NetStream(nc);
                             var video:Video=new Video(320, 200);
                             video.x=(stage.stageWidth-320)/2;
                             video.y=(stage.stageHeight-200)/2;
                             ns.client=this;
                             this.parent.addChild(video);
                             video.attachNetStream(ns);
                             ns.play("video_test.flv");
                             controlsF();
                             this.removeEventListener(MouseEvent.CLICK, clickF);
                             this.parent.removeChild(this);
                   private function controlsF():void{
                        MovieClip(root).play_btn.addEventListener(MouseEvent.CLICK,playF);
                        MovieClip(root).pause_btn.addEventListener(MouseEvent.CLICK,pauseF);
                        MovieClip(root).muteToggle_btn.addEventListener(MouseEvent.CLICK,muteF);
                        // add volume listener here.  you'll need to decide how you want to control volume.
                   function playF(e:MouseEvent):void{
                        ns.resume();
                   function pauseF(e:MouseEvent):void{
                        ns.pause();
                   function muteF(e:MouseEvent):void{
                        if(ns.soundTransform.volume>0){
                        var st:SoundTransform=ns.soundTransform;
                        previousVolume=st.volume;
                        st.volume=0;
                        ns.soundTransform=st;
                   } else {
                        st=ns.soundTransform;
                        st.volume=previousVolume;
                        ns.soundTransform=st;
              public function onMetaData(eobj:Object): void {
                   // this needs to be in the scope of your loader
              public function onPlayStatus(eObj: Object): void {
              public function onXMPData(eobj:Object):void{
    In 2nd keyfram I use this code on reply button
    package  {
         import flash.display.SimpleButton;
         import flash.display.MovieClip;
         import flash.events.MouseEvent;
         import flash.media.SoundMixer;
         import flash.media.Video;
         import flash.net.NetConnection;
         import flash.net.NetStream;
              public class reply extends SimpleButton {
                                  public function reply() {
                                            this.addEventListener(MouseEvent.CLICK,clickFF);
                                  private function clickFF(e:MouseEvent):void{
                                            SoundMixer.stopAll();
                                            MovieClip(this.root).gotoAndStop(1, "Scene 1");
                                            ns.close();
                                            //video.attachNetStream(null);
    But when I click on reply button I got this compiler error

  • Error while converting class file to exp and jca file

    error while converting *.class file to *.exp and *.jca file
    =====================================================================================================================
    linux-y60u:/home/admin/java_card_kit-2_2_1/samples/src # converter -exportpath "/home/admin/java_card_kit-2_2_1/lib/" com/sun/javacard/samples/HelloWorld 0x00:0x01:0x02:0x03:0x04:0x05:0x06:0x07:0x0b 1.0 -v -applet 0x00:0x01:0x02:0x03:0x04:0x05:0x06:0x07:0x0b:0x01 Identity
    Java Card 2.2.1 Class File Converter, Version 1.3
    Copyright 2003 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.
    parsing /home/admin/java_card_kit-2_2_1/samples/src/com/sun/javacard/samples/HelloWorld/HelloWorld.class
    parsing /home/admin/java_card_kit-2_2_1/samples/src/com/sun/javacard/samples/HelloWorld/Identity.class
    error: com.sun.javacard.samples.HelloWorld.HelloWorld: unsupported class file format of version 50.0.
    error: com.sun.javacard.samples.HelloWorld.Identity: unsupported class file format of version 50.0.
    conversion completed with 2 errors and 0 warnings.
    =====================================================================================================================

    i compile a file javacard use this command:
    ===
    javac -source 1.3 -target 1.1 -g -classpath ./classes:../lib/api.jar:../lib/installer.jar src/com/sun/javacard/samples/Identity/Identity.java
    ===
    and try to convert this class use this command
    ===
    /home/xnuxerx/admin/java_card_kit-2_2_1/bin/converter -exportpath "/home/xnuxerx/admin/java_card_kit-2_2_1/lib/" com/sun/javacard/samples/Identity 0x00:0x01:0x02:0x03:0x04:0x05:0x06:0x07:0x0b 1.0 -v -applet 0x00:0x01:0x02:0x03:0x04:0x05:0x06:0x07:0x0b:0x01 Identity
    ===
    result convert:
    ===
    Java Card 2.2.1 Class File Converter, Version 1.3
    Copyright 2003 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.
    parsing /home/xnuxerx/admin/java_card_kit-2_2_1/samples/classes/com/sun/javacard/samples/Identity/Identity.class
    converting com.sun.javacard.samples.Identity.Identity
    error: export file framework.exp of package javacard.framework not found.
    conversion completed with 1 errors and 0 warnings.
    ===
    why ??
    please your comment for this problem.
    thank 4 all.

Maybe you are looking for

  • Photos open in Preview, won't import to iPhoto

    iMac G5 MAC OS X 10.3.9 iPhoto 5.0.4 After coming home from college I noticed that the iPhoto on my family's home computer wasn't opening at all. After following the different instructions on the discussion boards with no success, I found the only th

  • Language conversion error

    Dear all,     We have imported data from SAP R/3 to BW. The problem we are getting is language. In R/3 they(key users) have mentioned customer name in both English,special characters and chinese. When I use ALPHA conversion routine, its giving error.

  • MobileService.SyncContext.PushAsync never returns in Release build

    I am currently trying to create a windows phone app with azure mobile services but somehow offline sync is not working. When I create a release build and call await SyncContext.PushAsync() it never returns back to the context. I dont really know what

  • SOA Round Trip Performance

    Hi Everyone, I'd like some advice: after makeing a small change to the SOAHello sample, that is add another string to the concat; i found that the ONLY way to get my server to work with my change, is to stop everything and start it up again; give to

  • Email was working perfect, now only some arrive (from Yahoo)

    Hello, The strangest thing. Email on my Macbook Pro (running Lion) was working perfectly and has been since Lion and of course since before that - I had other problems with Lion but never mail. My actual mail account is with Yahoo. Now, weirdly, some