• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Maven Error - Package does not exist, Symbols not recognised

 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Hi,

I am trying to build a Struts Web Application using Maven. I am getting the following errors when I run mvn compile:

1. package org.apache.struts.action does not exist
2. package org.apache.struts.util does not exist

Also getting the following unrecognised symbol errors:

1. ActionMapping, ActionForm, ActionForward, ActionErrors

2. HttpSevletRequest, HttpServletResponse

3. DynaActionForm

I tried installing the struts.jar file in the local maven repository using the command:

mvn install:install-file -DgroupId=struts -DartifactId=struts -Dversion=1.0 -Dpackaging=jar -Dfile= Path to file.

It gives the following error:
The plugin 'org.apache.maven.plugins:maven-D-plugin' does not exist or no valid version could be found.

Please help.

Thanks,
Praneet.
 
Ranch Hand
Posts: 244
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Try to install the jar file with the version that you have mentioned in your POM dependency.
I think these two are mismatching.
 
Praneet Mirchandani
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Kousik - that did not work unfortunately.

Do you know what is the latest version of the struts jar file?

Thanks,
Praneet
 
Kousik Majumder
Ranch Hand
Posts: 244
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think that hardly matter. What you have used in your project that only matters.
You also need to install servlet API jar. Because your error list also include that one.
 
Praneet Mirchandani
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Have managed to install servlet-api.jar successfully.

Its struts.jar that is giving the problem.


Thanks,
Praneet
 
Kousik Majumder
Ranch Hand
Posts: 244
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Give the pom.xml code and full error trace.
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I tried installing the struts.jar file in the local maven repository using the command:



It already available in the Maven repo. What exact errors do you get? And what does your pom.xml look like?
 
Praneet Mirchandani
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Hi,

I downloaded the struts jar from the maven repository and pasted it in my local maven repository.

Pasted the following at the path - D:\Documents and Settings\praneet.mirchandani\.m2\repository\struts\struts\1.0.2

struts-1.0.2.jar, struts-1.0.2.jar.sha1, struts-1.0.2.pom, struts-1.0.2.pom.sha1.

Then I ran mvn compile. This is the error log I got:


[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] The plugin descriptor for the plugin Plugin [struts:struts] was not found
. Please verify that the plugin JAR D:\Documents and Settings\praneet.mirchandan
i\.m2\repository\struts\struts\1.0.2\struts-1.0.2.jar is intact.
[INFO] ------------------------------------------------------------------------
[INFO] Trace
java.lang.IllegalStateException: The plugin descriptor for the plugin Plugin [st
ruts:struts] was not found. Please verify that the plugin JAR D:\Documents and S
ettings\praneet.mirchandani\.m2\repository\struts\struts\1.0.2\struts-1.0.2.jar
is intact.
at org.apache.maven.plugin.DefaultPluginManager.addPlugin(DefaultPluginM
anager.java:360)
at org.apache.maven.plugin.DefaultPluginManager.verifyVersionedPlugin(De
faultPluginManager.java:224)
at org.apache.maven.plugin.DefaultPluginManager.verifyPlugin(DefaultPlug
inManager.java:184)
at org.apache.maven.plugin.DefaultPluginManager.loadPluginDescriptor(Def
aultPluginManager.java:1642)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.verifyPlugin(Defa
ultLifecycleExecutor.java:1540)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.bindPluginToLifec
ycle(DefaultLifecycleExecutor.java:1503)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.constructLifecycl
eMappings(DefaultLifecycleExecutor.java:1282)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
ltLifecycleExecutor.java:534)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
dleFailures(DefaultLifecycleExecutor.java:387)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
ts(DefaultLifecycleExecutor.java:348)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
fecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:6
0)
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:585)
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)


This is the pom.xml file:


Thanks,
Praneet
 
Kousik Majumder
Ranch Hand
Posts: 244
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Remove the last struts plugin:

<plugin>
<groupId>struts</groupId>
<artifactId>struts</artifactId>
<version>1.0.2</version>
</plugin>

Then run again.
 
Praneet Mirchandani
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Hi Kousik,

Tried what you suggested. Now it is throwing me some more errors when I run mvn compile:

package org.apache.struts.action does not exist

package org.apache.struts.util does not exist

Unrecognised Symbols

ActionMapping, ActionForm
ActionForward, ActionErrors
DynaActionForm, DispatchAction

Thanks,
Praneet
 
Praneet Mirchandani
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Hi,

I need to include a jar file I have made in order to build the project.

I think I would need to mention that in my pom.xml, but I dont know how?

I dont think it can be put in the dependency tag or the plug in tag. So where do I put it?

Thanks,
Praneet
 
Kousik Majumder
Ranch Hand
Posts: 244
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think you have installed in wrong way.
Run the following command and install again.
I have only changed the groupid.

mvn install:install-file -DgroupId=org.apache.struts -DartifactId=struts -Dversion=1.0 -Dpackaging=jar -Dfile= Path to file
 
Praneet Mirchandani
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Hi,

I tried that. It throws the following error:

The plugin 'org.apache.maven.plugins:maven-D-plugin' does not exist or no valid version could be found.


Thanks,
Praneet
 
Kousik Majumder
Ranch Hand
Posts: 244
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Sorry . I make the mistake now. make the version 2.0.6 in the command line prompt that I had written.

mvn install:install-file -DgroupId=org.apache.struts -DartifactId=struts -Dversion=2.0.6 -Dpackaging=jar -Dfile= Path to file
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Struts 2.0.6?!

To the original poster: please show the *exact* command you're typing, and put it inside code tags, so we can see where any spaces are. So far it just looksl ike you're not putting quotes around a path that has spaces in it, which will cause the install to fail.

You can also just *look* in the repository to see if it's there, and obviously the dependency needs to be in your POM.

To summarize:
- Post the *exact* command you're using to install, in code tags
- Check to see if it's already in the repository
- Post the POM dependency you're using.
 
Praneet Mirchandani
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Sorry. Noted for next time.

I had to include a certain jar as a dependency. So I pasted it in the local repository and then ran the command below.



It gave the following error:
The plugin 'org.apache.maven.plugins:maven-D-plugin' does not exist or no valid version could be found.

Tried searching a lot for this error, but could not figure out.

Thanks,
Praneet
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Like I said, you're not quoting a path with a space in it: the computer has no way of knowing that space isn't delimiting commands. I'd also remove the space after the "-Dfile= ".

And *don't* put it in the repository manually--put it somewhere easy (like c:\), then you don't have to worry about spaces at all.
 
Praneet Mirchandani
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

I managed to install the external jar. Thanks David.

But when I ran mvn compile after that, it still threw me errors saying it cannot recognise certain packages which were in the newly installed jar. Any idea why this happened?

 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You did it wrong? Your POM dependency is wrong? The jar doesn't contain the classes you think it does?

Without knowing any details, it's impossible to help.
 
reply
    Bookmark Topic Watch Topic
  • New Topic