Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Help with compiler error: method in class X cannot be applied to class Y

Reply
Thread Tools

Help with compiler error: method in class X cannot be applied to class Y

 
 
Petterson Mikael
Guest
Posts: n/a
 
      10-08-2003
Hi,

I am trying to compile my app but get the following error:

BoamManagedObject.java:412:
addProxyObserver(se.company.subsys.app.boam.fpx.pr oxies.ProxyObserver)
in se.company.subsys.app.boam.fpx.proxies.BoamProxy cannot be applied to
(se.company.subsys.app.boam.mao.bcm.BoamManagedObj ect)
[javac] myProxies[i].addProxyObserver(this);


Any hints about what this problem could be related to?

Regards,

//Mikael
 
Reply With Quote
 
 
 
 
Gordon Beaton
Guest
Posts: n/a
 
      10-08-2003
On Wed, 08 Oct 2003 09:11:03 +0200, Petterson Mikael wrote:
> Hi,
>
> I am trying to compile my app but get the following error:
>
> BoamManagedObject.java:412:
> addProxyObserver(se.company.subsys.app.boam.fpx.pr oxies.ProxyObserver)
> in se.company.subsys.app.boam.fpx.proxies.BoamProxy cannot be applied to
> (se.company.subsys.app.boam.mao.bcm.BoamManagedObj ect)
> [javac] myProxies[i].addProxyObserver(this);
>
>
> Any hints about what this problem could be related to?


The error message tells you exactly what the problem is.

You attempt to invoke BoamProxy.addProxyObserver(this) from within
your BoamManagedObject class, but you need to pass a ProxyObserver to
the method. It is apparent that BoamManagedObject isn't a
ProxyObserver.

If ProxyObserver is an interface, BoamManagedObject needs to implement
it. If it's a class, BoamManagedObject needs to extend it. Or maybe
you've simply used the wrong argument.

/gordon

--
[ do not email me copies of your followups ]
g o r d o n + n e w s @ b a l d e r 1 3 . s e
 
Reply With Quote
 
 
 
 
Paul Lutus
Guest
Posts: n/a
 
      10-08-2003
Petterson Mikael wrote:

> Hi,
>
> I am trying to compile my app but get the following error:
>
> BoamManagedObject.java:412:
> addProxyObserver(se.company.subsys.app.boam.fpx.pr oxies.ProxyObserver)
> in se.company.subsys.app.boam.fpx.proxies.BoamProxy cannot be applied to
> (se.company.subsys.app.boam.mao.bcm.BoamManagedObj ect)
> [javac] myProxies[i].addProxyObserver(this);
>
>
> Any hints about what this problem could be related to?


I know exactly what this error message is related to -- it is related to
your code, which you did not post. And don't post all of it, just the
relevant few lines that created this error message.

Then someone here will point out your error, instead of guessing about it.

--
Paul Lutus
http://www.arachnoid.com

 
Reply With Quote
 
Neal Gafter
Guest
Posts: n/a
 
      10-08-2003
Yes, the type se.company.subsys.app.boam.mao.bcm.BoamManagedObje ct is not a
subtype of se.company.subsys.app.boam.fpx.proxies.ProxyObserv er.

Petterson Mikael wrote:
> Hi,
>
> I am trying to compile my app but get the following error:
>
> BoamManagedObject.java:412:
> addProxyObserver(se.company.subsys.app.boam.fpx.pr oxies.ProxyObserver)
> in se.company.subsys.app.boam.fpx.proxies.BoamProxy cannot be applied to
> (se.company.subsys.app.boam.mao.bcm.BoamManagedObj ect)
> [javac] myProxies[i].addProxyObserver(this);
>
>
> Any hints about what this problem could be related to?
>
> Regards,
>
> //Mikael


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
called method "cannot be applied to" method in a command object usinggenerics ... lbrtchx@gmail.com Java 0 05-07-2008 07:23 PM
Student in Java, getting error code"cannot be applied" in class miller587 Java 0 10-05-2007 09:05 AM
addChoosableFileFilter in javax.swing.JFileChooser cannot be applied to zipfilter error Darren Java 11 10-27-2005 08:37 AM
mergeWith(X) in ... cannot be applied to X HK Java 1 07-14-2005 12:22 PM
Compiler error - cannot be applied to (int) Jan Danielsson Java 2 01-15-2005 09:50 PM



Advertisments