Maven

The main problem stemmed from the version of Apache Tomcat I was using. The struts2 archetype requires a JavaEE container. It wanted me to use the TomcatEE or TomEE server. I installed it in NetBeans in the project folder right next to the other server.

 

To get the project running, clone the master branch. Open the project, right click properties and set run to TomEE with JavaEE 6 Web.

https://github.com/milesgwood/MavMoebot.git
Server Tomcat EE settings

TomEE

  1. Create a new project to Maven project.
  2. Use the struts2 archetype.
  3. Deploy to check that it works
  4. Swap out the struts2 file with your data. struts.xml
  5. put your hibernate.cfg.xml file in the source packages folder
    1. It has to be in the source packages folder project>src>main>java>file.xml
    2. It also has to be in project>src>main>resources>file.xml

Added the struts2 dependency.

Added the hibernate dependency.

What path do the actual java files get added at?

Add new java classes. Then the dependencies are automatically added like JUnit. To compile the project just use Custom>Goals and write compile. Or just run the project.

For some reason this error keeps reappearing whenever I try to clone the project on just the src side and not the target side.

20-Feb-2017 21:44:55.025 SEVERE [http-nio-8080-exec-150] org.apache.catalina.core.StandardContext.filterStart Exception starting filter struts2
 Unable to load configuration. - interceptor - jar:file:/Users/vicetad/NetBeansProjects/mavenproject2/target/webapp/WEB-INF/lib/struts2-core-2.3.1.2.jar!/struts-default.xml:133:116
 at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:449)
 at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:69)
 at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:51)
 at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:279)
 at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260)
 at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:105)
 at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4572)
 at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5215)
 at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
 at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:724)
 at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:700)
 at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
 at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:596)
 at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:467)
 at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1617)
 at sun.reflect.GeneratedMethodAccessor140.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:498)
 at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300)
 at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
 at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
 at org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1483)
 at org.apache.catalina.manager.ManagerServlet.deploy(ManagerServlet.java:904)
 at org.apache.catalina.manager.ManagerServlet.doGet(ManagerServlet.java:336)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
 at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
 at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:108)
 at org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:44)
 at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:589)
 at org.apache.catalina.valves.RequestFilterValve.process(RequestFilterValve.java:319)
 at org.apache.catalina.valves.RemoteAddrValve.invoke(RemoteAddrValve.java:88)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
 at org.apache.tomee.catalina.OpenEJBSecurityListener$RequestCapturer.invoke(OpenEJBSecurityListener.java:97)
 at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620)
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349)
 at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:784)
 at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
 at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:802)
 at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1410)
 at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
 at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
 at java.lang.Thread.run(Thread.java:745)
Caused by: Unable to load configuration. - interceptor - jar:file:/Users/vicetad/NetBeansProjects/mavenproject2/target/webapp/WEB-INF/lib/struts2-core-2.3.1.2.jar!/struts-default.xml:133:116
 at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:69)
 at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:390)
 at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:436)
 ... 54 more
Caused by: Caught Exception while registering Interceptor class com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor - interceptor - jar:file:/Users/vicetad/NetBeansProjects/mavenproject2/target/webapp/WEB-INF/lib/struts2-core-2.3.1.2.jar!/struts-default.xml:133:116
 at com.opensymphony.xwork2.ObjectFactory.buildInterceptor(ObjectFactory.java:213)
 at com.opensymphony.xwork2.config.providers.InterceptorBuilder.constructParameterizedInterceptorReferences(InterceptorBuilder.java:185)
 at com.opensymphony.xwork2.config.providers.InterceptorBuilder.constructInterceptorReference(InterceptorBuilder.java:85)
 at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.lookupInterceptorReference(XmlConfigurationProvider.java:1035)
 at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadInterceptorStack(XmlConfigurationProvider.java:852)
 at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadInterceptorStacks(XmlConfigurationProvider.java:865)
 at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadInterceptors(XmlConfigurationProvider.java:888)
 at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:468)
 at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages(XmlConfigurationProvider.java:278)
 at org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:112)
 at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:204)
 at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:66)
 ... 56 more
Caused by: java.lang.NullPointerException
 at org.apache.struts2.cdi.CdiObjectFactory.getInjectionTarget(CdiObjectFactory.java:125)
 at org.apache.struts2.cdi.CdiObjectFactory.buildBean(CdiObjectFactory.java:101)
 at com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:150)
 at com.opensymphony.xwork2.ObjectFactory.buildInterceptor(ObjectFactory.java:191)
 ... 67 more

This is a problem with struts 2 that I can’t seem to identify.