Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 11 of 11

Thread: Using a CountingBloomFilter (java.lang.VerifyError)

  1. #1
    Junior Member
    Join Date
    Jul 2012
    Posts
    9
    My Mood
    Confused
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Using a CountingBloomFilter (java.lang.VerifyError)

    Dear all,

    I want to use a CountingBloomFilter of java.lang.object.
    This is my primary code:

    CountingBloomFilter cbf=new CountingBloomFilter(12, 4, 1);
    cbf.add(123);
    System.out.print(cbf);
    System.out.print("membership:"+cbf.membershipTest( 1));
    but it seems there is an compiler bug!


    Exception in thread "main" java.lang.VerifyError: (class: countingbloomfilter/CountingBloomFilter, method: <init> signature: ()V) Constructor must call super() or this()


    Would you please help me to solve it?

    I am looking to here from you

    thanks
    Last edited by Silvery; July 19th, 2012 at 12:17 PM.

  2. #2
    Member
    Join Date
    Jul 2012
    Posts
    119
    Thanks
    0
    Thanked 19 Times in 19 Posts

    Default Re: Using a CountingBloomFilter (java.lang.VerifyError)

    the exception tells you already why your code ran into troubles: Constructor must call super() or this()

  3. #3
    Junior Member
    Join Date
    Jul 2012
    Posts
    9
    My Mood
    Confused
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Re: Using a CountingBloomFilter (java.lang.VerifyError)

    the constructor is written by java! I my self did not wrote it to edit.

    Is it possible to explain more?

  4. #4
    Member
    Join Date
    Jul 2012
    Posts
    119
    Thanks
    0
    Thanked 19 Times in 19 Posts

    Default Re: Using a CountingBloomFilter (java.lang.VerifyError)

    ...then pls. post the source so that I can tell you where to look at.
    In general: If a java class is an extension of an other Java class the first invocation in its constructor must be super() or super(parameters) or when it calls itself (or recursive) the this() or this(parameters) is used

  5. #5
    Junior Member
    Join Date
    Jul 2012
    Posts
    9
    My Mood
    Confused
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Re: Using a CountingBloomFilter (java.lang.VerifyError)

    I found the Counting Bloom Filter from this page:
    CountingBloomFilter (Apache Hadoop Main 2.0.0-alpha API)

    I think this source code should care about this point.is it?

    however now I no more can execute the mentioned code. it seems that java.lang.object does not contain the CountingBloomFilter calss!
    I need to have counting bloom filter in my code!

    Thanks for your attention.

  6. #6
    Member
    Join Date
    Jul 2012
    Posts
    119
    Thanks
    0
    Thanked 19 Times in 19 Posts

    Default Re: Using a CountingBloomFilter (java.lang.VerifyError)

    Silvery,
    oh, it's an API. Have you the package org.apache.hadoop.util.bloom. I strongly believe that this API is buggy because your code. Note: The line cbf.add(123) is probably wrong because 2 add methods require an object Key or Filter, not an integer.

    add(org.apache.hadoop.util.bloom.Key key)
    and(org.apache.hadoop.util.bloom.Filter filter)

    CountingBloomFilter cbf=new CountingBloomFilter(12, 4, 1);
    cbf.add(123);
    System.out.print(cbf);
    System.out.print("membership:"+cbf.membershipTest( 1));
    is correct. To be sure it's a bug try this:
    CountingBloomFilter cbf=new CountingBloomFilter(); // default constructor
    System.out.print("cbf="+cbf.toString());

  7. The Following User Says Thank You to Voodoo For This Useful Post:

    Silvery (July 22nd, 2012)

  8. #7
    Junior Member
    Join Date
    Jul 2012
    Posts
    9
    My Mood
    Confused
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Re: Using a CountingBloomFilter (java.lang.VerifyError)

    I downloaded the packages and Now the code is as below:

    It worked properly:

    String s="test";
    byte[] nn=new byte[100];
    nn=s.getBytes();
    System.out.println(nn);
    Key mine=new Key(nn);
    CountingBloomFilter cbf=new CountingBloomFilter();
    cbf.add(mine);
    System.out.print(cbf.toString());
    System.out.println("\nmembership:"+cbf.membershipT est(mine));
    Thank you so much...

  9. #8
    Junior Member
    Join Date
    Jul 2012
    Posts
    9
    My Mood
    Confused
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Re: Using a CountingBloomFilter (java.lang.VerifyError)

    Now I created this cbf. I need to save it to a table in mysql and fetch it later.
    How can I?
    what will be the column's type?
    what about the java code to construct the fetched cbf?

  10. #9
    Member
    Join Date
    Jul 2012
    Posts
    119
    Thanks
    0
    Thanked 19 Times in 19 Posts

    Default Re: Using a CountingBloomFilter (java.lang.VerifyError)

    Silvery,
    glad to hear that it worked. That means either the constructor with parameters is buggy or the misused method add() threw a wrong Exception
    Quote Originally Posted by Silvery View Post
    Now I created this cbf. I need to save it to a table in mysql and fetch it later.
    How can I?
    what will be the column's type?
    what about the java code to construct the fetched cbf?
    Sure you can do that. It depends only on your DB/SQL skill. This API provides 2 methods readFields() and write() for such purpose. You can easily retrieve the data (readFields()) and stow in your SQL table for later use. The question of column type is beyond my knowledge because I can't guess what your data are and what SQL table you want to create. As I said, it depends on your DB/SQL skill.

  11. #10
    Junior Member
    Join Date
    Jul 2012
    Posts
    9
    My Mood
    Confused
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Re: Using a CountingBloomFilter (java.lang.VerifyError)

    Hi

    After a long Holiday, I came back with this problem!
    I really do not know how to save a Counting Bloom Filter in a DB(MY SQL)?I don not know how to use readFileds() would you please help me?

    TNX

  12. #11
    Junior Member
    Join Date
    Jul 2012
    Posts
    9
    My Mood
    Confused
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Re: Using a CountingBloomFilter (java.lang.VerifyError)

    I solved it, just stored The Bloom Filter in a file and load it from the file

Similar Threads

  1. java.lang.String cannot be cast to java.util.Hashtable
    By ashin12 in forum What's Wrong With My Code?
    Replies: 6
    Last Post: April 1st, 2012, 06:17 AM
  2. Java Error cannot be applied to (java.lang.String), phone book entry program.
    By iceyferrara in forum What's Wrong With My Code?
    Replies: 5
    Last Post: September 23rd, 2011, 06:32 AM
  3. Java Web Start app exiting with access denie (java.lang.RuntimePermission
    By sonaljain in forum What's Wrong With My Code?
    Replies: 2
    Last Post: June 13th, 2011, 08:43 PM
  4. AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
    By nasi in forum What's Wrong With My Code?
    Replies: 6
    Last Post: March 25th, 2010, 10:37 PM
  5. Replies: 2
    Last Post: November 3rd, 2009, 05:28 AM