NullPointerException - com.opensymphony.xwork2.util.FileManager$FileRevision.needsReloading(FileManager.java:209) of "Apache Struts 2 Web Application Development" book

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

NullPointerException - com.opensymphony.xwork2.util.FileManager$FileRevision.needsReloading(FileManager.java:209) of "Apache Struts 2 Web Application Development" book

albert kao-2
I downloaded the source code of the book "Apache Struts 2 Web Application
Development" by Dave Newton from the
https://www.packtpub.com/books/content/support.

Chapter 2 had compile error with Apache Maven 3.5.0.
$ mvn -version
Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426;
2017-04-03T15:39:06-04:00)
Maven home: /home/alkao/maven/apache-maven-3.5.0
Java version: 1.8.0_144, vendor: Oracle Corporation
Java home: /home/alkao/jdk/jdk1.8.0_144/jre
Default locale: en_CA, platform encoding: UTF-8
OS name: "linux", version: "4.4.0-21-generic", arch: "i386", family: "unix"

To fix it, I removed just the <scope> tag in pom.xml.
Then run mvn:
$ cd
/home/alkao/Struts2/Apache_Struts_2_Web_Application_Development/ch02/sanity
$ mvn clean package

Running wildfly-10.1.0.Final:
$ JBOSS_HOME/bin/standalone.sh
$ jboss-cli.sh --connect --command="deploy
/home/alkao/Struts2/Apache_Struts_2_Web_Application_Development/ch02/sanity/target/ch02-sanity-1.0.war
--force"

Running these 3 http links resulted in the same error in the web browser
below.
Please help. Thanks.
http://localhost:8080/ch02-sanity-1.0/index.html
http://localhost:8080/ch02-sanity-1.0/sanity.jsp
http://localhost:8080/ch02-sanity-1.0/sanity.action




Error processing request
Context Path:
/ch02-convention-1.0

Servlet Path:
/index.html

Path Info:
null

Query String:
null

Stack Trace
java.lang.NullPointerException
com.opensymphony.xwork2.util.FileManager$FileRevision.needsReloading(FileManager.java:209)
com.opensymphony.xwork2.util.FileManager.fileNeedsReloading(FileManager.java:60)
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.needsReload(XmlConfigurationProvider.java:325)
org.apache.struts2.config.StrutsXmlConfigurationProvider.needsReload(StrutsXmlConfigurationProvider.java:168)
com.opensymphony.xwork2.config.ConfigurationManager.conditionalReload(ConfigurationManager.java:220)
com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:61)
org.apache.struts2.dispatcher.Dispatcher.getContainer(Dispatcher.java:774)
org.apache.struts2.dispatcher.ng.InitOperations.initStaticContentLoader(InitOperations.java:77)
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:49)
io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:111)
org.wildfly.extension.undertow.security.RunAsLifecycleInterceptor.init(RunAsLifecycleInterceptor.java:84)
io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:97)
io.undertow.servlet.core.ManagedFilter.createFilter(ManagedFilter.java:80)
io.undertow.servlet.core.ManagedFilter.getFilter(ManagedFilter.java:66)
io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)
io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)
io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)
io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)
io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:292)
io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81)
io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138)
io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135)
io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)
io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272)
io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)
io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104)
io.undertow.server.Connectors.executeRootHandler(Connectors.java:202)
io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:805)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
java.lang.Thread.run(Thread.java:748)
Reply | Threaded
Open this post in threaded view
|

Re: NullPointerException - com.opensymphony.xwork2.util.FileManager$FileRevision.needsReloading(FileManager.java:209) of "Apache Struts 2 Web Application Development" book

Dave Newton-6
What version of Struts 2 are you attempting to use?

On Sat, Nov 11, 2017 at 5:58 PM albert kao <[hidden email]> wrote:

