Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6969825
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:37:50+00:00 2026-05-27T16:37:50+00:00

I am getting a No matching ctor found error while trying to populate a

  • 0

I am getting a “No matching ctor found” error while trying to populate a Java class from Clojure.

I want to populate this class from Clojure.

import java.util.Date;

public class Account {
    Account() { acct_num = 0; 
                trans_type = 'U';
                trans_amt = 0.00;
                cur_bal = 0.00;
                last_update = null;
               }

    public int acct_num = 0;
    public char trans_type;
    public double trans_amt = 0.00;
    public double cur_bal = 0.00;
    public Date last_update;
}

I can import the class:

ba2-app=> (ns ba2-app (:import Account))
Account

but when I go to populate it, I get this error:

ba2-app=> (:use java.util.Date)
nil
ba2-app=> (Account. 1000 \C 100.00 0.00 (java.util.Date. "12/21/2011"))
java.lang.IllegalArgumentException: No matching ctor found for class Account (NO_SOURCE_FILE:9)

I followed these suggestions to get the Java class built in with my Clojure code. The suggestions which were very helpful, because I can now build the Java class.

Any pointers or suggestions would be helpful. I know the class members should be private, but this is to test out a larger project.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T16:37:51+00:00Added an answer on May 27, 2026 at 4:37 pm

    Make the constructor public with the public access modifier. Also your constructor doesn’t accept any args, but just sets a bunch of members to some values. So you can now actually only call it like: (Account.) (if it were public).

    When you want to use a constructor like this: (Account. 1000 \C 100.00 0.00 (java.util.Date. "12/21/2011")) you’ll have to add a constructor that accepts these types of arguments:

        public Account(int a, char c, double d1, double d2, Date date) { 
          acct_num = a; 
          trans_type = c;
          trans_amt = d1;
          cur_bal = d2;
          last_update = date;
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am getting this error: main.cpp:31: error: no matching function for call to 'QWebFrame::addToJavaScriptWindowObject(QString,
I was getting a confusing error message after trying git pull about no matching
Getting this error: 2009-09-03 12:44:02.307 xcodebuild[307:10b] warning: compiler 'com.apple.compilers.llvm.clang.1_0.analyzer' is based on missing compiler
Getting a rendering error for this form: 'NoneType' object has no attribute 'widget' http://dpaste.com/88585/
Getting a 'marshal data too short' error when trying to install the mysql gem
Getting this error with jquery & jquery.form. Site has been live for awhile..upgraded to
When running java from the command line: java -classpath bin:pellet-2.0.0/lib/* com.stuff.MyClass argumentTextStuff I'm getting
I am getting these error while creating bean id , Im using spring :
EDIT 11/3/2011 9:37pm: This is my error: error: no matching function for call to
In Reference to this question After getting the line identifier matching in first and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.