Websphere Application Server 6.0.2 不接受共享库中的 xml 文件

发布于 2024-10-16 13:00:59 字数 2067 浏览 1 评论 0原文

我使用的是 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

窗影残 2024-10-23 13:00:59

也许您应该尝试将 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

━╋う一瞬間旳綻放 2024-10-23 13:00:59

添加类路径条目 C:\WebSphere\AppServer\CommonLibs 来使其工作

Application servers > server > Process Definition > Java Virtual Machine

我通过使用 Websphere 的管理控制台 。终于起作用了。

I got it working by adding the classpath entry C:\WebSphere\AppServer\CommonLibs to

Application servers > server > Process Definition > Java Virtual Machine

using the admin console of Websphere. It works finally.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文