> I downloaded the source code of the book "Apache Struts 2 Web Application
> Development" by Dave Newton from the
> https://www.packtpub.com/books/content/support.
>
> Chapter 2 had compile error with Apache Maven 3.5.0.
> $ mvn -version
> Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426;
> 2017-04-03T15:39:06-04:00)
> Maven home: /home/alkao/maven/apache-maven-3.5.0
> Java version: 1.8.0_144, vendor: Oracle Corporation
> Java home: /home/alkao/jdk/jdk1.8.0_144/jre
> Default locale: en_CA, platform encoding: UTF-8
> OS name: "linux", version: "4.4.0-21-generic", arch: "i386", family: "unix"
>
> To fix it, I removed just the <scope> tag in pom.xml.
> Then run mvn:
> $ cd
> /home/alkao/Struts2/Apache_Struts_2_Web_Application_Development/ch02/sanity
> $ mvn clean package
>
> Running wildfly-10.1.0.Final:
> $ JBOSS_HOME/bin/standalone.sh
> $ jboss-cli.sh --connect --command="deploy
>
> /home/alkao/Struts2/Apache_Struts_2_Web_Application_Development/ch02/sanity/target/ch02-sanity-1.0.war
> --force"
>
> Running these 3 http links resulted in the same error in the web browser
> below.
> Please help. Thanks.
> http://localhost:8080/ch02-sanity-1.0/index.html
> http://localhost:8080/ch02-sanity-1.0/sanity.jsp
> http://localhost:8080/ch02-sanity-1.0/sanity.action
>
>
>
>
> Error processing request
> Context Path:
> /ch02-convention-1.0
>
> Servlet Path:
> /index.html
>
> Path Info:
> null
>
> Query String:
> null
>
> Stack Trace
> java.lang.NullPointerException
>
> com.opensymphony.xwork2.util.FileManager$FileRevision.needsReloading(FileManager.java:209)
>
> com.opensymphony.xwork2.util.FileManager.fileNeedsReloading(FileManager.java:60)
>
> com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.needsReload(XmlConfigurationProvider.java:325)
>
> org.apache.struts2.config.StrutsXmlConfigurationProvider.needsReload(StrutsXmlConfigurationProvider.java:168)
>
> com.opensymphony.xwork2.config.ConfigurationManager.conditionalReload(ConfigurationManager.java:220)
>
> com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:61)
> org.apache.struts2.dispatcher.Dispatcher.getContainer(Dispatcher.java:774)
>
> org.apache.struts2.dispatcher.ng.InitOperations.initStaticContentLoader(InitOperations.java:77)
>
> org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:49)
>
> io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:111)
>
> org.wildfly.extension.undertow.security.RunAsLifecycleInterceptor.init(RunAsLifecycleInterceptor.java:84)
>
> io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:97)
> io.undertow.servlet.core.ManagedFilter.createFilter(ManagedFilter.java:80)
> io.undertow.servlet.core.ManagedFilter.getFilter(ManagedFilter.java:66)
> io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
>
> io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
>
> io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)
>
> io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
>
> io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
>
> org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
>
> io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
>
> io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)
>
> io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
>
> io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
>
> io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
>
> io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
>
> io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)
>
> io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
>
> io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)
>
> io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
>
> io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
>
> org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
>
> io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
>
> io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
>
> io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:292)
>
> io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81)
>
> io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138)
>
> io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135)
>
> io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)
>
> io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
>
> io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
>
> io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
>
> io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
>
> io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
>
> io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
>
> io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272)
>
> io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)
>
> io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104)
> io.undertow.server.Connectors.executeRootHandler(Connectors.java:202)
> io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:805)
>
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
> java.lang.Thread.run(Thread.java:748)
>
--
e: [hidden email]
m: 908-380-8699
s: davelnewton_skype
t: @dave_newton <https://twitter.com/dave_newton>
b: Bucky Bits <http://buckybits.blogspot.com/>
g: davelnewton <https://github.com/davelnewton>
so: Dave Newton <http://stackoverflow.com/users/438992/dave-newton>
Reply | Threaded
Open this post in threaded view
|

Re: NullPointerException - com.opensymphony.xwork2.util.FileManager$FileRevision.needsReloading(FileManager.java:209) of "Apache Struts 2 Web Application Development" book

albert kao-2
struts2 version: 2.1.6

On Sat, Nov 11, 2017 at 9:47 PM, Dave Newton <[hidden email]> wrote:

