Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 522233
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:20:00+00:00 2026-05-13T08:20:00+00:00

When attempting to execute mvn tomcat:run right after a clean, and with a configured

  • 0

When attempting to execute mvn tomcat:run right after a clean, and with a configured tomcatWebXml specified in the pom, I get a FileNotFoundException.

Here’s the snippet from my POM:

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>tomcat-maven-plugin</artifactId>
    <version>1.0-beta-1</version>
    <configuration>                 
        <path>/licensing</path>
        <tomcatWebXml>${basedir}/src/main/mock/web.xml</tomcatWebXml>
    </configuration>
</plugin>

And here’s the error I experience, but only on the first invocation after a clean, subsequent invocations find the file and work fine.

[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Could not create Tomcat configuration

Embedded error: C:\..snip..\src\main\mock\web.xml
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Could not create Tomcat
configuration
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
ultLifecycleExecutor.java:703)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandalone
Goal(DefaultLifecycleExecutor.java:553)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
ltLifecycleExecutor.java:523)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
dleFailures(DefaultLifecycleExecutor.java:371)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
ts(DefaultLifecycleExecutor.java:332)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
fecycleExecutor.java:181)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
        at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:4
1)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)

        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Could not create Tomc
at configuration
        at org.codehaus.mojo.tomcat.AbstractRunMojo.execute(AbstractRunMojo.java
:153)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
nManager.java:483)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
ultLifecycleExecutor.java:678)
        ... 17 more
**Caused by: java.io.FileNotFoundException: C:\...snip..\src\main\mock\web.xml**
        at org.codehaus.mojo.tomcat.AbstractRunMojo.copyFile(AbstractRunMojo.jav
a:326)
        at org.codehaus.mojo.tomcat.AbstractRunMojo.initConfiguration(AbstractRu
nMojo.java:273)
        at org.codehaus.mojo.tomcat.AbstractRunMojo.execute(AbstractRunMojo.java
:143)
        ... 19 more

Any ideas on how I could resolve this? If it’s an unconditional bug, it would seem to be the sort of thing that would affect anyone & everyone.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T08:20:00+00:00Added an answer on May 13, 2026 at 8:20 am

    I could reproduce this bug. Not sure why but in the following method of AbstractRunMojo.java:

    private void copyFile( String fromPath, File toFile )
        throws IOException
    {
    
        URL fromURL = getClass().getResource( fromPath );
    
        if ( fromURL == null )
        {
            throw new FileNotFoundException( fromPath );
        }
    
        FileUtils.copyURLToFile( fromURL, toFile );
    }
    

    The call to getClass().getResource( fromPath ) indeed returns a null URL right after a clean and works during subsequent invocations. I didn’t really dig the issue but this seems to be a classloading issue (maybe related to MTOMCAT-25).

    It’s pretty annoying but the workaround is obviously to run the goal a second time after the first failure.

    EDIT: I’ve reported this problem, see MTOMCAT-42, which has been fixed and a new snapshot of the Maven Tomcat Plugin has been published! To use it, add the following snippet to your pom.xml:

      <pluginRepositories>
        <pluginRepository>
          <id>Codehaus Snapshots</id>
          <url>http://snapshots.repository.codehaus.org/</url>
          <snapshots>
            <enabled>true</enabled>
          </snapshots>
          <releases>
            <enabled>true</enabled>  <!-- Workaround for MNG-2974, see note below -->
          </releases>
        </pluginRepository>
      </pluginRepositories>
    

    Then change the version of the plugin to 1.0-SNAPSHOT and try again.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am attempting to execute a Stored Procedure within another stored procedure. The catch
I'm attempting to check that a file exists before including it with Server.Execute in
When attempting to compile my C# project, I get the following error: 'C:\Documents and
Attempting to insert an escape character into a table results in a warning. For
Attempting to print out a list of values from 2 different variables that are
Attempting to deploy a MOSS solution to a UAT server from dev server for
When attempting to call functions in math.h , I'm getting link errors like the
When attempting to understand how a SQL statement is executing, it is sometimes recommended
Does attempting to develop some sort of game, even just as a hobby during
Scenario: Attempting to import many (>100), large(>1M recs) flat-files (csv). Problem: Many records are

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.