문제

I am accessing an XML file through virtual directory and XML is kept at application server. Initially parsing was working fine but when I made some changes in XML after that I am not able to access that XML file. In that case I need to re-start the services then its working.

code : weblogic.xml

<wls:virtual-directory-mapping>
        <wls:local-path>/app/upload_files/</wls:local-path>
        <wls:url-pattern>/Banner/*</wls:url-pattern>
        <wls:url-pattern>/Login/*</wls:url-pattern>
        <wls:url-pattern>/Home/*</wls:url-pattern>
</wls:virtual-directory-mapping>
도움이 되었습니까?

해결책

It looks like you you are using default value for resource-reload-check-secs (which is -1 in production mode and 1 in development mode). This parameter controls caching of resource metadata (like file size for static resources, etc). -1 means that never reload the metadata so even if you change the static resource WLS will never reload the resource afresh.

And if this is the case for your XML file and if your XML file has changed in size, WLS would end up reading it partially if new file size is greater and XML parser would break, or give you an IO exception if new file size is lesser.

You can try re-delpoying the application.

Or if you frequently change the static resources then you may change value of resource-reload-check-secs to 0 or 1

sample weblogic.xml:

....
<container-descriptor>
<resource-reload-check-secs>0</resource-reload-check-secs>
</container-descriptor>
</weblogic-web-app>

Ref: http://docs.oracle.com/cd/E15051_01/wls/docs103/webapp/weblogic_xml.html#wp1067857

Cheers!

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top