4

I am getting the error below when executing a maven install from eclipse, which i am not getting when i am executing it manually (in command line without using eclipse)

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project pconIvr: Compilation failure [ERROR] \PCX\PCX\release\pcx\core\pconIvr\src\main\java\com\anexsys\epay\ivr\IvrHostServlet.java:[355,48] cannot find symbol [ERROR] symbol : method extractContentAsDocument() [ERROR] location: interface javax.xml.soap.SOAPBody [ERROR] -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project pconIvr: Compilation failure \PCX\PCX\release\pcx\core\pconIvr\src\main\java\com\anexsys\epay\ivr\IvrHostServlet.java:[355,48] cannot find symbol symbol : method extractContentAsDocument() location: interface javax.xml.soap.SOAPBody at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59) at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:534) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196) at org.apache.maven.cli.MavenCli.main(MavenCli.java:141) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352) Caused by: org.apache.maven.plugin.CompilationFailureException: Compilation failure 

2 Answers 2

1

I had the same problem. I've noticed that in my pom file version is set to 3.0.

<groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>2.0</version> 

I changed it back to 2.0 and everything started to compile.

Sign up to request clarification or add additional context in comments.

Comments

0

Is Eclipse set up to use the same JDK as from the command line? You can check the former by looking at the top of the console (it will have the path to the java executable) and the latter using java -version.

If you insist on using java 1.5 (which is very old and by the way the latest version is update 22), don't try to use the v1.6 extractContentAsDocument method because it's not going to compile.

3 Comments

Both are using the same JDK ....................... Eclipse -- C:\Program Files\Java\jdk1.5.0_11\bin\javaw.exe ................................... Console o/p -- C:\>java -version java version "1.5.0_11" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_11-b03) Java HotSpot(TM) Client VM (build 1.5.0_11-b03, mixed mode, sharing)
javax.xml.soap.SOAPBody.extractContentAsDocument is only in Java 1.6, so both should be failing. I'd check again your Eclipse is using 1.5 as you expect. Does your POM have the compiler version set?
Yes .. its 1.5 <compilerVersion>1.5</compilerVersion>

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.