f



[compilation error] debugging this error message "Object() in java.lang.Object cannot be applied to"

Hi,I have a class called Device that instantiates another class DbMoneyin this manner:===  return new DbMoney(  money, hardware.getName() );===1) Both are in the same package, i.e. my.IMoney & my.Device2) When I compile them, javac complains with the error:Object() in java.lang.Object cannot be applied to (my.IMoney,java.lang.String)       return new DbMoney(  money, hardware.getName() )                       ^Q) My arguments to the DbMoney constructor match that of its declaredmethod parameters. So that can't be the problem. What am I doingwrong ?Gavin
0
3/28/2007 5:25:28 AM
comp.lang.java.programmer 52714 articles. 0 followers. Post Follow

3 Replies
589 Views

Similar Articles

[PageSpeed] 52

On Mar 28, 3:25 pm, "Gavin" <gavin.emp...@gmail.com> wrote:> Hi,G'day.  Please note that starting a post'ssubject line with words in '['/']' will causethem to be hidden in the the GG groups list.I suggest not to do that, so everyone can seethe entire subject line.> I have a class called Device that instantiates another class DbMoney> in this manner:...>   return new DbMoney(  money, hardware.getName() );...> Object() in java.lang.Object cannot be applied to (my.IMoney,> java.lang.String)>        return new DbMoney(  money, hardware.getName() )>                        ^>> Q) My arguments to the DbMoney constructor match that of its declared> method parameters.Do they?  Your code snippets do not supportthat, or more accurately, if we had an SSCCE*,we could confirm that for ourselves.>..So that can't be the problem. What am I doing> wrong ?I am not sure, but if you supply anSSCCE of your current code, that showsthe same compilation error, I might beable to assist further.* For more info. on the SSCCE, see..<http://www.physci.org/codes/sscce.html>Andrew T.
0
Andrew
3/28/2007 5:40:13 AM
Andrew Thompson wrote:> G'day.  Please note that starting a post's> subject line with words in '['/']' will cause> them to be hidden in the the GG groups list.> I suggest not to do that, so everyone can see> the entire subject line.Or better yet.  Ignore the entire issue, and whatever way GG happens to bebroken today.  Stick to well-established Usenet conventions.  If GG can't getits act together then so much the worse for Google, its users, and itsadvertising income.I.e. bugger Google.    -- chris
0
Chris
3/28/2007 5:54:15 AM
Gavin wrote:> Object() in java.lang.Object cannot be applied to (my.IMoney,> java.lang.String)>        return new DbMoney(  money, hardware.getName() )>                        ^Andrew's advice to reduce this to an SCCCCE is good, you should follow it.But, just as a guess, it sounds as if my.DbMoney has no constructors -- haveyou inadvertently turned your would-be constructor into a normal method bygiving it a return type ?    -- chris
0
Chris
3/28/2007 5:57:46 AM
Reply:

Similar Artilces:

Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object
I downloaded jdk-6u7-solaris-sparcv9.tar.Z and installed it by these commands: # zcat jdk-6u7-solaris-sparc.tar.Z | tar -xf - # pkgadd -d . SUNWj6rtx SUNWj6dvx SUNWj6dmx # /usr/jdk/instances/jdk1.6.0/bin/sparcv9/java -version Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object # ls /usr/jdk/instances/ jdk1.5.0 jdk1.6.0 # uname -a SunOS sun1 5.10 Generic sun4u sparc SUNW,Sun-Blade-2500 Please help to fix the error. Thanks. TsanChung wrote: > I downloaded jdk-6u7-solaris-sparcv9.tar.Z and installed it by these > commands: > # zcat jdk-6u7-so...