> What version of Struts 2 are you attempting to use?
>
> On Sat, Nov 11, 2017 at 5:58 PM albert kao <[hidden email]> wrote:
>
> > I downloaded the source code of the book "Apache Struts 2 Web Application
> > Development" by Dave Newton from the
> > https://www.packtpub.com/books/content/support.
> >
> > Chapter 2 had compile error with Apache Maven 3.5.0.
> > $ mvn -version
> > Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426;
> > 2017-04-03T15:39:06-04:00)
> > Maven home: /home/alkao/maven/apache-maven-3.5.0
> > Java version: 1.8.0_144, vendor: Oracle Corporation
> > Java home: /home/alkao/jdk/jdk1.8.0_144/jre
> > Default locale: en_CA, platform encoding: UTF-8
> > OS name: "linux", version: "4.4.0-21-generic", arch: "i386", family:
> "unix"
> >
> > To fix it, I removed just the <scope> tag in pom.xml.
> > Then run mvn:
> > $ cd
> > /home/alkao/Struts2/Apache_Struts_2_Web_Application_
> Development/ch02/sanity
> > $ mvn clean package
> >
> > Running wildfly-10.1.0.Final:
> > $ JBOSS_HOME/bin/standalone.sh
> > $ jboss-cli.sh --connect --command="deploy
> >
> > /home/alkao/Struts2/Apache_Struts_2_Web_Application_
> Development/ch02/sanity/target/ch02-sanity-1.0.war
> > --force"
> >
> > Running these 3 http links resulted in the same error in the web browser
> > below.
> > Please help. Thanks.
> > http://localhost:8080/ch02-sanity-1.0/index.html
> > http://localhost:8080/ch02-sanity-1.0/sanity.jsp
> > http://localhost:8080/ch02-sanity-1.0/sanity.action
> >
> >
> >
> >
> > Error processing request
> > Context Path:
> > /ch02-convention-1.0
> >
> > Servlet Path:
> > /index.html
> >
> > Path Info:
> > null
> >
> > Query String:
> > null
> >
> > Stack Trace
> > java.lang.NullPointerException
> >
> > com.opensymphony.xwork2.util.FileManager$FileRevision.
> needsReloading(FileManager.java:209)
> >
> > com.opensymphony.xwork2.util.FileManager.fileNeedsReloading(
> FileManager.java:60)
> >
> > com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.
> needsReload(XmlConfigurationProvider.java:325)
> >
> > org.apache.struts2.config.StrutsXmlConfigurationProvider.needsReload(
> StrutsXmlConfigurationProvider.java:168)
> >
> > com.opensymphony.xwork2.config.ConfigurationManager.conditionalReload(
> ConfigurationManager.java:220)
> >
> > com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(
> ConfigurationManager.java:61)
> > org.apache.struts2.dispatcher.Dispatcher.getContainer(
> Dispatcher.java:774)
> >
> > org.apache.struts2.dispatcher.ng.InitOperations.initStaticContentLoader(
> InitOperations.java:77)
> >
> > org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.
> init(StrutsPrepareAndExecuteFilter.java:49)
> >
> > io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(
> LifecyleInterceptorInvocation.java:111)
> >
> > org.wildfly.extension.undertow.security.RunAsLifecycleInterceptor.init(
> RunAsLifecycleInterceptor.java:84)
> >
> > io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(
> LifecyleInterceptorInvocation.java:97)
> > io.undertow.servlet.core.ManagedFilter.createFilter(
> ManagedFilter.java:80)
> > io.undertow.servlet.core.ManagedFilter.getFilter(ManagedFilter.java:66)
> > io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
> >
> > io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.
> doFilter(FilterHandler.java:131)
> >
> > io.undertow.servlet.handlers.FilterHandler.handleRequest(
> FilterHandler.java:84)
> >
> > io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.
> handleRequest(ServletSecurityRoleHandler.java:62)
> >
> > io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(
> ServletDispatchingHandler.java:36)
> >
> > org.wildfly.extension.undertow.security.SecurityContextAssociationHand
> ler.handleRequest(SecurityContextAssociationHandler.java:78)
> >
> > io.undertow.server.handlers.PredicateHandler.handleRequest(
> PredicateHandler.java:43)
> >
> > io.undertow.servlet.handlers.security.SSLInformationAssociationHandl
> er.handleRequest(SSLInformationAssociationHandler.java:131)
> >
> > io.undertow.servlet.handlers.security.ServletAuthenticationCallHandl
> er.handleRequest(ServletAuthenticationCallHandler.java:57)
> >
> > io.undertow.server.handlers.PredicateHandler.handleRequest(
> PredicateHandler.java:43)
> >
> > io.undertow.security.handlers.AbstractConfidentialityHandler
> .handleRequest(AbstractConfidentialityHandler.java:46)
> >
> > io.undertow.servlet.handlers.security.ServletConfidentialityConstrai
> ntHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
> >
> > io.undertow.security.handlers.AuthenticationMechanismsHandle
> r.handleRequest(AuthenticationMechanismsHandler.java:60)
> >
> > io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHand
> ler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
> >
> > io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(
> NotificationReceiverHandler.java:50)
> >
> > io.undertow.security.handlers.AbstractSecurityContextAssocia
> tionHandler.handleRequest(AbstractSecurityContextAssocia
> tionHandler.java:43)
> >
> > io.undertow.server.handlers.PredicateHandler.handleRequest(
> PredicateHandler.java:43)
> >
> > org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.
> handleRequest(JACCContextIdHandler.java:61)
> >
> > io.undertow.server.handlers.PredicateHandler.handleRequest(
> PredicateHandler.java:43)
> >
> > io.undertow.server.handlers.PredicateHandler.handleRequest(
> PredicateHandler.java:43)
> >
> > io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(
> ServletInitialHandler.java:292)
> >
> > io.undertow.servlet.handlers.ServletInitialHandler.access$
> 100(ServletInitialHandler.java:81)
> >
> > io.undertow.servlet.handlers.ServletInitialHandler$2.call(
> ServletInitialHandler.java:138)
> >
> > io.undertow.servlet.handlers.ServletInitialHandler$2.call(
> ServletInitialHandler.java:135)
> >
> > io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(
> ServletRequestContextThreadSetupAction.java:48)
> >
> > io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(
> ContextClassLoaderSetupAction.java:43)
> >
> > io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(
> LegacyThreadSetupActionWrapper.java:44)
> >
> > io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(
> LegacyThreadSetupActionWrapper.java:44)
> >
> > io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(
> LegacyThreadSetupActionWrapper.java:44)
> >
> > io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(
> LegacyThreadSetupActionWrapper.java:44)
> >
> > io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(
> LegacyThreadSetupActionWrapper.java:44)
> >
> > io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(
> ServletInitialHandler.java:272)
> >
> > io.undertow.servlet.handlers.ServletInitialHandler.access$
> 000(ServletInitialHandler.java:81)
> >
> > io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(
> ServletInitialHandler.java:104)
> > io.undertow.server.Connectors.executeRootHandler(Connectors.java:202)
> > io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:805)
> >
> > java.util.concurrent.ThreadPoolExecutor.runWorker(
> ThreadPoolExecutor.java:1149)
> >
> > java.util.concurrent.ThreadPoolExecutor$Worker.run(
> ThreadPoolExecutor.java:624)
> > java.lang.Thread.run(Thread.java:748)
> >
> --
> e: [hidden email]
> m: 908-380-8699
> s: davelnewton_skype
> t: @dave_newton <https://twitter.com/dave_newton>
> b: Bucky Bits <http://buckybits.blogspot.com/>
> g: davelnewton <https://github.com/davelnewton>
> so: Dave Newton <http://stackoverflow.com/users/438992/dave-newton>
>
Reply | Threaded
Open this post in threaded view
|

