Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SAXNotRecognizedException exception on certain environments #311

Open
offtherailz opened this issue Oct 5, 2022 · 8 comments
Open

SAXNotRecognizedException exception on certain environments #311

offtherailz opened this issue Oct 5, 2022 · 8 comments

Comments

@offtherailz
Copy link
Member

offtherailz commented Oct 5, 2022

I wasn't able to replicate this directory but in the environment of @belom88 running MapStore cargo run on java 8 and 11.

Adding this

<cargo.jvmargs>
          -Djavax.xml.parsers.SAXParserFactory="com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl"
</cargo.jvmargs>

solved the problem

Log

INFO   2022-10-05 16:27:11.647   LogHelper.logPersistenceUnitInformation() - HHH000204: Processing PersistenceUnitInfo [name: geostore] 
INFO   2022-10-05 16:27:11.828   Version.logVersion() - HHH000412: Hibernate ORM core version 5.4.33.Final 
WARN   2022-10-05 16:27:12.191   EhcacheRegionFactory.<init>() - HHH020100: The Ehcache second-level cache provider for Hibernate is deprecated.  See https://hibernate.atlassian.net/browse/HHH-12441 for details. 
INFO   2022-10-05 16:27:12.232   JavaReflectionManager.<clinit>() - HCANN000001: Hibernate Commons Annotations {5.1.2.Final} 
INFO   2022-10-05 16:27:13.404   Dialect.<init>() - HHH000400: Using dialect: org.hibernate.dialect.H2Dialect 
INFO   2022-10-05 16:27:15.683   JtaPlatformInitiator.initiateService() - HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform] 
INFO   2022-10-05 16:27:16.226   GeoStoreInit.afterPropertiesSet() - ===== Starting GeoStore services ===== 
INFO   2022-10-05 16:27:16.227   GeoStoreInit.initPasswordEncoding() - === Set up the security system   ==== 
INFO   2022-10-05 16:27:16.228   GeoStoreInit.initPasswordEncoding() - Encoding Type:DIGEST 
WARN   2022-10-05 16:27:17.067   GeoStoreInit.afterPropertiesSet() - No category found. 
WARN   2022-10-05 16:27:17.068   GeoStoreInit.afterPropertiesSet() - Initializing categories from file /home/user/apps/MapStore2/product/target/apache-tomcat-8.5.69/webapps/mapstore/WEB-INF/classes/sample_categories.xml 
ERROR   2022-10-05 16:27:17.632   GeoStoreInit.initCategories() - Error while initting categories. Rolling back. 
java.lang.IllegalStateException: org.xml.sax.SAXNotRecognizedException: http://javax.xml.XMLConstants/feature/secure-processing
	at com.sun.xml.bind.v2.util.XmlFactory.createParserFactory(XmlFactory.java:143)
	at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.getXMLReader(UnmarshallerImpl.java:154)
	at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:157)
	at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:162)
	at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:171)
	at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:189)
	at it.geosolutions.geostore.init.GeoStoreInit.initCategories(GeoStoreInit.java:180)
	at it.geosolutions.geostore.init.GeoStoreInit.afterPropertiesSet(GeoStoreInit.java:89)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1863)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1800)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:953)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)
	at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:401)
	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:292)
	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:103)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4763)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5232)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:755)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:729)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:695)
	at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1016)
	at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1903)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:750)
Caused by: org.xml.sax.SAXNotRecognizedException: http://javax.xml.XMLConstants/feature/secure-processing
	at org.apache.xerces.parsers.AbstractSAXParser.setFeature(Unknown Source)
	at org.apache.xerces.jaxp.SAXParserImpl.setFeatures(Unknown Source)
	at org.apache.xerces.jaxp.SAXParserImpl.<init>(Unknown Source)
	at org.apache.xerces.jaxp.SAXParserFactoryImpl.newSAXParserImpl(Unknown Source)
	at org.apache.xerces.jaxp.SAXParserFactoryImpl.setFeature(Unknown Source)
	at com.sun.xml.bind.v2.util.XmlFactory.createParserFactory(XmlFactory.java:136)
	... 34 more
@offtherailz
Copy link
Member Author

offtherailz commented Jun 1, 2023

This issue can be replicated on MapStore when configuring external database (e.g. postgres) only on certain instances,

  • I used a ubuntu 22.04 provided by @randomorder that wasn't affected by this issue
  • while a local ubuntu 22.04 today, desktop, on virtualbox that I used for training rised the error. I fixed by manually editing jars inside WEB-INF/lib. Still have to identify what change exactly did the job.
  • also a docker compose for c044 produced the same error, and we had to fix ti with this https://github.com/geosolutions-it/npa-cgg/pull/355

@tdipisa should we create a mapstore issue for this?

@tdipisa
Copy link
Member

tdipisa commented Jun 1, 2023

not needed in the board we have both projects so you just need to add this to the MS board. we should also set a milestone. I would say 2023.02.00

@offtherailz
Copy link
Member Author

we have to create the milestone on this project too

@offtherailz offtherailz added this to the 2023.02.00 milestone Jun 1, 2023
@offtherailz
Copy link
Member Author

I created the milestone and associated with this issue, but the filter do not seems to work on my board. @tdipisa do you confirm? maybe I missed something

@offtherailz
Copy link
Member Author

Another use case has been notified to the mailing list here:
https://groups.google.com/g/mapstore-developers/c/NGQJV95rZFA/m/NYngrDd_AAAJ?utm_medium=email&utm_source=footer

@tdipisa tdipisa modified the milestones: 2023.02.00, 2022.01.00 Aug 25, 2023
@ale-cristofori
Copy link

@tdipisa and @offtherailz,

This is the same issue that was encountered while performing the training preparation.
The workaround fix for this issue, thanks to @offtherailz seems to be the following.

In the project webapp/mapstore/WEB-INF/lib folder (where all the jars files are contained).

REMOVE xercesImpl-2.4.0
ADD (REPLACE) https://repo1.maven.org/maven2/xerces/xercesImpl/2.12.0/xercesImpl-2.12.0.jar

REMOVE xml-apis-1.0.b2.jar
REMOVE xml-apis-1.3.04.jar

ADD https://repo1.maven.org/maven2/xml-apis/xml-apis/1.4.01/xml-apis-1.4.01.jar
ADD https://repo1.maven.org/maven2/xml-resolver/xml-resolver/1.2/xml-resolver-1.2.jar

@offtherailz
Copy link
Member Author

I was able to reproduce it locally during another installation and removing xercesImpl worked on tomcat9.
The very good thing is that I was able to verify that this issue is caused by printing lib and with print-lib 2.3-SNAPSHOT the jar is not included anymore !!! So probably this problem will be solved by itself in mapstore 2024.01.00

@tdipisa tdipisa removed this from the 2022.01.00 milestone Oct 25, 2023
@tdipisa
Copy link
Member

tdipisa commented Oct 25, 2023

Since there is no intention to maintain our old mapfish print fork I suppose we can close this issue then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants