I'm trying to make a webapp but I'm running into a problem.
First off, I've ran this webapp in Jetty and everything work perfectly. Now when I switch over to Apache tomcat 7 I'm getting errors.
The error that I receive is
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.NullPointerExceptionorg.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:681)org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:585)javax.servlet.http.HttpServlet.service(HttpServlet.java:647)javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
The root cause is
java.lang.NullPointerExceptionorg.eclipse.aether.examples.util.Booter.newRepositorySystemSession(Booter.java:41)
So I go over to that location and obviously I find out that its null.
So I'm wondering what is Tomcat doing that is making it null that jetty doesn't?
this is the fill that is returning null
public class ManualRepositorySystemFactory
{
public static RepositorySystem newRepositorySystem()
{
/*
* Aether's components implement org.eclipse.aether.spi.locator.Service to ease manual wiring and using the
* prepopulated DefaultServiceLocator, we only need to register the repository connector factories.
*/
DefaultServiceLocator locator = MavenRepositorySystemUtils.newServiceLocator();
locator.addService( RepositoryConnectorFactory.class, FileRepositoryConnectorFactory.class );
locator.addService( RepositoryConnectorFactory.class, WagonRepositoryConnectorFactory.class );
locator.setServices( WagonProvider.class, new ManualWagonProvider() );
//THis is the line that is returning a null
return locator.getService( RepositorySystem.class );
}
}
Edit
public class Booter
{
public static RepositorySystem newRepositorySystem()
{
return org.eclipse.aether.examples.manual.ManualRepositorySystemFactory.newRepositorySystem();
// return org.eclipse.aether.examples.guice.GuiceRepositorySystemFactory.newRepositorySystem();
// return org.eclipse.aether.examples.plexus.PlexusRepositorySystemFactory.newRepositorySystem();
}
public static DefaultRepositorySystemSession newRepositorySystemSession( RepositorySystem system )
{
DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession();
// LocalRepository localRepo = new LocalRepository( "target/local-repo" );
LocalRepository localRepo = new LocalRepository("target/local-repo/"); // For testing purposes dls to this directory, give an option later
///Users/Shared/dependencyBuilder/
session.setLocalRepositoryManager( system.newLocalRepositoryManager( session, localRepo ) ) // Line that gives me the error