将URL从WebSphere Traditional Application Server迁移到Liberty

问题描述 投票:0回答:1

我正在将复杂的应用程序迁移到Liberty,它使用的属性文件使用WAS URL资源。有没有一种方法,而无需在应用程序中重写任何内容,使其可以在Liberty中运行?如何在server.xml中定义URL?

websphere-liberty
1个回答
2
投票

您尝试使用jndiURL这样吗:

 <jndiURLEntry jndiName="myFirstJNDIEntry" value='"file:///myDirectory/myConfigFile.properties"' />

并以类似以下代码的方式访问它:

@Resource(name="myFirstJNDIEntry")
private URL propsURL;

在本红皮书Microservices Best Practices for Java和文档JNDI URL Entry (jndiURLEntry)中进行了讨论>

© www.soinside.com 2019 - 2024. All rights reserved.