title: Struts2 + Tiles + NETBEANS
body: <p><strong>I am a beginner to Struts2 and have successfully implemented simple examples.</strong></p>
  
  <p>I am getting problem with Tiles</p>
  
  <p>I refereed from this site
  <a href="http://www.dzone.com/tutorials/java/struts-2/struts-2-example/struts-2-tiles-example-1.html" rel="nofollow noreferrer">http://www.dzone.com/tutorials/java/struts-2/struts-2-example/struts-2-tiles-example-1.html</a></p>
  
  <p>and my files are exact same as given in that website mentioned above  </p>
  
  <p>I am using :
  Netbeans ide 7.3 , struts 2 , glassfish 3.1.2.2
  <strong><em>(note : The downloadable file from the tutorials site works in EclipseIDE , what do i need to add extra in netbeans)</em></strong></p>
  
  <p>here is my error from GlassFish :</p>
  
  <p>**HTTP Status 404 **</p>
  
  <p>type : Status report</p>
  
  <p>description : The requested resource () is not available.</p>
  
  <hr>
  
  <pre><code> INFO: Removing TilesContext for context: org.apache.catalina.core.ApplicationContextFacade
  INFO: Initializing Tiles2 application context. . .
  WARNING: Cannot find TilesContextFactory class org.apache.tiles.portlet.context.PortletTilesApplicationContextFactory
  INFO: Finished initializing Tiles2 application context.
  WARNING: Cannot find TilesContextFactory class org.apache.tiles.portlet.context.PortletTilesApplicationContextFactory
  INFO: Initializing Tiles2 container. . .
  WARNING: Cannot find TilesContextFactory class org.apache.tiles.portlet.context.PortletTilesApplicationContextFactory
  WARNING: Cannot find TilesRequestContextFactory class org.apache.tiles.portlet.context.PortletTilesRequestContextFactory
  INFO: Tiles2 container initialized
  INFO: Publishing TilesContext for context: org.apache.tiles.servlet.context.ServletTilesApplicationContext
  INFO: Parsing configuration file [struts-default.xml]
  SEVERE: WebModule[/StrutsTiles1]PWC1270: Exception starting filter struts2
  java.lang.InstantiationException
  </code></pre>
  
  <p>Tried both library styles
  ie : netbeans plugins + tiles extra and all jar only</p>
  
  <p><img src="https://i.stack.imgur.com/0MV5n.jpg" alt="enter image description here">
  <img src="https://i.stack.imgur.com/UBquw.jpg" alt="enter image description here"></p>
  
  <p>Complete error log</p>
  
  <pre><code>INFO: Removing TilesContext for context: org.apache.catalina.core.ApplicationContextFacade
  INFO: Initializing Tiles2 application context. . .
  WARNING: Cannot find TilesContextFactory class org.apache.tiles.portlet.context.PortletTilesApplicationContextFactory
  INFO: Finished initializing Tiles2 application context.
  WARNING: Cannot find TilesContextFactory class org.apache.tiles.portlet.context.PortletTilesApplicationContextFactory
  INFO: Initializing Tiles2 container. . .
  WARNING: Cannot find TilesContextFactory class org.apache.tiles.portlet.context.PortletTilesApplicationContextFactory
  WARNING: Cannot find TilesRequestContextFactory class org.apache.tiles.portlet.context.PortletTilesRequestContextFactory
  INFO: Tiles2 container initialized
  INFO: Publishing TilesContext for context: org.apache.tiles.servlet.context.ServletTilesApplicationContext
  INFO: Parsing configuration file [struts-default.xml]
  SEVERE: WebModule[/StrutsTiles1]PWC1270: Exception starting filter struts2
  java.lang.InstantiationException
      at org.apache.catalina.core.ApplicationFilterConfig.&lt;init&gt;(ApplicationFilterConfig.java:124)
      at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4685)
      at org.apache.catalina.core.StandardContext.start(StandardContext.java:5377)
      at com.sun.enterprise.web.WebModule.start(WebModule.java:498)
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:917)
      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:901)
      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:733)
      at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2019)
      at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1669)
      at com.sun.enterprise.web.WebApplication.start(WebApplication.java:109)
      at org.glassfish.internal.data.EngineRef.start(EngineRef.java:130)
      at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:269)
      at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:301)
      at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:461)
      at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
      at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:389)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:353)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:363)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1085)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:95)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1291)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1259)
      at org.glassfish.deployment.admin.ReDeployCommand.execute(ReDeployCommand.java:126)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:348)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:363)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1085)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:95)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1291)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1259)
      at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:461)
      at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:212)
      at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:179)
      at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)
      at com.sun.enterprise.v3.services.impl.ContainerMapper$Hk2DispatcherCallable.call(ContainerMapper.java:354)
      at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
      at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
      at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
      at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
      at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
      at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
      at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
      at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
      at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
      at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
      at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
      at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
      at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
      at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
      at java.lang.Thread.run(Thread.java:722)
  Caused by: Unable to load configuration. - bean - jar:file:/C:/Documents%20and%20Settings/chiya/My%20Documents/Downloads/StrutsTiles1/build/web/WEB-INF/lib/struts2-core-2.3.4.jar!/struts-default.xml:29:72
      at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:58)
      at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:360)
      at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:403)
      at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:69)
      at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:48)
      at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:264)
      at org.apache.catalina.core.ApplicationFilterConfig.&lt;init&gt;(ApplicationFilterConfig.java:120)
      ... 48 more
  Caused by: Unable to load bean: type: class:com.opensymphony.xwork2.ObjectFactory - bean - jar:file:/C:/Documents%20and%20Settings/chiya/My%20Documents/Downloads/StrutsTiles1/build/web/WEB-INF/lib/struts2-core-2.3.4.jar!/struts-default.xml:29:72
      at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:222)
      at org.apache.struts2.config.StrutsXmlConfigurationProvider.register(StrutsXmlConfigurationProvider.java:101)
      at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:165)
      at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:55)
      ... 54 more
  Caused by: Bean type class com.opensymphony.xwork2.ObjectFactory with the name xwork has already been loaded by bean - jar:file:/C:/Documents%20and%20Settings/chiya/My%20Documents/Downloads/StrutsTiles1/build/web/WEB-INF/lib/struts2-core-2.1.6.jar!/struts-default.xml:29:72 - bean - jar:file:/C:/Documents%20and%20Settings/chiya/My%20Documents/Downloads/StrutsTiles1/build/web/WEB-INF/lib/struts2-core-2.3.4.jar!/struts-default.xml:29:72
      at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:206)
      ... 57 more
  
  INFO: WEB0671: Loading application [StrutsTiles1] at [/StrutsTiles1]
  INFO: StrutsTiles1 was successfully deployed in 7,922 milliseconds.
  </code></pre>
  
  <p>HELP :)</p>