问题
I have a web application (running on glassfisch 3.1.2) where I'm facing ClassCastException. I would like to try to solve them by setting the classloader delegate to false. I'm not able to figure out where (what file) to insert following xml tag
<class-loader delegate="false" />
Google says to put that to glassfish-web.xml but I haven't got any such a file in my project (Netbeans 8.0.1) nor on server installation... Can some direct me?
Thanks
回答1:
The file has to be in the WEB-INF
folder.
In NetBeans you can right-click the WEB-INF
folder, choose New
and Glassfish Descriptor
. This should automatically create the correct file.
If this doesn't work, you can just create a new xml file in this folder. It has to look similar to this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Servlet 3.0//EN" "http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd">
<glassfish-web-app error-url="">
<class-loader delegate="false"/>
</glassfish-web-app>
来源:https://stackoverflow.com/questions/26475192/glassfish-where-do-i-set-classloader-delegate-option-to-false