How to set the classpath of properties file in Weblogic Admin Console?

一曲冷凌霜 提交于 2019-12-13 06:59:04

问题


I am using Apache Tomcat Server.

While the application is loading it reads from a properties file and the file will be usuall placed in the lib folder of Tomcat server.

Since I am using Windows 7 and I need to test the application on Weblogic Server 10.3.5

While running the application it cannot deploy the application to the server because the server cannot find the properties file.

I tried giving the path of the properties file in

Servers > AdminServer > Server Start > Class Path

and tried to put the propertues file in the Weblogic Server HOME

C:\ORA_WL\MIDDLEWARE\user_projects\domains\base_domain\lib

But still it is giving the error

java.lang.Exception: java.lang.NoClassDefFoundError: Could not initialize class com.bonsai.webutility.properties.SystemProperties


回答1:


Where does your class attempt to find the properties file? Using a relative path?

The Server Start tab only applies to servers started with the node manager, not with the startWebLogic script. So if your application is running on the admin server, you probably need to edit the startWeblogic script itself to put the properties file on your classpath.

A better option is to package the properties file directly in your .war/.ear. Reference the solution here: Java: Accessing properties file inside a war



来源:https://stackoverflow.com/questions/22501220/how-to-set-the-classpath-of-properties-file-in-weblogic-admin-console

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