Error occurred during intialization of VM java/lang/NoClassDefFoundError: java/lang/Object
Good day to all, I have installed the j2se/netbeans binary bundle on red hat 9. I can run everything perfectly as root but when I try to compile with any other user I get: Error occurred during intialization of VM java/lang/NoClassDefFoundError: java/lang/Object When I saw this it seemed like a permissions problem but I checked the permissions and everything seemed fine. All users have execute permissions of javac and java. I have read other threads dealing with the same or similar problem but have not reached any solution yet. I would appreciate if anyone that has run into this type o...

Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object (ant/tomcat/spring)
Hi, I've been trying to get Spring working with ant and tomcat. Ant was building just fine, but I came in today and tried to build it and got this: Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object ?!?! Makes no sense to me. There _is_ an older version of java installed on my machine; but JAVA_HOME and ANT_HOME are set to the correct paths, and <which java>and <java -version> produce the correct version. Any help would greatly alleviate my frustration! Thanks in advance... Courtney ...

Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object (ant/tomcat/spring)
Hi, I've been trying to get Spring working with ant and tomcat. Ant was building just fine, but I came in today and tried to build it and got this: Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object ?!?! Makes no sense to me. There _is_ an older version of java installed on my machine; but JAVA_HOME and ANT_HOME are set to the correct paths, and <which java>and <java -version> produce the correct version. Any help would greatly alleviate my frustration! Thanks in advance... Courtney ...

java matlab error: Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
Hello Im using matlab 2010 and 2007 with windows 7 and i have install the new java. Matlab array editor doesnt work right even though i can see the values of an array in the workspace when i try to edit them in the variable editor i cant see the values and i get an error: Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at com.mathworks.mlwidgets.array.ValueTableModel.setValuesAt(ValueTableModel.java:195) at com.mathworks.mlwidgets.array.ValueTableModel.setValueAt(ValueTableModel.java:190) at com.mathworks.widgets.spreadsheet.ResizingTableModelWrapper.s...

how to overcome "java.lang.OutOfMemory" Error
We already increased the Heap Space, But still i am getting this error. Actually we did increase the heapspace upto 1024MB. still java process eating memory. After that application crashes. I already search so many sites in Google. Can anybody shed some light on this issue? Ananth, 03.03.2008 13:38: > We already increased the Heap Space, But still i am getting this > error. Actually we did increase the heapspace upto 1024MB. still java > process eating memory. After that application crashes. I already > search so many sites in Google. Can anybody shed some light on this > is...

Error Message: "Error accessing product object method"
We get the Error message "Error accessing product object method" when we execute the following Lotus Script instruction: Call outlineTW.Save() in an agent. Our developer uses the Notes 5 Designer and those who have problems use the Notes 6 clients. Could it be the cause of the prolem? Or else: any help please? Hi Lucky Luke, > We get the Error message "Error accessing product object method" when > we execute the following Lotus Script instruction: Call > outlineTW.Save() in an agent. What type of object is outlineTW? I'm writing a script lib...

