| Author |
Properties file
|
dimple sharma
Greenhorn
Joined: Feb 18, 2002
Posts: 14
|
|
Hi, I want to use .properties file in my application. Hv any body know in web logic server where i hv to put this properties file ? Thanks in advance, Dimple
|
 |
Graham Thorpe
Ranch Hand
Joined: Mar 25, 2002
Posts: 264
|
|
|
You can place ur properti file at DefaultWebApp and give it classpath too.
|
 |
dimple sharma
Greenhorn
Joined: Feb 18, 2002
Posts: 14
|
|
Hi, Thanks for reply. I am deploying standalone JAR file - that is a ejb application. So don't hv DefaultWebApp folder. Do you hv any other idea ? Dimple
|
 |
Pradeep bhatt
Ranch Hand
Joined: Feb 27, 2002
Posts: 8876
|
|
|
Create a jar file containing the properties file and put the jar file inside the ejb jar file.
|
Groovy
|
 |
Graham Thorpe
Ranch Hand
Joined: Mar 25, 2002
Posts: 264
|
|
|
U can place ur property file at BEA Home and set the Classpath for that property file .
|
 |
dimple sharma
Greenhorn
Joined: Feb 18, 2002
Posts: 14
|
|
Hi, thanks for reply. I don't want to put properties file in jar file as it's need to be changed frequantly. I put it in Weblogic Home and also set class path in startWebLogic.sh, though i am getting same error. My code segment to get property value is as under " public static String getKeyValue ( String key ) { String valueString = ""; try { PropertyResourceBundle resBundle = ( PropertyResourceBundle ) PropertyResourceBundle.getBundle ( "iScheduler.properties" ); valueString = resBundle.getString ( key ); } catch ( Exception ex ) { ex.printStackTrace(); System.out.println ( " Exception ISchedulerClientResourceBundle.java in key " + key ); } return valueString; } Stacktrace : java.util.MissingResourceException: Can't find bundle for base name iScheduler.properties, locale en_US at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:804) at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:773) at java.util.ResourceBundle.getBundle(ResourceBundle.java:511) at ischeduler.support.common.ISchedulerClientResourceBundle.getKeyValue(ISchedulerClientResourceBundle.java:28) at ischeduler.sfsb.menuaccess.MenuAccessBean.readMenuAccessFile(MenuAccessBean.java:40) at ischeduler.sfsb.menuaccess.MenuAccessBean.ejbCreate(MenuAccessBean.java:29) at ischeduler.sfsb.menuaccess.MenuAccess_7gkmty_Impl.ejbCreate(MenuAccess_7gkmty_Impl.java:135) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at weblogic.ejb20.manager.StatefulSessionManager.create(StatefulSessionManager.java:828) at weblogic.ejb20.manager.StatefulSessionManager.remoteCreate(StatefulSessionManager.java:880) at weblogic.ejb20.internal.StatefulEJBHome.create(StatefulEJBHome.java:133) at ischeduler.sfsb.menuaccess.MenuAccess_7gkmty_HomeImpl.create(MenuAccess_7gkmty_HomeImpl.java:74) at ischeduler.sfsb.menuaccess.MenuAccess_7gkmty_HomeImpl_WLSkel.invoke(Unknown Source) at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:477) at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:108) at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:420) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:353) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:144) at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:415) at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:30) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170) Exception ISchedulerClientResourceBundle.java in key DataSource Can anybody tell me where i m wrong ? Dimple
|
 |
Pradeep bhatt
Ranch Hand
Joined: Feb 27, 2002
Posts: 8876
|
|
Remove the .proprties passed to getBundel method.
|
 |
 |
|
|
subject: Properties file
|
|
|