Glassfish where do I set classloader delegate option to false

我们两清 提交于 2020-03-16 07:28:39

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!