无法将[db.properties]加载为类加载器资源

问题描述

我正在尝试使用以下代码从weblogic服务器的域目录获取属性文件

private final Properties props = PropertyLoader.loadProperties("db.properties",this.getClass().getClassLoader());

上面的代码在weblogic服务器10.3上运行良好,但是由于我转向了weblogic 12.2.1,因此每当尝试访问此属性文件时,我都会遇到错误

java.lang.IllegalArgumentException: Could not load [db.properties] as a classloader resource
at com.tcs.icomply.common.utils.PropertyLoader.loadProperties(PropertyLoader.java:106)
at com.tcs.icomply.dao.EmployeeDAOImpl.(GenericDAOFactory.java:114)
at com.tcs.icomply.dao.GenericDAOFactory.getModuleDAO(GenericDAOFactory.java:30)
at com.tcs.icomply.dao.AuthorizationDAO.updateUserDetails(AuthorizationDAO.java:31)
at com.tcs.icomply.delegate.SecurityDelegate.validateUserFoRSSO(SecurityDelegate.java:69)
at com.tcs.icomply.security.TCSicomplyAuthenticationServlet.doPost(TCSicomplyAuthenticationServlet.java:76)
at com.tcs.icomply.security.TCSicomplyAuthenticationServlet.doGet(TCSicomplyAuthenticationServlet.java:55)
at com.tcs.icomply.security.TCSicomplyAuthenticationServlet.service(TCSicomplyAuthenticationServlet.java:44)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:286)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:260)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:137)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:350)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:247)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3653)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3620)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:326)
at weblogic.security.service.SecurityManager.runAsForUserCode(SecurityManager.java:196)
at weblogic.servlet.provider.WlsSecurityProvider.runAsForUserCode(WlsSecurityProvider.java:203)
at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:71)
at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2423)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2280)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2258)
at weblogic.servlet.internal.ServletRequestImpl.runInternal(ServletRequestImpl.java:1626)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1586)
at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:270)
at weblogic.invocation.ComponentInvocationContextManager._runAs(ComponentInvocationContextManager.java:348)
at weblogic.invocation.ComponentInvocationContextManager.runAs(ComponentInvocationContextManager.java:333)
at weblogic.work.LivePartitionUtility.doRunWorkUnderContext(LivePartitionUtility.java:54)
at weblogic.work.PartitionUtility.runWorkUnderContext(PartitionUtility.java:41)
at weblogic.work.SelfTuningWorkManagerImpl.runWorkUnderContext(SelfTuningWorkManagerImpl.java:617)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:397)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:346)

有人可以帮我解决问题。谢谢

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...