RE: Compilation Error -Incompatible Types
Hi David , This is the original post . I am facing the compilation error in my Jenkins job. We are not getting compile time error in Eclipse for BusinessObject but we are getting incompatible types error in Jenkins. Is there any way to resolve this issue rather than changing the source code. Please find the below. [ERROR] COMPILATION ERROR : [INFO] - [ERROR] /C:/Jenkins/jobs/XXX Commons/workspace/src/com/ABC/XXX/bo/BusinessObject.java:[4158,102] incompatible types required: com.ABC.XXX.bo.BusinessObject found:com.ABC.bo.BusinessObject [INFO] 1 error [INFO] Please help me out regarding this issue. -- View this message in context: http://maven.40175.n5.nabble.com/Compilation-Error-Incompatible-Types-tp5852871p5853516.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Compilation Error -Incompatible Types
Maybe you are missing a library that is provided by Eclipse for BusinessObject but not defined in the pom. In that case you need to find that library and add it to your maven build. On Tue, Dec 1, 2015 at 4:27 PM, pradeepkumar <pradeepkumar...@gmail.com> wrote: > Hi David , > > > This is the original post . > > I am facing the compilation error in my Jenkins job. > > We are not getting compile time error in Eclipse for BusinessObject but we > are getting incompatible types error in Jenkins. > Is there any way to resolve this issue rather than changing the source > code. > > > Please find the below. > > > [ERROR] COMPILATION ERROR : > [INFO] - > [ERROR] /C:/Jenkins/jobs/XXX > Commons/workspace/src/com/ABC/XXX/bo/BusinessObject.java:[4158,102] > incompatible types > required: com.ABC.XXX.bo.BusinessObject > found:com.ABC.bo.BusinessObject > [INFO] 1 error > [INFO] > > Please help me out regarding this issue. > > > > -- > View this message in context: > http://maven.40175.n5.nabble.com/Compilation-Error-Incompatible-Types-tp5852871p5853516.html > Sent from the Maven - Users mailing list archive at Nabble.com. > > - > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > For additional commands, e-mail: users-h...@maven.apache.org > > -- Adrien Rivard
RE: Compilation Error -Incompatible Types
I'm afraid I know nothing of Jenkins so I'm not able to advise on changing that. I was suggesting you might check the source to see which of com.ABC.XXX.bo.BusinessObject and com.ABC.bo.BusinessObject was being imported and confirm which one SHOULD be being imported. It might be that a difference in classpaths is allowing you to get away with a source error in Eclipse but not elsewhere, so the fact that it works in Eclipse doesn't guarantee it's right. It's a mistake I have made in the past. If you are sure that the source is correct then my observation will not apply! Good luck either way. Regards D.E> -Original Message- From: pradeepkumar [mailto:pradeepkumar...@gmail.com] Sent: 01 December 2015 15:27 To: users@maven.apache.org Subject: RE: Compilation Error -Incompatible Types Hi David , This is the original post . I am facing the compilation error in my Jenkins job. We are not getting compile time error in Eclipse for BusinessObject but we are getting incompatible types error in Jenkins. Is there any way to resolve this issue rather than changing the source code. Please find the below. [ERROR] COMPILATION ERROR : [INFO] - [ERROR] /C:/Jenkins/jobs/XXX Commons/workspace/src/com/ABC/XXX/bo/BusinessObject.java:[4158,102] incompatible types required: com.ABC.XXX.bo.BusinessObject found:com.ABC.bo.BusinessObject [INFO] 1 error [INFO] Please help me out regarding this issue. -- View this message in context: http://maven.40175.n5.nabble.com/Compilation-Error-Incompatible-Types-tp5852871p5853516.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Compilation Error -Incompatible Types
I have tried compile form console , even i am facing the same error from command prompt. -- View this message in context: http://maven.40175.n5.nabble.com/Compilation-Error-Incompatible-Types-tp5852871p5853003.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Compilation Error -Incompatible Types
pradeepkumar wrote: > I have tried compile form console , even i am facing the same error from > command prompt. That simply means your code is not Java compliant. It does not matter that the Eclipse compiler has no problem. Cheers, Jörg - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Compilation Error -Incompatible Types
I'm not sure this is the case here, but most of the time differences between eclipse and command line compilation are due to scopes problems. Eclipse is merging various scopes (test/compile ..) when compiling while command line is enforcing strict separation. Have a look at the scopes of the libraries of both problematics objects. On Thu, Nov 26, 2015 at 3:54 PM, Jörg Schaiblewrote: > pradeepkumar wrote: > > > I have tried compile form console , even i am facing the same error from > > command prompt. > > That simply means your code is not Java compliant. It does not matter that > the Eclipse compiler has no problem. > > Cheers, > Jörg > > > - > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > For additional commands, e-mail: users-h...@maven.apache.org > > -- Adrien Rivard
Re: Compilation Error -Incompatible Types
Hi Maybe try - to avoid wildcard (*) in your imports statement - check dependencies version differences between your workstation and jenkins Le 25 nov. 2015 09:48, "pradeepkumar" <pradeepkumar...@gmail.com> a écrit : > Is there any was to resolve this issue from maven side by adding any flag > to > avoid cast typing issues. > > > > > > > -- > View this message in context: > http://maven.40175.n5.nabble.com/Compilation-Error-Incompatible-Types-tp5852871p5852878.html > Sent from the Maven - Users mailing list archive at Nabble.com. > > - > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > For additional commands, e-mail: users-h...@maven.apache.org > >
Re: Compilation Error -Incompatible Types
Hi Adrien, > most of the time differences between eclipse and command line > compilation are due to scopes problems. I agree that Eclipse's handling of scopes is a common reason for code which works in Eclipse, but actually fails on the CLI. However, there are also significant differences in the compilers themselves, which I have encountered quite frequently. In particular, Eclipse tends to be laxer about complex generics expressions than javac is. Regards, Curtis On Thu, Nov 26, 2015 at 9:06 AM, Adrien Rivardwrote: > I'm not sure this is the case here, but most of the time differences > between eclipse and command line compilation are due to scopes problems. > Eclipse is merging various scopes (test/compile ..) when compiling while > command line is enforcing strict separation. > Have a look at the scopes of the libraries of both problematics objects. > > > On Thu, Nov 26, 2015 at 3:54 PM, Jörg Schaible > wrote: > > > pradeepkumar wrote: > > > > > I have tried compile form console , even i am facing the same error > from > > > command prompt. > > > > That simply means your code is not Java compliant. It does not matter > that > > the Eclipse compiler has no problem. > > > > Cheers, > > Jörg > > > > > > - > > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > > For additional commands, e-mail: users-h...@maven.apache.org > > > > > > > -- > Adrien Rivard >
RE: Compilation Error -Incompatible Types
I think the original question noted two different classes along the lines of com.someone.xxx.bo.BusinessObject and com.someone.xxx.BusinessObject These are different classes. ... I cannot find the original post and I can't be sure so sorry if this is a red herring. One of Eclipse's useful features is to allow you to pick a missing class to import (as a "quick fix"). I have sometimes made the mistake of picking the wrong class from the list offered. If I pick java.awt.List instead of java.util.List things go wrong downstream quickly and the mistake is pretty easy to find. If I pick a super or subclass of the one I should have chosen, the cause might not appear so quickly. The Primavera Integration API, for example, provides ample opportunity to make this kind of error - where a "family" of classes can live in different jars. Of the classes listed in the original post, which one should you be using? I would go back to my source and check whether the import is correct. As others have alluded to, the fact that it "works" in Eclipse doesn’t necessarily mean it's "correct". Regards D.E. -Original Message- From: ctrueden.w...@gmail.com [mailto:ctrueden.w...@gmail.com] On Behalf Of Curtis Rueden Sent: 26 November 2015 20:28 To: Maven Users List <users@maven.apache.org> Subject: Re: Compilation Error -Incompatible Types Hi Adrien, > most of the time differences between eclipse and command line > compilation are due to scopes problems. I agree that Eclipse's handling of scopes is a common reason for code which works in Eclipse, but actually fails on the CLI. However, there are also significant differences in the compilers themselves, which I have encountered quite frequently. In particular, Eclipse tends to be laxer about complex generics expressions than javac is. Regards, Curtis On Thu, Nov 26, 2015 at 9:06 AM, Adrien Rivard <adrien.riv...@gmail.com> wrote: > I'm not sure this is the case here, but most of the time differences > between eclipse and command line compilation are due to scopes problems. > Eclipse is merging various scopes (test/compile ..) when compiling > while command line is enforcing strict separation. > Have a look at the scopes of the libraries of both problematics objects. > > > On Thu, Nov 26, 2015 at 3:54 PM, Jörg Schaible <joerg.schai...@gmx.de> > wrote: > > > pradeepkumar wrote: > > > > > I have tried compile form console , even i am facing the same > > > error > from > > > command prompt. > > > > That simply means your code is not Java compliant. It does not > > matter > that > > the Eclipse compiler has no problem. > > > > Cheers, > > Jörg > > > > > > > > - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > > For additional commands, e-mail: users-h...@maven.apache.org > > > > > > > -- > Adrien Rivard >
Compilation Error -Incompatible Types
Hi , I am facing the compilation error in my Jenkins job. We are not getting compile time error in Eclipse for BusinessObject but we are getting incompatible types error in Jenkins. Because there is difference in package for the reference BusinessObject and the Object factory method returning. Please find the below. [ERROR] COMPILATION ERROR : [INFO] - [ERROR] /C:/Jenkins/jobs/XXX Commons/workspace/src/com/ABC/XXX/bo/BusinessObject.java:[4158,102] incompatible types required: com.ABC.XXX.bo.BusinessObject found:com.ABC.bo.BusinessObject [INFO] 1 error [INFO] Please help me out regarding this issue. -- View this message in context: http://maven.40175.n5.nabble.com/Compilation-Error-Incompatible-Types-tp5852871.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Compilation Error -Incompatible Types
Is there any was to resolve this issue from maven side by adding any flag to avoid cast typing issues. -- View this message in context: http://maven.40175.n5.nabble.com/Compilation-Error-Incompatible-Types-tp5852871p5852878.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Compilation Error -Incompatible Types
pradeepkumar wrote: > Is there any was to resolve this issue from maven side by adding any flag > to avoid cast typing issues. Just because Eclipse can compile it, does not mean that javac of Oracle JDK can also. You better try to compile from console using the real compiler to see what's wrong. Cheers, Jörg - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org