Websphere Application Server 6.0.2 不接受共享库中的 xml 文件
我使用的是 WAS 6.0.2。我的一个应用程序的类路径中需要一个 XML 文件。
借助此 post 的帮助,我已经配置了共享库与节点范围“通用”。共享库有以下条目。
C:\WebSphere\AppServer\CommonLibs\Config.xml
然后我将共享库与我的应用程序关联起来。当我运行服务器时,我在日志中看到以下内容。
[2/10/11 7:36:13:614 EST] 00000017 CompoundClass E WSVR0120E: An error occurred processing
C:\WebSphere\AppServer\CommonLibs\Config.xml
java.util.zip.ZipException: Error opening zip file
C:\WebSphere\AppServer\CommonLibs\Config.xml
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:140)
at java.util.jar.JarFile.<init>(JarFile.java:160)
at java.util.jar.JarFile.<init>(JarFile.java:98)
at com.ibm.ws.classloader.SinglePathClassProvider.buildContentsCache(SinglePathClassProvider.java:557)
at com.ibm.ws.classloader.SinglePathClassProvider.<init>(SinglePathClassProvider.java:99)
at com.ibm.ws.classloader.SinglePathClassProvider.create(SinglePathClassProvider.java:123)
at com.ibm.ws.classloader.CompoundClassLoader.addPaths(CompoundClassLoader.java:234)
at com.ibm.ws.classloader.JarClassLoader.addPaths(JarClassLoader.java:101)
at com.ibm.ws.classloader.ClassGraph.createClassLoaders(ClassGraph.java:472)
at com.ibm.ws.classloader.ClassGraph.calculate(ClassGraph.java:214)
at com.ibm.ws.classloader.ClassLoaderManager.initialize(ClassLoaderManager.java:204)
at com.ibm.ws.classloader.ClassLoaderManager.<init>(ClassLoaderManager.java:155)
at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:699)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:923)
at com.ibm.ws.runtime.component.ApplicationMgrImpl$AppInitializer.run(ApplicationMgrImpl.java:2214)
at com.ibm.ws.runtime.component.ComponentImpl$_AsynchInitializer.run(ComponentImpl.java:304)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1498)
我猜想服务器只需要类路径中的 zip 或 jar 文件。请指导如何包含 XML 文件。谢谢。
I am on WAS 6.0.2. I need an XML file in classpath for one of my applications.
Taking help from this post , I've configured Shared Library "common" with node scope. The shared library has the following entry.
C:\WebSphere\AppServer\CommonLibs\Config.xml
I then associated the shared libary with my application. When I run the server, I see the following in the log.
[2/10/11 7:36:13:614 EST] 00000017 CompoundClass E WSVR0120E: An error occurred processing
C:\WebSphere\AppServer\CommonLibs\Config.xml
java.util.zip.ZipException: Error opening zip file
C:\WebSphere\AppServer\CommonLibs\Config.xml
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:140)
at java.util.jar.JarFile.<init>(JarFile.java:160)
at java.util.jar.JarFile.<init>(JarFile.java:98)
at com.ibm.ws.classloader.SinglePathClassProvider.buildContentsCache(SinglePathClassProvider.java:557)
at com.ibm.ws.classloader.SinglePathClassProvider.<init>(SinglePathClassProvider.java:99)
at com.ibm.ws.classloader.SinglePathClassProvider.create(SinglePathClassProvider.java:123)
at com.ibm.ws.classloader.CompoundClassLoader.addPaths(CompoundClassLoader.java:234)
at com.ibm.ws.classloader.JarClassLoader.addPaths(JarClassLoader.java:101)
at com.ibm.ws.classloader.ClassGraph.createClassLoaders(ClassGraph.java:472)
at com.ibm.ws.classloader.ClassGraph.calculate(ClassGraph.java:214)
at com.ibm.ws.classloader.ClassLoaderManager.initialize(ClassLoaderManager.java:204)
at com.ibm.ws.classloader.ClassLoaderManager.<init>(ClassLoaderManager.java:155)
at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:699)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:923)
at com.ibm.ws.runtime.component.ApplicationMgrImpl$AppInitializer.run(ApplicationMgrImpl.java:2214)
at com.ibm.ws.runtime.component.ComponentImpl$_AsynchInitializer.run(ComponentImpl.java:304)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1498)
I guess the server only expects zip or jar files in the classpath. Please guide on how to include the XML file. Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
也许您应该尝试将 xml 文件放入 jar 文件中。
请参阅此问题,了解如何 Java:加载 jar 中包含的资源
Perhaps you should try putting the xml file in a jar file.
See this question on how Java: Load a resource contained in a jar
添加类路径条目
C:\WebSphere\AppServer\CommonLibs
来使其工作我通过使用 Websphere 的管理控制台 。终于起作用了。
I got it working by adding the classpath entry
C:\WebSphere\AppServer\CommonLibs
tousing the admin console of Websphere. It works finally.