Re: NullPointerException - com.opensymphony.xwork2.util.FileManager$FileRevision.needsReloading(FileManager.java:209) of "Apache Struts 2 Web Application Development" book

Dave Newton-6
Please create a GitHub repo with your code and I'll take a look. Note that
the examples from the book were tested only on Tomcat, and a pretty long
time ago. I'll need any server details you're using.

Also note that S2 is fairly different now than when the book was written.

On Sun, Nov 12, 2017 at 8:26 AM albert kao <[hidden email]> wrote:

> struts2 version: 2.1.6
>
> On Sat, Nov 11, 2017 at 9:47 PM, Dave Newton <[hidden email]>
> wrote:
>
> > What version of Struts 2 are you attempting to use?
> >
> > On Sat, Nov 11, 2017 at 5:58 PM albert kao <[hidden email]> wrote:
> >
> > > I downloaded the source code of the book "Apache Struts 2 Web
> Application
> > > Development" by Dave Newton from the
> > > https://www.packtpub.com/books/content/support.
> > >
> > > Chapter 2 had compile error with Apache Maven 3.5.0.
> > > $ mvn -version
> > > Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426;
> > > 2017-04-03T15:39:06-04:00)
> > > Maven home: /home/alkao/maven/apache-maven-3.5.0
> > > Java version: 1.8.0_144, vendor: Oracle Corporation
> > > Java home: /home/alkao/jdk/jdk1.8.0_144/jre
> > > Default locale: en_CA, platform encoding: UTF-8
> > > OS name: "linux", version: "4.4.0-21-generic", arch: "i386", family:
> > "unix"
> > >
> > > To fix it, I removed just the <scope> tag in pom.xml.
> > > Then run mvn:
> > > $ cd
> > > /home/alkao/Struts2/Apache_Struts_2_Web_Application_
> > Development/ch02/sanity
> > > $ mvn clean package
> > >
> > > Running wildfly-10.1.0.Final:
> > > $ JBOSS_HOME/bin/standalone.sh
> > > $ jboss-cli.sh --connect --command="deploy
> > >
> > > /home/alkao/Struts2/Apache_Struts_2_Web_Application_
> > Development/ch02/sanity/target/ch02-sanity-1.0.war
> > > --force"
> > >
> > > Running these 3 http links resulted in the same error in the web
> browser
> > > below.
> > > Please help. Thanks.
> > > http://localhost:8080/ch02-sanity-1.0/index.html
> > > http://localhost:8080/ch02-sanity-1.0/sanity.jsp
> > > http://localhost:8080/ch02-sanity-1.0/sanity.action
> > >
> > >
> > >
> > >
> > > Error processing request
> > > Context Path:
> > > /ch02-convention-1.0
> > >
> > > Servlet Path:
> > > /index.html
> > >
> > > Path Info:
> > > null
> > >
> > > Query String:
> > > null
> > >
> > > Stack Trace
> > > java.lang.NullPointerException
> > >
> > > com.opensymphony.xwork2.util.FileManager$FileRevision.
> > needsReloading(FileManager.java:209)
> > >
> > > com.opensymphony.xwork2.util.FileManager.fileNeedsReloading(
> > FileManager.java:60)
> > >
> > > com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.
> > needsReload(XmlConfigurationProvider.java:325)
> > >
> > > org.apache.struts2.config.StrutsXmlConfigurationProvider.needsReload(
> > StrutsXmlConfigurationProvider.java:168)
> > >
> > > com.opensymphony.xwork2.config.ConfigurationManager.conditionalReload(
> > ConfigurationManager.java:220)
> > >
> > > com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(
> > ConfigurationManager.java:61)
> > > org.apache.struts2.dispatcher.Dispatcher.getContainer(
> > Dispatcher.java:774)
> > >
> > >
> org.apache.struts2.dispatcher.ng.InitOperations.initStaticContentLoader(
> > InitOperations.java:77)
> > >
> > > org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.
> > init(StrutsPrepareAndExecuteFilter.java:49)
> > >
> > > io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(
> > LifecyleInterceptorInvocation.java:111)
> > >
> > > org.wildfly.extension.undertow.security.RunAsLifecycleInterceptor.init(
> > RunAsLifecycleInterceptor.java:84)
> > >
> > > io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(
> > LifecyleInterceptorInvocation.java:97)
> > > io.undertow.servlet.core.ManagedFilter.createFilter(
> > ManagedFilter.java:80)
> > > io.undertow.servlet.core.ManagedFilter.getFilter(ManagedFilter.java:66)
> > > io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
> > >
> > > io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.
> > doFilter(FilterHandler.java:131)
> > >
> > > io.undertow.servlet.handlers.FilterHandler.handleRequest(
> > FilterHandler.java:84)
> > >
> > > io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.
> > handleRequest(ServletSecurityRoleHandler.java:62)
> > >
> > > io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(
> > ServletDispatchingHandler.java:36)
> > >
> > > org.wildfly.extension.undertow.security.SecurityContextAssociationHand
> > ler.handleRequest(SecurityContextAssociationHandler.java:78)
> > >
> > > io.undertow.server.handlers.PredicateHandler.handleRequest(
> > PredicateHandler.java:43)
> > >
> > > io.undertow.servlet.handlers.security.SSLInformationAssociationHandl
> > er.handleRequest(SSLInformationAssociationHandler.java:131)
> > >
> > > io.undertow.servlet.handlers.security.ServletAuthenticationCallHandl
> > er.handleRequest(ServletAuthenticationCallHandler.java:57)
> > >
> > > io.undertow.server.handlers.PredicateHandler.handleRequest(
> > PredicateHandler.java:43)
> > >
> > > io.undertow.security.handlers.AbstractConfidentialityHandler
> > .handleRequest(AbstractConfidentialityHandler.java:46)
> > >
> > > io.undertow.servlet.handlers.security.ServletConfidentialityConstrai
> > ntHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
> > >
> > > io.undertow.security.handlers.AuthenticationMechanismsHandle
> > r.handleRequest(AuthenticationMechanismsHandler.java:60)
> > >
> > > io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHand
> > ler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
> > >
> > >
> io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(
> > NotificationReceiverHandler.java:50)
> > >
> > > io.undertow.security.handlers.AbstractSecurityContextAssocia
> > tionHandler.handleRequest(AbstractSecurityContextAssocia
> > tionHandler.java:43)
> > >
> > > io.undertow.server.handlers.PredicateHandler.handleRequest(
> > PredicateHandler.java:43)
> > >
> > > org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.
> > handleRequest(JACCContextIdHandler.java:61)
> > >
> > > io.undertow.server.handlers.PredicateHandler.handleRequest(
> > PredicateHandler.java:43)
> > >
> > > io.undertow.server.handlers.PredicateHandler.handleRequest(
> > PredicateHandler.java:43)
> > >
> > > io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(
> > ServletInitialHandler.java:292)
> > >
> > > io.undertow.servlet.handlers.ServletInitialHandler.access$
> > 100(ServletInitialHandler.java:81)
> > >
> > > io.undertow.servlet.handlers.ServletInitialHandler$2.call(
> > ServletInitialHandler.java:138)
> > >
> > > io.undertow.servlet.handlers.ServletInitialHandler$2.call(
> > ServletInitialHandler.java:135)
> > >
> > > io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(
> > ServletRequestContextThreadSetupAction.java:48)
> > >
> > > io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(
> > ContextClassLoaderSetupAction.java:43)
> > >
> > > io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(
> > LegacyThreadSetupActionWrapper.java:44)
> > >
> > > io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(
> > LegacyThreadSetupActionWrapper.java:44)
> > >
> > > io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(
> > LegacyThreadSetupActionWrapper.java:44)
> > >
> > > io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(
> > LegacyThreadSetupActionWrapper.java:44)
> > >
> > > io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(
> > LegacyThreadSetupActionWrapper.java:44)
> > >
> > > io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(
> > ServletInitialHandler.java:272)
> > >
> > > io.undertow.servlet.handlers.ServletInitialHandler.access$
> > 000(ServletInitialHandler.java:81)
> > >
> > > io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(
> > ServletInitialHandler.java:104)
> > > io.undertow.server.Connectors.executeRootHandler(Connectors.java:202)
> > >
> io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:805)
> > >
> > > java.util.concurrent.ThreadPoolExecutor.runWorker(
> > ThreadPoolExecutor.java:1149)
> > >
> > > java.util.concurrent.ThreadPoolExecutor$Worker.run(
> > ThreadPoolExecutor.java:624)
> > > java.lang.Thread.run(Thread.java:748)
> > >
> > --
> > e: [hidden email]
> > m: 908-380-8699
> > s: davelnewton_skype
> > t: @dave_newton <https://twitter.com/dave_newton>
> > b: Bucky Bits <http://buckybits.blogspot.com/>
> > g: davelnewton <https://github.com/davelnewton>
> > so: Dave Newton <http://stackoverflow.com/users/438992/dave-newton>
> >
>
--
e: [hidden email]
m: 908-380-8699
s: davelnewton_skype
t: @dave_newton <https://twitter.com/dave_newton>
b: Bucky Bits <http://buckybits.blogspot.com/>
g: davelnewton <https://github.com/davelnewton>
so: Dave Newton <http://stackoverflow.com/users/438992/dave-newton>
Reply | Threaded
Open this post in threaded view
|

