You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by glenh <gl...@quickplay.com> on 2011/08/11 19:26:38 UTC

problems loading correct class, using maven 2.2.1 and jdk1.6

Hey,

We're using web service annotations for our application and running into a
strange problem.  During compilation we get an error stating that it can't
find a specific constructor(s).  The problem is that the class that has the
correct constructor is located in a third party jar (from geranimo and yes
I've specified in classpath/dependency) but the classloader is picking up a
similar class in the rt.jar (I'm assuming from the bootclasspath based on
how the classloader works I think).  The particular class in question is the
Service class.

I believe this has been corrected in jdk1.7 but unfortunately we need it for
jdk1.6.

Is there a way I can ignore finding the class in rt.jar in maven?  As a
temporary solution, we've specified the jar we want to use in the
bootclasspath when we invoke the compiler-plugin.  I'm hoping we don't need
to write our own classloader if at all possible...

Thanks in advance.

--
View this message in context: http://maven.40175.n5.nabble.com/problems-loading-correct-class-using-maven-2-2-1-and-jdk1-6-tp4690291p4690291.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: problems loading correct class, using maven 2.2.1 and jdk1.6

Posted by Daivish Shah <da...@gmail.com>.
Hi Glenh,

I have similar issue and i want to pass my JDK version rt.jar file...

Can you please send me the Tags that  you are using ? And The line of code
which i need to use to implement this ?

thanks,
daivish.



On Tue, Aug 16, 2011 at 12:44 PM, glenh <gl...@quickplay.com> wrote:

> I think I found a solution for this problem.  In my maven build I just
> download the particular jar that I need and add the -endorseddirs option
> when I invoke the maven compiler to override the default class provided in
> the rt.jar.
>
> --
> View this message in context:
> http://maven.40175.n5.nabble.com/problems-loading-correct-class-using-maven-2-2-1-and-jdk1-6-tp4690291p4705586.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: problems loading correct class, using maven 2.2.1 and jdk1.6

Posted by glenh <gl...@quickplay.com>.
I think I found a solution for this problem.  In my maven build I just
download the particular jar that I need and add the -endorseddirs option
when I invoke the maven compiler to override the default class provided in
the rt.jar.

--
View this message in context: http://maven.40175.n5.nabble.com/problems-loading-correct-class-using-maven-2-2-1-and-jdk1-6-tp4690291p4705586.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: problems loading correct class, using maven 2.2.1 and jdk1.6

Posted by Baptiste MATHUS <ml...@batmat.net>.
Are you sure what you need is feasible with javac?
As Maven just uses it to compile, anything feasible with javac should be
easy enough to pass through.

My 2 cents.
Le 11 août 2011 19:27, "glenh" <gl...@quickplay.com> a écrit :
> Hey,
>
> We're using web service annotations for our application and running into a
> strange problem. During compilation we get an error stating that it can't
> find a specific constructor(s). The problem is that the class that has the
> correct constructor is located in a third party jar (from geranimo and yes
> I've specified in classpath/dependency) but the classloader is picking up
a
> similar class in the rt.jar (I'm assuming from the bootclasspath based on
> how the classloader works I think). The particular class in question is
the
> Service class.
>
> I believe this has been corrected in jdk1.7 but unfortunately we need it
for
> jdk1.6.
>
> Is there a way I can ignore finding the class in rt.jar in maven? As a
> temporary solution, we've specified the jar we want to use in the
> bootclasspath when we invoke the compiler-plugin. I'm hoping we don't need
> to write our own classloader if at all possible...
>
> Thanks in advance.
>
> --
> View this message in context:
http://maven.40175.n5.nabble.com/problems-loading-correct-class-using-maven-2-2-1-and-jdk1-6-tp4690291p4690291.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>