"Ascii2Hex2Ascii" Compiler says "java.lang.NumberFormatException", What does this mean?
I am getting some pretty weird 'messages' perhaps errors? When I Run my program. It compiles with no errors or messages. Could someone tell me what to do, or more import explain what that message is trying to tell me? If you need more information then please ask. Here is the source code with comments. /* I get the following error or message when the program goes into the last for-loop to convert BACK from HEX to ASCII it seems to only happen when the Length goes over 4 or higher? java.lang.NumberFormatException: For input string: "0041004100410071" ...

SGI Java issue "Exception in thread "main" java.lang.UnsatisfiedLinkError: poll0"
Hello all; I'm trying to debug an issue with a java script called, SelectSockets. It appears to be a fairly common one found on the web. I downloaded the SGI Java v1.4.1 installation from SGI's webpage and installed it using SGI's swmgr application. The installation was very straight forward and there were no errors when I installed the package. Then I ran /usr/java2/bin/javac SelectSockets.java to make the SelectSockets.class file. Then I ran /usr/java2/bin/java SelectSockets, and got the following error message: =================================================...

Swing error :Exception in thread "main" java.lang.NoClassDefFoundError
Am trying to learn. From Schlidt's Java A Beginners Guide entered Swing program SwingDemo p 567 and seperately ButtonDemo p 574. Both compiled. But runing both gave same error message : Exception in thread "main" java.lang.NoClassDefFoundError Both do have a class definition. Am using JDK6 downloaded 6 weeks ago onto new Dell with XP. Only problem I had with setup is classpath. Am storing source files and compiling/running from bin directory. Thanks for any help to this frustrating problem. Dave WB3DWE pdlemper@earthlink.net wrote: > Am trying to learn. From Schlidt'...

<%@ page language="java" contentType="text/html" JSP Compilation error
Hi There, I am trying do a shopping cart tutorial and have the following error when compiling my shop products.jsp file. The rest of the code is below the line. Thanks Jim Ascroft shop_0002dproducts$jsp.java [3:1] '.' expected import ShoppingBasket; <%@ page language="java" contentType="text/html" import="ShoppingBasket,Product,java.util.*" errorPage="errorpage.jsp" %> __________________________________________________________________ <html> <head> <title>Welcome to the Shop</title>...

Validator gives: "Uncaught error java.lang.Exception: Import loop detected"
Hi, When I validate this page: http://www.drfunkenstein.net/using http://jigsaw.w3.org/css-validator/, I get the following results: http://jigsaw.w3.org/css-validator/validator?profile=css2&warning=2&uri=http%3A//www.drfunkenstein.net/ Or briefly: "Uncaught error java.lang.Exception: Import loop detected in http://www.drfunkenstein.net/styles/base.css" I'm guessing that the validator is telling me there's some kind of loop created by the import statements in my CSS, but I can't for the life of me see the error. The java.lang.Exception part makes...

Error Message : "Object Required"
Hi, I've been working on a form that contains a subform. The fields in the main form are EvendId, EventName, Date, time, place, etc.. These fields cannot be edited (locked = yes and activated = no) In the subform the fields are EventId, TicketNo, Qty, Section, Row, Seat,etc... I use this subform to see the list of tickets for the event and to add new tickets. When I open my form, the focus goes to the last record. Then, if I want to close the form or undo, I have a "Object Required" message by Microsoft Access. I double checked all of my fields. They all allow null va...

"java out of memory error message"
I dont know if this helps but I only recieved the error if I had the array viewer open and was viewing the variables that I was using in the script. Not to technical but seemed to stop this error message. ...

Web resources about - [compilation error] debugging this error message "Object() in java.lang.Object cannot be applied to" - comp.lang.java.programmer

KDE Software Compilation - Wikipedia, the free encyclopedia
The KDE Software Compilation ( KDE SC ) is a desktop environment and an associated range of KDE Applications produced by KDE . Prior to version ...

YouTube - Tom Cruise Compilation (Run! GO GO GO GO GO!!)
Hochgeladen am 12.01.2009 A compilation of the gratuitous amount of scenes with Tom Cruise sprinting, yelling, dashing and all out running for ...

Animals in Super Bowl Ads: Video Compilation - Special: Super Bowl - AdAge
Cheetahs and horses and bears, oh my! Spots featuring fuzzy, scaly and winged creatures are a time-honored tradition in the Super Bowl. Over ...

Instagram Spotlight Compilations to Shine More Frequently
Instagram launched curated content streams called Spotlight Compilations this past Halloween, and the Facebook-owned photo- and video-sharing ...

A compilation of people hurting themselves on their new Christmas Hoverboards
Hoverboards might not be safe or legal in all places, but they’re definitely popular gifts, especially around Christmas , but controlling these ...

Emperor X, members of Porches, Sorority Noise & many more contribute songs to new Bernie Sanders benefit ...
We're just a few days away from the Iowa Caucus, the real kickoff to primary season. Bernie Sanders has been getting a lot of support from musicians, ...

Compilation Of Bunnies Yawning
Submitted by: (via The Dodo ) Tagged: bunnies , yawning , compilation , bunny , Video Share on Facebook

Put That Thing On Ice, STAT: Compilation Of All The Lightsaber Amputations In Star Wars
This is a video compilation of all the non-doctor performed amputations in the Star Wars film franchise . It was pretty brutal. I can't help ...

Connor Franta Debuts Fourth Compilation Album 'Common Culture Vol 4'
Connor Franta is back with another compilation album and it's going to be even more awesome than last year's! The ...

A Compilation of Every Time That R2-D2 Saves the Day
IGN has created a compilation video of every time that the heroic astromech droid, R2-D2 , has saved the day in the Star Wars films. Luke, Han, ...

Resources last updated: 2/2/2016 9:22:11 PM