How to enable JSP compilation on the fly in Wildfly 9?

Im using Wildfly 9.0.0.CR2. How to enable JSP compilation on the fly? I found this configuration in another thread

<subsystem xmlns="urn:jboss:domain:web:1.4" default-virtual-server="default-host" native="false"> <configuration> <jsp-configuration development="true" check-interval="1" modification-test-interval="1" recompile-on-fail="true"/> </configuration> </subsystem> 

but alas, it does not work, leads to the fact that this exception is lower when I restart my JBoss server ...

  14:23:05,224 ERROR [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0055: Caught exception during boot: org.jboss.as.controller.persistence.ConfigurationPersistenceException: WFLYCTL0085: Failed to parse configuration at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:131) at org.jboss.as.server.ServerService.boot(ServerService.java:350) at org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:271) at java.lang.Thread.run(Thread.java:745) Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[442,2] Message: Unexpected element '{urn:jboss:domain:web:1.4}subsystem' at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:108) at org.jboss.staxmapper.XMLExtendedStreamReaderImpl.handleAny(XMLExtendedStreamReaderImpl.java:69) at org.jboss.as.server.parsing.StandaloneXml.parseServerProfile(StandaloneXml.java:1199) at org.jboss.as.server.parsing.StandaloneXml.readServerElement_1_4(StandaloneXml.java:457) at org.jboss.as.server.parsing.StandaloneXml.readElement(StandaloneXml.java:144) at org.jboss.as.server.parsing.StandaloneXml.readElement(StandaloneXml.java:106) at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:110) at org.jboss.staxmapper.XMLMapperImpl.parseDocument(XMLMapperImpl.java:69) at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:123) ... 3 more 
+4
source share
3 answers

This is an XML parsing issue, as evidenced by the javax.xml.stream.XMLStreamException: ParseError error message. The parsing for this particular line is Unexpected element{urn:jboss:domain:web:1.4}subsystem .

You can look at XML schema documents to find out these types of XML parsing problems. Schemes are located under the WildFly docs folder.

By the way, you should use the version of WildFly-9.0.1.Final build, as this is the latest version of the candidate release.

You will most likely need to make changes to the subsystem of the subsystem. I updated the example below:

  <subsystem xmlns="urn:jboss:domain:undertow:2.0"> <buffer-cache name="default"/> <server name="default-server"> <http-listener name="default" socket-binding="http" redirect-socket="https"/> <host name="default-host" alias="localhost"> <location name="/" handler="welcome-content"/> <filter-ref name="server-header"/> <filter-ref name="x-powered-by-header"/> </host> </server> <servlet-container name="default"> <jsp-config development="true" check-interval="1" modification-test-interval="1" recompile-on-fail="true"/> <websockets/> </servlet-container> <handlers> <file name="welcome-content" path="${jboss.home.dir}/welcome-content"/> </handlers> <filters> <response-header name="server-header" header-name="Server" header-value="WildFly/9"/> <response-header name="x-powered-by-header" header-name="X-Powered-By" header-value="Undertow/1"/> </filters> </subsystem> 

I highly recommend using the CLI to make these changes:

 /subsystem=undertow/servlet-container=default/setting=jsp:write-attribute(name=development,value=true) /subsystem=undertow/servlet-container=default/setting=jsp:write-attribute(name=recompile-on-fail,value=true) /subsystem=undertow/servlet-container=default/setting=jsp:write-attribute(name=check-interval,value=1) /subsystem=undertow/servlet-container=default/setting=jsp:write-attribute(name=modification-test-interval,value=1) 

This way you can avoid these XML parsing errors without having to find the exact XML schemas.

+3
source

Search engine and add this to jsp config

 <subsystem xmlns="urn:jboss:domain:undertow:1.1"><br>. . . .<br> <servlet-container name="default" default-buffer-cache="default" stack-trace-on-error="local-only"> <jsp-config development="true" check-interval="1" modification-test-interval="1" recompile-on-fail="true"/> 


+2
source

Make sure you download the pallet extension. Otherwise, the subsystem configuration cannot be loaded. Also, your syntax is correct.

 <extensions> <!-- other extensions here --> <extension module="org.wildfly.extension.undertow"/> </extensions> 
+1
source

All Articles