> -----Original Message----- > From: Christopher Schultz [mailto:ch...@christopherschultz.net] > Sent: Friday, March 10, 2017 10:32 AM > To: Tomcat Users List <users@tomcat.apache.org> > Subject: Re: Moved app from TomEE to Tomcat, now getting Spring errors > failing to go through proxy for XML validation > > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA256 > > David, > > On 3/10/17 1:07 PM, KARR, DAVID wrote: > > I have an app using CXF/REST/Spring/JDBC that is working pretty well > > in TomEE (7.0.1). I'm trying to move it to Tomcat (8.5.11) because it > > doesn't need to be in TomEE, and I'm having problems adding additional > > features due to aspects of TomEE. > > > > I'm first testing the port by running Tomcat in Eclipse. I had > > previously verified that the app works fine in the same environment > > when running in TomEE. > > > > I moved all of my Resource and Environment entries to the Tomcat > > context.xml file. > > > > When I start it up, I'm seeing errors like the following: > > ------------------- > > org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: > > > > > Line 1 in XML document from ServletContext resource > > [/WEB-INF/applicationContext.xml] is invalid; nested exception is > > org.xml.sax.SAXParseException; systemId: > > http://.../ProxyWarning.html; lineNumber: 1; columnNumber: 3; The > > markup in the document preceding the root element must be well-formed. > > at > > org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBe > anDefinitions(XmlBeanDefinitionReader.java:399) > > > > > > > ... > > Caused by: org.xml.sax.SAXParseException; systemId: > > http://.../ProxyWarning.html; lineNumber: 1; columnNumber: 3; The > > markup in the document preceding the root element must be well-formed. > > at > > com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXP > arseException(ErrorHandlerWrapper.java:203) > > > > > > > - ------------------- > > > > That URL that I've elided is the page we see in our enterprise when we > > try to reach the internet without going through our proxy. > > > > So, this app that was working fine in TomEE now is getting this proxy > > error when it runs in Tomcat. Any ideas what I might be missing? > > That error seems to be that the markup is bad. Are you saying that the > markup is bad because the resource you are requesting ends up being an > HTTP BAD REQUEST or other response rather than the XML document you are > expecting?
The former, as it fails to get through the proxy. > How did you have TomEE configured for a proxy before? Generally, proxies > are configured for the whole JVM. Curiously, I can't find any evidence that I had configured a proxy for TomEE. I never saw this error when running the app in TomEE. > In Tomcat, you generally do this in one of two ways: > > 1. For a standard command-line launch (e.g. testing, *NIX systems, > etc.) create/edit CATALINA_BASE/bin/setenv.sh and add the following line > : > > CATALINA_OPTS="$CATALINA_OPTS -Dhttp.proxyHost=... ..." That worked, thanks. > 2. For Windows Service-based services, open the Tomcat Service Manager > (tomcatXw.exe //ES//) and add the appropriate system properties to the > "system properties" tab. > > FYI There will be a few presentations at TomcatCon/ApacheCon in Miami in > May. that might interest you, including a presentation by Romain on > TomEE and Meecrowave. > > http://events.linuxfoundation.org/events/apachecon-north-america/attend/ > register- Thanks. Hopefully those will be recorded.