腾讯云
开发者社区
文档
建议反馈
控制台
登录/注册
首页
学习
活动
专区
圈层
工具
MCP广场
文章/答案/技术大牛
搜索
搜索
关闭
发布
文章
问答
(9999+)
视频
沙龙
4
回答
getClassLoader
().
getResource
()
返回
null
、
public class Test extends Applet { System.out.println(some.toString()); System.out.println
浏览 0
提问于2009-03-09
得票数 17
回答已采纳
2
回答
getResource
("/some.jar")
返回
null
,尽管在getURL()中存在"some.jar“
、
、
、
、
URL myURL =
null
; if (url.getPath().endsWith("some.jar")) {myURL = url;}
返回
file:/C:/Users/Me/.m2/repository/path/to/some.jar但是,以下所有代码都
返回
null
:
浏览 0
提问于2012-03-29
得票数 1
回答已采纳
1
回答
在调用
getClassLoader
()之前,是否需要在
getResource
()上处理
null
我有一个名为MyClass的类,在这个类中我调用了MyClass.class.
getClassLoader
().
getResource
("SCHEMA.xsd")。当我对这段代码运行fortify扫描时,它会在调用MyClass.class.
getClassLoader
()之前在
getResource
()上处理
null
。我真的需要在这里处理
null
吗?在什么情况下,
getClassLoader
()将
返回
null
?
浏览 5
提问于2017-02-28
得票数 0
回答已采纳
2
回答
在WebSphere 6.1中,如何正确获取类路径上资源的URL?
、
、
、
下面的代码在Tomcat中运行得很好,但是对
getResource
(...)的调用在WebSphere 6.1中
返回
null
。我尝试过使用Thread.currentThread()、.
getClassLoader
()和MyClass.class.
getClassLoader
() --它们都
返回
null
。URL url =
null
; ClassLoader cl = MyClass.class.
getClassLoader
(
浏览 1
提问于2012-03-01
得票数 4
回答已采纳
1
回答
getClass().
getClassLoader
().
getResource
( "/My_Form.xsd")
返回
null
我跟踪问题到getClass().
getResource
("/My_Form.xsd")
返回
null
。JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA); URL schemaUrl = getClass().
getClassLoader
().
getResource
( schema); if (schemaU
浏览 1
提问于2017-03-20
得票数 0
回答已采纳
4
回答
MyClass.class.
getClassLoader
().
getResource
("").getPath()抛出NullPointerException
、
抛出异常的行如下:因此,我将其分成多行代码,以查看哪个调用确切地
返回
null
,如下所示:URL url = cl.
getResource
("");现在,url.getPath
浏览 2
提问于2013-10-11
得票数 2
回答已采纳
2
回答
无法访问位于src/main/resources/下的文件
、
我正在尝试访问位于资源下的一个文件并获取
null
: File propertiesFile = new File(this.getClass().
getClassLoader
().
getResource
this.getClass().
getClassLoader
().
getResource
(file) -
返回
null
浏览 8
提问于2018-10-08
得票数 0
2
回答
JavaFX: IllegalStateException:位置是必需的
、
、
、
URL tmp = getClass().
getClassLoader
().
getResource
("FXMLDocument.fxml"); FXMLLoader baseLoader = new
浏览 27
提问于2019-10-04
得票数 0
1
回答
为什么toURI()方法给我错误的“方法调用'toURI‘可能产生'NullPointerException'"?
、
DocumentBuilder builder = builderFactory.newDocumentBuilder();在执行程序时,文件中的内容(即xml文件)显示为doc:"#document:
null
“
浏览 4
提问于2022-03-29
得票数 -1
1
回答
如何从Spring @Configuration类获得WEB资源?
、
、
、
使用ClassLoader的方法不起作用,并且总是
返回
null
。().
getResource
("WEB-INF/someFolder"); final URL someFolderDirUrl3 = WebConfig.class.<e
浏览 3
提问于2014-09-19
得票数 0
回答已采纳
1
回答
可执行jar中Class.
getResource
()和ClassLoader.
getResource
()的奇怪行为
、
、
、
我从和自己的代码中了解到是相同的发布的显示了一个问题,即使用在可执行jar文件中
浏览 3
提问于2012-11-07
得票数 39
回答已采纳
2
回答
getClass().
getClassLoader
().
getResource
( path )总是
返回
null
,即使路径正确
URL url = this.getClass().
getClassLoader
().
getResource
("Rain.wav"); System.out.println("url:"+url
浏览 4
提问于2014-03-18
得票数 2
3
回答
在Java中获取NullPointerException
、
JFrame.EXIT_ON_CLOSE);} } icons = new ImageIcon[12]; icons[0] = new ImageIcon(this.getClass().
getClassLoader
().
g
浏览 9
提问于2011-08-13
得票数 0
回答已采纳
1
回答
未能使用ByteBuddy加载类
、
MethodDelegation.to(new MyMethodInterceptor())) .load(Calendar.class.
getClassLoader
(), ClassLoadingStrategy.Default.WRAPPER)当使用Calendar.class.
getClassLoader
浏览 3
提问于2022-06-07
得票数 -1
1
回答
为什么服务器上的路径抛出NullPonterException?
、
、
在本地(Windows),测试通过,但是当我将它上传到服务器(Linux)时,我有:unmarshaller.unmarshal
浏览 2
提问于2022-07-21
得票数 1
1
回答
Web找不到系统资源
、
、
、
、
someimage.png");Image img = kit.createImage(url); // fails with
null
浏览 3
提问于2015-11-12
得票数 0
回答已采纳
2
回答
getClassLoader
().
getResource
(filepath)
返回
空指针
、
、
、
但是,下面的代码:其中_levelFile是上面生成的文件名之一
浏览 1
提问于2011-12-01
得票数 1
2
回答
函数getResourceAsStream
返回
null
,而
getResource
返回
URL
我遇到了很奇怪的问题,希望你能帮我:我运行下面这行:this.getClass().
getClassLoader
().getResourceAsStream(SOME_PATH)this.getClass().
getClassLoader
().
getResou
浏览 0
提问于2013-01-10
得票数 4
1
回答
测试应用程序是否在Java的jar文件中运行
、
下面是我到目前为止所发现的:我注意到如果我在项目中加载一个文件 File file = this.getClass().
getClassLoader
().
getResource
(somefile.txt
浏览 2
提问于2015-01-26
得票数 0
回答已采纳
4
回答
用什么替换这段java代码?
、
、
synchronized void play() { //Here filename is a URL retreived through InputStream in = new FileInputStream(filename.getFile()); AudioStream
浏览 0
提问于2009-03-09
得票数 2
回答已采纳
点击加载更多
相关
资讯
基于 Http 的文件断点续传实现
JDBCPreparedStatment、批处理、处理二进制、自动主键、调用存储过程、函数
Javaweb-类加载器-类加载器的了解入门
JavaWeb获取项目路径的两种方法
重点JDBC的使用
热门
标签
更多标签
云服务器
ICP备案
云直播
实时音视频
即时通信 IM
活动推荐
运营活动
广告
关闭
领券