Archive for April, 2014

Neither GenericXmlContextLoader nor AnnotationConfigContextLoader was able to detect defaults for context configuration


Problem: Running JUnit 4 with Spring 3 and getting below exception

 

Neither GenericXmlContextLoader nor AnnotationConfigContextLoader was able to detect defaults for context configuration

 

Solution: Add locations attribute to the contextConfiguration.

@ContextConfiguration(locations = {“classpath:applicationContext.xml”}) for the JUnit to refer to the beans Definition.

 

 

Leave a comment

Cannot execute mojo: resources. It requires a project with an existing po m.xml, but the build is not using one.


Problem: Cannot execute mojo: resources. It requires a project with an existing po
m.xml, but the build is not using one.

This error simply means there is not pom.xml in the working directory. From the path,where the mvn jetty:run is being run, pom.xml does not exist.

Navigate to the right directory and run the command being tried again should resolve the issue.

Leave a comment

The plugin ‘org.apache.maven.plugins:maven-jetty-plugin’ does not exist o r no valid version could be found


Problem: The plugin ‘org.apache.maven.plugins:maven-jetty-plugin’ does not exist o
r no valid version could be found

 

Performing mvn jetty:run is throwing this error and infact maven-jetty-plugin does not exist in pom.xml. Instead of adding it every pom.xml that tries to use jetty, instead plug-in is added to settings.xml as below

 

<pluginGroups>
<!– pluginGroup
| Specifies a further group identifier to use for plugin lookup.
<pluginGroup>com.your.plugins</pluginGroup>
–>
<pluginGroup>org.mortbay.jetty</pluginGroup>
</pluginGroups>

Leave a comment