• Post Reply Bookmark Topic Watch Topic
  • New Topic

not able to implement an interface from another package  RSS feed

 
balajib babu
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I have the below code in a package


I am trying to implement the above interface in another package common.utils



When I build the package common.utils, i get the below error message

error: publish(ValueObject) in AMQ1 cannot implement publish(ValueObject) in Publisher

I tried even referring Publisher here with the complete package name. (i.e. common.remote.Publisher), but still got the same error. Could anybody find something that is wrong here that gives this error?
 
Tapas Chand
Ranch Hand
Posts: 614
9
BSD Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This much of code looks fine and should not have any compilation error.
Can you help us by providing the complete error message thrown by the compiler?
 
Dave Tolls
Ranch Foreman
Posts: 3068
37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How are you compiling the code?
If you're compiling on the command line, what command are you using and what directory are you in?
 
Stephan van Hulst
Saloon Keeper
Posts: 7993
143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to CodeRanch!

I find your package names suspicious. Do you have references to libraries that provide packages common.utils and common.remote? If so, then why are you adding your classes to these packages?
 
balajib babu
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tapas Chand wrote:This much of code looks fine and should not have any compilation error.
Can you help us by providing the complete error message thrown by the compiler?


I am using an IDE (built on eclipse, inhouse by the company where i work). Our application is using maven to build.
The complete error message is

[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] \BALAJIBABU\githome\apps\batchprocess\projects\common\utils\AMQ1.java:[11,13] error: publish(ValueObject) in AMQ1 cannot implement publish(ValueObject) in Publisher
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.077s
[INFO] Finished at: Thu Aug 06 14:59:45 IST 2015
[INFO] Final Memory: 25M/436M
[INFO] ----------------------
 
balajib babu
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Stephan van Hulst wrote:Welcome to CodeRanch!

I find your package names suspicious. Do you have references to libraries that provide packages common.utils and common.remote? If so, then why are you adding your classes to these packages?

Sorry, I am not able to get your question. For instance, if your question was "Why do i refer to masspayprocessorexception from the same package where i add my class?" yeah, i don't need to have that reference. I was trying to do different things to solve this issue and while copy pasting, i could have done this
 
Stephan van Hulst
Saloon Keeper
Posts: 7993
143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you show us the project POM?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!