title: Error in load Properties file and upload image in jboss 7 server
body: <p>In jeety , Glassfish server when project is deploy then make one folder in webapp but in jboss 7 server have no webapp folder.</p>
  
  <p>where is project deploy( folder name ) in jboss 7?</p>
  
  <p>so there are some problem like read properties file and image upload . b'caz i use class path and server path for it.</p>
  
  <p>for ex in jboss 7:
  get File path : "E:/jboss-as-7.1.1.Final/bin/content/mwp.war/WEB-INF/classes/analytics.properties"</p>
  
  <pre><code>Properties pro = new Properties();
  String fileName = this.getClass().getClassLoader().getResource("analytics.properties").getFile();
  pro.store(new FileOutputStream(fileName),null);
  </code></pre>
  
  <p>then get error :</p>
  
  <pre><code>16:21:52,004 ERROR [stderr] (MSC service thread 1-3)    at java.io.FileOutputStream.open(Native Method)
  16:21:52,006 ERROR [stderr] (MSC service thread 1-3)    at java.io.FileOutputStream.&lt;init&gt;(FileOutputStream.java:212)
  16:21:52,007 ERROR [stderr] (MSC service thread 1-3)    at java.io.FileOutputStream.&lt;init&gt;(FileOutputStream.java:104)
  16:21:52,008 ERROR [stderr] (MSC service thread 1-3)    at mwp.slktechlabs.model.analytics.AnalyticsDBData.updateAnalyticsPropertiesData(AnalyticsDBData.ja
  va:95)
  16:21:52,010 ERROR [stderr] (MSC service thread 1-3)    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  16:21:52,011 ERROR [stderr] (MSC service thread 1-3)    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
  16:21:52,013 ERROR [stderr] (MSC service thread 1-3)    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  16:21:52,015 ERROR [stderr] (MSC service thread 1-3)    at java.lang.reflect.Method.invoke(Method.java:601)
  16:21:52,016 ERROR [stderr] (MSC service thread 1-3)    at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleEle
  ment.invoke(InitDestroyAnnotationBeanPostProcessor.java:340)
  16:21:52,018 ERROR [stderr] (MSC service thread 1-3)    at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMet
  adata.invokeDestroyMethods(InitDestroyAnnotationBeanPostProcessor.java:305)
  16:21:52,020 ERROR [stderr] (MSC service thread 1-3)    at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessB
  eforeDestruction(InitDestroyAnnotationBeanPostProcessor.java:148)
  16:21:52,023 ERROR [stderr] (MSC service thread 1-3)    at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.ja
  va:166)
  16:21:52,025 ERROR [stderr] (MSC service thread 1-3)    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingle
  tonBeanRegistry.java:487)
  16:21:52,027 ERROR [stderr] (MSC service thread 1-3)    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultS
  ingletonBeanRegistry.java:463)
  16:21:52,029 ERROR [stderr] (MSC service thread 1-3)    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(Default
  SingletonBeanRegistry.java:431)
  16:21:52,031 ERROR [stderr] (MSC service thread 1-3)    at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationC
  ontext.java:1053)
  16:21:52,033 ERROR [stderr] (MSC service thread 1-3)    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContex
  t.java:463)
  16:21:52,035 ERROR [stderr] (MSC service thread 1-3)    at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:294
  )
  16:21:52,036 ERROR [stderr] (MSC service thread 1-3)    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:215)
  16:21:52,038 ERROR [stderr] (MSC service thread 1-3)    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.j
  ava:47)
  16:21:52,040 ERROR [stderr] (MSC service thread 1-3)    at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3392)
  16:21:52,041 ERROR [stderr] (MSC service thread 1-3)    at org.apache.catalina.core.StandardContext.start(StandardContext.java:3850)
  16:21:52,043 ERROR [stderr] (MSC service thread 1-3)    at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90)
  16:21:52,045 ERROR [stderr] (MSC service thread 1-3)    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:18
  11)
  16:21:52,046 ERROR [stderr] (MSC service thread 1-3)    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
  16:21:52,048 ERROR [stderr] (MSC service thread 1-3)    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
  16:21:52,050 ERROR [stderr] (MSC service thread 1-3)    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
  16:21:52,051 ERROR [stderr] (MSC service thread 1-3)    at java.lang.Thread.run(Thread.java:722)
  </code></pre>
  
  <p>so how to remove this error ?</p>
  
  <p>Thanks,
  kamlesh</p>