You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by maarten roosendaal <mr...@yahoo.com> on 2007/06/25 08:35:33 UTC

Maven 1.1 feat. ANT Classloader problem when using Jasper

Hi,

We are trying to convert an ANT  (1.6.5) project to a Maven project but first we have to call the ANT scripts from Maven (1.1). This works fine except when there is a part in the ANT-script that does JSP compilation.

What we get is a ClassCastException: java.lang.ClassCastException: org.apache.tools.ant.loader.AntClassLoader2

The problem is that apparently when you run ANT a different Classloader is used then when you run Maven and call ANT. The JspRuntimeContext-class expects a URLClassloader as parent but gets an AntClassLoader2. I've found some threads regarding this problem but no real solution.

We are using a Maven 1.1 custom plugin (with Jelly-scripting) to call ANT-targets and Maven goals in a specific order.

Does anyone have an idea on how to fix this? Again, the problem only occurs when we call ANT targets via Maven.

Thanks,
Maarten



 
____________________________________________________________________________________
Food fight? Enjoy some healthy debate 
in the Yahoo! Answers Food & Drink Q&A.
http://answers.yahoo.com/dir/?link=list&sid=396545367

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


Re: Maven 1.1 feat. ANT Classloader problem when using Jasper

Posted by Lukas Theussl <lt...@apache.org>.
Does loading the jsp deps in the root classloader help [1]? However, I 
don't think there is a general solution, since maven and ant use a 
different classpath, see the remark at the ant:execute goal [2].

HTH,
-Lukas

[1] 
http://maven.apache.org/maven-1.x/using/developing-plugins.html#Plugin_dependencies
[2] http://maven.apache.org/maven-1.x/plugins/ant/goals.html


maarten roosendaal wrote:
> Hi,
> 
> We are trying to convert an ANT  (1.6.5) project to a Maven project but first we have to call the ANT scripts from Maven (1.1). This works fine except when there is a part in the ANT-script that does JSP compilation.
> 
> What we get is a ClassCastException: java.lang.ClassCastException: org.apache.tools.ant.loader.AntClassLoader2
> 
> The problem is that apparently when you run ANT a different Classloader is used then when you run Maven and call ANT. The JspRuntimeContext-class expects a URLClassloader as parent but gets an AntClassLoader2. I've found some threads regarding this problem but no real solution.
> 
> We are using a Maven 1.1 custom plugin (with Jelly-scripting) to call ANT-targets and Maven goals in a specific order.
> 
> Does anyone have an idea on how to fix this? Again, the problem only occurs when we call ANT targets via Maven.
> 
> Thanks,
> Maarten
> 
> 
> 
>  
> ____________________________________________________________________________________
> Food fight? Enjoy some healthy debate 
> in the Yahoo! Answers Food & Drink Q&A.
> http://answers.yahoo.com/dir/?link=list&sid=396545367
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org

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