Re: NullPointerException - com.opensymphony.xwork2.util.FileManager$FileRevision.needsReloading(FileManager.java:209) of "Apache Struts 2 Web Application Development" book

Yasser Zamani
In reply to this post by albert kao-2


On 11/12/2017 2:28 AM, albert kao wrote:
> java.lang.NullPointerException
> com.opensymphony.xwork2.util.FileManager$FileRevision.needsReloading(FileManager.java:209)

I just googled "needsReloading(FileManager.java:209)" and found [1] :)
it seems has been a bug and has fixed in 2.1.8.

[1] https://issues.apache.org/jira/browse/WW-2956

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: NullPointerException - com.opensymphony.xwork2.util.FileManager$FileRevision.needsReloading(FileManager.java:209) of "Apache Struts 2 Web Application Development" book

albert kao-2
As per your suggestion, changing struts2 version to 2.1.8 fix the problem.
Thanks!

On Sun, Nov 12, 2017 at 12:29 PM, Yasser Zamani <[hidden email]>
wrote:

>
>
> On 11/12/2017 2:28 AM, albert kao wrote:
> > java.lang.NullPointerException
> > com.opensymphony.xwork2.util.FileManager$FileRevision.
> needsReloading(FileManager.java:209)
>
> I just googled "needsReloading(FileManager.java:209)" and found [1] :)
> it seems has been a bug and has fixed in 2.1.8.
>
> [1] https://issues.apache.org/jira/browse/WW-2956
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>