Stop tomcat 8 from scanning for TLDs - tomcat8

I have a Lucee web app that is packaged as a WAR. Long story short, when the app is deployed, the Lucee runtime places some custom TLD files under WEB-INF/lucee-server/library/tld. These TLD files are intended only for Lucee to read - they are not JSP taglib definitions.
Problem is, Tomcat is scanning those TLD files on restart, and cannot validate them because it cannot find the DTD, thus preventing the webapp from starting.
I've already tried adding
<context>
<JarScanner scanClassPath="false"/>
</Context>
but that did not seem to help.
How can I disable Tomcat from scanning WEB-INF for tld files?

Related

Weblogic 12.2.1 RegistrationService_V10 in web application war is mapped to multiple Servlets

I am using Weblogic 12.2.1 and I added a JAX-WS client. It runs perfectly when run in eclipse but if I try to deploy the war file through the admin console I get:
The url-pattern RegistrationService_V10 in web application webApp.war is mapped to multiple Servlets. The only place I could find a reference to that is the the com.oracle.webservices.wls.wls-soap-stack-impl package in a class called RegistrationServiceV10 which is annotaited as a webservice to RegistrationService_V10 but that is the only place I could find a reference to it, not mapped in my web.xml so where is the multiple servlet mapping coming from.
I know this question was asked some time ago, but I had the same problem, and reading the question lead me to the answer, so here's what worked for me:
I had the same problem, did I text search on every single file in the repository for the text 'RegistrationService_V10' (and 'RegistrationService_V11', as I got that as an issue too), but it wasn't present.
The problem was the presence of multiple weblogic jar files. I was using maven to copy my dependencies into the weblogic domain lib folder, but because the code was depending on weblogic it was also copying a whole host of weblogic jar files as well. This resulted in multiple copies of the same files in my weblogic application classpath (the server's own weblogic files and my imported files). Thus there was an issue with code trying to register the same service with the same name more than once.
The solution is to make sure there is only one copy of the weblogic jar files available to weblogic (which is a part of weblogic; you shouldn't be copying any in).
Hope this helps you or somebody else with the same problem.
I've been facing similar issue when uploading my war files to WebLogic server.
After scouring the internet for answers, I've stumbled this question mapped to multiple servlet which led me to OpenAM weblogic bugtracker
Workaround is to disable annotation processing by either:
starting WebLogic with -Dweblogic.servlet.DIDisabled=true parameter
or
setting metadata-complete attribute to true in web.xml
<web-app metadata-complete="true" id="WebApp_ID" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0">
By putting metadata-complete on my web.xml, fixes the problem for me.

grails.app.context being ignored deploying to Tomcat

I have an Apache server proxying all traffic from mainhost.com/subdirectory to someec2instance/subdirectory. When I start Apache and hit someec2instance.com, I get the ROOT war page. That works fine. If I deploy my app as ROOT.war, everything works fine form someec2instance.com.
However, when I access mainhost.com/subdirectory, all the asset urls and link_to urls are wrong and point to mainhost.com instead of mainhost.com/subdirectory.
I've set grails.app.context and confirmed via application.properties that the correct grails.env is being set.
Why isn't grails.app.context being respected when I deploy as ROOT.war? I would expect the site to be accessible on someec2instance.com/context, but it's like it ignore grails.app.context entirely.
The reason is doesn't work is that those settings are for running locally, not when deployed as a WAR file. When you use the tomcat or jetty plugin in run-app we configure the container to make it look like it's running an "exploded" war (similar to when a WAR gets unpacked to the file system by various servers). Since the container is running in embedded mode, it's easy to configure it programmatically as needed.
But when you deploy a WAR file there's nowhere near as much configurability. In run-app the build logic of Grails starts the server, configures it, and deploys the app, but a WAR file deployed to a "real" server is managed by the server and not the other way around.

JSP file is served as plain/text, when TOMCAT is behind an APACHE server

I'm running in a strange problem. I have a project based on MAVEN. When I run the project directly from my computer for testing it, using mvn tomcat7:run, my website display is correct. When I upload it to my distant Tomcat server, that is accessed through the JK Apache Tomcat connector, the JSP page is served as a text file. In response headers, I can see Content-Type:text/plainwhich is almost strange, and I'm suspecting the Apache server is adding it because of some erroneous configuration.
Any idea where to look, to fix this problem ?

GWT GUI Application not getting loaded on Apache Tomcat 7.0.39

I have a GWT GUI (getmap) application and i have placed it at \Apache Software Foundation\Tomcat 7.0\webapps directory.
Now when i am trying to open it using http://:8080/getmap/GetMap.html>, i am getting an error " Requested Resource is not available"
But when i copy same GWT GUI Application under \Apache Software Foundation\Tomcat 7.0\examples directory and load it using http://:8080/examples/getmap/GetMap.html>, everything works perfectly !!!
This problem is faced on Windows Vista.
I wold appreciate if anybody could provide some pointers to get rid of this issue ?
webapps contains WAR files or their exploded equivalent (i.e. a folder with a WEB-INF subfolder containing a web.xml file). The root of the server (served at the URL /) is a special webapp named ROOT.
So either create a ROOT webapp, or make getmap a webapp by adding the necessary WEB-INF/web.xml.
DISCLAIMER: the above is overly simplified and might not be accurate; plase check the Servlets spec and/or the Tomcat docs about deployment.

Glassfish: how to investigate roles/groups problems

I have a Glassfish server in production which uses JDBC Realm for authentication.
It works well, but there is the need to change all the roles/groups. I developed a new version of the web application in a test environment changing glassfish-web.xml and web.xml to align them with the groups contained in the groups table on the db for test. Everything works flawlessly. So I moved the web application to the production environment and updated the content of the groups table on production db.
The authentication works well but roles are not recognized. How can I investigate this problem ? I checked the production db and the groups table is fine and can be accessed for select. Glassfish-web.xml and web.xml are the same of the test enviroment. This is a real brain teaser. The only explanation I can give is that Glassfish-web.xml is discarded for unknown reasons or the old file is still present and read from some other location than web-inf directory.
Thanks for any help
Filippo
Explore your domain's folder under GlassFish root folder + \domains. If you are unsure what domain you are on, it is domain1 by default. Under this folder you should have a folder called applications. This folder contains the deployed version of all your applications, and it's the place where to check your application's Glassfish-web.xml configuration file.
Anyway, if you are having this kind of problems, a Clean & Build of your project, followed by a redeploy, usually works.